Author: rhuijben
Date: Sat Oct 17 15:15:21 2015
New Revision: 1709184
URL: http://svn.apache.org/viewvc?rev=1709184&view=rev
Log:
Add a new bucket type that handles reading an http2 frame.
* serf-dev/dev/buckets/http2_frame_buckets.c
New file.
* serf-dev/dev/serf_bucket_types.h
(serf_bucket_type_http2_unframe): New bucket type.
(SERF_BUCKET_IS_HTTP2_UNFRAME): New define.
(serf_bucket_http2_unframe_create,
serf_http2_unframe_bucket_read_info): New function.
* serf-dev/dev/test/test_buckets.c
(test_http2_unframe_buckets): New function.
(test_buckets): Add function to suite.
Modified:
serf/trunk/serf_bucket_types.h
Modified: serf/trunk/serf_bucket_types.h
URL:
http://svn.apache.org/viewvc/serf/trunk/serf_bucket_types.h?rev=1709184&r1=1709183&r2=1709184&view=diff
==============================================================================
--- serf/trunk/serf_bucket_types.h (original)
+++ serf/trunk/serf_bucket_types.h Sat Oct 17 15:15:21 2015
@@ -756,6 +756,30 @@ serf_bucket_t *serf_bucket_copy_create(
/* ==================================================================== */
+extern const serf_bucket_type_t serf_bucket_type_http2_unframe;
+#define SERF_BUCKET_IS_HTTP2_UNFRAME(b) SERF_BUCKET_CHECK((b), http2_unframe)
+
+serf_bucket_t *
+serf_bucket_http2_unframe_create(serf_bucket_t *stream,
+ apr_size_t max_payload_size,
+ serf_bucket_alloc_t *allocator);
+
+/* Obtains the frame header state, reading from the bucket if necessary.
+ If the header was read successfully (or was already read before calling)
+ the *payload_length, *stream_id, * frame_type and *flags values
+ (when not pointing to NULL) will be set to the requested values.
+
+ returns APR_SUCCESS when the header was already read before calling this,
+ function. Otherwise it will return the result of reading. */
+apr_status_t
+serf_http2_unframe_bucket_read_info(serf_bucket_t *bucket,
+ apr_size_t *payload_length,
+ apr_int32_t *stream_id,
+ unsigned char *frame_type,
+ unsigned char *flags);
+
+/* ==================================================================== */
+
/* ### do we need a PIPE bucket type? they are simple apr_file_t objects */