You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@commons.apache.org by gs...@apache.org on 2003/11/10 04:25:03 UTC
svn commit: rev 97 - in commons/serf/branches/gen2: . buckets
Author: gstein
Date: Sun Nov 9 19:25:03 2003
New Revision: 97
Modified:
commons/serf/branches/gen2/buckets/simple_buckets.c
commons/serf/branches/gen2/serf.h
Log:
Clarify a return code from the bucket 'peek' function.
* gen2/serf.h:
(serf_bucket_t.peek): APR_EOF may be returned in some cases, and
APR_EAGAIN will never be returned.
* gen2/buckets/simple_buckets.c:
(serf_simple_peek): return APR_EOF since we're always returning all the
data from the bucket.
Modified: commons/serf/branches/gen2/buckets/simple_buckets.c
==============================================================================
--- commons/serf/branches/gen2/buckets/simple_buckets.c (original)
+++ commons/serf/branches/gen2/buckets/simple_buckets.c Sun Nov 9 19:25:03 2003
@@ -118,7 +118,8 @@
*data = ctx->current;
*len = ctx->remaining;
- return APR_SUCCESS;
+ /* we returned everything this bucket will ever hold */
+ return APR_EOF;
}
static void serf_simple_destroy(serf_bucket_t *bucket)
Modified: commons/serf/branches/gen2/serf.h
==============================================================================
--- commons/serf/branches/gen2/serf.h (original)
+++ commons/serf/branches/gen2/serf.h Sun Nov 9 19:25:03 2003
@@ -464,6 +464,11 @@
*
* Note: if the peek does not return enough data for your particular
* use, then you must read/consume some first, then peek again.
+ *
+ * If the returned data represents all available data, then APR_EOF
+ * will be returned. Since this function does not consume data, it
+ * can return the same data repeatedly rather than blocking; thus,
+ * APR_EAGAIN will never be returned.
*/
apr_status_t (*peek)(serf_bucket_t *bucket,
const char **data, apr_size_t *len);