Commit Graph

75 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa 0edce70343 Rebranding nghttp2 2013-07-13 00:43:06 +09:00
Tatsuhiro Tsujikawa 439b34f49f Don't allow control characters in outgoing name/value pairs
This check is done in spdylay_submit_* family functions and they will
return error if they found control characters.
2013-03-23 21:23:13 +09:00
Tatsuhiro Tsujikawa 10c54e44ba Don't pack multiple empty header values in one header field
SPDY spec does not allow multiple empty header values in one header
field. This change makes out-going framer ignore such empty header
value if there is non-empty header value with the same name.
2013-03-23 19:31:22 +09:00
Tatsuhiro Tsujikawa 2ca7b51eb6 Fix the incoming last empty header value is not checked properly
This change fixes the bug that spdylay_frame_unpack_nv does not check
the size of header value if it is the last value in NULL separated
list.
2013-03-23 18:50:36 +09:00
Tatsuhiro Tsujikawa 24e932dfa2 Iterative treap implementation
This change implements spdylay_map functions in iterative approach
instead of original recursive approach. The iterative version is
overall faster than recursive one. The traversal function
(spdylay_map_each) is slightly slower but it is not noticeable.
2012-10-05 00:46:03 +09:00
Tatsuhiro Tsujikawa 088e4f15a2 Check frame length after packing a frame
If resultant length of a frame exceeds the maximum value (which is
2**24 - 1 for SPDY/2 and 3), SPDYLAY_ERR_FRAME_TOO_LARGE is used to
indicate this error. This error will be notified by
on_ctrl_not_send_callback.
2012-09-14 22:41:55 +09:00
Tatsuhiro Tsujikawa b8d0b4034c Eliminate malloc in spdylay_map
We use intrusive style pattern in spdylay_stream, which now has
spdylay_map_entry has its first member.
2012-09-12 00:13:02 +09:00
Tatsuhiro Tsujikawa 4e5e741907 Add spdylay_npn_get_proto_list() public API function.
spdylay_npn_get_proto_list() returns a pointer to the supported SPDY
version list. The element of the list is spdylay_npn_proto struct. It
contains all SPDY version information this library supports. The
application can use this information to configure NPN protocol
offerings/selection.
2012-08-27 23:16:44 +09:00
Tatsuhiro Tsujikawa f8fcee122a Check that empty name and NULL value are not included in nv 2012-08-21 23:19:15 +09:00
Tatsuhiro Tsujikawa 5236394c1c Take into account shut_flags when accepting DATA frame 2012-06-14 22:39:44 +09:00
Tatsuhiro Tsujikawa 245c7ff1b3 Return nonzero exit status if test fails. Fixed failmalloc tests. 2012-05-31 21:55:21 +09:00
Tatsuhiro Tsujikawa a6ae4fc72c Incremental name/value block decompression 2012-05-25 10:46:40 +09:00
Tatsuhiro Tsujikawa 164312d857 Added test for EOF from recv_callback. 2012-05-12 18:32:37 +09:00
Tatsuhiro Tsujikawa 5c187b950f spdylay_data_source_read_callback can return
SPDYLAY_ERR_TEMPORAL_CALLBACK_FAILURE to signal stream error.
2012-05-12 18:19:05 +09:00
Tatsuhiro Tsujikawa b7429e7c2d Added spdylay_submit_window_update() public API. 2012-05-08 23:41:59 +09:00
Tatsuhiro Tsujikawa 13ea7c60ba Added spdylay_session_set_option() public API. 2012-05-08 22:59:34 +09:00
Tatsuhiro Tsujikawa 5412ccf129 Renamed spdylay_gzip API. Added test for them. 2012-05-07 22:56:28 +09:00
Tatsuhiro Tsujikawa d83d1cd33a Added CREDENTIAL frame support. 2012-04-06 01:45:39 +09:00
Tatsuhiro Tsujikawa 262cda86e8 Issue RST_STREAM with PROTOCOL_ERROR if invalid header block is received.
We say the header block is invalid if at least one of the following
condition is true:
There are duplicate header names; or the header names are not
encoded in US-ASCII character set and not lower cased; or the
header name is zero-length string; or the header value contains
multiple in-sequence NUL bytes.

