diff options
| author | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2015-04-24 15:05:28 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2015-04-24 15:05:28 -0700 |
| commit | f5848972f992e20093da85e91761c327e2f3d3ce (patch) | |
| tree | d491a4d7fcb425b5c4a639af925a895d27e8dfd4 /osdep/Http.cpp | |
| parent | 54954f5b8886bd6ea49e043fa5a695fcd7608c68 (diff) | |
| download | infinitytier-f5848972f992e20093da85e91761c327e2f3d3ce.tar.gz infinitytier-f5848972f992e20093da85e91761c327e2f3d3ce.zip | |
Windows now builds and runs selftest correctly, and fixed a Windows (and possibly other platforms) issue in Phy<>.
Diffstat (limited to 'osdep/Http.cpp')
| -rw-r--r-- | osdep/Http.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/osdep/Http.cpp b/osdep/Http.cpp index 1abf4903..cd3cf137 100644 --- a/osdep/Http.cpp +++ b/osdep/Http.cpp @@ -130,7 +130,7 @@ static int ShttpOnUrl(http_parser *parser,const char *ptr,size_t length) static int ShttpOnStatus(http_parser *parser,const char *ptr,size_t length) { HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data); - hh->messageSize += length; + hh->messageSize += (unsigned long)length; if (hh->messageSize > hh->maxResponseSize) return -1; return 0; @@ -138,13 +138,13 @@ static int ShttpOnStatus(http_parser *parser,const char *ptr,size_t length) static int ShttpOnHeaderField(http_parser *parser,const char *ptr,size_t length) { HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data); - hh->messageSize += length; + hh->messageSize += (unsigned long)length; if (hh->messageSize > hh->maxResponseSize) return -1; if ((hh->currentHeaderField.length())&&(hh->currentHeaderValue.length())) { (*hh->responseHeaders)[hh->currentHeaderField] = hh->currentHeaderValue; - hh->currentHeaderField.assign("",0); - hh->currentHeaderValue.assign("",0); + hh->currentHeaderField = ""; + hh->currentHeaderValue = ""; } for(size_t i=0;i<length;++i) hh->currentHeaderField.push_back(OSUtils::toLower(ptr[i])); @@ -153,7 +153,7 @@ static int ShttpOnHeaderField(http_parser *parser,const char *ptr,size_t length) static int ShttpOnValue(http_parser *parser,const char *ptr,size_t length) { HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data); - hh->messageSize += length; + hh->messageSize += (unsigned long)length; if (hh->messageSize > hh->maxResponseSize) return -1; hh->currentHeaderValue.append(ptr,length); @@ -169,7 +169,7 @@ static int ShttpOnHeadersComplete(http_parser *parser) static int ShttpOnBody(http_parser *parser,const char *ptr,size_t length) { HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data); - hh->messageSize += length; + hh->messageSize += (unsigned long)length; if (hh->messageSize > hh->maxResponseSize) return -1; hh->responseBody->append(ptr,length); @@ -198,7 +198,7 @@ unsigned int Http::_do( { try { responseHeaders.clear(); - responseBody.assign("",0); + responseBody = ""; HttpPhyHandler handler; |
