Commit Graph

101 Commits

Author SHA1 Message Date
June Han
5ecd04ade2 fix: call after_handlers for legitimate requests without body part 2024-02-21 21:37:51 +01:00
bruvey
78d1d2bfba fix #626 2024-01-09 20:16:31 +01:00
jfm
f3e0846ee5 My mistake. Crow is compiled with c++11 under windows and has a macro for std::min not being defined as std::min(a,b) under c++11, CROW_MIN 2024-01-01 22:40:37 +01:00
jfm
6704b9b3ab Add <algorithm> header-file, it doesn't compile on windows if not included 2024-01-01 22:40:37 +01:00
jfm
195cd6ad00 Fixed a typo. As in other places, use 2^14 here 2024-01-01 22:40:37 +01:00
Felix
ae8643a1b6 Performance fix for non-static streaming data 2024-01-01 22:40:37 +01:00
Vasileios Anagnostopoulos
d5e0523602 Fix memory leaks caused from the http_connection
This memory leak was caused from the fact that we were creating a raw
pointers in the do_accept method of the http_server. The initial
connection was never released, but all subsequent connection
were released without problem. So this commit introduces shared_ptr
to manage all the connection and release the memory when the
connection is not needed any more.

Signed-off-by: Vasileios Anagnostopoulos <anagnwstopoulos@hotmail.com>
2023-05-14 13:38:42 +02:00
okaestne
5543276c4e
http_connection: initialize task_id_ 2022-11-05 23:08:54 +01:00
Farook Al-Sammarraie
27439944b0
Merge branch 'master' into fix-stack-data-disclosure 2022-08-23 00:22:17 +03:00
Igor Mróz
d17a88af69
Fix stack data disclosure when returning static files smaller than
16KiB. It could also cause to return partially incorrect file ending in
case of file not being rounded up to 16KiB.

Thanks to Gynvael Coldwind and hebi for discovering and preparing
report.
2022-08-22 20:15:03 +02:00
The-EDev
fba01dc76d
Prevent HTTP pipelining which Crow doesn't support. 2022-08-21 21:33:04 +03:00
The-EDev
25eefa1711 Addressed code reviews + small tweaks (unit test and paser.done()) 2022-07-22 17:17:38 +03:00
The-EDev
b986d1e38a Find the route as soon as the URL is parsed 2022-07-22 17:17:38 +03:00
Luca Schlecker
3a485078b8 rework the way asio is handled as a dependency. 2022-06-22 18:14:09 +02:00
Luca Schlecker
2fbf93e211 replace std::error_code with asio::error_code.
This makes the code more consistent and also reflects the intention a little better.
2022-06-18 17:21:37 +03:00
Luca Schlecker
5b1c5a9e9e removing some boost includes, fixing version checks and further phase out boost. 2022-06-18 17:21:37 +03:00
Luca Schlecker
df92d6d639 replace boost::lexical_cast with an equivalent based on std::stringstream. 2022-06-18 17:21:37 +03:00
Luca Schlecker
f3d00bbecf replace boost::asio with standalone asio. 2022-06-18 17:21:37 +03:00
Luca Schlecker
78f764791e remove 'using namespace boost' declarations. 2022-06-18 17:21:37 +03:00
Farook Al-Sammarraie
a6bf90fa8b
Merge branch 'master' into blueprint-middleware 2022-05-23 09:43:17 +03:00
konrad
7e4f57486c Add extra log when status code is not defined.
Just to document behaviour when returning status that is
not well-known.
2022-05-18 15:57:46 +03:00
Farook Al-Sammarraie
e7007cfbce
Merge branch 'master' into blueprint-middleware 2022-05-18 13:30:13 +03:00
The-EDev
78c7186897 Allowed Crow class to be passed to Websocket connection object 2022-05-14 12:05:06 +03:00
Vladislav
cca8578556
Merge branch 'master' into blueprint-middleware 2022-04-12 10:52:45 +03:00
Vladislav Oleshko
3b9e522523 Blueprint middleware prototype 2022-04-11 16:01:27 +03:00
The-EDev
0a739b35c6
fixed issue where SSL websockets wouldn't run due to HTTP upgrade 2022-04-07 15:54:50 +03:00
Kinshuk Bairagi
ee4ccf755a
Add http 504 codes 2022-03-20 23:23:07 +05:30
Farook Al-Sammarraie
9db0e3b8fe
Merge branch 'master' into parser_optimization 2022-02-15 15:56:48 +03:00
The-EDev
9a7677bf1a
Applied changes from review
Also moved builtin_expect to utility.h (for use in sanitizer function)
2022-02-11 00:56:30 +03:00
The-EDev
175b004c26
code formatting (also disabled formatting where not applicable) 2022-02-06 22:29:46 +03:00
The-EDev
4cdde73388
Optimized HTTP parser
Also (likely) fixed problem with streaming without keeping connection
alive
Also fixed problem with multipart hanging on request
Also updated TODO entries to indicate Writer
2022-02-05 18:15:19 +03:00
Vladislav Oleshko
69e9ad9c1e Run clang format 2022-02-01 23:21:07 +03:00
Vladislav Oleshko
e60714c0b2 Separate middleware for handlers 2022-02-01 22:49:41 +03:00
Maxime BELUGUET
dea78e02a0
Merge branch 'master' into master 2021-12-07 14:12:29 +01:00
Maxime BELUGUET
874b4d2da0
Apply suggestions from code review
Add debug verbosity

