Commit Graph

299 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa 5dcdf95a67 Fix doc 2012-08-21 01:03:22 +09:00
Tatsuhiro Tsujikawa 7cc1c73120 Updated doc 2012-08-03 22:35:38 +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 adefcad530 Don't call on_data_recv_callback and on_data_chunk_recv_callback if
stream was closed or being closed.
2012-06-08 23:48:35 +09:00
Tatsuhiro Tsujikawa d654ad0cc6 Fixed bug on_ctrl_recv_callback not called for RST_STREAM 2012-06-04 23:44:18 +09:00
Tatsuhiro Tsujikawa 3c49a31a07 Fixed typo 2012-05-30 21:20:38 +09:00
Tatsuhiro Tsujikawa ad13e56617 Removed unused variable 2012-05-25 19:07:01 +09:00
Tatsuhiro Tsujikawa e13152c0a5 Made spdylay_strerror(0) return "Success" 2012-05-25 14:44:25 +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 b06fa25ad2 Fixed compile error with -Wshadow. Fixed const cast. 2012-05-20 17:40:29 +09:00
Tatsuhiro Tsujikawa 6f066d7f64 Avoid overflow of spdylay_stream.recv_window_size 2012-05-20 16:13:26 +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 3be09efbde Fixed the bug that erase_rotate_recur() erases parent node. 2012-05-19 00:49:15 +09:00
Tatsuhiro Tsujikawa f96c7f8720 Updated doc 2012-05-16 23:48:27 +09:00
Tatsuhiro Tsujikawa c53e7613c9 Renamed index in spdylay_get_credential_cert prototype to idx
This is because compiler may warn that name `index` shadows global
declaration if the application code uses the prototype argument names
as is.
2012-05-13 17:40:18 +09:00
Tatsuhiro Tsujikawa 88599228f8 Prefer spdy/3 to spdy/2 in spdylay_select_next_protocol() 2012-05-12 18:23:17 +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 42c0e3c758 Renamed error as error_code in spdylay_on_ctrl_not_send_callback prototype 2012-05-11 23:33:46 +09:00
Tatsuhiro Tsujikawa 93593a76ec spdylay_session_pack_data() now returns error code as specified in the doc. 2012-05-11 23:23:46 +09:00
Tatsuhiro Tsujikawa ef2bd10d94 Check window size is positive when bringing back deferred DATA frame
when WINDOW_UPDATE is received.
2012-05-11 23:02:13 +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 3e2dc04264 Fixed the bug that spdylay_recv does not return SPDYLAY_ERR_EOF. 2012-05-11 00:21:36 +09:00
Tatsuhiro Tsujikawa 0288bedabb Renamed FRAME_TOO_LARGE as SPDYLAY_FRAME_TOO_LARGE 2012-05-09 23:29:33 +09:00
Tatsuhiro Tsujikawa b371a0ae19 Updated doc 2012-05-09 23:25:31 +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 649e62bd33 Updated doc 2012-05-09 23:03:16 +09:00
Tatsuhiro Tsujikawa d377fe0dc6 Added spdylay_strerror() public API. 2012-05-09 23:01:46 +09:00
Tatsuhiro Tsujikawa c68a0b5e6d Added spdylay_on_unknown_ctrl_recv_callback.
This callback function is invoked when the unknown frame type is received.
Added debug output using this callback to spdycat.
2012-05-09 22:41:08 +09:00
Tatsuhiro Tsujikawa 171bede1fa Added spdylay_session_on_ctrl_recv_parse_error_callback.
This callback function is invoked when the received frame data could not
be parsed correctly.
Added debug output using this callback to spdycat.
2012-05-09 21:55:21 +09:00
Tatsuhiro Tsujikawa b7429e7c2d Added spdylay_submit_window_update() public API. 2012-05-08 23:41:59 +09:00
Tatsuhiro Tsujikawa fa04757ff4 Don't send WINDOW_UPDATE automatically if SPDYLAY_OPT_NO_AUTO_WINDOW_UPDATE
is set.
2012-05-08 23:29:24 +09:00
Tatsuhiro Tsujikawa d6a03f74b7 Updated doc 2012-05-08 23:00:32 +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 67eca8d078 Use local_settings' INITIAL_WINDOW_SIZE when deciding to send WINDOW_UPDATE. 2012-05-08 00:08:24 +09:00
Tatsuhiro Tsujikawa 7972bd79b9 Initialized opaque with Z_NULL 2012-05-07 22:57:07 +09:00
Tatsuhiro Tsujikawa 5412ccf129 Renamed spdylay_gzip API. Added test for them. 2012-05-07 22:56:28 +09:00
Jim Morrison 1a384a6000 Move inflate functions to libspdylay from examples. 2012-04-30 12:36:37 -07:00
Tatsuhiro Tsujikawa a87303a731 Added zlib to Requires.private and updated Description 2012-04-26 23:32:17 +09:00
Tatsuhiro Tsujikawa b7392acf46 Document markup fix 2012-04-25 21:33:38 +09:00
Tatsuhiro Tsujikawa f21c0ee3d9 Don't call spdylay_zlib_inflate_free when inflateInit failed. 2012-04-24 22:40:59 +09:00
Tatsuhiro Tsujikawa 36ba636e30 Fixed memory leak in out of memory situation 2012-04-06 23:36:10 +09:00
Tatsuhiro Tsujikawa c89fc13c80 Fixed segmentation fault in out of memory situation 2012-04-06 23:35:30 +09:00
Tatsuhiro Tsujikawa d2b189e573 Updated doc 2012-04-06 21:29:37 +09:00
Tatsuhiro Tsujikawa 08d53318cd Updated doc 2012-04-06 02:34:45 +09:00
Tatsuhiro Tsujikawa 94650de16e Exposed spdylay_session_fail_session() to the public API. 2012-04-06 02:16:01 +09:00
Tatsuhiro Tsujikawa ab0bd62b14 Changed SPDYLAY_ERR_CREDENTIAL_PENDING code 2012-04-06 02:07:29 +09:00
Tatsuhiro Tsujikawa a5c7301f4b Updated doc 2012-04-06 02:07:08 +09:00
Tatsuhiro Tsujikawa 9627d5355a Moved SPDYLAY_SETTINGS_MAX inside spdylay_settings_id. 2012-04-06 02:04:54 +09:00
Tatsuhiro Tsujikawa d1d0a16fba Wrote SETTINGS ID pack/unpack without WORDS_BIGENDIAN 2012-04-06 02:02:19 +09:00
Tatsuhiro Tsujikawa d83d1cd33a Added CREDENTIAL frame support. 2012-04-06 01:45:39 +09:00
Tatsuhiro Tsujikawa 4456d2506d Added callbacks for CREDENTIAL frame. 2012-04-02 22:44:37 +09:00
Tatsuhiro Tsujikawa 169857742b Call on_ctrl_send_callback and before_ctrl_send_callback for WINDOW_UPDATE. 2012-03-30 00:17:01 +09:00
Tatsuhiro Tsujikawa 90c2739a9c Renamed spdylay_frame.common as spdylay_frame.ctrl 2012-03-30 00:07:27 +09:00
Tatsuhiro Tsujikawa db04143f32 Use assert instead of abort 2012-03-30 00:02:42 +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 67e83e09a6 Fixed duplicate name/value header block detection 2012-03-29 23:50:08 +09:00
Tatsuhiro Tsujikawa efebc1e1af Made SPDYLAY_PROTO_SPDY2 and SPDYLAY_PROTO_SPDY3 enum 2012-03-27 18:23:05 +09:00
Tatsuhiro Tsujikawa 200012f1b5 Removed SPDYLAY_SPDY2_PRI_LOWEST and SPDYLAY_SPDY3_PRI_LOWEST macros.
Made spdylay_session_get_pri_lowest() to get the lowest priority value
for the current session.

