Commit Graph
255 Commits
Author SHA1 Message Date
Mohammad Nejati aefc564fa7 basic_parser: remove skip_ usage 2024-08-22 00:22:16 +03:30
Mohammad Nejati b1f377b2eb basic_parser: set state_ before calling on_finish_impl 2024-08-22 00:22:16 +03:30
Mohammad Nejati a620d4175a basic_parser: apply header_limit_ to trailer headers 2024-08-22 00:22:16 +03:30
Mohammad Nejati f181fbf6e4 basic_parser returns error::header_limit ealier 2024-08-22 00:22:16 +03:30
Mohammad Nejati a9c4a19f26 parser uses basic_fields::insert() with error_code overload 2024-08-22 00:22:16 +03:30
Mohammad Nejati 2e6d9bb491 Add overload for basic_fields::insert() to set error_code 2024-08-22 00:22:16 +03:30
Mohammad Nejati 5f5507f647 Initiating functions no longer perform mutating operations
Using `asio::deferred` as a completion token defers the initiation of
operations and creates a lazy operation which might even be discarded.
We need to move mutating operations to the initiator function objects or
the constructor of operation objects, which are guaranteed to run when
the deferred operation is launched.
2024-08-06 15:42:40 +03:30
Mohammad Nejati aabd5b51d3 net::prepend is replaced with net::append 2024-07-07 14:58:49 +03:30
Mohammad Nejati 75812db90a get_executor() works on initiation objects
This is required for the new `asio::cancel_at` and `asio::cancel_after`
completion token adapters to work.
2024-07-04 19:49:41 +03:30
Mohammad Nejati e7f49190ef Fix basic_fields move assignment
Fixes #2517
2024-06-09 18:23:12 +03:30
Alexander Kernozhitsky 4bff457ef7 Add 418 I'm a teapot HTTP status 2024-06-03 17:59:18 +03:30
Ruslan Zakirov 3461ad1a2b fix asserts, it's possible that we reach code only with 3 symbols
This happens when:
* chunked encoding
* body is empty
* chunk has no extensions
* and put calls are really weird
2024-05-10 17:28:19 +03:30
Mohammad Nejati 7d4da621ac Update bytes_transferred documentation for http reads operations 2024-02-12 18:56:48 +03:30
Mohammad Nejati f8ff44d072 Improve documentation of http::serializer
Resolves #2221
2024-02-09 23:32:58 +03:30
Mohammad Nejati 25105e476a Update status code list to conform with IANA registry
https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml

