Commit f9a1b3dc authored by jan.koester's avatar jan.koester
Browse files

test

parent 38066fca
Loading
Loading
Loading
Loading
+2 −0
Changes for examples/httpclient.cpp: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@ int main(int argc, char** argv){
          if(amount>0)
            html.assign(data+hsize,amount);

          std::cout << res.getContentLength() << std::endl;

          while(amount < res.getContentLength()){
            size_t recv=cltsock->recvData(&srvsock,data,512);
            amount+=recv;
+4 −2
Changes for src/http.cpp: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ const char* libhttppp::HttpHeader::getData(const char* key,HttpHeader::HeaderDat
    curdat = *pos;
  while(curdat){
    if(curdat->_Key==key){
        if(pos!=nullptr)
        if(!*pos)
            *pos=curdat;
        return curdat->_Value.c_str();
    }
@@ -107,7 +107,9 @@ size_t libhttppp::HttpHeader::getDataSizet(const char *key,HttpHeader::HeaderDat
        httpexception[HTTPException::Note] << "getDataSizet key: " << key << " not found !";
        throw httpexception;
    }
    return atoi(val);
    size_t ret;
    sscanf(val,"%zu",&ret);
    return ret;
}

int libhttppp::HttpHeader::getDataInt(const char *key,HttpHeader::HeaderData **pos){