eaf49d968f5cbda1de3ccd45ce4d764d4bed2352 |
|
27-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Fix request statistics text to properly report send attempts.
If the request was first sent in the same ioloop cycle in which the text is
generated, the text would claim it was not sent at all yet.
With this commit the text now explicitly makes the distinction between request
attempts and actual send attempts. The number of attempts is increased at each
retry, while the send attempts are increased each time the request is actually
being sent to a server. |
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. |
924b2252e6df602cddc61c3abf61ee5a2a6bdb57 |
|
26-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Trigger special events when a request is finished, retried or redirected. |
27521d4fae648249bcf9dbc83cd3b58682989755 |
|
26-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Record last status code in the request object. |
370753545874ea89be54dbfb52ec77dafb7bad95 |
|
26-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Reset redirect counter when the request is retried.
The absence of this reset caused problems when there was a redirect limit and
the request was retried, in which case the limit is reached too soon. |
1eb1b5b429b7d1958fc63e5433aeff5d65404109 |
|
26-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Add "host" and "port" fields to request event. |
eb580abe118fbf04431a3b297b4e79d4bf967bea |
|
26-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Use the new http_url_get_port*() functions. |
7707704ce6c324e707266958b9434bb6bd3da3f9 |
|
17-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Simplified return code handling in http_client_request_send_real(). |
94281d6c41af860e16bb66e18a69dd2984e87181 |
|
17-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Make sure output is used only when valid in http_client_request_send_real(). |
5bde522a449024c667c58dc8b6f398cbb3060185 |
|
17-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Perform output stream error handling in one place. |
0753b82010b1ae517d3cec8988a2cffcfbc0dc5b |
|
17-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Flush and check output for errors after uncorking.
Otherwise, a disconnection event may be missed. |
e9fbe5e18b798728041b7e2ffc6c4fa964fc35a3 |
|
31-Jan-2018 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
global: start relying on str_free(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- str_free(&E);
- }
+ str_free(&E); |
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. |
6e1bc1f4a080539860a3f121c5b51c9bfda1f1af |
|
28-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Assert that req->client != NULL in http_client_request_send_error().
Applies when blocking payload output API is being used.
Addresses a report by scan-build. |
fda72a49ea41acd0bd085ec2e63813e01f156fdf |
|
04-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Set req->client to NULL once the request is destroyed.
The http_client_request_destroy() function does not free the request
immediately, as long as it is still referenced. It can still be referenced by a
connection that has sent it and is waiting for a reply (payload). In the mean
time the actual client can be gone, so we want to make sure nothing is pointing
to that anymore.
This change adds a few extra assertions to make sure nothing tries to use a
NULL client later on. Some direct references to req->client are replaced with a
local client variable if there is one. |
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. |
e8a1b62fe4a81b211dcccd1a58b44f254074eab6 |
|
13-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Made http_client record the current ioloop it is switched to.
This prevents http_client_wait() from switching the client to an ioloop it was never explicitly switched to. |
324f41beb33c20a6cd9248771c7fa4f58533bb3f |
|
13-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Add named event: http_request_finished |
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. |
4d1cc687f40dc2697005a4977e7ac40dda3d7dcf |
|
21-Sep-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Send empty payload (Content-Length: 0) for requests that normally expect a payload.
This includes the standard POST and PUT methods.
Others need to use the new http_client_request_set_payload_empty() function to force sending an empty payload. |
204ee6ed414f5e4eeb6f6c10763b55daf56f11ac |
|
19-Sep-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
global: start relying on [io]_stream_unref(NULL) being a no-op
Cleanup performed with the following semantic patch:
@@
expression E;
@@
- if (E != NULL) {
- i_stream_unref(&E);
- }
+ i_stream_unref(&E);
@@
expression E;
@@
- if (E != NULL) {
- o_stream_unref(&E);
- }
+ o_stream_unref(&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); |
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. |
f27497406f8819ac97bc16cd9b16d20630899187 |
|
10-Apr-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Improve request stats text.
It's important to know how long the request was in queue before it was sent.
Also the "n attempts in m secs" makes more sense if it was counting only the
time after the initial request was sent, not including the queuing time.
If there is more than 1 attempt, log separately how long all the attempts
were waited on vs. how long the last attempt took. |
bf7740f6bcea93a45e68113f1334c2be7f3cea4d |
|
10-Apr-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Add http_client_request_stats.first_sent_msecs
Also rename sent_msecs to last_sent_msecs. |
f0452e0b310ddc74d84c2492f72fea41ffcb96a8 |
|
10-Apr-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Track request's first and last send attempt times separately. |
28be42b4c27b0415da92ae7dd2c6e9cee2836c51 |
|
01-Apr-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Implemented means to obtain request statistics. |
eed02e3be957727e44afac3c20ab64ed80cc8644 |
|
30-Mar-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: http_client_request_delay_from_response() should use per-request timeout as max
It was using the global request_timeout_msecs for the maximum timeout,
which could be different from the per-request timeout set by
http_client_request_set_attempt_timeout_msecs(). |
561a21c8ecefaade916d686c763f2123e1f9a151 |
|
26-Mar-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Fix aborting a request that has a delayed error.
Caused by recent changes in delayed error handling. |
e46130f48a6962734bfde7e71906d3894bedf45b |
|
22-Mar-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Implemented http_client_request_url_str() function that accepts an URL string rather than a pre-parsed URL object.
If the provided HTTP URL is invalid, the callback with the error is called some time later from the ioloop.
This change also amends the test-http-client-errors test suite with a new test for this new feature. |
7a358ecd8918d1280a0b68cdf348c23f6721c799 |
|
22-Mar-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Make sure a request's log label never gets a duplicate request target part.
Make sure the URL part of the label always only consists of a http://host:port part and nothing more. |
8d845733408c0cb06a8884d12101beb0d40e6869 |
|
22-Mar-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Restructured the handling of delayed errors.
The req->delayed_error* fields are cleared before the callback is called and before the request is dereferenced.
This way, freeing the request never removes it from the delayed request list when the list is being processed.
It also makes it possible to resubmit the request from the callback (mainly for future use). |
15fe3500f08cfb1d4bde1f97afd7d287486dbd21 |
|
22-Mar-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Clear request pointer immediately in http_client_request_error(). |
887c92aa9f171ab90e417de48ffa08d4909c809a |
|
13-Feb-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: http_client_request_add_header() - Add key/value asserts
These don't check that they're entirely correct as required by HTTP
specifications. They're mainly there as a quick check that if the caller
didn't validate the key/value in any way, we'll crash instead of creating
a potential security hole. (Because with line feeds the attacker could
add extra headers or even entirely new HTTP requests.) |
e94584bf65f0985f1512a9f0c0651dfcc56ed0f2 |
|
24-Jan-2017 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
lib-http: Improve http_client_request_set_destroy_callback
It now allows using non-void* context |
bf45537f0263bdc02dea119ef2ab79599bf1a5c8 |
|
23-Jan-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Fixed handling of errors occurring for unsubmitted requests during http_client_request_send_payload().
When http_client_request_send_payload() is executed for the first time, the request is submitted.
Errors occurring during submission don't trigger a callback immediately.
Instead, these are queued in the client and will trigger a callback when an ioloop is run with the client.
However, in http_client_request_send_payload() the ioloop is never executed when the request fails that way, meaning that
the callback was never called. Since for example SOLR assumes the callback is always called for an error in
http_client_request_send_payload(), this causes all kinds of problems.
Fixed by manually handling the delayed request errors in http_client_request_send_payload() explicitly. |
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. |
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 |
2ac5f36aa7c2e7a07ba8815d43a6d7483f62e74c |
|
16-Dec-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Change string position/length from unsigned int to size_t
Mainly to avoid truncating >4GB strings, which might potentially cause
some security holes. Normally there are other limits, which prevent such
excessive strings from being created in the first place.
I'm sure this didn't find everything. Maybe everything could be found with
compiler warnings. -Wconversion kind of does it, but it gives way too many
unnecessary warnings.
These were mainly found with:
grep " = strlen"
egrep "unsigned int.*(size|len)" |
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. |
b284962364068d5e9d60b8b1e98ba61b4b6593ec |
|
09-Nov-2016 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Fixed assert failure occurring when server returns error status early while client is still sending blocking payload. |
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. |
5b6bfa39481f719c1fd6ed3febeaf7f0be9e8886 |
|
04-Aug-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Support per-request timeout and max_attempts |
f733f54c88d6acccad5e057f03a10d5221216c61 |
|
01-Jul-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Clarify response message when retries have happened.
"1 attempts" sounds like 1 attempt in total, while this was actually the
second attempt. |
d6a88217c273cc67f5de93949bdd065a15eeabe0 |
|
20-Jun-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Allow retrying requests that failed internally. |
378e6cb162b355d6f103526505bc00b9a78962e7 |
|
30-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
o_stream_send_istream() API changed again
The new API enforces the caller to correctly handle all the possible
situations. It also makes in unambiguous whether to wait for input or
output stream. |
0af543c1f5407f2fafd8685642e55385abade14a |
|
27-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Default port for http should be 80, not 443. |
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. |
6ab81c81be13f33486746deeffe02a1ef2bcc821 |
|
26-May-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Prevent useless and unexpected request callbacks during http_client_deinit().
Requests are now destroyed before queues, hosts, peers and connections.
As a side-effect, requests are now removed from the client request list at http_client_request_destroy(), so that requests with lingering references will no longer make http_client_wait() hang. |
1569b12af7b7394ff820382011f8e22970180e8b |
|
26-May-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Removed curiously duplicated code.
Probably a patch got applied with sufficient fuzz that it duplicated this code fragment, while it actually already existed. |
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. |
43c49be6f1ca42b9284833b2297e72ea0393fc9c |
|
26-May-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Fixed reference counting for requests that are aborted due to having a broken outgoing payload stream. |
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. |
43f651585cf5663bf176340b26eadd94b4060a9a |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Fixed checking if istream or ostream needs waiting. |
d04f3e064ceb2ba1d734182937a7115739ebadbe |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Simplify code with the new o_stream_send_istream() API |
43cc944340b6879ce2c6aeba048ceaf040bf0932 |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Code cleanup - remove unnecessary errno changes.
These were left behind from changing %m to [io]_stream_get_error() |
f74dbd3ff682fea040f60383e001620d1f1b09d3 |
|
16-May-2016 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Started using struct uri_host in struct http_url. |
f883bf3eff62f5d27df5ee9ee664edc38a77937f |
|
16-May-2016 |
Stephan Bosch <stephan@rename-it.nl> |
uri-util: Removed have_port and have_host_ip flags.
Presence of port can be tested with port != 0.
Presence of IP can be tested with ip->family != 0. |
befccf297cba74009dfd0447a0dcea018af756fe |
|
29-Apr-2016 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Added ability to configure a specific proxy for individual requests.
This way, a request can be routed to a specific proxy (or origin server). The destination can also be a unix socket. |
93c9909f68f7d057e38cca3b4612ec8d0bf42999 |
|
22-Apr-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Include information about number of request attempts and its timing in response reason.
Because the reason is usually logged as part of the error string, this
causes all of the error messages to include the attempts count and how long
the requests took in total. This should make it easier to understand problems
in error logs.
http_client_request_set_preserve_exact_reason() can be used to disable
modifying the reason string. This may also apply to other reason
modifications that may be done in the future. |
2a9cadfccc8fb2c609eedbb929952b49181b6d25 |
|
20-Apr-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Added pure attribute to some of the request property functions. |
7a13cd2268a5a99d2975a1648d6d14ffe1b6ccb0 |
|
20-Apr-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Implemented means to set request payload buffer rather than an input stream.
This is not purely a convenience function: there have been bugs caused by allocating a data input stream from a datastack buffer.
With this function, the buffer is copied to the request pool, so that it is durably allocated while the request exists.
This prevents futher mishaps. The server already has an equivalent function for its response object. |
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. |
c3a4c931e95737a52e1cebeeb109a2e1cc4d47d6 |
|
22-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Clarify http_client_request_*_payload() API and minor change to it
The earlier behavior was pretty confusing, and potentially could have caused
double-freeing memory in some situations. Now it's clear that req is set to NULL
always when the request is finished, regardless of whether it has any references left.
Changed http_client_request_finish_payload() to return 0 on success instead of 1.
This could have been left alone, but it's unlikely that there is any code outside
Dovecot core that calls it and this way is cleaner. |
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. |
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. |
47a53a80656dc400ff8effdc1432a69fbf5ae8ba |
|
16-Jan-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Assign an ID for each HTTP request and log it in debug lines.
The ID stays the same when request is retried. Added a "Req" prefix so it's
easier to search for the IDs. Based on patch by Stephan Bosch. |
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/' |
7387c86ae0297703ac398addbf0ff3904361fd3d |
|
06-Oct-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed handling of response timout if there is no payload going to the server. |
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. |
8192e6fcab193e174a3258457e967a6fcc60b05e |
|
22-Sep-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed bug that caused queues to be duplicated over time when host has multiple IPs.
The peer address comparison did not account for the fact that the initial
queue address has no IP assigned. |
cb44fd2f888be7da34b5d3db2f4d3e88b989f0fb |
|
22-Sep-2015 |
Timo Sirainen <tss@iki.fi> |
lib-http: Optimized http_client_request_send_payload() fix
Badly copy&pasted my original fix, instead of noticing that Stephan's fix
was slightly different. Probably shouldn't have made actual difference
other than for performance. |
47ff1eaf3bc13a702c8491d248d8d34d08796937 |
|
21-Sep-2015 |
Timo Sirainen <tss@iki.fi> |
lib-http: Avoid crashes on failing http_client_request_send_payload() calls
It HTTP server connection died, ioloop might not have anything to do
anymore:
Panic: file ioloop-epoll.c: line 187 (io_loop_handler_run_internal): assertion failed: (msecs >= 0) |
ede750711f27ca9d9037a7ab9f016411b57f1ad9 |
|
25-Apr-2015 |
Stephan Bosch <stephan@rename-it.nl> |
http-client: Added support for using an HTTP proxy running on a unix socket. |
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(). |
4c4c4a740bbb1b674d4b0dae009d1919f8ad96b7 |
|
18-Aug-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http client: Implemented proxy authentication using Basic scheme. |
91a4eaad6cae9b59820a1fa3ad42ef7aea7d1e67 |
|
18-Aug-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http client: Added inline function to check whether request is directed at a proxy. |
30f35cf5d1e1374d7fab4231e86144fc106a8e79 |
|
18-Aug-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http client: Implemented simple authentication using Basic scheme. |
fb2098157791f20fca11e1673cdf5386806fd885 |
|
18-Aug-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http client: Removed useless assignment of request->authority in http_client_request_redirect().
It is assigned again in http_client_request_do_submit(). |
2ff548b46061f984def8d36736745333b8405a31 |
|
18-Jun-2015 |
Timo Sirainen <tss@iki.fi> |
lib-http: http_client_request_send() failure returned already-freed error string. |
5e4cdaaf560cfa94bfc014ce8e1a52e4d0a85b48 |
|
02-Feb-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed double unref of request when error occurs during http_client_request_try_retry().
Much like when the request is first submitted, any errors that occur while attempting a retry from within the callback are now delayed in a zero timer. |
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> |
9145c8b5eda526d05bd4a7ced20f6f6f2ff8df03 |
|
25-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed conflict between request abort and request delayed error. |
a991cfe2157e58ee43bc580f517ce9ef0dfb7acf |
|
20-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Created list of all submitted requests.
Currently only needed to improve debugging of hanging requests. |
fca68889b287d8eed4babe72a231bd6079da012d |
|
12-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Moved delayed failed requests from host to client object. |
840abb812d2e8edc42b5e2a4e3838b8d5e759e6a |
|
09-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed assert crash occurring when DNS lookup fails immediately during request submission.
In that situation, the request was not dropped from the queue immediately, triggering the assert crash. |
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. |
de0181258ab66b527ad8dc7e51a8efa76b4658d0 |
|
04-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Added support for delaying requests in milliseconds. |
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. |
16eb9a737d42017fc875ef7b68afc25c3c9f8979 |
|
30-Sep-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Fixed crash occurring sometimes when delay timeout expired.
Forgot to drop destroyed requests from delay queue. |
42630b23d5a1b03cf6db4eaa2eb21e3ec4033b2c |
|
26-Aug-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added http_client_request_get_method() |
31fa529029f35f65451fb1d119ed1d5435b62e46 |
|
11-Jul-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Debug log now includes where HTTP requests spent their time on. |
6ee9ce5ed955a1283dc22ad28980bf9cc23d4c4e |
|
01-Jul-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Updated comments to RFC7230/RFC7231. |
b2a3fbfe1b436123bbe1849eeeef9bb0c28b1f90 |
|
30-Jun-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added http_client_request_get_target()
This can be useful in error message logging without having to duplicate the
string. |
d3d941cc89a8ef5fe0de16bd89e50030e5d22f5b |
|
27-May-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Fixed assertion failure in http_client_request_send_payload() caused by inappropriate retry attempt. |
b36e026fb1e31bb76524cb345eb40c73e528507b |
|
27-Apr-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Prevented http_client_request_continue_payload() from segfaulting when the callback sets the request pointer to NULL. |
0d5c9a80e91a4073d5fd6820e9ddce2755221f64 |
|
27-Apr-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Forgot to switch dns-client io_loop in http_client_request_continue_payload() in ealier change (6c3bd941e153). |
ea2c9ff03053b7d255984d6bbcb3a48c052d1e4d |
|
25-Apr-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Better error handling fix for payload read/write failures |
5777eef991bdb9dc487e9b8e8da8a4579fc67f6c |
|
25-Apr-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Failed payload read/write error was handled wrongly as "stream input size changed". |
b7540564b9d7b69ce8f6e5a80011ccd5f8b86005 |
|
25-Apr-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added more information to "stream input size changed" error |
a0613a630a412b0649b83c40c83f9fcfe50e1ad7 |
|
17-Apr-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: http_client_request_finish_payload() no longer waits for the entire result payload.
The caller can now read it instead, or just discard it by not reading it. |
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. |
a8c5a86d183db25a57bf193c06b41e092ec2e151 |
|
04-Feb-2014 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2014. |
84740b03d3ee9e96a2e446a54729188764c99292 |
|
14-Jan-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added http_client_request_remove_header() |
49287618521ff2c69385456de116e5d1581426c0 |
|
14-Jan-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Allow calling http_client_request_add_header() when retrying requests. |
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. |
19db4c57fd7acc9e54e5724ccfa0633a5665dfef |
|
22-Nov-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Compiler warning fix |
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. |
129596c93692b21d6c6b1313b389774af24c2983 |
|
22-Nov-2013 |
Stephan Bosch <stephan@rename-it.nl> |
http-client: Improved handing of delayed request errors.
Originally each request would have its own zero timeout, but now only one
timeout is put in the host object. |
de96afeeaa5242cffe89f1966457e935806b5746 |
|
22-Nov-2013 |
Stephan Bosch <stephan@rename-it.nl> |
http-client: Changed struct http_client_host_port into a struct http_client_queue object.
Peer and request objects now reference the queue object directly rather
than the host object. This way, there is no need to find the matching
host:port in the host anymore. This makes the queueing structure more
intuitive and more efficient. This is a first step towards support for
connecting to HTTP services through unix sockets or directing requests at
specific hosts (so not from the URL). This patch also fixes a potential
timeout leak (to_connect) in http_client_host_port (now http_client_queue)
and makes sure it is moved during switch_ioloop(). Finally it updates the
structure comment at the top of http-client.c. |
35f3b7e05afecacd0332c210c6e253911c2813d8 |
|
16-Nov-2013 |
Timo Sirainen <tss@iki.fi> |
Use io_loop_set_current() instead of directly setting it. |
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. |
4219de12b28f1936219e27501b9c4b27a4f8d53c |
|
12-Oct-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Implemented proxy support. |
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. |
6c6915f4d75c352c63156df202fa51cd97524bab |
|
12-Oct-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Made requests release payload input stream as early as possible.
This prevents deadlock conditions when used for the HTTP proxy. |
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. |
b99130e4cf4af4e6b103b949456222f3a2dff424 |
|
08-Oct-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added setting for User-Agent header. |
87c121a4c05b9cee46f1f757ec6999d441519abf |
|
17-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Allow overriding all implicitly generated special headers.
Which are: Connection, Content-Length, Date, Expect, Host, and Transfer-Encoding. |
2ccb0bce340110ab68d1a490103d7b0271962139 |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Implemented explicit HTTP/1.0 support. |
e8f1e510df3ab051a816715c2056f0d10aee929e |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Unified http-request.h and http-response.h headers.
Renamed struct http_response_header to struct http_header_field,
encapsulated the array in struct http_header and put it all in
http-header.h/c Added inline utility functions for header querying and
getting response/request payload size. |
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). |
6d573191bea1a64d6046be070487a5705a2d0204 |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Requests now automatically generate a Date header.
The used date value is normally the submission time of the request, but it
can be set explicitly. |
fc94140acba51adafedafbc8491a3223a51db7a8 |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Fixed request scheduling and connection management. |
27421074812b84d144b68388e597f4700f4f1c1b |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Fixed leak of ostream when request was resubmitted upon 417 response regarding 100-continue.
This would only occur when the server refuses Expect: 100-continue with a
417 response. The payload_output stream would be overwritten without being
freed first. |
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. |
7ec4907a598d72dc058eb11d97a86b8cd254d5bd |
|
10-Aug-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Removed more code duplication |
8608ffb77a62476c1edfaad30d7e0a64070b3258 |
|
10-Aug-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Removed duplicated code |
069def4dc35022852d569b7ab75a3b19d2cb0f1c |
|
04-Aug-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed redirect request target encoding and NULL target.
Patch by Stephan Bosch. |
fe681e6db72f30bd754b622005bbe298e5ca775a |
|
27-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Call request's destroy callback always, not just on success. |
c6494255de7b934281dd052960fd8ab5aa48e79e |
|
10-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: http_client_deinit() calls any pending delayed failure callbacks. |
ccd968b44a40b9c2cf6278fabfa2a80cc5d9e46b |
|
10-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added data stack frame to avoid unnecessary data stack wasting. |
791fb70b3255a11a91ce0c2dc3ae1460d4cf8459 |
|
05-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
Make static analyzer happier. |
6bc9fb43cc1ac24693d030a6cbfa43bc7cbc82cb |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: If http_client_request_submit() fails, don't immediately call the callback.
This simplifies the caller's error handling since there is now only one
error code path instead of two. |
667de5cf294d833b3d47dd455bacff4fd68dd146 |
|
10-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added assert. |
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. |
1d048c5050f03c24251e5af8087e640de21b2d62 |
|
10-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Allow caller to find out what state a request is in. |
dd61a7356c4e00d733fd6cd99b29d979b9eb26df |
|
08-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Send Content-Length whenever payload is specified, even if its size is 0. |
99feb6521535a7dc59d8dda89981ceac084b3e88 |
|
05-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: If we get disconnected, say exactly what the error was. |
fb025942616dfec7770455a7092d01f2e516314d |
|
21-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed hangs/crashes with chunked ostream.
Based on patch by Stephan Bosch. |
fb1be3de0159d6a10e916ad992e2bc53be64c6d5 |
|
20-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Avoid hanging in http_client_wait() while there's nothing to do. |
069b28a2ef54072a221fe4ac67aaeb4e83fee6c1 |
|
20-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Minor API change: Added http_client_request_finish_payload() |
4521d35c263add6af3f1ae55b3760291767ce50c |
|
04-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: If http_client_request_set_payload() fails to get stream size, log an error. |
4124bebe6daab2cd05acb0416096fc47cb9abd92 |
|
04-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added http_client_request_set_destroy_callback()
This is useful for io_remove()ing the payload stream's fd at the right time. |
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. |
57962a937b214be3a131f78005509afaa26fe4bf |
|
18-Dec-2012 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed a crash when http_client_request_submit() failed immediately |
02da50edce6812808600f9ce20fd90057ef9c4b5 |
|
12-Dec-2012 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed sending HTTP request's payload. |
50a6d26bd9041f44b4cad0c0357c0c604c132cc8 |
|
12-Dec-2012 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Added support for chunked input/output streams and some bugfixes. |
d45ab3fff7c47f1719b9cd310228c0dac2bdd1b2 |
|
29-Nov-2012 |
Timo Sirainen <tss@iki.fi> |
lib-http: http_url_parse() now returns the http_url allocated from given memory pool. |
7384b4e78eaab44693c985192276e31322155e32 |
|
23-Nov-2012 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Added initial HTTP client implementation. |