Commit Graph

192 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa 5dc060c1a2 src: Use C++11 value-initialization, instead of memset-ing 0 2015-07-19 17:55:37 +09:00
Tatsuhiro Tsujikawa 68c0f8a310 Fix compile error with gcc-4.7
Use std::map::insert instead of std::map::emplace, since gcc-4.7 does
not support the latter.
2015-06-27 11:19:54 +09:00
Tatsuhiro Tsujikawa 301df2a856 src: Disable SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 2015-06-22 23:26:45 +09:00
Tatsuhiro Tsujikawa cebfdacc5a src: Use user-defined literals for time (hours and minutes) 2015-06-21 14:51:32 +09:00
Tatsuhiro Tsujikawa 39f89f4a60 src: Use user-defined literals for k, m, and g. 2015-06-21 14:32:47 +09:00
Tatsuhiro Tsujikawa c6c7145167 Fix compile warning with android NDK 2015-06-12 19:19:53 +09:00
Tatsuhiro Tsujikawa 34efc6b7a4 More constexpr 2015-05-29 22:36:05 +09:00
Tatsuhiro Tsujikawa fe752174a9 nghttpd: Close connection after settings timeout and GOAWAY was sent 2015-05-18 21:38:12 +09:00
Tatsuhiro Tsujikawa 0b27f005e0 Merge branch 'master' into v1.0.0
Conflicts:
	src/HttpServer.cc
2015-05-15 23:24:19 +09:00
Tatsuhiro Tsujikawa 38cfc5c47c Check more headers and funcs 2015-05-13 23:29:20 +09:00
Tatsuhiro Tsujikawa 5da49989f8 nghttpd: Add --echo-upload option to send back request body 2015-05-13 00:38:28 +09:00
Tatsuhiro Tsujikawa e63d6e490a Merge branch 'master' into v1.0.0
Conflicts:
	lib/nghttp2_option.h
	lib/nghttp2_session.h
	src/HttpServer.cc