Co-authored-by: Farook Al-Sammarraie <farook@the-e-dev.com>
2021-12-07 10:58:40 +01:00
Maxime BELUGUET
5825b55350 Move queue length decrementation, formatting 2021-12-03 17:33:40 +01:00
The-EDev
a0a5616d1c
Added missing buffer clears and removed no longer used method from response 2021-12-02 20:18:34 +03:00
The-EDev
bb48f95298
moved file sending to connection and added check_destroy to it 2021-12-02 15:36:52 +03:00
Maxime BELUGUET
31143b9f06 Fix atomic queue_length initialisation 2021-11-30 19:54:37 +01:00
Maxime BELUGUET
2607bf5791 Change += to ++, add queue length decrementation on error 2021-11-30 19:22:07 +01:00
Maxime BELUGUET
f8af9eb187 Formatting 2021-11-30 18:14:16 +01:00
Maxime BELUGUET
0f6043f60d Add basic load balancing #258 #182 2021-11-29 16:56:12 +01:00
Luca Schlecker
7e4f1494d2 improved lambda bracing by inlining only empty lambdas.
Signed-off-by: Luca Schlecker <luca.schlecker@hotmail.com>
2021-11-27 19:22:35 +01:00
The-EDev
03e59aa446
improved bracing rules, commented out clang-format 14 rule 2021-11-27 15:28:50 +03:00
The-EDev
7f4b7c8ff9
created new rules, used bot to enforce rules in PRs 2021-11-25 14:45:38 +03:00
Luca Schlecker
912bf47b6f fix faulty https redirection.
Crow would redirect to https if ssl is enabled, even if no ssl is being actively used.

Signed-off-by: Luca Schlecker <luca.schlecker@hotmail.com>
2021-11-22 02:45:08 +01:00
Luca Schlecker
6458184e8f task_timer: rename set_timeout to schedule.
Signed-off-by: Luca Schlecker <luca.schlecker@hotmail.com>
2021-11-20 17:03:58 +01:00
Luca Schlecker
de92d28f29 replace dumb_timer_queue with new task_timer.
fixes #264, lays ground for #273 and #257.

Signed-off-by: Luca Schlecker <luca.schlecker@hotmail.com>
2021-11-19 18:55:10 +01:00
The-EDev
20c7720f72 Made crow's streaming threshold changeable through app.stream_threshold (I also added a getter for it to avoid sending it to the server then the connection) 2021-10-12 15:35:08 +03:00
Farook Al-Sammarraie
72e33c743e
Merge branch 'master' into revamped_setup 2021-10-02 17:29:07 +03:00