Commit Graph

158 Commits

Author SHA1 Message Date
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 c235800a1a Link -ldl with tests only 2013-01-27 16:48:52 +09:00
Tatsuhiro Tsujikawa 5adfd07e7c Fix SPDY/3 priority pack and unpack handling 2013-01-20 19:04:04 +09:00
Tatsuhiro Tsujikawa 8a2020362d tests: Use traditional C-style comments 2012-11-14 21:00:36 +09:00
Tatsuhiro Tsujikawa 46e7da2166 Get rid of flags member in spdylay_map 2012-10-05 23:41:49 +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 e69947a054 Removed trailing spaces 2012-10-01 21:51:24 +09:00
Tatsuhiro Tsujikawa 58619a4f97 Enable name/value header compression on server side 2012-09-15 00:47:17 +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 ca415a2a15 Add --enable-src configure option
When --enable-src is given, the programs in src directory will be
built. If --disable-src is given, those programs will not be built. If
none of them are given, --enable-src is assumed.
2012-09-10 21:51:08 +09:00
Tatsuhiro Tsujikawa b0fcd68783 Move spdycat, spdyd and shrpx from examples to src
To distinguish the to-be-installed programs and non-installable
example source code, the former programs, spdycat, spdydyd and shrpx,
were moved to src directory. spdynative was removed from Makefile
because it does not appeal to any users much.
2012-09-10 21:39:51 +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 05e6d527b1 Fix compile error on netbsd
Include config.h from sources under examples.  Added kevent.udata type
check.
2012-07-27 22:11:13 +09:00
Tatsuhiro Tsujikawa 5236394c1c Take into account shut_flags when accepting DATA frame 2012-06-14 22:39:44 +09:00
Tatsuhiro Tsujikawa 7b8768bd3a Fixed compile error with --enable-maintainer-mode 2012-06-11 23:12:23 +09:00
Tatsuhiro Tsujikawa d12217a1c5 Removed redundant CFLAGS 2012-06-11 23:12:02 +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 4dd9c32c25 Added SPDYLAY_OPT_MAX_RECV_CTRL_FRAME_BUFFER option.
This option sets maximum receive buffer size for incoming control
frame.  Basically the library checks the length field of the incoming
control frame. For frames with name/value header block, the library
also checks the length of inflated block is also under the limit. This
is done while incrementally inflating block. If the length of frames
with name/value header block exceeds the limit, the library will issue
RST_STREAM with FRAME_TOO_LARGE. For other frames, it will issue
GOAWAY.
2012-05-25 13:49:18 +09:00
Tatsuhiro Tsujikawa a6ae4fc72c Incremental name/value block decompression 2012-05-25 10:46:40 +09:00
Tatsuhiro Tsujikawa a18f04e8c7 Fixed buffer overrun in spdylay_pq_push 2012-05-24 21:35:27 +09:00
Tatsuhiro Tsujikawa b95e9a8c4c Made spdylay_submit_window_update() not be bounded by recv_window_size
Current SPDY/3 spec does not clearly prohibit to send
delta_window_size which makes resulting window size more than initial
window size. For this reason, spdylay_submit_window_update() can send
delta_window_size in [1, (1 << 31)-1], inclusive, without bounded by
stream's recv_window_size. Of course, the application is now
responsible to keep the resulting window size <= (1 << 31)-1.

spdylay_submit_window_update() now returns
SPDYLAY_ERR_INVALID_ARGUMENT if delta_window_size is 0 or negative.
2012-05-20 16:09:57 +09:00
Tatsuhiro Tsujikawa e778f268de Fixed compiler warning with stricter warning options 2012-05-13 17:38:29 +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 9b619e5dd7 Bring back deferred DATA to the outbound queue when SETTINGS with
INITIAL_WINDOW_SIZE is received and the window size becomes positive.
2012-05-11 23:01:40 +09:00
Tatsuhiro Tsujikawa 1158de22a3 Added status_code argument to spdylay_on_invalid_ctrl_recv_callback 2012-05-09 23:10:52 +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 02e4440e4a Having the number of server and client streams be limited separately
using SETTINGS_MAX_CONCURRENT_STREAMS
2012-05-08 00:59:26 +09:00
Tatsuhiro Tsujikawa 5412ccf129 Renamed spdylay_gzip API. Added test for them. 2012-05-07 22:56:28 +09:00
Tatsuhiro Tsujikawa 7b239cc7b0 Packaging fix 2012-04-25 22:27:50 +09:00
Tatsuhiro Tsujikawa c91a4ec091 Added tests for malloc failures 2012-04-24 22:51:06 +09:00
Jim Morrison f74bfae451 Merge remote-tracking branch 'original_master/master' 2012-04-11 12:45:46 -07:00
Tatsuhiro Tsujikawa 6c32c50e23 Include spdylay_net.h instead of arpa/inet.h 2012-04-06 23:37:25 +09:00
Jim Morrison f7d1ca2740 Move timeout checking into the query parameter condition. Copy last_modified date string for file responses. 2012-04-05 11:11:02 -07:00
Tatsuhiro Tsujikawa 828b57c937 Merge branch 'master' of github.com:tatsuhiro-t/spdylay 2012-04-06 02:25:49 +09:00
Tatsuhiro Tsujikawa cb7c0ba142 Fixed typo in union selection 2012-04-06 01:50:48 +09:00
Tatsuhiro Tsujikawa d83d1cd33a Added CREDENTIAL frame support. 2012-04-06 01:45:39 +09:00
Jim Morrison 310d88c787 Add a timeout parameter to spdycat and add a crazy parameter to spdyd to test it (or test other clients) 2012-04-04 10:19:00 -07:00
Tatsuhiro Tsujikawa 93953c102b Fixed memory leak in unittest 2012-04-04 00:56:21 +09:00
Tatsuhiro Tsujikawa ba56ed6c48 Hide spdylay_data from public API.
The spdylay_data contains full of implementation details and is not
used in public API. It should be hidden.
The spdylay_frame union now only contains the control frame.
2012-03-29 23:59:51 +09:00
Tatsuhiro Tsujikawa 8251fa1315 Made OpenSSL not mandatory. Don't build examples if OpenSSL is not found.
Spdylay library itself does not depend on OpenSSL. The example programs
in examples directory do. Spdylay library should be built without
OpenSSL.
2012-03-29 02:13:33 +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 e9b56ab1f6 Added @DEFS@ to CPPFLAGS/CFLAGS. 2012-03-24 00:07:56 +09:00
Tatsuhiro Tsujikawa 9e716eb635 Code cleanup: C89 and old-style-prototypes and definition. 2012-03-23 02:17:48 +09:00
Tatsuhiro Tsujikawa 425a9558d7 Fixed memory leak in unit test 2012-03-17 23:03:11 +09:00