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. |
fab1c263d60ee6a08f162af2146ff0ccf6b36061 |
|
26-Feb-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: Create http-common.h, which contains global definitions shared by client and server.
Currently contains only the default HTTP port definitions that used to be
private to the client. |
ff8a751fb9227a4fd73b2cdaa16d7a2616b3e7e7 |
|
15-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Add http_client_init_private()
This allows creating a HTTP client without a shared context, in case it's
needed for some reason. |
e7bc4ce82122c30696e60789432ffeb2e26b265b |
|
15-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Change http_client_init() to use the global shared client context
This is most likely what is usually wanted. |
788e61d347adbdb7c9a4d767e381f4bd8a3526b2 |
|
15-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Add http_client_get_global_context() |
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. |
2d1ad5742dd723b39c51bcf64c62a600237de8ae |
|
13-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: client: Add support for event API |
fab1a1c57f467c19c728d2391ff5e5025bb832f7 |
|
07-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Created basic shared context between clients.
In this basic form it only shares default settings. |
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. |
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. |
28be42b4c27b0415da92ae7dd2c6e9cee2836c51 |
|
01-Apr-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Implemented means to obtain request statistics. |
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. |
a8741f46cb3cf40e58e3d47b263f238918243380 |
|
22-Mar-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: Explicitly define the start of the range of internal response status codes. |
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 |
1e63e30812158e6446d81cdbb2f45954794d4f8a |
|
02-Nov-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Implemented host name lookup TTL.
Host name lookups will now be performed again when the results have expired.
Without access to TTL information from DNS lookups, all lookups will use the same default TTL for now. |
5b6bfa39481f719c1fd6ed3febeaf7f0be9e8886 |
|
04-Aug-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Support per-request timeout and max_attempts |
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(). |
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. |
c275cef636c79e1d08b3a82462c4abdca6f8cef3 |
|
07-May-2016 |
Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi> |
lib-http: use ssl_iostream_settings in http_client_settings |
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. |
5a37824675033747fcae3fe3fc3c0dd7ef0ca1cd |
|
20-Apr-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Cleaned up headers and added some more documentation there. |
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. |
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. |
ede750711f27ca9d9037a7ab9f016411b57f1ad9 |
|
25-Apr-2015 |
Stephan Bosch <stephan@rename-it.nl> |
http-client: Added support for using an HTTP proxy running on a unix socket. |
4c4c4a740bbb1b674d4b0dae009d1919f8ad96b7 |
|
18-Aug-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http client: Implemented proxy authentication using Basic scheme. |
30f35cf5d1e1374d7fab4231e86144fc106a8e79 |
|
18-Aug-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http client: Implemented simple authentication using Basic scheme. |
94d1b08c9e20d637db568a3eab3dfc2b9e96e62a |
|
23-Oct-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Implemented maximum for connection backoff time.
Without a maximum, the backoff time grows exponentially to enormous values,
because it isn't reset until the connection succeeds. This causes recovery
from connection failures to become very slow. Current maximum is one
minute. |
74c09aceb0118b564f8443e1276c465738d19c17 |
|
14-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
Compiler warning fix |
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. |
fe2b0e3de834dd40b698bb579adc5357d5789ec9 |
|
10-Sep-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Implemented support for connection failure backoff. |
9d746c6785d17e421c3f3c74cf29d059ae2ab233 |
|
10-Sep-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Added support for attempting a single IP several times.
Also limits the number of attempts when there are many IPs. |
42630b23d5a1b03cf6db4eaa2eb21e3ec4033b2c |
|
26-Aug-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added http_client_request_get_method() |
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. |
84740b03d3ee9e96a2e446a54729188764c99292 |
|
14-Jan-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added http_client_request_remove_header() |
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. |
7944646fad6aa1e7c649c3d33e454c516b0220b6 |
|
22-Oct-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Support DNS lookups via the new dns-client API. |
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. |
ad03049781fc14807248007d524be4daf06c3ee2 |
|
12-Oct-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Added support for disabling automatic redirects. |
b99130e4cf4af4e6b103b949456222f3a2dff424 |
|
08-Oct-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added setting for User-Agent header. |
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. |
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. |
1920ef85b63738a06914e56508049dd0afe38732 |
|
10-Jul-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Moved struct http_response* to http-response.h
Also http-client.h now #includes only http-response.h |
17cd0e0963f2fb0e66d49703e8cd0bda1b842468 |
|
27-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added http_client_get_pending_request_count() |
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. |
a8c4e79ff50fac21b05a7368b052583d410ca15c |
|
05-Jun-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added connect and request timeout settings. |
35e962a9186b4e9b2001628c1d7b55c24b33ce84 |
|
23-May-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added ssl_cert|key|key_password settings to be passed to ssl-iostream.
These are used for sending client's SSL certificate. |
56d1345c43bbd28c36b7faa85e4163bd9e874290 |
|
07-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
Added ssl_client_ca_file to specify the CA certs as a file instead of as a dir.
This is required for Redhat-based systems where there isn't a CA directory
like in Debian/Ubuntu. |
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. |
30d917bcd48d70af0371baf27571cc198d621a62 |
|
02-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added ssl_ca setting to specify the CA certificate directly. |
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. |
069b28a2ef54072a221fe4ac67aaeb4e83fee6c1 |
|
20-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Minor API change: Added http_client_request_finish_payload() |
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. |
eb325a5a90c1d2655e74972bde0de6a699d2c864 |
|
01-Feb-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Various bugfixes |
7384b4e78eaab44693c985192276e31322155e32 |
|
23-Nov-2012 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Added initial HTTP client implementation. |