Timo Sirainen [Mon, 20 Jun 2016 17:06:38 +0000 (20:06 +0300)]
dbox: Optimize POP3 MAIL_FETCH_UIDL_BACKEND.
We keep track of the highest UID known to have POP3 UIDL in index's header.
If saving adds a newer message, it'll also update the header. When fetching
UIDL_BACKEND, we can need to check only mails with lower UIDs. There are
some race conditions here, but normally UIDLs are set only once during
migration so it shouldn't matter.
Timo Sirainen [Mon, 20 Jun 2016 11:29:57 +0000 (14:29 +0300)]
Added valgrind suppression for OpenSSL <v1.0.2
This one works at least for CentOS 6. Because the OpenSSL library is
loaded as a plugin and unloaded before exit, valgrind sees only "???"
as the addresses. That's why we're using "obj:*". But the number of
obj:* lines is also important, so this may not work everywhere.
Stephan Bosch [Sun, 19 Jun 2016 23:15:18 +0000 (01:15 +0200)]
lib-http: server: Wrap request payload in a timeout input stream.
The server cannot reset the timeout properly while the payload is being read by the application.
The HTTP client solved this same problem by identical means.
Stephan Bosch [Fri, 17 Jun 2016 14:59:15 +0000 (16:59 +0200)]
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().
Stephan Bosch [Wed, 25 May 2016 21:41:47 +0000 (23:41 +0200)]
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.
Stephan Bosch [Mon, 23 May 2016 00:38:49 +0000 (02:38 +0200)]
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.
Stephan Bosch [Sun, 22 May 2016 10:48:37 +0000 (12:48 +0200)]
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.
Stephan Bosch [Sat, 21 May 2016 11:16:08 +0000 (13:16 +0200)]
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.
Timo Sirainen [Sun, 19 Jun 2016 22:47:59 +0000 (01:47 +0300)]
lib-index: Don't break indexes on syscall failures during index refreshing.
Especially mmap() failures due to out of memory could have triggered this.
We treated the open as successful, which meant that an empty index was
opened.
Timo Sirainen [Mon, 13 Jun 2016 17:16:14 +0000 (20:16 +0300)]
dict: Increased max number of pipelined requests from 5 to 1000.
The client is supposed to be the one throttling the requests. We mainly
want to avoid accidental abuses. Using 1000 is hopefully "large enough"
without being "too large".
Timo Sirainen [Mon, 2 May 2016 15:16:00 +0000 (18:16 +0300)]
quota: Skip reading mail sizes when quota backend doesn't need it.
If quota backend is updating the quota internally, it's just going to ignore
the looked up size. The only reason for looking up the sizes is to check
with quota_try_alloc() whether user is going over quota.