Commit Graph

52 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa 89b8039466 nghttp, nghttpd: Add --hexdump option to hexdump incoming traffic
The output format is similar to `hexdump -C`
2015-03-24 02:30:51 +09:00
Tatsuhiro Tsujikawa 80a7523b49 nghttpd: Add --trailer to send trailer header fields 2015-03-07 17:50:03 +09:00
Tatsuhiro Tsujikawa 3715a89655 Merge branch 'bcard/address-nghttp2-server' of https://github.com/bcard/nghttp2 into bcard-bcard/address-nghttp2-server
Conflicts:
	src/nghttp.cc
2015-02-27 00:02:45 +09:00
Tatsuhiro Tsujikawa 489b4f307c nghttp, nghttpd, nghttpx: Remove validations libnghttp2 offers 2015-02-20 01:01:10 +09:00
Tatsuhiro Tsujikawa 795a22a320 src: Remove ringbuf.h, use buffer.h instead 2015-02-06 23:40:34 +09:00
Tatsuhiro Tsujikawa f8f9b36acd http2: Use std::array for indexing headers 2015-02-06 00:15:43 +09:00
Brian Card 516a2f0efc Adding an address parameter that allows nghttpd to bind to a non-default address. Both IPv4 and IPv6 addresses are supported. In addition with verbose mode enable the address that the webserver binds to is now printed in addition to the port. 2015-01-24 15:26:49 -05:00
Tatsuhiro Tsujikawa d142830109 nghttpd: Issue RST_STREAM if content-length does not match uploaded bytes 2015-01-15 23:07:25 +09:00
Tatsuhiro Tsujikawa 8e3406ad20 nghttpd: Use faster request header handling 2015-01-03 00:19:41 +09:00
Tatsuhiro Tsujikawa fe8f2a4603 nghttpd: Use larger write buffer 2015-01-03 00:19:41 +09:00
Tatsuhiro Tsujikawa 0a4330ee3c nghttpd: Fix handling pending data and rename rb_ as wb_ 2015-01-03 00:19:41 +09:00
Tatsuhiro Tsujikawa cd7258a7cd Use libev for nghttpd
Benchmark shows 10% faster with libev compared to libevent.  Also
response time in high load condition is much faster.
2015-01-03 00:19:41 +09:00
Tatsuhiro Tsujikawa 292f219900 nghttpd: Avoid sending last 0-sized DATA 2014-12-24 00:31:21 +09:00
Tatsuhiro Tsujikawa 55e550f08f nghttpd: Remove unused variable 2014-12-24 00:23:01 +09:00
Tatsuhiro Tsujikawa b1f807abd1 Reformat lines with clang-format-3.5 2014-11-27 23:56:30 +09:00
Tatsuhiro Tsujikawa 29fcd7c946 nghttpd: Use http2::Headers 2014-11-02 23:33:04 +09:00
Tatsuhiro Tsujikawa 3931a0b04d Fix bugs found by coverity scan 2014-10-10 22:50:35 +09:00
Tatsuhiro Tsujikawa a9b74261b6 nghttpd: Rewrite using bufferevent (again) for simplicity 2014-09-19 00:58:32 +09:00
Tatsuhiro Tsujikawa 901de5fbce Add nghttp2_option_set_recv_client_preface()
By default, nghttp2 library only handles HTTP/2 frames and does not
recognize first 24 bytes of client connection preface. This design
choice is done due to the fact that server may want to detect the
application protocol based on first few bytes on clear text
communication. But for simple servers which only speak HTTP/2, it is
easier for developers if nghttp2 library takes care of client
connection preface.

