2513 Commits

Author SHA1 Message Date
openharmony_ci 813dc7f68e !3 告警与遗留问题文件补充
Merge pull request !3 from peizhe/master
OpenHarmony-v4.0-Beta1 OpenHarmony-v4.0-Beta2
2023-05-09 11:13:28 +00:00
peizhe 7aee158eb3 告警与遗留问题文件补充
Signed-off-by: peizhe <zhaipeizhe@huawei.com>
2023-05-08 15:25:18 +08:00
openharmony_ci 515c182ea3 !2 CI OAT 告警清零与README.OpenSource 中License信息整改
Merge pull request !2 from peizhe/master
2023-05-04 06:59:10 +00:00
peizhe 73a480f5f0 CI OAT 告警清零与README.OpenSource 中License信息整改
Signed-off-by: peizhe <zhaipeizhe@huawei.com>
2023-04-25 20:27:43 +08:00
openharmony_ci f26b256c6c !1 [hyper]Add GN Build Files and Custom Modifications to Rust Third-party Libraries
Merge pull request !1 from peizhe/master
2023-04-19 01:28:56 +00:00
peizhe adeb7b128e Add GN Build Files and Custom Modifications
Signed-off-by: peizhe <472708703@qq.com>
2023-04-18 18:31:19 +08:00
Sean McArthur 3a2e07f642 v0.14.20 github.com/hyperium/hyper/refs/tags/v0.14.20 2022-07-07 13:38:22 -07:00
Sean McArthur c79b5c1f54 chore(lib): bump MSRV to 1.56 (#2902)
(cherry picked from commit a563404033b66663fe7e2b54f93cb033d4029100)
2022-07-07 13:38:05 -07:00
silence-coding 7e36f1472c fix(http1): fix http1_header_read_timeout to use same future (#2891)
Co-authored-by: silence <xxx@email.com>
(cherry picked from commit 5fa113ebffafef9fb655bc67b5d4fc0f3245fda5)
2022-07-07 13:32:49 -07:00
Adam C. Foltzer 20fa5c9dbf feat(ext): support non-canonical HTTP/1 reason phrases (#2792)
Add a new extension type `hyper::ext::ReasonPhrase` gated by either the `ffi` or `http1` Cargo
features. When enabled, store any non-canonical reason phrases in this extension when parsing
responses, and write this reason phrase instead of the canonical reason phrase when emitting
responses.

Reason phrases are a disused corner of the spec that implementations ought to treat as opaque blobs
of bytes. Unfortunately, real-world traffic sometimes does depend on being able to inspect and
manipulate them.

Non-canonical reason phrases are checked for validity at runtime to prevent invalid and dangerous
characters from being emitted when writing responses. An `unsafe` escape hatch is present for hyper
itself to create reason phrases that have been parsed (and therefore implicitly validated) by
httparse.
2022-06-08 15:57:33 -07:00
evenbetter 3eba3206df refactor(lib): resolve unused import (#2889) 2022-06-07 08:10:29 -07:00
Kian-Meng Ang ee21bb3ea6 docs(proto): fix typos (#2876) 2022-05-30 07:43:39 -07:00
Sean McArthur a6a6282d68 v0.14.19 2022-05-27 12:05:38 -07:00
Ryan Russell 9a727190aa docs(various): fix typos in VISION and ROADMAP (#2875)
Signed-off-by: r <ryanrussell@users.noreply.github.com>
2022-05-27 13:51:32 +00:00
Nylonicious f2b0ddc972 chore(lib): update tokio-util to 0.7 (#2762) 2022-05-26 16:26:31 -07:00
Sean McArthur 77fe15bbe8 docs(contrib): add guide for Triaging Issues 2022-05-25 14:13:09 -05:00
Sean McArthur c978944338 docs(lib): propose 1.0 roadmap (#2806) 2022-05-20 10:08:55 -07:00
silence-coding 0ff123a9e1 feat(server): add Connection::http2_max_header_list_size option (#2828)
This allows setting the HTTP/2 `SETTINGS_MAX_HEADER_LIST_SIZE` which advertises to the peer the maximum header size allowed, and internally is enforced.

Closes #2826
2022-05-18 16:52:01 -07:00
Jannes (思明) e59da72f7f fix(server): don't add implicit content-length to HEAD responses (#2836)
HEAD responses should not have content-length implicitly set by hyper.

Co-authored-by: Jannes Timm <jannes@cloudflare.com>
2022-05-18 10:49:58 -07:00
Basti Ortiz d96076a751 refactor(http1): assorted code readability improvements in h1/conn.rs (#2817)
* refactor: use `matches` macro to flatten code

* refactor: prefer `matches` over explicit matching

* refactor: reuse `can_write_body` method

* refactor: use `matches` over `if`-`let`

* refactor: nested `if`-`else` as early return

* refactor: move inner `match` logic outside

* refactor: unneeded `return` in `match`

* refactor: remove unneeded reference matching

* refactor: use early returns for idle check

* refactor: use `matches` macro for Boolean `match`
2022-04-26 11:29:49 -07:00
Anthony Ramine e7420b22a3 fix(http1): fix preserving header case without enabling ffi (#2820)
The previous commit broke this, but it wasn't released, so released versions will never notice the breakage.
2022-04-26 08:24:57 -07:00
cui fliter 33a903c162 docs(lib): fix some typos (#2818)
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-04-25 11:05:48 -07:00
Liam Warfield 4192329658 feature(ffi): add connection option to preserve header order (#2798)
Libcurl expects that headers are iterated in the same order that they
are recieved. Previously this caused curl tests 580 and 581 to fail.
This necessitated exposing a way to preserve the original ordering of
http headers.

SUMMARY OF CHANGES: Add a new data structure called OriginalHeaderOrder that
represents the order in which headers originally appear in a HTTP
message. This datastructure is `Vec<(Headername, multimap-index)>`.
This vector is ordered by the order which headers were recieved.
Add the following ffi functions:
- ffi::client::hyper_clientconn_options_set_preserve_header_order : An
     ffi interface to configure a connection to preserve header order.
- ffi::client::hyper_clientconn_options_set_preserve_header_case : An
     ffi interface to configure a connection to preserve header case.
- Add a new option to ParseContext, and Conn::State called `preserve_header_order`.
  This option, and all the code paths it creates are behind the `ffi`
  feature flag. This should not change performance of response parsing for
  non-ffi users.

Closes #2780

BREAKING CHANGE: hyper_clientconn_options_new no longer
  sets the http1_preserve_header_case connection option by default.
  Users should now call
  hyper_clientconn_options_set_preserve_header_case
  if they desire that functionality.
2022-04-23 09:05:37 -07:00
Ralf Jung 0bcaaae2f7 test(lib): add CI job to test with Miri 2022-04-21 12:55:52 -07:00
Ralf Jung 1cb1f6b493 test(lib): fix tests with more feature combinations 2022-04-21 12:55:52 -07:00
Ilya Trefilov 3a55af68b4 feat(server): add AddrStream::local_addr() (#2816)
Expose local address of tcp connection in AddrStream.

Closes #2773
2022-04-20 15:35:36 -07:00
Sean McArthur b50df8bd63 docs(contrib): add contributing guide for submitting pull requests 2022-04-15 09:19:32 -07:00
Sean McArthur 98180b05f0 docs(lib): define the VISION and TENETS 2022-04-12 16:54:27 -07:00
Basti Ortiz 8999a22417 refactor(capi): make early returns consistent in C examples (#2812)
- Since the `if` condition already causes the loop to `break`,
  the `else` is not necessary. We wouldn't have reached the `else`
  block, anyway, if the prior `if` condition passed.
- We are more likely to poll a successful chunk than finish
  the request or throw an error. Thus, it is best if we go
  for the optimistic route and check for the successful
  case first.
2022-04-11 17:20:14 -07:00
SabrinaJewson 835899b3fc style(server): rustfmt 2022-04-08 17:02:02 -07:00
SabrinaJewson a7b8ae363c refactor(server): simplify server cfgs
`server.rs` is currently littered with `cfg`s for `http1` or `http2`,
since the majority of server behaviour is only available with either one
of those feature flags active. This is hard to maintain and confusing to
read, so this commit extracts the two implementations into their own
files, since there is very little benefit in sharing code between the
two.
2022-04-08 17:02:02 -07:00
SabrinaJewson c4992491b6 refactor(server): move non-conn code out of conn.rs
The actual code for `Server` was previously organized very confusingly:
it was thrice layered with `SpawnAll` and `Serve` which both appeared in
conn.rs despite not having anything to do with the lower-level conn API.
This commit changes that, removing all layering and having the code for
the higher-level `Server` appear inside `server.rs` only.
2022-04-08 17:02:02 -07:00
Sean McArthur 38cbe561b3 v0.14.18 2022-03-22 14:12:13 -07:00
Sean McArthur dbdeb08657 refactor(error): improve error message when user body ends early 2022-03-14 10:31:31 -07:00
Rémy Rakic 59d1ee1891 docs(ffi): document nightly requirement for FFI
Update the command to use `--crate-type`.
2022-03-03 15:05:42 -08:00
Rémy Rakic 7eb396b773 chore(ci): test FFI on CI using nightly
Now that FFI is opt-in using cargo's --crate-type, nightly needs to be used
on CI: this flag is still unstable and requires a nightly to enable -Z unstable options.
2022-03-03 15:05:42 -08:00
Rémy Rakic c0cd00359c fix(ffi): don't build C libraries by default
Remove unconditional building of FFI libraries: now
that nightly supports --crate-type, it can be opted into.
This fixes cargo's pipelining both for dependencies and
for dependent crates, resulting in faster from-scratch builds.
2022-03-03 15:05:42 -08:00
Devrim Şahin b70a0131ed feat(client): add HttpInfo::local_addr() method
This adds `local_addr` information from `TcpStream` to the `HttpInfo` struct

Closes #2767
2022-02-28 14:18:51 -08:00
Sean McArthur 15f5280e66 docs(conduct): add custom CODE_OF_CONDUCT 2022-02-28 12:18:12 -08:00
Stéphan Kochen b64a291674 docs(upgrade): fix typo in upgrade docs (#2765) 2022-02-25 10:28:13 -08:00
Sean McArthur 1fb13d8d85 chore(ci): increase MSRV to 1.49 2022-02-24 09:48:41 -08:00
Ilya Trefilov 7b5ef7121a docs(client): Add tcp feature for Client::new docs
added cfg attr to denote required tcp feature in docs for Client::new method

Closes: #2759
2022-02-15 15:23:15 -08:00
Sean McArthur 33331ff437 v0.14.17 2022-02-10 12:49:30 -08:00
Anthony Ramine 253394a356 feat(http1): implement obsolete line folding (#2734)
The client now has an option to allow parsing responses with obsolete line folding in headers. The option is off by default, since the spec recommends to reject such things if you can.
2022-02-09 12:59:23 -08:00
Anthony Ramine 8fa3207342 feat(client): implement the HTTP/2 extended CONNECT protocol from RFC 8441 (#2682) 2022-02-07 17:35:34 -08:00
David Pedersen 59f89c5971 feat(error): add Error::message (#2737)
This adds Error::message which returns the message that is unique to the error, without the message from the source. That way users can create a newtype around hyper::Error and use this in the Display impl to work around #2732.

Closes #2732
2022-02-04 17:10:00 -08:00
Oliver Gould 944b60c62c fix(client): avoid panics in uses of Instant (#2746)
Even though this is almost definitely a bug in Rust, it seems most
prudent to actively avoid the uses of `Instant` that are prone to this
bug.

This change replaces uses of `Instant::elapsed` and `Instant::sub` with
calls to `Instant::saturating_duration_since` to prevent this class of
panic.
2022-01-31 16:33:16 -08:00
Ivan Boldyrev b4c994e590 refactor(client): use Box<str> inside dns::Name (#2727)
Use Box<str> in hyper::client::connect::dns::Name, so
its size is 16 bytes, not 24 bytes.  As Name never
change its contents, read-only Box<str> is perfectly OK.
2021-12-29 08:33:06 -08:00
Bruce Mitchener 357185724d chore(dependencies): update to itoa 1 2021-12-14 10:55:21 -08:00
Rajin Gill 36fc622560 style(http1): correct indentation
Minor reformatting of single block.
2021-12-14 08:01:14 -08:00