Commit Graph

2463 Commits

Author SHA1 Message Date
Sean McArthur efcbcdff48 docs(contrib): add ISSUES doc 2021-12-09 18:15:04 -08:00
Sean McArthur b935a95079 docs(dev): rename dev docs directory to 'docs' 2021-12-09 17:02:25 -08:00
Sean McArthur a1304a1155 v0.14.16 2021-12-09 10:14:08 -08:00
Sean McArthur b0660ce59f feat(http2): add http2_max_send_buf_size option to client and server
This value is like a high-water mark. It applies per stream. Once a
stream has buffered that amount of bytes to send, it won't poll more
data from the `HttpBody` until the stream has been able to flush under
it.
2021-12-09 10:06:14 -08:00
Sean McArthur 6a99141968 fix(http2): received Body::size_hint() now return 0 if implicitly empty (#2715)
An HTTP/2 stream may include a set of headers, and a flag signalling
END-STREAM, even if a `content-length` isn't included. hyper wouldn't
notice, and so the `Body` would report a size-hint of `0..MAX`. hyper
now notices that the stream is ended, and couldn't possibly include any
bytes for the body, and thus will give a size-hint of `0` exactly.
2021-12-06 14:14:41 -08:00
Sean McArthur 444b27b41e refactor(lib): resolve unused warnings from server-specific code (#2710) 2021-11-30 10:26:20 -08:00
Jonathan Murray 7364d7c578 fix(server): use case-insensitive comparison for Expect: 100-continue (#2709)
According to rfc2616#section-14.20 the header value is case-insensitive. Certain clients send the expectation as `100-Continue` and this should be handled by the server.

Closes #2708
2021-11-30 08:58:50 -08:00
Rajin Gill db73bb99dd fix(http1): return 414 when URI contains more than 65534 characters (#2706)
Previous behavior returned a 404 Bad Request. Conforms to HTTP 1.1 RFC.

Closes #2701
2021-11-29 12:31:41 -08:00
Sean McArthur 72f2402edb test(client): refactor client helper macro to handle options better 2021-11-24 14:26:26 -08:00
Paolo Barbolini b5200ee1f6 feat(server): add HTTP/1 header read timeout option (#2675)
Adds `Server::http1_header_read_timeout(Duration)`. Setting a duration will determine how long a client has to finish sending all the request headers before trigger a timeout test. This can help reduce resource usage when bad actors open connections without sending full requests.

Closes #2457
2021-11-18 12:02:06 -08:00
Sean McArthur cbbfbe437f v0.14.15 2021-11-16 11:56:51 -08:00
Sean McArthur 4ae0bcd1b2 docs(http1): clarify HTTP1 preserve case option 2021-11-16 11:44:21 -08:00
Sean McArthur 436ae84c60 docs(upgrade): add module documentation for HTTP upgrades 2021-11-15 14:47:29 -08:00
Sean McArthur f596509cee refactor(benches): make benchmark names more consistent 2021-11-12 15:09:52 -08:00
Ahmed Sobeh 7beeb5e318 fit(client): cancel blocking DNS lookup if GaiFuture dropped (#2689)
Closes #2686
2021-11-08 14:23:18 -08:00
muvlon 6a2557a69c docs(client): fix missing feature attrs in another doctest
when testing my fix for #2687, I noticed that this doctest has the same issue,
so here's another fix.
2021-11-08 10:47:08 -08:00
muvlon f70ef6422d docs(body) fix doctest failing due to missing features
The doctest uses `hyper::Client`, but that is not available unless these features are enabled.
This commit adds an attribute to check for those and allows `cargo test` with no arguments to pass again.

fixes #2687.
2021-11-08 10:47:08 -08:00
Anthony Ramine 0f24c1316f feat(http1): Add http1_writev(bool) to client and server Builders
Restore a way to force queue writing strategy.

Closes #2676
2021-11-04 15:29:43 -07:00
Luqman Aden febc0c5284 feat(upgrade): allow http upgrades with any body type
Allow using `Request<T>`/`Response<T>` for any given T with
`upgrade::on` instead of just restricting it to `hyper::Body`.
2021-11-03 11:40:33 -07:00
Sean McArthur 4795fc4286 v0.14.14 2021-10-22 09:53:21 -07:00
Alice Ryhl 7648d9e8aa fix(client): make ResponseFuture implement Sync 2021-10-18 10:25:27 -07:00
Sean McArthur 3147ee0ad1 chore(ci): only run cargo check on MSRV, not tests 2021-10-18 09:52:21 -07:00
Sean McArthur 00b56142b7 refactor(http1): adjust a few tracing event outputs 2021-10-13 17:42:30 -07:00
Sean McArthur 6028e5e51b test(client): remove unneeded ipv6 dns parse test 2021-10-13 17:26:36 -07:00
Ryan Goodfellow 3f977b5029 fix(client): remove ipv6 square brackets before resolving 2021-10-13 15:54:38 -07:00
Rafael Ávila de Espíndola 189561264c feat(server): Remove Send + Sync requirement for Body in with_graceful_shutdown
Also expand the single threaded example to use that.
2021-10-12 16:47:03 -07:00
Rafael Ávila de Espíndola e96b83e166 test(server): Use a !Send and !Sync HttpBody in an example
The default Body type is used in the client in a Pool, so it has to be
Send. On the server, we can use a !Send type if the executor is single
threaded.

Expand the existing example to show that.
2021-10-12 16:47:03 -07:00
Anthony Ramine c87af01941 feat(h2): always include original h2 error on broken pipe 2021-10-04 13:35:07 -07:00
Sean McArthur 4fa87fb063 docs(contrib): add Minimum Support Rust Version (MSRV) policy 2021-09-21 16:02:04 -07:00
Dai Dao c169cf6ff5 docs(examples): updated imports in client_json example (#2412) 2021-09-16 16:34:10 -07:00
Ivan Tham c493b3b103 docs(client): add link and cleanup example for hyper::client::conn (#2533) 2021-09-16 16:31:59 -07:00
Vagelis Prokopiou cdb3ea1135 docs(body): add example for to_bytes()
cc #2201
2021-09-16 16:25:40 -07:00
Sean McArthur d7ef977d24 docs(dev): start a set of "dev" docs
Initially this creates a top-level "dev" directory to hold documents
pertaining to the development, as opposed to the usage, of hyper. For a
first doc, it splits out the commit guidelines to its own file.

cc #2586
2021-09-16 12:53:59 -07:00
Sean McArthur 393cbb9d89 v0.14.13 2021-09-16 10:25:36 -07:00
Sean McArthur 3ab6f71a14 docs(ffi): expand URI documentation 2021-09-16 10:20:40 -07:00
David Cook eb695bfc63 feat(ffi): add hyper_request_set_uri_parts
Add a second FFI interface for setting the URI of a request with three
separate schema, authority, and path/query strings, rather than one URI
string.
2021-09-16 09:55:28 -07:00
Sean McArthur eb252a20a0 fix(server): convert panic to error if Connection::without_shutdown called on HTTP/2 conn 2021-09-15 15:50:49 -07:00
Sean McArthur 7dfa7acecf fix(client): don't reuse a connection while still flushing
A client connection that read a full response while the request body was
still flushing would see incorrect behavior, since the pool would let it
be checked out again for a new request. In debug builds, it would then
panic, but in release builds it would intermix the 2nd request bytes
with the body of the previous request.

In practice, this only ever happens if a server replies with a full
response before reading the full request, while also choosing to not
close that connection. Most servers either wait for the full request, or
close the connection after the new response is written, so as to stop
reading.
2021-09-15 10:25:17 -07:00
Sean McArthur cedc458cab refactor(lints): fix unused warnings in tests/docs 2021-09-14 16:50:22 -07:00
Jonas Platte 7903b0f894 feat(lib): Export more things with Cargo features [server, !http1, !http2]
* server::Server
* server::conn::{AddrIncoming, AddrStream}

This allows higher-level libraries to use or re-export more parts of the
API without deciding for the end user which HTTP versions the hyper
server will support.
2021-08-31 16:35:52 -07:00
Jonas Platte 7a5ebb6cd8 feat(lib): Export rt module independently of Cargo features 2021-08-31 16:35:52 -07:00
Jonas Platte 8b86ece1fe refactor(server): Merge imports 2021-08-31 16:35:52 -07:00
Jonas Platte ae6091197b refactor(lib): Clean up cfg usage 2021-08-31 16:35:52 -07:00
Jonas Platte 95f6264d72 refactor(lib): Inline cfg_http1, cfg_http2 macros 2021-08-31 16:35:52 -07:00
Jonas Platte dd5259b3fa refactor(lib): Import tracing macros per-module
Instead of one #[macro_use] at the crate root.
2021-08-31 16:35:52 -07:00
Sean McArthur ff59bb248b docs(ffi): note that hyper_buf_copy can return NULL on error 2021-08-26 16:48:03 -07:00
Sean McArthur 04fc83fc94 v0.14.12 2021-08-24 16:24:51 -07:00
Sean McArthur adb5b84339 fix(ffi): on_informational callback had no headers 2021-08-19 12:21:17 -07:00
Sean McArthur ce98e7e5b4 chore(dependencies): require httparse 1.5.1 2021-08-19 11:30:41 -07:00
Soveu fee7353425 refactor(http1): use MaybeUninit for parsing with uninitialized headers (#2545)
Closes #2532
2021-08-19 11:10:30 -07:00