Author: rhuijben
Date: Thu Nov 26 14:45:10 2015
New Revision: 1716707

URL: http://svn.apache.org/viewvc?rev=1716707&view=rev
Log:
Following up on r1699995, which made the linebuffers consistently '\0'
terminated, remove some unneeded work.

* buckets/dechunk_buckets.c
  (wait_for_chunk): Remove work already done by the linebuffer.

Modified:
    serf/trunk/buckets/dechunk_buckets.c

Modified: serf/trunk/buckets/dechunk_buckets.c
URL: 
http://svn.apache.org/viewvc/serf/trunk/buckets/dechunk_buckets.c?rev=1716707&r1=1716706&r2=1716707&view=diff
==============================================================================
--- serf/trunk/buckets/dechunk_buckets.c (original)
+++ serf/trunk/buckets/dechunk_buckets.c Thu Nov 26 14:45:10 2015
@@ -82,13 +82,8 @@ static apr_status_t wait_for_chunk(serf_
 
             /* if a line was read, then parse it. */
             if (ctx->linebuf.state == SERF_LINEBUF_READY) {
-                /* NUL-terminate the line. if it filled the entire buffer,
-                   then just assume the thing is too large. */
-                if (ctx->linebuf.used == sizeof(ctx->linebuf.line))
-                    return APR_FROM_OS_ERROR(ERANGE);
-                ctx->linebuf.line[ctx->linebuf.used] = '\0';
 
-                /* convert from HEX digits. */
+                /* Convert from HEX digits. The linebuffer ensures a '\0' */
                 ctx->body_left = apr_strtoi64(ctx->linebuf.line, NULL, 16);
                 if (errno == ERANGE) {
                     return APR_FROM_OS_ERROR(ERANGE);


Reply via email to