Skip to content

Commit

Permalink
modify http - enable save request if content length == 0
Browse files Browse the repository at this point in the history
add multithread mod for interface read thread
  • Loading branch information
Radek Bucek committed Oct 24, 2013
1 parent c54c81e commit e3568bc
Show file tree
Hide file tree
Showing 8 changed files with 1,172 additions and 414 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ sql_db.o : sql_db.cpp sql_db.h ${headers}
g++ -c sql_db.cpp $(args) ${CFLAGS}

md5.o : md5.cpp md5.h ${headers}
g++ -c md5.cpp $(args) ${CFLAGS}
g++ -c md5.cpp $(args) -O2 ${CFLAGS}

mirrorip.o : mirrorip.cpp mirrorip.h ${headers}
g++ -c mirrorip.cpp $(args) ${CFLAGS}
Expand Down
8 changes: 4 additions & 4 deletions http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ void HttpData::processData(u_int32_t ip_src, u_int32_t ip_dst,
return;*/
}
contentLength = atol(this->getTag(request, "Content-Length").c_str());
if(!contentLength) {
continue;
//if(!contentLength) {
// continue;
/*delete data;
return;*/
}
//}
response_data = NULL;
if(data->response.size()) {
response_data = &data->response[0];
Expand Down Expand Up @@ -112,7 +112,7 @@ void HttpData::processData(u_int32_t ip_src, u_int32_t ip_dst,
}
}
}
if(!body.length() ||
if(//!body.length() ||
contentLength != body.length()) {
if(body.length() == contentLength - 1 &&
body[0] == '{' && body[body.length() - 1] != '}') {
Expand Down
Loading

0 comments on commit e3568bc

Please sign in to comment.