026b8778de7db026b1d42745114d8bb43c2a5d45 |
|
26-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Add event fields for the number of bytes sent and received for each request in the last attempt. |
daf2f019f8fb7f96c323c8f0eb397393b9694cb3 |
|
17-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Uncork and flush the output stream explicitly after continuing request payload.
This allows detecting any output stream errors. |
c80afa7573a9ca38b5ea789f9b0c21e8633efd2b |
|
17-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Hold reference to the connection while continuing request payload.
Subsequent changes may cause the connection to be destroyed while sending. |
82bff47d0746603fd6befd397fa8a9b730eaf143 |
|
17-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Continue sending request payload in a separate function. |
6cb2469058cfad0eb69d84ca33dfb82aedaabcf4 |
|
17-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Hold reference to the connection while sending the next request.
Subsequent changes may cause the connection to be destroyed while sending. |
5bde522a449024c667c58dc8b6f398cbb3060185 |
|
17-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Perform output stream error handling in one place. |
7691bf6c1c6060fcd1e8d823bf1f80ebd6a784f5 |
|
17-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Make http_client_connection_lost() available outside http-client-connection.c. |
753c65234187ca52423e7384796a8b0a2d531591 |
|
17-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Handle output stream errors in a separate function. |
47c89f8a25d625ccb8d6988149771bdb0c21ac53 |
|
15-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Recreate connection IO after streams change. |
aaf5d12795e228ef7a26b68da9d161b065f107bc |
|
15-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Use the new connection_input_halt/resume() functions. |
7d3a967fb4c22cd53807c9e492e476724664decd |
|
15-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Use conn->conn.ioloop rather than cctx->ioloop in connection.
This leads to somewhat simpler code, and makes having connections on different
ioloops easier in the future. |
c68926bf1de7ecff6666c3caac3e516af2a70980 |
|
15-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Move connection to shared context's ioloop, rather than the current_ioloop.
This is an omission. |
ca400a499cf1f6a5b28cd3f62f69b1a3b5487c67 |
|
08-Feb-2018 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: client: Fix using non-context SSL settings
The SSL settings were used for the SSL context, but they weren't used for
individual SSL streams. This broke stream-only settings, like
allow_invalid_cert=TRUE. |
a68aaff537e2e30d782bb8b9d8782e1a10a17d1a |
|
30-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Make sure all ioloop objects are created on the ioloop that the client/context is switched to. |
bcb4e51a409d94ae670de96afb8483a4f7855294 |
|
01-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2018. |
3c8a163545079984e827aa50349cbc4fe570875f |
|
14-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Check whether client is running in a wait loop with the correct condition.
This used to check client->ioloop != NULL, but now it should check client->waiting.
Previous commit (e8a1b62fe4a81b211dcccd1a58b44f254074eab6) omitted a few instances where this should have been changed. |
36409af77b42dc1c18c0691970b2eb07785fbba4 |
|
13-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: client: Replace http_*_debug() with e_debug() |
39018a601747b9d52a15ce2451e64e9515587944 |
|
13-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: client: Remove redundant debug logging checks |
2d1ad5742dd723b39c51bcf64c62a600237de8ae |
|
13-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: client: Add support for event API |
fd30e54bd56f0869f5c2e14b42fd53f7b36cff45 |
|
07-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Added identifier to client log messages. |
27a2e59eaa648fef2acb2c4b852567d22e016a2d |
|
07-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: shared context: Allow sharing peer state between clients. |
20493a543316e8c3acfd8ba4af257ceb658cdfce |
|
07-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Moved connection pool handling from peer to separate object. |
9fe6a55877bee691b32c12c7be56242054841670 |
|
07-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Moved connection list from client to shared context. |
0d1b8b6bec79746c5d89d57dd8c1688946bd9237 |
|
19-Sep-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
global: start relying on timeout_remove(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- timeout_remove(&E);
- }
+ timeout_remove(&E); |
5f1d689131a75c39f064cbd4202373e7edf78f18 |
|
19-Sep-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
global: start relying on io_remove{,_closed}(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- io_remove(&E);
- }
+ io_remove(&E);
@@
expression E;
@@
- if (E != NULL) {
- io_remove_closed(&E);
- }
+ io_remove_closed(&E); |
7ebcb054e0d3cc4be54038cbf763ec4189d9725b |
|
11-Jul-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: Restructured the header, message, request, and response parsers to have an extensible and consistent API using flags.
Extended the test suites with a few cases that test parsing with and without the STRICT flag. |
7a1bc4683f3667f440df415b3f839e25046cc720 |
|
25-May-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: When a request is destroyed prematurely during payload input, consider the payload stream destroyed and act accordingly.
The application may hold a reference to the payload stream still, and it may be difficult to prevent that.
This causes lib-http to keep waiting for the payload to be destroyed.
When nothing else is going on, the current ioloop may then become empty, which caused the familiar assert failure. |
567d1c82e3e59a8e8acc2e1e01228585bab83bc6 |
|
25-May-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Explicitly destroy the response payload timeout stream when the request is destroyed while receiving payload.
This way, the timeout is stopped.
This caused ioloop panics. |
28be42b4c27b0415da92ae7dd2c6e9cee2836c51 |
|
01-Apr-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Implemented means to obtain request statistics. |
210256b5d443a13a9ea662cd3a807b80bdeff331 |
|
30-Mar-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Fixed request-specific attempt timeout.
This is the timeout applied to a single request attempt. Using http_client_request_set_attempt_timeout_msecs() this can be set for a specific request.
However, this was mostly ignored for requests that weren't in the process of handling response payload.
Instead, the global request_timeout_msecs client setting was used.
Also amended the (currently manual) test suite with tests that demonstated the problem and now verify the fix. |
ce3fc9190e82d8d9e9604afd4ebbee1d61957764 |
|
22-Mar-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
global: Use http_response_get_message() to log HTTP responses. |
b3c095d1fb0bb86695d92c2045eb09e985623934 |
|
22-Feb-2017 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
global: Fix ssl_set usage
Remove verify_remote_cert, as it's always TRUE now.
Set allow_invalid_cert to TRUE if verification is
not required. |
9465a050729f555318cbda2c5b9d531b04dbce7f |
|
19-Jan-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Make sure req->conn is only not NULL when that connection holds a reference to that request.
This consolidates the management of req->conn to one place, thereby preventing mishaps.
It makes sure req->conn is always properly assigned, making it more reliable.
This fixes a problem that emerged in the http-proxy. |
79450122997042f3c72a07c0b2153cc2b1f13c1d |
|
19-Jan-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Keep connection reference throughout http_client_connection_return_response().
Before, it was held in two intervals.
Next commit requires this change, but it also simplifies this function significantly. |
2454dfa32c93c20a8522c6ed42fe057baaac9f9a |
|
01-Jan-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2017. |
efe78d3ba24fc866af1c79b9223dc0809ba26cad |
|
24-Dec-2016 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
global: Replaced all instances of memset(p, 0, sizeof(*p)) with the new i_zero() macro.
Used the following script:
C_FILES=`git ls-files *.c`
H_FILES=`git ls-files *.h`
for F in "$C_FILES $H_FILES"; do
echo "$F"
perl -p -i -e 's/safe_memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero_safe(&$1)/g' $F
perl -p -i -e 's/safe_memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero_safe($1)/g' $F
perl -p -i -e 's/memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero(&$1)/g' $F
perl -p -i -e 's/memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero($1)/g' $F
done |
f17ac27e5989d6b3b3e4f4fb249bef4b06833ab7 |
|
17-Dec-2016 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Treat connections that get disconnected prematurely as connection failures.
This means that the backoff time is increased when this happens.
A premature disconnection happens when the connection is disconnected before any data is received from the server. |
bad9931efd293ea9a676ce99e82c539e9d215e0d |
|
17-Dec-2016 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Consolidated connection loss handling into a single function. |
92f66f98f64ee3febbfba6618c4e144080d81a66 |
|
15-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Use io_wait_timer for tracking wait times.
The previous code was completely incorrect, since it wasn't even tracking
the HTTP request's start usecs. |
2b9d522a3300fa84a1606e2108a159be7bb36154 |
|
02-Nov-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Added function that checks whether a connection is currently active. |
32ef0bd65f1263626ac138183c0a8ca9a564502e |
|
02-Nov-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Created http_client_connection_failure() handler. |
e6c7a2711a51c9e8231b239bcea68177250efc97 |
|
02-Nov-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Set conn->connect_request to NULL immediately in http_client_connection_tunnel_response().
Prevents referring to this completed request in other parts of the code. |
86ab71bf134573e45dd9ab6bde9d55da4c44fc48 |
|
24-Oct-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Add ioloop and lock wait information to timeout messages.
It'll now log for example:
9007 Request timed out (Request sent 7.087 secs ago, 0.076 in other ioloops, 7.012 in locks, connected 7.087 secs ago)
Which points out that the problem wasn't really with the HTTP, but with
locking. This likely should be fixed in some way also in lib-http so that
it gives a bit of extra time for reading the request, but that's a separate
fix. |
7f74811b78f8915e73dffc88bb49009e98b6846d |
|
09-Oct-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Make sure i_stream_read() calls handle 0 and -2 return values correctly. |
1c9f4c14e9c17abcc2813ae977274e40b6579973 |
|
13-Sep-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Fixed hang occurring when nested ioloops are used in response callbacks.
To prevent missing disconnect events, i_stream_read() is called once a change in ioloop is detected.
However, if something was actually read into the stream, the input handler was never called.
So, a response could linger in the stream buffer, without being handled, thereby causing the connection to hang indefinitely.
An additional input event could end the hang, but sometimes this doesn't happen before the request times out.
This problem was seen in test-http-payload once in about 10 invocations.
Obox uses nested ioloops, to this applies there. |
5b6bfa39481f719c1fd6ed3febeaf7f0be9e8886 |
|
04-Aug-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Support per-request timeout and max_attempts |
744c06ab0d4aebf0e35665740ea7b13b57fd2f59 |
|
30-Jun-2016 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed potential segfault problem in http_client_connection_server_close().
Used wrong variable: it is set to NULL by http_client_request_unref() before it is used.
Problem found by Coverity. |
486c7c8d9e725e0227c7723aa43b7fce724eb9ee |
|
20-Jun-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Implemented no_auto_retry setting that disables all automatic request retries.
This currently only applies to requests sent over a connection that is subsequently lost before a response is received.
Before, such requests were always implicitly resumbitted for a new connection, without the application knowing about it.
By enabling the no_auto_retry client setting, the application is always notified of connection loss through the request's response callback.
As a consequence, requests need to be retried explicitly using the http_client_request_try_retry(). |
44005db1cad775e5edf0ea0e88295fa69b5c400f |
|
16-Jun-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client/server: Enable the TCP_NODELAY option for all connections.
This disables the TCP Nagle algorithm. With the Nagle algorithm enabled, TCP waits a little to accumulate more data in a small segment before it is sent. For transfer of large continuous payloads, this is not useful and even harmful.
If the final remaining bit of the payload is small, the TCP layer will wait for a significant amount of time at the end of the payload. For many sequential transfers, this amounts to much waiting time.
This is particularly evident in the test-http-payload test suite tool. Setting TCP_NODELAY decreases its run time from up to 20 minutes to about half a minute my system. |
095481fee84040436ce2dccca472c9bb1df4d5bb |
|
16-Jun-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-ssl-iostream: Changed require_valid_cert -> allow_invalid_cert
We should default to being safe. |
bcb07f51d871e84ba0dbd8ba9f74f93f0c2ddd12 |
|
26-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Improved error logging for net_set_*_buffer_size() failures. |
57c339f4e3404355a8924103317a6158a709ecf1 |
|
26-May-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Fixed bug in handling of lost connections while returning from another ioloop.
At one instance the http_client_connection_is_ready() function could have destroyed the connection while the caller still depended on it.
Renamed the http_client_connection_is_ready() function to http_client_connection_check_ready().
This now returns -1 when the connection got destroyed. Before it returned a bool that just indicated whether the connection was ready or not.
So, there is no need anymore to preserve a connection reference while calling this function. |
8a6dc50255a27bf887bbd9ed7c3a87bf629d4179 |
|
26-May-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Reworked connection close handling.
Now, the peer is immediately notified of the lost connection.
Before, this step was only taken when the connection was fully dereferenced.
To prevent recursive notifications between peer and connection, handling the loss of a connection is deferred to the request handler.
When a peer is freed, any associated lingering connections have conn->peer set to NULL. |
7abab3b191860a3d77af5192b0649833c8a0c803 |
|
26-May-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Improved labeling of debug messages.
Request label is corrected.
Labels are now pre-composed and stored. |
c972eaa3565e849df71b44cf0cd45d38c5567d07 |
|
26-May-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Added settings to configure the connection's socket kernel buffer sizes.
This is mainly useful for use in the lib-http test suite. |
3e9055cee8e331a84522dd1e65d0d0e09a4e8803 |
|
26-May-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Improved request reference counting in connection code.
It should now always be clear when the connection object holds a reference to a request and when it is released.
Only while the reference is held, req->conn points to a connection.
This also makes the assertion in http_client_request_unref() more robust and clear. |
6bdb1b488a5712ec7df0712949c31885e43d273c |
|
26-May-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Fixed reference counting for requests that are aborted due to an early server response.
An additional http_client_request_unref() is (now) unneccessary. |
d5c665cf2989d49922b63439ac45714e9755838a |
|
26-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Changed http_client_request_error to set request to NULL
It's going to internally unreference it, so the caller should be aware of it
also.
I also changed request state check to be an assert, since I don't think
there's any safe way this could work otherwise. |
c275cef636c79e1d08b3a82462c4abdca6f8cef3 |
|
07-May-2016 |
Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi> |
lib-http: use ssl_iostream_settings in http_client_settings |
173d53863744e8ed87e8fa4c32dfcf3759e2ceb0 |
|
24-Mar-2016 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed request timeout handling during pipelining.
The timeout was not managed correctly. If an earlier request finished, it
would not restart the timeout for the next pending request.
Also, filling the pipeline caused the timout to be reset inappropriately,
postponing its expiry. |
ca270e31c9c43f7559b2378cb3ece7e09491e4d9 |
|
16-Mar-2016 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Improved test-http-payload to test partial reading of response payload. |
f1a9b58ae3512ce0042e244cd2f86809e6be0148 |
|
23-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Fix to earlier http_client_connection_unref() change 1dead6
Patch by Stephan Bosch |
d1f964d3f1dd9c5868b134c4f44dd63f3722eef7 |
|
22-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: http_client_request_unref() now always sets *req=NULL
This makes its behavior consistent with other APIs in Dovecot.
Also http_client_request_finish() no longer sets req=NULL, because all of
its callers already keep a reference. Instead added an assert to make sure
the reference is there. |
1dead6eacb9302a8419bfc8f4b571ea9a3c00296 |
|
22-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: http_client_connection_unref() now always sets *conn=NULL
This makes its behavior consistent with other APIs in Dovecot. |
e1d8d185fa74752ba6807e415a9c82ebfdb2082c |
|
10-Feb-2016 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed pipelining bug: client sometimes sent new request while still waiting for 100-continue. |
79f8a20424633e806447bc9375a5ab403aabc758 |
|
10-Feb-2016 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Make sure that any pending request is aborted and destroyed before connection FDs are closed.
This way, any payload io struct created from the response callback can be freed before the associated FD becomes invalid.
This would cause an assert failure otherwise. |
02c335c23bf5fa225a467c19f2c063fb0dc7b8c3 |
|
12-Jan-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: freshen copyright
git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-5]/$1-2016/g;s/ (201[0-5]) Dovecot/ $1-2016 Dovecot/' |
3e8c8984b2bb217d17b1f04e3441bfe59a8971db |
|
23-Dec-2015 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Add more timing information to debug logs when HTTP connections get closed. |
231629a38dbfbf5dc56180425de3e883310ad853 |
|
04-Dec-2015 |
Timo Sirainen <tss@iki.fi> |
lib-http: Give a better error message if request times out.
Instead of just giving the configured timeout, log how long the timeout
actually took for the oldest request in wait list. Also if the request was
retried, log how many times the request was sent and how long the request
took in total. |
e9228a3918aa0243eff4aae1ff5462bd3198417f |
|
28-Sep-2015 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added asserts to all refcount increments.
These could catch situations where an already freed object's refcount is
attempted to be increased. |
76beac266ef81cf885fac676d6005b641f546a04 |
|
28-Sep-2015 |
Timo Sirainen <tss@iki.fi> |
lib-http: Avoid crashes when server is already disconnected.
I'm not sure if this is the nicest fix, but seems to work for now at least. |
e312e229f27f3c4bfeccc17bfa008e90e29253df |
|
28-Sep-2015 |
Timo Sirainen <tss@iki.fi> |
lib-http: Disconnection from HTTP server could have caused accessing already freed memory.
Freeing a request could have freed the connection. |
ede750711f27ca9d9037a7ab9f016411b57f1ad9 |
|
25-Apr-2015 |
Stephan Bosch <stephan@rename-it.nl> |
http-client: Added support for using an HTTP proxy running on a unix socket. |
009217abb57a24a4076092e8e4e165545747839e |
|
29-Aug-2015 |
Stephan Bosch <stephan@rename-it.nl> |
Changed type of internet port values to in_port_t everywhere.
Created special SET_IN_PORT setting type for internet port values.
Created net_str2port() for parsing internet port values.
Removed several atoi() invocations in the process. |
62812c68a2086b900466efbbbdd49b1cdb7a38b3 |
|
29-Aug-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Added proper handling of 408 response status.
This is treated as a special server connection close event, rather than a
response to the last issued request. |
3d1edb8e3a07d91860cc6b4b3cec8282caa70891 |
|
18-Aug-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed handling of request timeout.
It was inappropriately active when the client needed to take action.
This showed particularly with large payloads sent using
http_client_request_send_payload(). |
8c80cd4e90c621d7ddedf0ee29b4ff8effb9b9f8 |
|
25-Apr-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed memory leak in CONNECT tunnel support.
Forgot to dereference streams once tunnel was completed and passed to the new connection object. |
7cb128dc4cae2a03a742f63ba7afee23c78e3af0 |
|
05-Jan-2015 |
Phil Carmody <phil@dovecot.fi> |
global: freshen copyright
Robomatically:
git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-4]/$1-2015/g;s/ (201[0-4]) Dovecot/ $1-2015 Dovecot/'
Happy 2015 everyone!
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
c9421d67eaaa64bcac32861ee60c96ba4e65c2ea |
|
15-Nov-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Removed connection code that is already in src/lib/connection.c. |
83db24db79d5b0cd79ab60d20fcdaa585bbe048d |
|
29-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Make sure we don't access already freed client connection in payload-destroyed callback. |
bf1134c9c153e6ea652a8a6cd9ae340c87039561 |
|
26-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Removed asssert in http_client_connection_is_ready().
There is no reason why the input stream couldn't be full. |
4e1039a8f27640eac849038a6ff31f28d1439d62 |
|
26-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: The asserts recently added to http_connection_check_idle() are bogus. |
1a2ce9ef13bbc4c9d7708b43a6eb5e72e19c9280 |
|
25-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Handle situation in which server sends response before request payload is fully sent. |
30ccfe4fdc2212d4341fa0edd6e8e73609ef1418 |
|
25-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed handling of requests aborted while still sending payload to server. |
7e5ead02b7d29e859d290668987b1cbf4a16867a |
|
25-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed cleanup of remaining waiting requests at connection destroy.
Forgot to dereference the requests for the reference that the connection
itself holds for each waiting request. |
23f432e57662577b648d274a4d5533e796e76117 |
|
25-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Aborted requests were not counted as finished in the connection's response receive loop.
This caused a hang. |
0d24f1550f5f70eb199018926a7bf0a12971695c |
|
23-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed proxied client connect timeout.
Timeout didn't cause requests to be aborted with error. |
5e3c6e99844b1981df1b6ffa484211dc0e3ce089 |
|
23-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Clear req->conn when request is finished.
This prevents a spurious assert failure. |
72383415a26b7f0b26457ba685b37a8abe7964ca |
|
20-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Connection erroneously indicated that it was ready while SSL handshake was not yet completed. |
60381d37ec7213c21bd6ada7babb769f572646f9 |
|
20-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed handling of connection timeouts.
A timeout caused an assert failure, because the connection status was
altered before the peer_connection_failure handler was called. |
68fb5a74d7890cfc7085301583874df6c32da4aa |
|
12-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed segfault caused by earlier change. |
22215c2d7538f4367c93e2d8b6ec4722463ac757 |
|
04-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Fixed detecting disconnection when ioloop is running only intermittently.
This fix only applies to ioloops created and run by lib-http itself. |
b66def5dadd3e7c250313a938d26ad113663f86b |
|
04-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Added support for absolute request timeout.
Requests cannot survive beyond this deadline. |
9f4f35957d2839d487d14b42bcb3f1a1de098b4b |
|
04-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed problem occuring when a nested ioloop was run inside a request callback using the same client.
If requests in the nested ioloop would use the same connection as the one
that called the callback, the requests would (in the best scenario) all be
doomed to time out. |
aab7256cdcfb7abd01c822e3df8dd77a30c572e0 |
|
01-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed aborting request in the middle of sending payload.
If the request payload is so big that it cannot be sent all at once, the
caller may at some point abort the request when it is still being sent. The
bug occurred when the request finally finished sending. It erroneously
advanced the state to WAITING rather than remaining ABORTED, thus
'reviving' the request unexpectedly. |
b5014077fa40fe76ff37bdf03008389256141140 |
|
29-Sep-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed assert-crash when http_client_connection_disconnect() is called multiple times. |
e4322927c4bf31b00ae71aa7c0f9d097eccfe3c8 |
|
10-Sep-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Tunnel connection failure would cause segfault.
That happened because it tried to retry waiting requests, which makes no sense for a CONNECT tunnel. |
31fa529029f35f65451fb1d119ed1d5435b62e46 |
|
11-Jul-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Debug log now includes where HTTP requests spent their time on. |
abc8180415e2054465b87d8c696471de40924542 |
|
09-Jul-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Made sure that connections that are still connecting to the server aren't marked as idle. |
6ee9ce5ed955a1283dc22ad28980bf9cc23d4c4e |
|
01-Jul-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Updated comments to RFC7230/RFC7231. |
f8e6e85ab508e80a66f323390f8f4e2edfff2730 |
|
26-Jun-2014 |
Timo Sirainen <tss@iki.fi> |
lib: Moved rawlog dir stat()s to iostream_rawlog_create() internally.
This is required to allow TCP rawlogs to actually work. |
880230bc289dab1bfad4b0aceb0ee9031b7d4767 |
|
26-Apr-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Fixed problem with connections idling indefinitely.
Forgot to check for idle connections when request finished after waiting
for payload to be read by application. |
37703e8d00a3a486aafba6a276fef35b38eab948 |
|
03-Apr-2014 |
Timo Sirainen <tss@iki.fi> |
Use io_add_istream() wherever possible.
This shouldn't fix anything, but might make some functionality easier to
implement in future. |
9937dfc157dc64ed781b7aa264aa893d1d50c5c4 |
|
03-Apr-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Wrap response payload istream into a istream-timeout. |
a8c5a86d183db25a57bf193c06b41e092ec2e151 |
|
04-Feb-2014 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2014. |
35df1d3e03ffb05ee21077018f5154a4b1e47e37 |
|
08-Dec-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Don't try to automatically retry requests whose payload was already lost.
Patch by Stephan Bosch. |
267923f5b62d680b050f0691c25a1ca3a2370c6e |
|
22-Nov-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed request hang on connect() timeout. |
93cc87bb22386e020cee1093b6bd59295e0b33f0 |
|
22-Nov-2013 |
Stephan Bosch <stephan@rename-it.nl> |
http: Implemented delayed requests scheduling.
Requests can now be (re)submitted with a delay. The request is not sent
until the delay time expires. This facilitates handling the Retry-After
header in responses. This can either be performed automatically if the
indicated delay is not too long or explicitly by the code using lib-http. |
dde71564d306d07cba63bdf0f40996ffb90ca47a |
|
06-Nov-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Use [io]_stream_get_error() instead of just errno strings. |
e47c2f17d8136c4d972d1074a3f84ba2ecef4fdc |
|
12-Oct-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Added support for tunneling SSL conntections through proxy. |
a62fe4b300e2f591e939993aec4cac1e7ae30ad1 |
|
12-Oct-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Added support for creating CONNECT tunnels through HTTP. |
50d1446e71cfbdc5b6d7bafcf91b7bff453989d3 |
|
12-Oct-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Added request error code for broken payload input stream.
This error is triggered when reading from the provided payload input stream
fails while sending the request. Previously this would yield the same error
code as for a failure to write to the connection output. |
ad03049781fc14807248007d524be4daf06c3ee2 |
|
12-Oct-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Added support for disabling automatic redirects. |
0252ab930ea091e4c5ff18974ea2a21df00cab52 |
|
12-Oct-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: When client request is retried based on a response received from server, return full response to caller if retry is not possible.
Before, it would construct a dummy-response that basically retains only the
status and reason elements. This is currently only relevant for the way a
417 Expectation Failed response from the server is handled. |
2e6f9d35d7b09ef87f347c67e7d77a28731a6bda |
|
16-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Fixed segfault caused by earlier improvement of connection output locking.
Segfault was triggered when an aborted request received a response. |
feba5e502b2131c9a1c766b7ef9ff041dbf71d1d |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Implemented limits on overall HTTP header size, size of individual header fields and the number of fields in the header. |
6a90041707f1290c8970a3bacb0f8f928aeaaba6 |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Adjusted response and request parsers to accept a request/response object to fill with data, rather than have it return one. |
a4e186e3ef267fc7a6b592788067c8c9c87d0785 |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Added support for asynchronous payload for requests.
This means that the payload stream passed to the request can be a
non-blocking socket stream from some other connection (e.g. proxy client
connection). |
fc94140acba51adafedafbc8491a3223a51db7a8 |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Fixed request scheduling and connection management. |
fde2e392f3003ec9adc4df7b0c395b4e498bfd28 |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Connection was using wrong request index in request_wait_list to continue sending outgoing payload. |
858a13d06402d3d6e2dc683f6696c14192ad6b02 |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Fixed pipelining when payload synchronizatio (100-continue) is used.
Forgot to lock the connection output, which meant that new requests would
enqueued for the connection while waiting for 100 Continue. This would
cause an assert failure. |
cddbeddaefeff42d731a8b02f74815dfff034d50 |
|
03-Aug-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Don't crash when receiving 304 or a redirect without Location: header.
Patch by Stephan Bosch |
0ffbb284f017f54ef9b8377ae6678066460a38e1 |
|
10-Jul-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Http requests weren't freed when connection was aborted.
Patch by Stephan Bosch. |
b3289b68d4c2e90fc369ea41539d49a6746764de |
|
10-Jul-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fix/cleanup to handling connect failures.
There was some kind of double-error handling which messed up things. |
edbfc217b093f6e2a6a8ebfd91ad8abcc0dc996a |
|
27-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added more debug messages. |
270f75edb88360c5d76d51516bf9b9c89c38e718 |
|
27-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Don't crash if payload stream is referenced by caller after its connection is freed. |
06b1ec1b1b6b217811c999dd09d9642a5698f454 |
|
27-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Remove request timeout from being used during payload read.
The reading is done by the lib-http caller, which should have its own
timeouts. |
fd0ec0a782a9d361217155042a9ce4b2054aef9b |
|
27-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: If connection times out, set the stream's errno to ETIMEDOUT in case it's used. |
8615a72651c441aeaa439e174441128141ff6d9e |
|
27-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: When connection is freed, abort also the pending request. |
92908d748f0982f726244904c2b444d63d4d3b6f |
|
27-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Timeouts were being handled wrong/leaked by ioloop switching. |
6a33d6385601c89fdaeb437537f714b3a01dcea4 |
|
27-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Minor code cleanup. |
70505f4839520ac67895992621c97d2480c22e7f |
|
09-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added soft_connect_timeout_msecs setting to connect to multiple IPs in parallel.
Based on patch by Stephan Bosch. |
381a4bd0f30fe99037047edcf3b18d76939f3197 |
|
06-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Treat connect() timeouts as retryable errors. |
1e9def6676e6535869b883886c7a1d7eb01761b6 |
|
06-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed previous patch setting connection connected only after SSL handshake.
This just caused crashes. The main point was anyway to include the SSL
handshake as part of the connect_timeout_msecs. Apparently the easiest way
is to set it immediately connected and delay removing the timeout. |
515bb2bea9a398cb17c34c16729bc4222881de14 |
|
05-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: After peer has received 100 response, don't add ambiguity timeout anymore.
The server should be sending the 100 responses then, and long delays
shouldn't be confused with them being missing. |
eca9a97f8e99703df155439d70bdf3bdc985fb45 |
|
05-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: When receiving 1xx response while waiting for 100, don't restart timeout.
The 100 response is missing only from HTTP/1.0 requests, which also didn't
allow any 1xx responses. So if a 1xx response is returned, a 100 response is
definitely also coming. |
a8c4e79ff50fac21b05a7368b052583d410ca15c |
|
05-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added connect and request timeout settings. |
4cadfabdf19b4be84d23356029d21deaa40c5138 |
|
05-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Mark the HTTP connection connected only after SSL handshake is finished. |
0f37e68570ccf3230748cfbc697ddddbc00e2545 |
|
10-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Don't double-free request memory when aborting them. |
9a50449644cb4277d5a35f5ca7b04c7389f464e7 |
|
08-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: If remote SSL cert is invalid, treat it as non-retryable error. |
1a0ece3e873e3864269ed7eaed957dc10c56d25f |
|
07-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
istream API change: Added support for multiple destroy callbacks. |
bf48ae15501dcff377dbcf114a67c10076cdec0e |
|
07-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed receiving 100-continue reply after we already timed out waiting for it. |
b4d850a0ffd519c1c745557568daf7d48e18c820 |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-ssl-iostream: Simplified certificate validation. Also give better error messages. |
3b4bd183cc469f70eb91d82a7f01f60ffc24ca5b |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-ssl-iostream: Added support for TLS SNI, which caused some API changes. |
e1f9521e847757342e10b3c8d330e7a47f4ce286 |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Prepare for TLS SNI support. |
9709107819ba60d41f737279dd070b40d46b4120 |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-ssl-iostream: If handshake callback fails, close the iostreams immediately.
This way the callback itself doesn't have to do it. Also fixes errors caused
by it, since they didn't close the ostream. |
52ccd525937de3e914cc0c54f46de98414dd979d |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Removed last traces of http_client_connection_error() |
ac645fe16c0619771c0a961db91df16485513c52 |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-ssl-iostream: ssl_iostream_set_handshake_callback() API changed.
The callback can now return the error message to caller instead of having to
log it itself. |
2a889fc596b12639ac55e657816b8a4f90440f88 |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Pass connect failures all the way to request callback's error string. |
f5386adc7c2918ac44a53b6ea470189ed973dcb2 |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Reorder http_client_connection deinit code just to be safe.
I'm not sure if this fixes any actual bugs, but just in case request
callbacks cause the connection to be accessed/modified in some way abort the
requests before doing anything else. |
9c8d244b701c9323e88c9506b78cbe3ad362910a |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed double-free on delayed connect() failures caused by recent change. |
32b6d861342775b20794ec927171def6fc595fb1 |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: If SSL init/handshake fails for connection, destroy it. |
436c529e13e79db5f007196606d847589c6e54fe |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: If connect() fails, destroy the http_client_connection.
Fixes hanging requests when a peer has multiple connections. |
a321ac56cfe330e3b28a4690f285419d36c3c6f4 |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Simplify error handling by delaying connect() failures. |
ba1c847d0af4afe4787ed470d0c818e948e184e2 |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-ssl-iostream: API changes to return error strings if init() functions fail.
This also fixed a couple of broken error handlings. |
415e16c3dc185578695b7d88e561a52de6c8b1b1 |
|
03-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Each peer doesn't need a separate ssl context, enough to have one for http_client.
Also removed #ifdefs for building with SSL support. lib-ssl-iostream
nowadays dynamically loads the SSL library when needed, and also handles
failures if Dovecot was built without SSL support. |
ab4bd2aaf8d897dbfa61d3e3ec943685b2e85e4e |
|
10-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Don't crash if request callback manages to get the connection destroyed. |
6c768e0e1ca2da178e79f7435c32ced01f6bcb24 |
|
10-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Callback can now request a retry with http_client_request_try_retry()
This can be useful for handling "try again" errors from HTTP servers. |
4d4f0aca019c31cf4b555a99d3c0b3f2c1e1e80f |
|
10-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: If host can't be connected to, don't keep retrying with more than one connection.
This also fixes infinitely trying to reconnect to host and retry. |
a477aae12e54b3a1d00574bd3d1a21610d8be40f |
|
10-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: If SSL connection gets lost, log the last SSL error. |
296ad15ccfdc0a9e81b09b332c893d5ae7382126 |
|
10-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed hangs with urgent requests. |
92e011227877493a1b6a5a38863aabde7e07bd76 |
|
05-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Avoid hanging on urgent requests.
Patch by Timo & Stephan. There are still some problems though, all urgent
requests don't seem to get a new connection. |
f21b0af073359dfc5560a6187a0257b3000b39dc |
|
05-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed crash caused by previous change. |
99feb6521535a7dc59d8dda89981ceac084b3e88 |
|
05-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: If we get disconnected, say exactly what the error was. |
c367bee43096e1dd7bdc48c455601418bd917bf3 |
|
21-Feb-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Fixed hanging on errors |
5a580c3a38ced62d4bcc95b8ac7c4f2935b5d294 |
|
02-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
Oops :) Update copyrights to 2013 without breaking all .c files. |
cca4ba2a504d70a9fe9fee37f8433997359de52c |
|
02-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2013. |
eb325a5a90c1d2655e74972bde0de6a699d2c864 |
|
01-Feb-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Various bugfixes |
65c0e43da8cfc730eeb4634f8aa384081bbfa4e7 |
|
06-Jan-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Various fixes
Patch by Stephan Bosch. |
50a6d26bd9041f44b4cad0c0357c0c604c132cc8 |
|
12-Dec-2012 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Added support for chunked input/output streams and some bugfixes. |
9a5fadfa108d778c6ff02304838e5d024811123b |
|
01-Dec-2012 |
Timo Sirainen <tss@iki.fi> |
lib-http: Don't free connection immediately in payload-destroyed callback.
This caused a crash in http_client_connection_return_response() after the
stream was unrefed. |
7384b4e78eaab44693c985192276e31322155e32 |
|
23-Nov-2012 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Added initial HTTP client implementation. |