serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bert Huijben" <b...@qqmail.nl>
Subject RE: svn commit: r1713948 - /serf/trunk/buckets/iovec_buckets.c
Date Thu, 12 Nov 2015 12:41:37 GMT


> -----Original Message-----
> From: gstein@apache.org [mailto:gstein@apache.org]
> Sent: donderdag 12 november 2015 00:12
> To: dev@serf.apache.org
> Subject: svn commit: r1713948 - /serf/trunk/buckets/iovec_buckets.c
> 
> Author: gstein
> Date: Wed Nov 11 23:12:08 2015
> New Revision: 1713948
> 
> URL: http://svn.apache.org/viewvc?rev=1713948&view=rev
> Log:
> Leave some notes for future work/improvements.
> 
> * buckets/iovec_buckets.c:
>   (serf_bucket_iovec_create): note: skip a vec if it is zero length
>   (serf_iovec_read_iovec): note: skip producing zero len vecs
>   (serf_iovec_peek): note: avoid returning zero len data
> 
> 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=171
> 3948&r1=1713947&r2=1713948&view=diff
> ==========================================================
> ====================
> --- serf/trunk/buckets/iovec_buckets.c (original)
> +++ serf/trunk/buckets/iovec_buckets.c Wed Nov 11 23:12:08 2015
> @@ -53,6 +53,7 @@ serf_bucket_t *serf_bucket_iovec_create(
> 
>      /* copy all buffers to our iovec. */
>      for (i = 0; i < len; i++) {
> +        /* ### skip if iov_len == 0. (and adjust ->vecs_len)  */
>          ctx->vecs[i].iov_base = vecs[i].iov_base;
>          ctx->vecs[i].iov_len = vecs[i].iov_len;
>      }


If this ^^^ case is fixed, non of the later cases should ever occur on trunk.
(They can occur on 1.3.8, where reading to the end of one iovec record might not handle it
as done... Making peek return nothing, etc.)

> @@ -80,6 +81,7 @@ static apr_status_t serf_iovec_read_iove
>          if (*vecs_used >= vecs_size)
>              break;
> 
> +        /* ### skip returning a vec, if its iov_len will be 0.  */
>          vecs[*vecs_used].iov_base = (char*)vec.iov_base + ctx->offset;
>          remaining = vec.iov_len - ctx->offset;
> 
> @@ -139,6 +141,7 @@ static apr_status_t serf_iovec_peek(serf
> 
>      /* Return the first unread buffer, don't bother combining all
>         remaining data. */
> +    /* ### skip current_vec if iov_len will be 0.  */
>      *data = (const char *)ctx->vecs[ctx->current_vec].iov_base + ctx->offset;
>      *len = ctx->vecs[ctx->current_vec].iov_len - ctx->offset;
> 
> 



Mime
View raw message