Commit Graph

70 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa 441f1cc282 nghttpx: Validate received response body length against content-length 2015-01-17 21:33:23 +09:00
Tatsuhiro Tsujikawa f004361ef2 nghttpx: Add --backend-request-buffer option 2015-01-13 23:30:28 +09:00
Tatsuhiro Tsujikawa c88a5291b7 nghttpx: Add --backend-response-buffer option 2015-01-13 23:20:06 +09:00
Tatsuhiro Tsujikawa d80952a2bc nghttpx: Implement stream level timeout using ev_timer 2015-01-06 00:30:57 +09:00
Tatsuhiro Tsujikawa 3ae44ef2f3 nghttpd, nghttpx: Rework incoming header handling 2015-01-05 01:46:41 +09:00
Tatsuhiro Tsujikawa 2003be8dc5 src: Fix unit tests failure 2015-01-03 00:19:41 +09:00
Tatsuhiro Tsujikawa bfac015d61 src: Use libev for rest of the applications 2015-01-03 00:19:41 +09:00
Tatsuhiro Tsujikawa b1f807abd1 Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
Lucas Pardue 6e178653a5 fixed conflict 2014-11-23 21:10:51 +00:00
Lucas Pardue 9cf1a0c77c Add features to logging, client and server port,
time_iso8601 and request_time.
2014-11-23 20:37:51 +00:00
Tatsuhiro Tsujikawa 74ec1d3377 nghttpx: Write accesslog when upstream connection is lost for HTTP/2 and SPDY 2014-11-23 17:24:23 +09:00
Tatsuhiro Tsujikawa 958cd0de64 nghttpx: Add configurable access logging format
This commit adds functionality to customize access logging format in
nghttpx.  The format variables are inspired by nginx.  The default
format is combined format.
2014-11-19 01:29:55 +09:00
Tatsuhiro Tsujikawa ce71e65aee nghttpx: Replace WARNING with WARN for consistency 2014-11-08 10:51:56 +09:00
Tatsuhiro Tsujikawa 31528b6267 Use uint32_t for HTTP/2 error_code
h2-14 now allows extensions to define new error codes.  To allow
application callback to access such error codes, we uses uint32_t as
error_code type for structs and function parameters.  Previously we
treated unknown error code as INTERNAL_ERROR, but this change removes
this and unknown error code is passed to application callback as is.
2014-08-25 21:24:04 +09:00
Tatsuhiro Tsujikawa d5dcbf6f3b nghttpx: Fix possible flow control issue
Previously we only update consumed flow control window when number of
bytes read in nghttp2 and spdylay callback is 0.  Now we notify
nghttp2 library the consumed bytes even if number of bytes read > 0.
This change also uses newly added spdylay_session_consume() API, so we
require spdylay >= 1.3.0.
2014-08-21 21:22:16 +09:00
Tatsuhiro Tsujikawa a5dfe24e49 nghttpx: Use std::unique_ptr for DownstreamConnection 2014-08-19 00:20:57 +09:00
Tatsuhiro Tsujikawa 273d9f4f7d nghttpx: Use std::unique_ptr for Downstream object 2014-08-19 00:20:56 +09:00
Tatsuhiro Tsujikawa 49a9ec2cb3 nghttpx: Use int for resonse_rst_stream_error_code_ 2014-08-17 16:36:02 +09:00
Tatsuhiro Tsujikawa 93ed89df5f nghttpx: Make stream timeout disable by default
It might be useful to clean the unused stream out to make up the room
for new streams.  On the other hand, proxy should maintain the
connection between upstream client and downstream server and they have
the timeout for their own.  Proxy just reacts to their decision.
2014-08-10 00:08:44 +09:00
Tatsuhiro Tsujikawa 76703f79fa nghttpx: Add stream level timeout for HTTP/2 and SPDY upstream/downstream 2014-08-09 22:56:27 +09:00
Tatsuhiro Tsujikawa d4d56e1846 nghttpd, nghttpx: Check that pseudo headers come before normal headers 2014-08-08 20:52:32 +09:00
Tatsuhiro Tsujikawa c859fb8f7c nghttpx: Don't respond DATA frame for HEAD request or 204, 304, 1xx 2014-07-31 23:05:53 +09:00
Tatsuhiro Tsujikawa 079db14d45 Add nghttp2_session_consume() API
Reworked no automatic WINDOW_UPDATE feature.  We added new API
nghttp2_session_consume() which tells the library how many bytes are
consumed by the application.  Instead of submitting WINDOW_UPDATE by
the application, the library is now responsible to submit
WINDOW_UPDATE based on consumed bytes.  This is more reliable method,
since it enables us to properly send WINDOW_UPDATE for stream and
connection individually.  The previous implementation of nghttpx had
broken connection window management.
2014-07-31 23:05:53 +09:00
Tatsuhiro Tsujikawa 4f815521ae nghttpx, nghttpd: Support non-final response 2014-07-31 23:05:52 +09:00
Tatsuhiro Tsujikawa af5fd2019d src: Remove 0x00 concatenation for headers
Now concatenating header values with 0x00 as delimiter is not
necessary because HPACK reference set is removed and the order of
header field fed into HPACK encoder is preserved when they are
decoded.
2014-07-31 23:05:52 +09:00
Tatsuhiro Tsujikawa 0ce848a611 nghttpx: Rewrite logging system
This change rewrites logging system of nghttpx.  Previously access log
and error log are written to stderr or syslog and there was no option
to change stderr to something else.  With this change, file path of
access log and error log can be configured separately and logging to
regular file is now added.  To support rotating log, if SIGUSR1 signal
is received by nghttpx, it closes the current log files and reopen it
with the same name.  The format of access log is changed and has same
look of apache's.  But not all columns are not supported yet.
2014-07-05 18:43:24 +09:00
Tatsuhiro Tsujikawa 4b6f124b7e Add API to check half-closed state for both direction of stream 2014-07-03 21:44:29 +09:00
Tatsuhiro Tsujikawa 1ce00f455c nghttpx: Remove requirement of content-length for HTTP2 upstream POST 2014-07-03 19:59:10 +09:00
Tatsuhiro Tsujikawa 93b3a44fb5 nghttpx: Add ability to Http2Upstream to send RST_STREAM after END_STREAM 2014-07-02 23:56:26 +09:00
Tatsuhiro Tsujikawa 94b9c3771d nghttpx: Throw away request and response headers when they are done 2014-06-15 17:25:24 +09:00
Tatsuhiro Tsujikawa 59c9c4511c nghttpx: Use move to insert crumbled cookies 2014-04-05 23:45:07 +09:00
Tatsuhiro Tsujikawa b1edb1f3ae Don't index name/value pair bearing NO_INDEX flag when forwarding it 2014-04-03 11:22:11 +09:00
Tatsuhiro Tsujikawa 34581d830d Define NGHTTP2_CLEARTEXT_PROTO_VERSION_ID
This identifier string is used if HTTP/2 is used over cleartext TCP.
2014-03-30 21:30:47 +09:00
Tatsuhiro Tsujikawa ab2dc5967d Replace HTTP/2.0 with HTTP/2 2014-03-30 19:26:37 +09:00
Tatsuhiro Tsujikawa a85455ed0b src: Zero clear http_parser_url struct 2014-02-27 22:11:31 +09:00
Tatsuhiro Tsujikawa 3c96041c43 nghttpx: Fix typo 2014-02-19 22:53:33 +09:00
Tatsuhiro Tsujikawa ff475104ab nghttpx: Fix runtime errors due to uninitialized values 2014-01-29 00:59:12 +09:00
Tatsuhiro Tsujikawa 864789ca65 nghttpx: Limit the maximum header block size (again) 2014-01-28 01:17:54 +09:00
Tatsuhiro Tsujikawa 8f3d4fdeec nghttpx: Remove deprecated evbuffer_setcb, send WU before buffer gets empty 2014-01-18 18:39:25 +09:00
Tatsuhiro Tsujikawa 59ff0b2f77 nghttpx: Propagate upstream priority change to downstream 2014-01-18 16:12:03 +09:00
Tatsuhiro Tsujikawa 0e4b3d435e Emit header name/value pair using callback functions
Now, in nghttp2_on_frame_recv_callback, nva and nvlen in
HEADERS and PUSH_PROMISE frames are always NULL and 0 respectively.
The header name/value pairs are emitted successive
nghttp2_on_header_callback functions. The end of header fields are
signaled with nghttp2_on_end_headers_callback function.

