--- apache-2.0/mod_jk.c (revision 548002) +++ apache-2.0/mod_jk.c (working copy) @@ -515,16 +515,16 @@ exit(1); } -static int get_content_length(request_rec * r) +static apr_off_t get_content_length(request_rec * r) { if (r->clength > 0) { - return (int)r->clength; + return r->clength; } else if (r->main == NULL || r->main == r) { char *lenp = (char *)apr_table_get(r->headers_in, "Content-Length"); if (lenp) { - int rc = atoi(lenp); + apr_off_t rc = apr_atoi64(lenp); if (rc > 0) { return rc; } --- common/jk_ajp12_worker.c (revision 548002) +++ common/jk_ajp12_worker.c (working copy) @@ -457,17 +457,19 @@ if (s->content_length) { char buf[READ_BUF_SIZE]; - unsigned so_far = 0; + apr_off_t so_far = 0; jk_log(l, JK_LOG_DEBUG, "ajpv12_handle_request, sending the request body"); while (so_far < s->content_length) { unsigned this_time = 0; - unsigned to_read = s->content_length - so_far; - if (to_read > READ_BUF_SIZE) { - to_read = READ_BUF_SIZE; + int to_read = 0; + apr_off_t to_read_off = s->content_length - so_far; + if (to_read_off > READ_BUF_SIZE) { + to_read_off = READ_BUF_SIZE; } + to_read = (int) to_read_off; if (!s->read(s, buf, to_read, &this_time)) { jk_log(l, JK_LOG_ERROR, --- common/jk_ajp_common.c (revision 548002) +++ common/jk_ajp_common.c (working copy) @@ -1375,10 +1375,14 @@ */ if (ae->left_bytes_to_send > 0) { - int len = ae->left_bytes_to_send; - if (len > AJP13_MAX_SEND_BODY_SZ) { - len = AJP13_MAX_SEND_BODY_SZ; + int len = 0; + apr_off_t len_off = ae->left_bytes_to_send; + + if (len_off > AJP13_MAX_SEND_BODY_SZ) { + len_off = AJP13_MAX_SEND_BODY_SZ; } + len = (int) len_off; + if ((len = ajp_read_into_msg_buff(ae, s, op->post, len, l)) < 0) { /* the browser stop sending data, no need to recover */ op->recoverable = JK_FALSE; @@ -1392,7 +1396,7 @@ s->reco_status = RECO_FILLED; } - s->content_read = len; + s->content_read = (int)len; if (ajp_connection_tcp_send_message(ae, op->post, l) != JK_TRUE) { /* Close the socket if unable to send request */ jk_close_socket(ae->sd); @@ -1490,7 +1494,7 @@ len = AJP13_MAX_SEND_BODY_SZ; } if ((unsigned int)len > ae->left_bytes_to_send) { - len = ae->left_bytes_to_send; + len = (int)ae->left_bytes_to_send; } /* the right place to add file storage for upload */ --- common/jk_ajp_common.h (revision 548002) +++ common/jk_ajp_common.h (working copy) @@ -313,7 +313,7 @@ jk_endpoint_t endpoint; - unsigned int left_bytes_to_send; + apr_off_t left_bytes_to_send; /* time of the last request handled by this endpoint */ --- common/jk_service.h (revision 548002) +++ common/jk_service.h (working copy) @@ -133,7 +133,7 @@ const char *server_name; unsigned server_port; char *server_software; - unsigned content_length; /* integer that represents the content */ + apr_off_t content_length; /* integer that represents the content */ /* length should be 0 if unknown. */ unsigned is_chunked; /* 1 if content length is unknown (chunked rq) */ unsigned no_more_chunks; /* 1 if last chunk has been read */