Author: rjung Date: Thu Apr 10 12:37:18 2014 New Revision: 1586282 URL: http://svn.apache.org/r1586282 Log: Followup for r1586044 (broken request chunking).
Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp_common.c?rev=1586282&r1=1586281&r2=1586282&view=diff ============================================================================== --- tomcat/jk/trunk/native/common/jk_ajp_common.c (original) +++ tomcat/jk/trunk/native/common/jk_ajp_common.c Thu Apr 10 12:37:18 2014 @@ -1479,11 +1479,15 @@ static int ajp_read_into_msg_buff(ajp_en /* Pick the max size since we don't know the content_length */ - if ((r->is_chunked && len == 0) || len < 0 || len > maxlen) { + if (r->is_chunked && ae->left_bytes_to_send == 0) { len = maxlen; - } - if (ae->left_bytes_to_send > 0 && (jk_uint64_t)len > ae->left_bytes_to_send) { - len = (int)ae->left_bytes_to_send; + } else { + if ((jk_uint64_t)maxlen > ae->left_bytes_to_send) { + maxlen = (int)ae->left_bytes_to_send; + } + if (len < 0 || len > maxlen) { + len = maxlen; + } } if ((len = ajp_read_fully_from_server(r, l, read_buf, len)) < 0) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org