View | Details | Raw Unified | Return to bug 42608
Collapse All | Expand All

(-)apache-2.0/mod_jk.c (-3 / +3 lines)
Lines 515-530 Link Here
515
    exit(1);
515
    exit(1);
516
}
516
}
517
517
518
static int get_content_length(request_rec * r)
518
static apr_off_t get_content_length(request_rec * r)
519
{
519
{
520
    if (r->clength > 0) {
520
    if (r->clength > 0) {
521
        return (int)r->clength;
521
        return r->clength;
522
    }
522
    }
523
    else if (r->main == NULL || r->main == r) {
523
    else if (r->main == NULL || r->main == r) {
524
        char *lenp = (char *)apr_table_get(r->headers_in, "Content-Length");
524
        char *lenp = (char *)apr_table_get(r->headers_in, "Content-Length");
525
525
526
        if (lenp) {
526
        if (lenp) {
527
            int rc = atoi(lenp);
527
            apr_off_t rc = apr_atoi64(lenp);
528
            if (rc > 0) {
528
            if (rc > 0) {
529
                return rc;
529
                return rc;
530
            }
530
            }
(-)common/jk_ajp12_worker.c (-4 / +6 lines)
Lines 457-473 Link Here
457
457
458
    if (s->content_length) {
458
    if (s->content_length) {
459
        char buf[READ_BUF_SIZE];
459
        char buf[READ_BUF_SIZE];
460
        unsigned so_far = 0;
460
        apr_off_t so_far = 0;
461
461
462
        jk_log(l, JK_LOG_DEBUG,
462
        jk_log(l, JK_LOG_DEBUG,
463
               "ajpv12_handle_request, sending the request body");
463
               "ajpv12_handle_request, sending the request body");
464
464
465
        while (so_far < s->content_length) {
465
        while (so_far < s->content_length) {
466
            unsigned this_time = 0;
466
            unsigned this_time = 0;
467
            unsigned to_read = s->content_length - so_far;
467
            int to_read = 0;
468
            if (to_read > READ_BUF_SIZE) {
468
			apr_off_t to_read_off = s->content_length - so_far;
469
                to_read = READ_BUF_SIZE;
469
            if (to_read_off > READ_BUF_SIZE) {
470
                to_read_off = READ_BUF_SIZE;
470
            }
471
            }
472
			to_read = (int) to_read_off;
471
473
472
            if (!s->read(s, buf, to_read, &this_time)) {
474
            if (!s->read(s, buf, to_read, &this_time)) {
473
                jk_log(l, JK_LOG_ERROR,
475
                jk_log(l, JK_LOG_ERROR,
(-)common/jk_ajp_common.c (-5 / +9 lines)
Lines 1375-1384 Link Here
1375
         */
1375
         */
1376
1376
1377
        if (ae->left_bytes_to_send > 0) {
1377
        if (ae->left_bytes_to_send > 0) {
1378
            int len = ae->left_bytes_to_send;
1378
			int len = 0;
1379
            if (len > AJP13_MAX_SEND_BODY_SZ) {
1379
            apr_off_t len_off = ae->left_bytes_to_send;
1380
                len = AJP13_MAX_SEND_BODY_SZ;
1380
1381
            if (len_off > AJP13_MAX_SEND_BODY_SZ) {
1382
                len_off = AJP13_MAX_SEND_BODY_SZ;
1381
            }
1383
            }
1384
			len = (int) len_off;
1385
1382
            if ((len = ajp_read_into_msg_buff(ae, s, op->post, len, l)) < 0) {
1386
            if ((len = ajp_read_into_msg_buff(ae, s, op->post, len, l)) < 0) {
1383
                /* the browser stop sending data, no need to recover */
1387
                /* the browser stop sending data, no need to recover */
1384
                op->recoverable = JK_FALSE;
1388
                op->recoverable = JK_FALSE;
Lines 1392-1398 Link Here
1392
                s->reco_status = RECO_FILLED;
1396
                s->reco_status = RECO_FILLED;
1393
            }
1397
            }
1394
1398
1395
            s->content_read = len;
1399
            s->content_read = (int)len;
1396
            if (ajp_connection_tcp_send_message(ae, op->post, l) != JK_TRUE) {
1400
            if (ajp_connection_tcp_send_message(ae, op->post, l) != JK_TRUE) {
1397
                /* Close the socket if unable to send request */
1401
                /* Close the socket if unable to send request */
1398
                jk_close_socket(ae->sd);
1402
                jk_close_socket(ae->sd);
Lines 1490-1496 Link Here
1490
                len = AJP13_MAX_SEND_BODY_SZ;
1494
                len = AJP13_MAX_SEND_BODY_SZ;
1491
            }
1495
            }
1492
            if ((unsigned int)len > ae->left_bytes_to_send) {
1496
            if ((unsigned int)len > ae->left_bytes_to_send) {
1493
                len = ae->left_bytes_to_send;
1497
                len = (int)ae->left_bytes_to_send;
1494
            }
1498
            }
1495
1499
1496
            /* the right place to add file storage for upload */
1500
            /* the right place to add file storage for upload */
(-)common/jk_ajp_common.h (-1 / +1 lines)
Lines 313-319 Link Here
313
313
314
    jk_endpoint_t endpoint;
314
    jk_endpoint_t endpoint;
315
315
316
    unsigned int left_bytes_to_send;
316
    apr_off_t left_bytes_to_send;
317
317
318
    /* time of the last request
318
    /* time of the last request
319
       handled by this endpoint */
319
       handled by this endpoint */
(-)common/jk_service.h (-1 / +1 lines)
Lines 133-139 Link Here
133
    const char *server_name;
133
    const char *server_name;
134
    unsigned server_port;
134
    unsigned server_port;
135
    char *server_software;
135
    char *server_software;
136
    unsigned content_length;        /* integer that represents the content  */
136
    apr_off_t content_length;       /* integer that represents the content  */
137
    /* length should be 0 if unknown.        */
137
    /* length should be 0 if unknown.        */
138
    unsigned is_chunked;    /* 1 if content length is unknown (chunked rq) */
138
    unsigned is_chunked;    /* 1 if content length is unknown (chunked rq) */
139
    unsigned no_more_chunks;        /* 1 if last chunk has been read */
139
    unsigned no_more_chunks;        /* 1 if last chunk has been read */

Return to bug 42608