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. |
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. |
e0990933b4c3428f3de18cbeb5844217cb029611 |
|
04-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Implicitly switch ioloop for global shared client context.
If the new ioloop is NULL, close the shared client context. In that case all
shared hosts, peers and idle connetions are closed and destroyed. The context
just remains as a container for settings and shared context. This is only
allowed when there are no clients left. |
ee90a96c4f47ff9c1e56451201386ca8a0b48124 |
|
04-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Use merged DNS settings from all clients connected to a shared context for DNS lookups. |
473f30e2d1ce3a2320aeae03b32b766437ef0a13 |
|
04-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Base forcing shared context debug logging on the settings of the context itself and each associated client. |
4977156a495d44a5876be598b561bf1d9579e52e |
|
04-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Register client objects in the associated client shared context. |
ac58ae8fb539021189941651b33246b749c35297 |
|
04-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Call switching ioloop for shared peer from shared client context.
Before, it was called from the client peer. |
a00f5a4cf1d47cbdca0a86c34ea57902e0e24492 |
|
04-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Merge socket buffer size settings with settings from shared context.
While using the default global context, per-client socket buffer size settings were ignored. |
fcb3882db19a56a4421174576e4c5103de3490a5 |
|
04-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Merge max_idle_time_msecs setting with setting from shared context.
While using the default global context, per-client max_idle_time_msecs setting was ignored. |
bcb4e51a409d94ae670de96afb8483a4f7855294 |
|
01-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2018. |
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() |
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. |
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 |
ea4a85f5883baa653e8e60246c6ad570565cd831 |
|
11-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Cleaned up initialization of client settings.
There were checks for the client context not being NULL, which makes no sense anymore, since a private context is always created when none is provided.
Problem reported by Coverity. |
6776cc851a593b2a893103833e08ed3902ce1933 |
|
07-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Amended the top comment explaining the structure of the HTTP client. |
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. |
e48102389fb49deadfc685600dc2e56177fd0d7c |
|
07-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: shared context: Allow sharing host lookups between clients. |
9fe6a55877bee691b32c12c7be56242054841670 |
|
07-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Moved connection list from client to shared context. |
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. |
d67f004ebf944adca3ba09ed547febfa75442476 |
|
07-Dec-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib-http: client: Fixed whitespace in the top comment explaining the structure of the HTTP client. |
ebcf7d6c9222f2c96053516e0c90994bff62dd55 |
|
07-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Replace ssl_iostream_context_init_client() with ssl_iostream_client_context_cache_get() |
15d19d6e4daf460d8d2c82b981e23996dbdf7ba5 |
|
07-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Rename ssl_iostream_context_deinit() to ssl_iostream_context_unref() |
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); |
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). |
2454dfa32c93c20a8522c6ed42fe057baaac9f9a |
|
01-Jan-2017 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
Updated copyright notices to include the year 2017. |
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. |
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(). |
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. |
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. |
ebe0f5e387744621b73c4db79d5891ccbe0a1321 |
|
26-May-2016 |
Stephan Bosch <stephan@dovecot.fi> |
lib-http: client: Made peer object reference-counted to prevent invalid memory access in request handling routine.
Resetting the peer->handling_requests flag risked triggering a segfault, since the peer object could be deleted from within the request handler loop. |
5d31e4b38ef03b002e2ab245a7f8a4c0da3dd03d |
|
08-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Allow http_client_settings.ssl==NULL |
c275cef636c79e1d08b3a82462c4abdca6f8cef3 |
|
07-May-2016 |
Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi> |
lib-http: use ssl_iostream_settings in http_client_settings |
5257840e8d31a6cb7051703b4cb0931c82aba638 |
|
25-Feb-2016 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: client: Gave request, connect and dns timeouts defaults that make more sense. |
f9d2a1f21ad65262bc630f0834d7eead06a1bac3 |
|
22-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib-http: Always set *_obj=NULL first in deinit functions (mainly for consistency)
This doesn't usually matter, but in case deinit calls some callback they may
be trying to access the partially destroyed object. |
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/' |
4c4c4a740bbb1b674d4b0dae009d1919f8ad96b7 |
|
18-Aug-2015 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http client: Implemented proxy authentication using Basic scheme. |
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> |
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. |
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. |
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. |
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. |
6ee9ce5ed955a1283dc22ad28980bf9cc23d4c4e |
|
01-Jul-2014 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Updated comments to RFC7230/RFC7231. |
856ae2ad98cee79b2719911a3cc131d7f4ec8a90 |
|
19-Apr-2014 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed resource leaks in http_client_wait() occurring a dns_client is used.
If all DNS lookups finished before the end of the wait cycle, the dns_client would not be switched back to the original ioloop. |
a8c5a86d183db25a57bf193c06b41e092ec2e151 |
|
04-Feb-2014 |
Timo Sirainen <tss@iki.fi> |
Updated copyright notices to include year 2014. |
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. |
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. |
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. |
4219de12b28f1936219e27501b9c4b27a4f8d53c |
|
12-Oct-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Implemented proxy support. |
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. |
fc94140acba51adafedafbc8491a3223a51db7a8 |
|
15-Sep-2013 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: http-client: Fixed request scheduling and connection management. |
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. |
9d0aee99a8c80d71137aa9b8c216cc203bec7a9a |
|
07-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: ssl_crypto_device and ssl_allow_invalid_cert settings were ignored. |
636d0f43138468f8efe685a681326b123f660e49 |
|
05-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed moving delayed request error timeouts between ioloops. |
d47b9f1bd7274c7b2d9049c2e1718d1cf89cc572 |
|
04-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-ssl: If debug=TRUE, set also SSL verbose=TRUE |
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. |
30d917bcd48d70af0371baf27571cc198d621a62 |
|
02-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Added ssl_ca setting to specify the CA certificate directly. |
1a9a35a6b307f8d5b25345af55e40a99162b4072 |
|
05-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Fixed http_client_wait() assert. |
9dc01e0d10a61cab14867b26bf0d2d1dcf8ad978 |
|
26-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Track peers using a linked list also.
Mainly because this makes it much easier to debug using gdb. The overhead
isn't that much extra either. |
42174e52368295ec35ba9841334c177fcedb7116 |
|
26-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Assert-crash in http_client_wait() if it's waiting without doing anything. |
aacf2a69acc59e9382578d6f4e030788abc79706 |
|
26-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Track list of hosts using a linked list also.
http_client_switch_ioloop() is done very often, and scanning a few entries
in a linked list is much faster than going through a hash table. |
fb1be3de0159d6a10e916ad992e2bc53be64c6d5 |
|
20-Feb-2013 |
Timo Sirainen <tss@iki.fi> |
lib-http: Avoid hanging in http_client_wait() while there's nothing to do. |
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 |
7384b4e78eaab44693c985192276e31322155e32 |
|
23-Nov-2012 |
Stephan Bosch <stephan@rename-it.nl> |
lib-http: Added initial HTTP client implementation. |