spdylay_frame_unpack_nv() returns SPDYLAY_ERR_INVALID_HEADER_BLOCK
if the unpacking suceeded but it found the header block is invalid.
This means that caller treats it as success, but do additional
processing for invalid header block if it wants.
The functions calling spdylay_frame_unpack_nv() also return
SPDYLAY_ERR_INVALID_HEADER_BLOCK.
2012-03-26 23:19:58 +09:00
Tatsuhiro Tsujikawa 9e716eb635 Code cleanup: C89 and old-style-prototypes and definition. 2012-03-23 02:17:48 +09:00
Tatsuhiro Tsujikawa 8f038ae4b6 Added spdylay_session_get_outbound_queue_size() 2012-03-15 23:06:28 +09:00
Tatsuhiro Tsujikawa 02924b6dd0 Added spdylay_submit_settings 2012-03-10 18:41:01 +09:00
Tatsuhiro Tsujikawa 82e20192d8 Added functions to process received SETTINGS frame.
Now remote and local settings are stored separately.
The initial window size is included in SETTINGS frame, all active stream's
window sizes are now updated.
Removed the initial_window_size member from spdylay_stream because
it is the same as remote_settings's initial window size.
2012-03-10 00:10:11 +09:00
Tatsuhiro Tsujikawa d05d29b507 Added SPDY/3 SETTINGS frame pack/unpack 2012-03-08 23:49:26 +09:00
Tatsuhiro Tsujikawa 11020146f5 Added on_ctrl_not_send_callback.
This callback function is invoked after the control frame
is not sent because of the error. The error is indicated by
the error argument, which is one of the values defined in spdylay_error.
2012-03-08 00:18:18 +09:00
Tatsuhiro Tsujikawa 00abfc8dd3 Always accept SPDY/3 style name/value pairs from spdylay_submit_* and
translate them into SPDY/2 as needed.
2012-03-07 00:38:27 +09:00
Tatsuhiro Tsujikawa e79de111a4 Added spdylay_submit_syn_reply 2012-02-28 23:27:10 +09:00
Tatsuhiro Tsujikawa 036efc1018 Separated SPDY2 and SPDY3 tests to ease debugging 2012-02-26 16:33:53 +09:00
Tatsuhiro Tsujikawa d5cc71c636 Added status_code handling to GOAWAY 2012-02-26 16:26:38 +09:00
Tatsuhiro Tsujikawa 8693874340 Added SPDY/3 flow control. 2012-02-26 00:12:32 +09:00
Tatsuhiro Tsujikawa 4e62c75b02 Added function to pack and unpack WINDOW_UPDATE frame. 2012-02-25 01:47:37 +09:00
Tatsuhiro Tsujikawa 847830f132 Added ability to pack/unpack SPDY/3 frames.
Added SPDY/3 zlib dictionary from draft-mbelshe-httpbis-spdy-00.
2012-02-25 01:17:03 +09:00
Tatsuhiro Tsujikawa 769150d5f7 Added spdylay_submit_headers function. 2012-02-24 00:02:29 +09:00
Tatsuhiro Tsujikawa 9e9e281bca Added spdylay_submit_syn_stream function. 2012-02-23 23:20:05 +09:00
Tatsuhiro Tsujikawa 37944253d2 Ensure read_callback is non-NULL for response bodies. 2012-02-21 22:04:24 +09:00
Jim Morrison 6e7025b9f5 Test that FLAG_FIN is set if the read callback is NULL. 2012-02-20 13:12:13 -08:00
Tatsuhiro Tsujikawa 301eb29cd4 Added ability to postpone DATA frames for asynchronous I/O. 2012-02-19 23:42:25 +09:00
Tatsuhiro Tsujikawa 03307116a2 Send GOAWAY when spdylay_frame_unpack_* is failed with non-fatal error.
SPDYLAY_ERR_ZLIB is now moved back to non-fatal error and it is subject
to GOAWAY if it occurred.
2012-02-18 21:55:40 +09:00
Tatsuhiro Tsujikawa 6f30bbbcb5 Fixed test name 2012-02-16 23:47:04 +09:00
Jim Morrison 40e8fc960e Create a test that explicitly checks that a key exists only once in a name/value block. 2012-02-15 12:07:25 -08:00
Tatsuhiro Tsujikawa 85ec883d11 Lower-case names in name/value pairs in spdylay_submit_{request, response} 2012-02-15 23:54:42 +09:00
Tatsuhiro Tsujikawa fd06d21638 Call on_stream_close_callback when server pushed SYN_STREAM has FIN flag set.
Don't mix status code and return value in
spdylay_session_on_syn_stream_received.
2012-02-15 00:45:09 +09:00
Tatsuhiro Tsujikawa a48ad800b2 When a stream is canceled by RST_STREAM, don't send further DATA on that stream. 2012-02-12 19:01:23 +09:00
Tatsuhiro Tsujikawa 028e1f2b8f Added test case where DATA frame is backed off by higher priority frame. 2012-02-12 18:30:19 +09:00
Tatsuhiro Tsujikawa 34f0f6be1b Refuse incoming SYN_STREAM with SPDYLAY_REFUSED_STREAM if max-concurrent-streams number is reached. 2012-02-08 23:45:48 +09:00
Tatsuhiro Tsujikawa 679159878f Merge branch 'master' of https://github.com/sorced-jim/spdylay into sorced-jim-master
Conflicts:
	tests/main.c
	tests/spdylay_session_test.c
	tests/spdylay_session_test.h
2012-02-08 21:37:44 +09:00
Jim Morrison 4298dc8a51 Erase the stream from the map after calling the on_stream_close callback 2012-02-07 14:17:38 -08:00
Tatsuhiro Tsujikawa 4630dfb4fe Added spdylay_on_request_recv_callback function.
This function invoked when request from remote peer is
received.  In other words, frame with FIN flag set is received.  In
HTTP, this means HTTP request, including request body, is fully
received.
2012-02-08 00:11:44 +09:00
Tatsuhiro Tsujikawa 00bed87537 Support max concurrent streams limit.
If max concurrent streams limit is reached, SYN_STREAM frames are not sent
and backed off. If other type of frame is waiting in the tx queue, it is
sent first. We introduced another priority queue for this purpose.
In this change we did not add code to send RST_STREAM when SYN_STREAM is
received but max concurrent stream is reached.
2012-02-06 00:14:19 +09:00
Tatsuhiro Tsujikawa 8b20e83652 Rewritten spdylay_frame_unpack_nv().
We use just single buffer to store name/value headers fields, instead of
allocating memory for each name/value strings.
It is now more than 2 times faster than old one.
2012-02-04 23:09:03 +09:00