Evgeny Grin (Karlson2k)
7f33ea76e7
Stop shrinking memory buffer after preparing reply header or footers
2021-08-23 22:22:16 +03:00
Evgeny Grin (Karlson2k)
95d1725ce3
Connection: allocate persistent connection memory with helper
...
The new helper function may reduce read or write buffer to make
available the required amount of memory.
This allow to use entire pool for read or write buffer.
2021-08-23 22:20:50 +03:00
Evgeny Grin (Karlson2k)
5c8b5aefd0
memory pool: added internal helper function
2021-08-23 22:13:00 +03:00
Evgeny Grin (Karlson2k)
11a2e0126e
Added new connection state MHD_CONNECTION_START_REPLY
2021-08-23 12:54:42 +03:00
Evgeny Grin (Karlson2k)
e76e18e453
Added new connection state MHD_CONNECTION_FULL_REQ_RECEIVED
...
The new state improved readability of the code.
2021-08-21 19:51:50 +03:00
Evgeny Grin (Karlson2k)
37593020c7
Added new connection state MHD_CONNECTION_REQ_LINE_RECEIVING
...
This allow to distinguish between connections received any data and
connections without any incoming data.
2021-08-21 19:44:48 +03:00
Evgeny Grin (Karlson2k)
4d7d35d8a2
build_header_response(): clarified comment
2021-08-21 18:37:16 +03:00
Evgeny Grin (Karlson2k)
66e6f4f2e9
connection.c: simplified request line processing, fix
...
Fixed potential hung when the first line is empty and no
other connections are processed.
2021-08-21 18:35:21 +03:00
Evgeny Grin (Karlson2k)
4fb57ae153
Added new connection flag "stop_with_error".
...
Stopped usage of "read_close" flag when read hasn't been closed.
2021-08-21 18:35:20 +03:00
Evgeny Grin (Karlson2k)
55785fe949
enum MHD_CONNECTION_STATE: sorted states
2021-08-21 18:35:20 +03:00
Evgeny Grin (Karlson2k)
9d2588d9d8
enum MHD_CONNECTION_STATE: removed numbers from doxy
...
The numbers were meaningless as states are switched not in order
2021-08-21 18:35:20 +03:00
Christian Grothoff
067628c6f7
-fix typo
2021-08-21 14:11:02 +02:00
Evgeny Grin (Karlson2k)
d8ea84fd6d
connection.c: minor updates: used new reply flags, added asserts and TODOs
2021-08-21 14:28:05 +03:00
Evgeny Grin (Karlson2k)
08d144ba19
Do not use the same flag for chunked request and chunked reply
2021-08-21 13:18:29 +03:00
Evgeny Grin (Karlson2k)
5d35f4f7f9
replies: fixed HTTP/1.0 keep-alive replies
...
Always send "Connection:" headers when replying with keep-alive HTTP/1.0
2021-08-20 15:42:34 +03:00
Evgeny Grin (Karlson2k)
4169e7b6cc
test_get_close_keep_alive: added more combinations and more checks
...
The test now checks all combination of parameters.
Added check for absence of "Keep-Alive" header when it's needed.
Added checks for HTTP version of MHD replies.
Added checks whether socket was / wasn't closed by libcurl.
2021-08-20 13:39:05 +03:00
Evgeny Grin (Karlson2k)
a0edd36628
Simple fix for 6f48db46b1
2021-08-19 21:18:51 +03:00
Evgeny Grin (Karlson2k)
6f48db46b1
Added response flag to always send "Connection:" header
2021-08-19 20:11:13 +03:00
Evgeny Grin (Karlson2k)
dab2db20fd
microhttpd.h: moved up MHD_VERSION macro
2021-08-19 16:48:25 +03:00
Evgeny Grin (Karlson2k)
a96eaaaa25
Response flags: clarified functionality, added synonymous names
...
Fixed support for explicitly requested Keep-Alive with
responses with MHD_RF_HTTP_VERSION_1_0_RESPONSE flag
2021-08-19 16:40:11 +03:00
Evgeny Grin (Karlson2k)
f5fc702a4d
RFC compliance: HTTP/1.1 replies for HTTP/1.0 clients
2021-08-19 14:32:15 +03:00
Evgeny Grin (Karlson2k)
5c7a9ff9c3
setup_reply_properties(): removed one assert
...
Actually non-chunked can be enforced by response flags
2021-08-18 20:19:26 +03:00
Evgeny Grin (Karlson2k)
be1065889b
keepalive_possible: simplified; added new value for MHD_ConnKeepAlive
2021-08-18 19:21:42 +03:00
Evgeny Grin (Karlson2k)
ea1edc3dc6
test_get_chunked: re-use the same port for all tests
2021-08-18 14:05:22 +03:00
Evgeny Grin (Karlson2k)
b70fa61d47
test_get_chunked: check whether chunked is used for non-Keep-Alive
2021-08-18 12:52:32 +03:00
Evgeny Grin (Karlson2k)
496900010b
RFC compliance: use chunked even for non-Keep-Alive HTTP/1.1 clients
2021-08-18 12:52:31 +03:00
Evgeny Grin (Karlson2k)
be6faace00
microhttpd.h: minor macro formatting
2021-08-18 12:50:23 +03:00
Evgeny Grin (Karlson2k)
0c3806b058
curl tests: updated select() error handling, file doxy
...
Tests reports now about unexpected errors from select() and
source code line number to simplify problematic position
locating.
Used much smaller timeout on W32 if system is doing some
sockets data processing in other threads.
2021-08-18 12:48:46 +03:00
Christian Grothoff
ebd43f0373
-bump version
2021-08-18 11:10:42 +02:00
Evgeny Grin (Karlson2k)
3db35a4ca6
test_get_close_keep_alive: removed double assignment of curl header
2021-08-18 10:18:37 +03:00
Evgeny Grin (Karlson2k)
83c0cc0720
Updated .gitignore
2021-08-18 10:14:12 +03:00
Evgeny Grin (Karlson2k)
02af598a81
test_get_close_keep_alive: minor reporting improvment
2021-08-18 10:13:36 +03:00
Evgeny Grin (Karlson2k)
16ac89f3be
Fixed: avoid duplication of "close" token in replies
2021-08-17 21:34:41 +03:00
Evgeny Grin (Karlson2k)
cc29f300ab
Fixed: do not enforce "close" connection if reply has no body and
...
size is unknown
2021-08-17 21:33:58 +03:00
Evgeny Grin (Karlson2k)
3fa1d302d2
Fixed: always close connection if "close" was requested by client
2021-08-17 21:32:29 +03:00
Evgeny Grin (Karlson2k)
f30afba986
Simplified makefile for testcurl
2021-08-17 21:30:53 +03:00
Evgeny Grin (Karlson2k)
21b807ae1c
Added two tests for correct choice of "Keep-Alive" or "Close"
2021-08-17 20:57:08 +03:00
Evgeny Grin (Karlson2k)
b812b174c3
tests: improved handling of curl multi_*
2021-08-16 19:30:25 +03:00
Evgeny Grin (Karlson2k)
303d42fdcd
test_get_chunked: fixed leak of libcurl resource for "close" mode
2021-08-16 14:50:22 +03:00
Evgeny Grin (Karlson2k)
99455892ab
HTTPS tests: fixed memory leak in tests
2021-08-16 11:55:23 +03:00
Evgeny Grin (Karlson2k)
dd21230987
test_get_chunked: do not allocate buffer for cls when not needed
2021-08-16 11:25:27 +03:00
Evgeny Grin (Karlson2k)
6e7e5e26e4
test_get_chunked: fixed validation error report
2021-08-16 11:18:21 +03:00
Evgeny Grin (Karlson2k)
d2e271a4eb
connection.c: added assert to mute static analyzer
2021-08-16 11:09:48 +03:00
Evgeny Grin (Karlson2k)
1dafa07eb3
connection.c: added check to mute static analyzer error
2021-08-16 10:33:31 +03:00
Evgeny Grin (Karlson2k)
ada8dc689e
Fixed memory leak introduced by 39eb60df61
...
When "Date:" header is replaced with new value, old value wasn't freed
2021-08-16 10:21:48 +03:00
Evgeny Grin (Karlson2k)
4820d93bc9
Complete re-write of reply header build function and helpers
...
The reply headers build function was re-implemented from scratch.
Added some helper functions to simplify maintainability and increase readability.
Fixed chunked encoding handling and compliance with RFC.
This implementation tries to resemble behavior of previous implementations
(except fixes).
Some code is marked with TODO to make further improvements.
2021-08-15 20:12:10 +03:00
Evgeny Grin (Karlson2k)
225268ae81
chunked response: do not try to send more than needed
2021-08-15 18:23:52 +03:00
Evgeny Grin (Karlson2k)
5383019bf5
connection.c: fixed chunked response without callback
2021-08-15 18:23:52 +03:00
Evgeny Grin (Karlson2k)
4595a443ed
Added more chunked response tests
2021-08-15 18:23:33 +03:00
Evgeny Grin (Karlson2k)
564c953306
Fixed chunked response with known size
...
When size was known for chunked response, "response end of the
response" marker was not sent
2021-08-15 18:22:34 +03:00