serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Zhakov <i...@visualsvn.com>
Subject Re: svn commit: r1711794 - /serf/trunk/buckets/iovec_buckets.c
Date Mon, 02 Nov 2015 08:23:23 GMT
On 1 November 2015 at 19:02, Ivan Zhakov <ivan@visualsvn.com> wrote:
> On 1 November 2015 at 17:56,  <rhuijben@apache.org> wrote:
>> Author: rhuijben
>> Date: Sun Nov  1 14:56:57 2015
>> New Revision: 1711794
>>
>> URL: http://svn.apache.org/viewvc?rev=1711794&view=rev
>> Log:
>> Implement get_remaining support on the standard iovec bucket.
>>
>> * buckets/iovec_buckets.c
>>   (serf_iovec_get_remaining): New function.
>>   (serf_bucket_type_iovec): Implement as v2 bucket and handle get_remaining.
>>
>> Modified:
>>     serf/trunk/buckets/iovec_buckets.c
>>
>> Modified: serf/trunk/buckets/iovec_buckets.c
>> URL: http://svn.apache.org/viewvc/serf/trunk/buckets/iovec_buckets.c?rev=1711794&r1=1711793&r2=1711794&view=diff
>> ==============================================================================
>> --- serf/trunk/buckets/iovec_buckets.c (original)
>> +++ serf/trunk/buckets/iovec_buckets.c Sun Nov  1 14:56:57 2015
>> @@ -155,6 +155,19 @@ static apr_status_t serf_iovec_peek(serf
>>      return APR_SUCCESS;
>>  }
>>
>> +static apr_uint64_t serf_iovec_get_remaining(serf_bucket_t *bucket)
>> +{
>> +    iovec_context_t *ctx = bucket->data;
>> +    apr_uint64_t total = 0;
>> +    int i;
>> +
>> +    for (i = ctx->current_vec; i < ctx->vecs_len; i++)
>> +      {
>> +        total += ctx->vecs[i].iov_len;
>> +      }
>> +
>> +    return total;
>> +}
>>
> You should take 'ctx->offset' in account for get_remaining() calculation.
>
> PS: Test will be great also.
>
Nevermind: I've fixed it myself in r1711904.


-- 
Ivan Zhakov

Mime
View raw message