2015-05-08 19:21:51 +09:00
Tatsuhiro Tsujikawa 2d5d9d5d04 nghttpd: Add -m, --max-concurrent-streams option 2015-05-06 10:42:43 +09:00
Tatsuhiro Tsujikawa 5937b4b6f7 Merge branch 'master' into v1.0.0 2015-04-19 23:13:38 +09:00
Tatsuhiro Tsujikawa 102ea7c0bb nghttpd: Cache fd
Implement fd caching for static files.  The response body for such as
404 was dynamically generated previously, but now it is written in
temporally file and its fd is cached.  Currently, cache is reference
counted and expired when count becomes 0.  This makes caching is not
effective other than "busy" period, but we don't need this feature if
we are not busy.
2015-04-19 17:38:06 +09:00
Tatsuhiro Tsujikawa d0c27d5229 Send 24 bytes client magic byte string by library
Previously nghttp2_session_send() and nghttp2_session_mem_send() did
not send 24 bytes client magic byte string (MAGIC).  We made
nghttp2_session_recv() and nghttp2_session_mem_recv() process MAGIC by
default, so it is natural to make library send MAGIC as well.  This
commit makes nghttp2_session_send() and nghttp2_session_mem_send()
send MAGIC.  This commit also replace "connection preface" with
"client magic", since we call MAGIC as "connection preface" but it is
just a part of connection preface.  NGHTTP2_CLIENT_CONNECTION_PREFACE
macro was replaced with NGHTTP2_CLIENT_MAGIC.  The already deprecated
NGHTTP2_CLIENT_CONNECTION_HEADER macro was removed permanently.
nghttp2_option_set_no_recv_client_preface() was renamed as
nghttp2_option_set_no_recv_client_magic().  NGHTTP2_ERR_BAD_PREFACE
was renamed as NGHTTP2_ERR_BAD_CLIENT_MAGIC.
2015-04-05 23:15:20 +09:00
Tatsuhiro Tsujikawa 250ea53e4b Deal with 24 bytes client connection preface by default
Since HTTP/2 spec requires for client to send connection preface, it
is reasonable to make this option enabled by default.  It is still a
use case to disable this, so replace this option with
nghttp2_option_set_no_recv_client_preface().
2015-04-05 23:15:20 +09:00
Tatsuhiro Tsujikawa 7522d50d1a nghttpd, tiny-nghttpd: No need to check existence of stream
The stream existence is guaranteed by library as of
cc03a12b75.
2015-04-05 23:13:29 +09:00
Tatsuhiro Tsujikawa 9eff511c5e Add nghttp2_send_data_callback to send DATA payload without copying
To avoid buffer copy in nghttp2_data_source_read_callback, this commit
introduces NGHTTP2_DATA_FLAG_NO_COPY and nghttp2_send_data_callback.
By using NGHTTP2_DATA_FLAG_NO_COPY in
nghttp2_data_source_read_callback, application can avoid to copy
application data to given buffer.  Instead, application has to
implement nghttp2_send_data_callback to send complete DATA frame by
itself.  We see noticeable performance increase in nghttpd and
tiny-nghttpd using this new feature.  On the other hand, nghttpx does
not show such difference, probably because buffer copy is not
bottleneck.  Using nghttp2_send_data_callback adds complexity, so it
is recommended to measure the performance to see whether this extra
complexity worth it.
2015-04-04 21:23:50 +09:00
Tatsuhiro Tsujikawa a2486daee1 nghttpd: Rename Http2Handler::on_connect as connection_made 2015-03-28 20:21:12 +09:00
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 a0524ef05d Fix busy loop 2015-03-11 00:11:51 +09:00
Tatsuhiro Tsujikawa 961f41d7ce nghttp, nghttpd: Add trailer header field when sending trailer part 2015-03-08 17:52:36 +09:00
Tatsuhiro Tsujikawa d10dc4bb9b nghttp, nghttpd: Clean up around NGHTTP2_DATA_FLAG_NO_END_STREAM 2015-03-08 16:28:23 +09:00
Tatsuhiro Tsujikawa 80a7523b49 nghttpd: Add --trailer to send trailer header fields 2015-03-07 17:50:03 +09:00
Tatsuhiro Tsujikawa c2f49fa478 nghttpd: Fix bug that date header field value is not updated 2015-03-07 01:10:49 +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
Brian Card 1bdf664f4d Changing signature of numeric_name from numeric_name(addrinfo *addr)
to numeric_name(const struct sockaddr *sa, socklen_t salen) to remove
dependency on addrinfo struct.
2015-02-26 08:59:25 -05:00
Brian Card b773d63b92 Moving nghttp's numeric_name function to util.cc and using this to generate the address name in HttpServer.cc 2015-02-24 09:50:18 -05:00
Tatsuhiro Tsujikawa e457c9a414 src: Add util::strieq_l 2015-02-22 15:32:48 +09:00
Tatsuhiro Tsujikawa 489b4f307c nghttp, nghttpd, nghttpx: Remove validations libnghttp2 offers 2015-02-20 01:01:10 +09:00
Tatsuhiro Tsujikawa b14cfaf308 src: Store token in Header object to avoid additional lookups 2015-02-08 16:10:01 +09:00
Tatsuhiro Tsujikawa 795a22a320 src: Remove ringbuf.h, use buffer.h instead 2015-02-06 23:40:34 +09:00
Tatsuhiro Tsujikawa 4cda09beff src: Prefer std::array 2015-02-06 00:15:43 +09:00
Tatsuhiro Tsujikawa ab6663c785 src: Use std::array instead of std::vector if size is compile time constant 2015-02-06 00:15:43 +09:00
Tatsuhiro Tsujikawa 54851ef7a6 src: Move make_unique to nghttp2 namespace 2015-02-06 00:15:43 +09:00
Tatsuhiro Tsujikawa 9f5f724147 nghttpd, nghttpx: Don't log error NGHTTP2_ERR_BAD_PREFACE 2015-02-02 00:20:44 +09:00
Tatsuhiro Tsujikawa b99b83812b nghttpd: RST_STREAM if te header field contains value other than trailers 2015-01-25 22:58: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 2b458666ba nghttpd: Fix compiler warning 2015-01-16 23:22:10 +09:00
Tatsuhiro Tsujikawa a08ce38bcf nghttpd: Cache date by comparing ev_now 2015-01-15 23:27:52 +09:00
Tatsuhiro Tsujikawa c3aa02f003 nghttpd: Use Http2Handler::submit_rst_stream 2015-01-15 23:11:14 +09: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 22e41bab3f nghttpd: Issue RST_STREAM if received header field contains invalid chars 2015-01-15 22:45:18 +09:00
Tatsuhiro Tsujikawa 473f1d71ff src: Clear OpenSSL error queue before SSL_shutdown 2015-01-09 09:15:01 +09:00
Tatsuhiro Tsujikawa 8f40bd4675 nghttp, nghttpd, h2load: Clear OpenSSL error queue and handle renegotiation 2015-01-09 09:10:59 +09:00
Tatsuhiro Tsujikawa f570757701 nghttpd: Fix data race when updating cached_date 2015-01-08 21:41:26 +09:00
Tatsuhiro Tsujikawa 8bfd900be5 src, examples: Check return value 2015-01-07 00:26:17 +09:00
Tatsuhiro Tsujikawa fcf0ceeac6 nghttpd: Make use of accept4 2015-01-05 15:59:51 +09:00
Tatsuhiro Tsujikawa 3ae44ef2f3 nghttpd, nghttpx: Rework incoming header handling 2015-01-05 01:46:41 +09:00