Resolves #2729
2024-02-06 18:09:48 +03:30
Mohammad Nejati ea424f1da6 Fix the issue of paragraph separation in the documentation
Fixes #2792
2024-01-11 13:11:41 +03:30
Mohammad Nejati a0a80359fe Fix list format in documentation for http::message::prepare_payload 2024-01-07 11:01:45 +03:30
Mohammad Nejati b7f635dce0 Remove extra spaces from documentation 2024-01-06 07:50:11 +00:00
Mohammad Nejati d3afd7fad6 Improve documentation for http::message::prepare_payload()
Fixes #603
2024-01-06 09:11:10 +03:30
Mohammad Nejati 9e16754dd5 Add non-allocating overload for error category message function
Fixes #2646
2024-01-03 18:21:52 +03:30
Mohammad 0d1e2d64f8 Replace beast::bind_front_handler uses with asio::prepend 2023-12-30 08:47:32 +03:30
Klemens Morgenstern dd875463ff immediate_executor is supported. (#2672) 2023-10-13 05:33:23 -03:00
Shukant Pal 177a1222a6 Fix typo in documentation 2023-10-12 13:39:36 +08:00
Edward Nolan cd6b79db5a headers using std::int8_t et al. include <csdint>. 2023-05-15 08:49:53 +08:00
Klemens 1d965752b2 beast file_body & file support seek.
win32 file_body handles seek correctly.
Added seek to win32 file.
file_body_writer handles offsets.
2023-02-05 02:57:41 +08:00
Klemens 4ff4c79d5b file_body buffer size can be configured. 2023-02-05 02:57:41 +08:00
Klemens Morgenstern aef9c88c9d error categories use numeric id 2023-01-23 17:48:28 +08:00
Klemens Morgenstern 48f82ac817 Switched self-posting to the io-object's executor.
This is a conceptual change in the recent asio version that is reflected in any_completion_handler.
2022-12-20 14:45:26 +08:00
Klemens 860bfbdeab Added source-location to all ecs.
Closes #2475.
2022-12-20 13:16:39 +08:00
Klemens 3ebff60b1a beast support per-op cancellation
- websocket supports cancellation.
 - Iterating test for ws cancellation.
 - Only terminal cancellation is forwarded by default.
 - basic_stream supports cancellation.
 - supported cancellation is documented.
 - http cancellation additions.
 - Added cancellation_slot tests to http, utils and saved_handler.
 - Added post to write.cpp, to avoid SIGSEV in test.
 - Refresher describes cancellation in more detail.
2022-10-27 22:56:19 +08:00
Klemens Morgenstern f4d1936bb2 error_codes use source_location. 2022-10-26 00:06:01 +08:00
Klemens Morgenstern 1a02413638 unquote takes s by reference.
Closes #471.
2022-10-12 09:53:42 +08:00
Klemens Morgenstern 8f74e0d464 Field function state they're case-insensitive.
Closes #516.
2022-10-12 01:42:20 +08:00
Klemens 01dd53d665 Empty header values are allowed & documented. 2022-10-10 14:39:46 +08:00
alandefreitas fbcc16301d Fix API reference 2022-10-02 22:34:36 +08:00
alandefreitas 5866e50438 Add multiple content length error
fix #2468
2022-10-02 20:04:46 +08:00
Ed Catmur 78fc61a9f7 Remove unnecessary constant_time_size for multi_buffer:
http::basic_fields::set_t::size() is unused
core::multi_buffer::list_type::size() is only compared to 1 (in shrink_to_fit()); compare iterators instead.

close #2498
2022-08-24 21:42:22 +02:00
alandefreitas eaa51201bd Fix broken links
fix #2333
2022-06-22 15:07:30 -03:00
alandefreitas 3272dc0aeb Document fields::equal_range
fix #1251
2022-06-22 15:06:39 -03:00
Petre Pircalabu 7f6adb91f7 Fix large files transfer on Windows
The maximum number of bytes to write using TransmitFile cannot be
greater than INT_MAX - 1, otherwise the function fails with WSAEINVAL.

https://docs.microsoft.com/en-us/windows/win32/api/mswsock/nf-mswsock-transmitfile

The issue can be reproduced using the http-server-sync example, by
sending a GET request for a file larger than INTMAX.

e.g:
$ curl -v http://127.0.0.1:8080/ubuntu.iso -o ubuntu.iso
*   Trying 127.0.0.1:8080...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /ubuntu.iso HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.83.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: Boost.Beast/330
< Content-Type: application/text
< Content-Length: 3654957056
<
{ [0 bytes data]
* transfer closed with 3654957056 bytes remaining to read
  0 3485M    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
curl: (18) transfer closed with 3654957056 bytes remaining to read

Signed-off-by: Petre Pircalabu <ppircalabu@bitdefender.com>
2022-06-21 20:37:43 -03:00
sehe 740879a995 Add http::message_generator 2022-05-21 22:12:13 -07:00
sehe 344c10ff1e serializer::is_done is const 2022-05-21 22:12:13 -07:00
Glen Fernandes 24275ac0c6 Use static_string from Boost.StaticString 2022-04-17 12:30:52 -04:00
Michael Haubenschild 31a1fb332a Fix missing check for error code after header is parsed:
The missing error check leads to completely ignoring the body limit,
as the body limit is compared to the "Content-Length" header inside
the "finish_header" method.

closes #2201
2021-03-25 15:04:12 +01:00
Richard Hodges 670f01f050 No undefined behaviour in parser
closes #2172
2021-03-03 19:22:13 +01:00
Richard Hodges bea31bfff6 Fix nullptr implicit cast on fields::set()
fixes #2085
2020-09-13 16:19:27 +02:00
Richard Hodges 91d9457ab9 Add Sec-* HTTP headers
fixes #2080
closes #2082
2020-09-07 17:26:34 +02:00
Richard Hodges 9e6822773e Fix erroneous error when HTTP body_limit is none
fixes #2070
closes #2073
2020-08-28 13:26:59 +02:00
Christopher Kohlhoff 11385141ea Add handler tracking locations to http operations 2020-08-28 13:26:21 +02:00
Richard Hodges 2efb729c53 Fix compile errors under Clang 3.4
fixes #2030
closes #2031
2020-07-24 13:59:49 +02:00