Author: rjung Date: Fri Jan 2 14:38:38 2015 New Revision: 1649049 URL: http://svn.apache.org/r1649049 Log: Apache: Fix get_content_length().
clength in request_rec is for response sizes, not request body size. It is initialized to 0, so the "if" branch was never taken. Modified: tomcat/jk/trunk/native/apache-1.3/mod_jk.c tomcat/jk/trunk/native/apache-2.0/mod_jk.c Modified: tomcat/jk/trunk/native/apache-1.3/mod_jk.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-1.3/mod_jk.c?rev=1649049&r1=1649048&r2=1649049&view=diff ============================================================================== --- tomcat/jk/trunk/native/apache-1.3/mod_jk.c (original) +++ tomcat/jk/trunk/native/apache-1.3/mod_jk.c Fri Jan 2 14:38:38 2015 @@ -709,17 +709,12 @@ static void jk_error_exit(const char *fi /* Return the content length associated with an Apache request structure */ static jk_uint64_t get_content_length(request_rec * r) { - if (r->clength > 0) { - return (jk_uint64_t)r->clength; - } - else { - char *lenp = (char *)ap_table_get(r->headers_in, "Content-Length"); + char *lenp = (char *)ap_table_get(r->headers_in, "Content-Length"); - if (lenp) { - jk_uint64_t rc = 0; - if (sscanf(lenp, "%" JK_UINT64_T_FMT, &rc) > 0 && rc > 0) { - return rc; - } + if (lenp) { + jk_uint64_t rc = 0; + if (sscanf(lenp, "%" JK_UINT64_T_FMT, &rc) > 0 && rc > 0) { + return rc; } } Modified: tomcat/jk/trunk/native/apache-2.0/mod_jk.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?rev=1649049&r1=1649048&r2=1649049&view=diff ============================================================================== --- tomcat/jk/trunk/native/apache-2.0/mod_jk.c (original) +++ tomcat/jk/trunk/native/apache-2.0/mod_jk.c Fri Jan 2 14:38:38 2015 @@ -770,10 +770,7 @@ static void jk_error_exit(const char *fi static jk_uint64_t get_content_length(request_rec * r) { - if (r->clength > 0) { - return (jk_uint64_t)r->clength; - } - else if (r->main == NULL || r->main == r) { + if (r->main == NULL || r->main == r) { char *lenp = (char *)apr_table_get(r->headers_in, "Content-Length"); if (lenp) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org