serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1711794 - /serf/trunk/buckets/iovec_buckets.c
Date Sun, 01 Nov 2015 14:56:58 GMT
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;
+}
 
 const serf_bucket_type_t serf_bucket_type_iovec = {
     "IOVEC",
@@ -162,7 +175,10 @@ const serf_bucket_type_t serf_bucket_typ
     serf_iovec_readline,
     serf_iovec_read_iovec,
     serf_default_read_for_sendfile,
-    serf_default_read_bucket,
+    serf_buckets_are_v2,
     serf_iovec_peek,
     serf_default_destroy_and_data,
+    serf_default_read_bucket,
+    serf_iovec_get_remaining,
+    serf_default_ignore_config
 };



Mime
View raw message