This change allows the application code to get the lowest priority value
without knowing the protocol version which the current session uses.
2012-03-26 23:35:20 +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 5deef03687 Moved include of arpa/inet.h to spdylay_net.h
spdylay_net.h is compatibility layer for network related header files.
In the nature of spdylay library it should not depend on the actual
networking implementations, but we need some system headers for
optimization. Currently, arpha/inet.h and netinet/in.h are needed for
ntoh*/hton* functions.
2012-03-24 00:14:04 +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 f40615a3dc Updated doc 2012-03-19 00:47:15 +09:00
Tatsuhiro Tsujikawa 33e86024d9 Updated doc 2012-03-17 23:44:49 +09:00
Tatsuhiro Tsujikawa 742a8bbac9 Added spdylay_session_mem_recv()
spdylay_session_mem_recv() processes input bytes as the received data
from the remote endpoint. spdylay_session_recv() uses it internally.
The spdylay_inbound_buffer and ibuf member in spdylay_session is removed.
The buffer is allocated in the stack when spdylay_session_recv() is called.
2012-03-17 23:39:38 +09:00
Tatsuhiro Tsujikawa 8f038ae4b6 Added spdylay_session_get_outbound_queue_size() 2012-03-15 23:06:28 +09:00
Tatsuhiro Tsujikawa b8e4116f9a Updated doc 2012-03-15 22:39:26 +09:00
Tatsuhiro Tsujikawa 488b5acec7 Sort nv after 3to2 and 2to3 translation. 2012-03-14 22:53:14 +09:00
Tatsuhiro Tsujikawa a01b63b37a Added doc about the required members for spdylay_session_callbacks when
it is passed to spdylay_session_{client,server}_new().
2012-03-14 00:36:53 +09:00
Tatsuhiro Tsujikawa 07b02404c3 Added API reference generator script.
Formatted the public APIs with Sphinx syntax.
2012-03-14 00:32:52 +09:00
Tatsuhiro Tsujikawa 686c2ea95d Merge git://github.com/sorced-jim/spdylay into sorced-jim-master 2012-03-11 22:44:39 +09:00
Tatsuhiro Tsujikawa 6024106695 Issue stream error with the status code STREAM_IN_USE if multiple SYN_REPLY
frames are received for the same active stream ID.
2012-03-11 22:42:22 +09:00
Tatsuhiro Tsujikawa ce6dc1303e Issue session error with PROTOCOL_ERROR if SYN_STREAM with a stream ID
which is less than any previously received SYN_STREAM.
2012-03-11 19:27:33 +09:00
Tatsuhiro Tsujikawa 8284746163 spdylay_submit_syn_stream: Return SPDYLAY_ERR_INVALID_ARGUMENT if even
Associated-To-Stream-ID is specified.
Check the Associated-To-Stream is active before sending SYN_STREAM.
2012-03-11 18:55:40 +09:00
Tatsuhiro Tsujikawa 94c7e89742 Renamed SPDYLAY_CONCURRENT_STREAMS_MAX as
SPDYLAY_INITIAL_MAX_CONCURRENT_STREAMS
2012-03-10 18:49:25 +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 6c9e79e8ca Use SPDY/3 name in spdylay_settings_flag.
Added SPDYLAY_SETTINGS_CLIENT_CERTIFICATE_VECTOR_SIZE.
2012-03-09 21:38:05 +09:00
Tatsuhiro Tsujikawa d05d29b507 Added SPDY/3 SETTINGS frame pack/unpack 2012-03-08 23:49:26 +09:00
Tatsuhiro Tsujikawa 643238813d Added doc for spdylay_error values. 2012-03-08 22:44:17 +09:00
Tatsuhiro Tsujikawa e2092966ef Mentioned on_ctrl_not_send_callback in spdylay_session_send doc. 2012-03-08 22:02:48 +09:00
Tatsuhiro Tsujikawa fcde841cab Added spdylay_is_fatal 2012-03-08 00:40:17 +09:00
Tatsuhiro Tsujikawa 0a7c510147 Renamed SPDYLAY_ERR_STREAM_ALREADY_CLOSED as SPDYLAY_ERR_STREAM_CLOSED
Added doc for spdylay_error values
2012-03-08 00:37:18 +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
Jim Morrison dc1e79f409 Fix a typo. 2012-03-06 09:02:38 -08:00
Tatsuhiro Tsujikawa 185d929d86 Translate received SPDY/2 name/value pairs into SPDY/3 style.
The callback functions receives SPDY/3 style name/value pairs.
2012-03-07 00:42:47 +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 7d9a7b3069 Don't return on partial write 2012-03-06 23:43:45 +09:00
Tatsuhiro Tsujikawa e2658ca757 Added doc about callback time chart and about how to get stream ID
of the request submitted by spdylay_submit_request().
2012-03-06 23:00:17 +09:00
Tatsuhiro Tsujikawa 8fd2fabef8 Made spdylay_select_next_protocol() return SPDY protocol version if one of
SPDY versions is selected.
2012-03-02 22:52:01 +09:00
Jim Morrison cee79961f6 Update documentation for spdylay_select_next_protocol. 2012-03-01 13:26:51 -08:00
Tatsuhiro Tsujikawa e29bb449e9 Exposed spdylay_frame_alloc_{pack,unpack}_nv for easy performance test 2012-03-01 23:52:15 +09:00
Tatsuhiro Tsujikawa a9d9126229 Assign 0 to GOAWAY status_code for SPDY/2 2012-03-01 22:39:26 +09:00
Tatsuhiro Tsujikawa abfc100edb Added convenient function spdylay_frame_nv_norm_copy() 2012-02-28 23:38:40 +09:00
Tatsuhiro Tsujikawa e79de111a4 Added spdylay_submit_syn_reply 2012-02-28 23:27:10 +09:00
Tatsuhiro Tsujikawa 9185629604 Fixed memory leak 2012-02-28 23:25:44 +09:00