If this option is used with nonzero val, nghttp2 library checks first
24 bytes client connection preface. If it is not a valid one,
nghttp2_session_recv() and nghttp2_session_mem_recv() will return
error NGHTTP2_ERR_BAD_PREFACE, which is fatal error.
2014-09-13 19:50:44 +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 4f815521ae nghttpx, nghttpd: Support non-final response 2014-07-31 23:05:52 +09:00
Tatsuhiro Tsujikawa 545732fed8 nghttpd: Add --early-response option
This option is testing the client behavior when it gets response
before sending all request.
2014-07-03 22:44:27 +09:00
Tatsuhiro Tsujikawa 4e81a34146 nghttpd: Add --dh-param-file option to support DHE ciphers 2014-06-28 15:43:06 +09:00
Tatsuhiro Tsujikawa 3db8935e20 Remove per-frame compression 2014-06-07 16:04:43 +09:00
Tatsuhiro Tsujikawa 9125499dd0 src: Implement per-frame DATA compression
Currently, nghttpd server only compresses files whose extensions are
one of .html, .js, .css and .txt.  nghttp advertises its support of
per-frame compression in SETTINGS frame.  To implement this feature,
we added 2 public API: nghttp2_session_get_remote_settings() and
nghttp2_gzip_inflate_finished().
2014-05-03 00:02:17 +09:00
Tatsuhiro Tsujikawa ab2dc5967d Replace HTTP/2.0 with HTTP/2 2014-03-30 19:26:37 +09:00
Tatsuhiro Tsujikawa fac42788bc nghttpd: Rename Request as Stream 2014-03-21 23:26:53 +09:00
Tatsuhiro Tsujikawa 464fef7c6e nghttpd: Add HTTP/2 stream read/write timeout 2014-03-21 23:07:20 +09:00
Tatsuhiro Tsujikawa c048ac5eff nghttpd: Avoid to use bufferevent for connection 2014-03-18 00:09:59 +09:00
Tatsuhiro Tsujikawa a61ca763df nghttpd: Add -e option to toggle gzipped error response 2014-03-04 23:29:30 +09:00
Tatsuhiro Tsujikawa caeeba681f nghttpd: Add multi threading support 2014-03-04 23:14:26 +09:00
Tatsuhiro Tsujikawa 7504d89f9b src: Add at most N bytes as padding if --padding option is used 2014-02-15 16:40:32 +09:00
Tatsuhiro Tsujikawa 68b5ffc1dc Rename padding related names 2014-02-09 21:46:15 +09:00
Tatsuhiro Tsujikawa 1db2195389 Implement padding for HEADERS and CONTINUATION 2014-02-09 15:17:26 +09:00
Tatsuhiro Tsujikawa 814d0f76f3 Implement DATA frame padding 2014-02-08 00:23:18 +09:00
Tatsuhiro Tsujikawa c79adf6997 Remove flow control disabling feature 2014-02-06 00:23:20 +09:00
Tatsuhiro Tsujikawa e186e01933 Replace on_end_headers_callback with on_begin_headers_callback
Previously, there is inconsistency when on_frame_recv_callback
is called between HEADERS/PUSH_PROMISE and the other frames.
For former case, it is called before header block, in latter
case, it is called after whole frame is received. To make it
consistent, we call on_frame_recv_callback for HEADERS/PUSH_PROMISE
after its frame is fully received. Since on_frame_recv_callback
can signal the end of header block, we replaced on_end_headers_callback
with on_begin_headers_callback, which is called when the reception
of the header block is started.
2014-01-29 21:23:13 +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 78e5149495 src: Support ALPN
Requires unreleased OpenSSL >= 1.0.2
2014-01-02 00:15:08 +09:00
Tatsuhiro Tsujikawa 9cb8754d09 Rename nghttp2_session_fail_session as nghttp2_session_terminate_session 2013-12-26 00:23:07 +09:00
Tatsuhiro Tsujikawa 04e496d7bd nghttpd: Use nghttp2_session_fail_session instead of nghttp2_submit_goaway 2013-12-25 00:40:57 +09:00
Tatsuhiro Tsujikawa 47f53940da nghttpd: Add -p, --push option to configure server push
The option syntax is <PATH>=<PUSH_PATH,...>.
Push resources PUSH_PATHs when PATH is requested. This option can be used
repeatedly to specify multiple push configurations. For example,
  -p/=/foo.png -p/doc=/bar.css
PATH and PUSH_PATHs are relative to document root.
2013-12-09 00:00:12 +09:00
Tatsuhiro Tsujikawa 6ea91e57e0 Adjust struct/class alignment 2013-12-06 23:17:38 +09:00
Tatsuhiro Tsujikawa be5d08647e nghttpd: Add -c, --header-table-size option 2013-11-05 23:44:20 +09:00
Tatsuhiro Tsujikawa dc61f705df nghttp, nghttpd: Add SETTINGS timeout handling
SETTINGS timeout is 10 seconds for now.
2013-10-27 23:02:39 +09:00
Tatsuhiro Tsujikawa c751a6e935 Fix cosmetic errors 2013-09-07 16:38:21 +09:00
Tatsuhiro Tsujikawa 053c444769 Add int return value to nghttp2_on_request_recv_callback 2013-08-29 23:03:21 +09:00
Tatsuhiro Tsujikawa 0c9703fa2c Remove NGHTTP2_FLAG_END_FLOW_CONTROL 2013-08-23 03:33:05 +09:00
Tatsuhiro Tsujikawa 07814be5b2 src: HttpServer: Remove unused member variable sfd_ 2013-08-06 23:17:13 +09:00
Tatsuhiro Tsujikawa 9f9c0cbcd1 nghttpd: Add -F and -f option to disable connection/stream level flow control 2013-07-28 19:29:11 +09:00