From: <no...@so...> - 2010-07-21 14:39:29
|
Update of /cvsroot/ijbswa/current In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25732 Modified Files: jcc.c Log Message: In chat(), add another last-chunk-check right after parsing the server headers. Should fix #3028326 reported by "Karsten". The check at the beginning of the loop should be obsolete now, but there's no hurry to remove it right away. Index: jcc.c =================================================================== RCS file: /cvsroot/ijbswa/current/jcc.c,v retrieving revision 1.324 retrieving revision 1.325 diff -u -d -r1.324 -r1.325 --- jcc.c 21 Jul 2010 14:35:09 -0000 1.324 +++ jcc.c 21 Jul 2010 14:39:20 -0000 1.325 @@ -1789,9 +1789,14 @@ && ((csp->iob->eod - csp->iob->cur) >= 5) && !memcmp(csp->iob->eod-5, "0\r\n\r\n", 5)) { + /* + * XXX: This check should be obsolete now, + * but let's wait a while to be sure. + */ log_error(LOG_LEVEL_CONNECT, - "Looks like we read the last chunk together with " - "the server headers. We better stop reading."); + "Looks like we got the last chunk together with " + "the server headers but didn't detect it earlier. " + "We better stop reading."); byte_count = (unsigned long long)(csp->iob->eod - csp->iob->cur); csp->expected_content_length = byte_count; csp->flags |= CSP_FLAG_CONTENT_LENGTH_SET; @@ -2294,6 +2299,19 @@ log_error(LOG_LEVEL_FATAL, "Out of memory parsing server header"); } + if ((csp->flags & CSP_FLAG_CHUNKED) + && !(csp->flags & CSP_FLAG_CONTENT_LENGTH_SET) + && ((csp->iob->eod - csp->iob->cur) >= 5) + && !memcmp(csp->iob->eod-5, "0\r\n\r\n", 5)) + { + log_error(LOG_LEVEL_CONNECT, + "Looks like we got the last chunk together with " + "the server headers. We better stop reading."); + byte_count = (unsigned long long)(csp->iob->eod - csp->iob->cur); + csp->expected_content_length = byte_count; + csp->flags |= CSP_FLAG_CONTENT_LENGTH_SET; + } + csp->server_connection.response_received = time(NULL); if (crunch_response_triggered(csp, crunchers_light)) |