Since NGHTTP2_ERR_PAUSE for nghttp2_on_frame_recv_callback is
introduced to handle header block, it is now deprecated.
Instead, nghttp2_on_header_callback can be paused using
NGHTTP2_ERR_PAUSE.
2014-01-17 01:49:43 +09:00
Tatsuhiro Tsujikawa c4539046be nghttpx: No string copy if no cookie crumbling occurs 2013-12-22 15:42:12 +09:00
Tatsuhiro Tsujikawa e955598923 nghttpx: Remove downstream_port from location rewrite code 2013-12-21 18:35:53 +09:00
Tatsuhiro Tsujikawa ccfa13cd5b nghttpx: Rewrite location header field
We thought that this kind of rewrite can be achieved by the configuration
of the backend severs, but in some configuration, however, it may get
complicated. So we decided to implement at least location rewrite in
nghttpx.

This commit also contains a fix to the bug which prevents the http2
backend request from concatenating header fields with the same value.
2013-12-21 17:49:31 +09:00
Tatsuhiro Tsujikawa b38b233aa6 nghttpx: Check failure of evbuffer_* and bufferevent_* functions 2013-12-20 23:28:54 +09:00
Tatsuhiro Tsujikawa baa2272b0a src: Concatenate header fields with same name by NULL as delimiter
cookie and set-cookie are treated specially and won't be concatenated.
2013-12-07 00:32:14 +09:00
Tatsuhiro Tsujikawa 6ea91e57e0 Adjust struct/class alignment 2013-12-06 23:17:38 +09:00
Tatsuhiro Tsujikawa bbebc4ad8d nghttpx: Fix crash on CONNECT or downstream failure 2013-11-21 02:06:28 +09:00
Tatsuhiro Tsujikawa e14baf134c nghttpx: Implement cookie crumbling 2013-11-16 21:15:55 +09:00
Tatsuhiro Tsujikawa a255e4efa6 nghttpx: Use same priority in frontend and backend HTTP2 2013-11-16 15:41:24 +09:00