google-code-export / serf

Automatically exported from code.google.com/p/serf
Apache License 2.0
1 stars 1 forks source link

Serf does not handle content streams larger than 4GB on 32 bit operating systems #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
response_bucket.c contains:

v = serf_bucket_headers_get(ctx->headers, "Content-Length");
if (v) {
    apr_size_t length;
    length = apr_strtoi64(v, NULL, 10);
    if (errno == ERANGE) {
        return APR_FROM_OS_ERROR(ERANGE);
    }
    ctx->body = serf_bucket_limit_create(ctx->body, length,
                                         bkt->allocator);
}

This truncates the content length to a 32 bit integer, as apr_size_t is 32 
bit. 

I think the internal content length counters should allow using a 64 bit 
integer. 

If no 64 bit counter support is added the overflow should be handled with 
a discoverable error.

(Research triggered by 'Re: 413 Request Entity Too Large' mail on 
users@subversion.tigris.org; which by itself is not relevant to serf)

Original issue reported on code.google.com by bhuijben on 18 Sep 2008 at 11:50

GoogleCodeExporter commented 9 years ago
Fix committed in r1205.  Thanks.

Original comment by justin.e...@gmail.com on 30 Dec 2008 at 6:27

GoogleCodeExporter commented 9 years ago
Since r1498 serf_bucket_limit_create() accepts 64-bit value on all platforms.

Original comment by chemodax@gmail.com on 21 Jun 2011 at 11:11