Stephan Bosch [Tue, 17 Oct 2017 01:19:19 +0000 (03:19 +0200)]
doveadm-server: http: Fixed lingering connections after the request is sent.
Turns out conn->http_client is already NULL while doveadm_http_server_connection_destroy() is called.
This is because http_server_connection_unref() sets it to NULL;
Fixed by removing useless HTTP connection reference.
Timo Sirainen [Mon, 16 Oct 2017 11:49:56 +0000 (14:49 +0300)]
cassandra: Fix using bigint types with unprepared statements
This reverts the code to not using the statements with binding at all.
Alternative fix would be to start using explicit int32 or int64 parameter
types, but that breaks backwards compatibility a bit.
Bill Cole [Tue, 10 Oct 2017 21:40:04 +0000 (17:40 -0400)]
Added "ULL" to the hex literals that needed it.
On 32-bit platforms with older compilers (e.g. gcc 4.2 on MacOS 10.6
running on a 1st-gen Core Duo) a 'long' is 4 bytes and the compiler does
not automatically use a 'long long' when needed, but instead generates
an error. e.g.:
libtool: compile: /usr/bin/g++-4.2 -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/lib -I../../../src/lib-mail -I../../../src/lib-index -I../../../src/lib-storage -I../../../src/plugins/fts -I../../../src/doveadm -I/opt/local/include/openssl -I/opt/local/include -I/opt/local/include/CLucene/ext -pipe -Os -arch i386 -D__STDC_LIMIT_MACROS -MT lucene-wrapper.lo -MD -MP -MF .deps/lucene-wrapper.Tpo -c lucene-wrapper.cc -fno-common -DPIC -o .libs/lucene-wrapper.o
In file included from ../../../src/lib/lib.h:33,
from lucene-wrapper.cc:4:
../../../src/lib/byteorder.h:94: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:95: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:96: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:97: error: integer constant is too large for ‘long’ type
make[4]: *** [lucene-wrapper.lo] Error 1
Adding the 'ULL' to the end of the 16-digit hex literals that are used
to test the structure of 64-bit integers fixes this and avoids any
problem which could arise from the compiler using a 32-bit type for
those literals that could fit in 32 bites.
Timo Sirainen [Wed, 4 Oct 2017 18:45:18 +0000 (21:45 +0300)]
global: Use check-local in Makefile.am instead of overriding check directly
This helps with dependency problems, like running "make check" in
lib-storage without "make" first would try to compile the test programs
too early and fail.
Timo Sirainen [Mon, 9 Oct 2017 10:19:32 +0000 (13:19 +0300)]
lib: ostream-multiplex - set ostream_private.parent
Unlike with istream-multiplex, there are no issues with I/Os. Only the
parent stream will have the I/O. Using the default parent adds the
missing methods that otherwise would have needed to be implemented:
- cork
- flush_pending
- switch_ioloop
Timo Sirainen [Mon, 9 Oct 2017 10:14:23 +0000 (13:14 +0300)]
lib: istream-multiplex - Forward i_stream_switch_ioloop() to parent
Most istreams do this because istream_private.parent is set to the parent
stream, but this can't be done with istream-multiplex. The main problem
with attempting to do the same with istream-multiplex is that the different
channels don't share the same I/O. Just because one channel received data
doesn't mean that other channels received any data. (It would be possible
to solve this by implementing a new method that allows overriding
i_stream_set_io(), but I'm not sure if that's a good idea either.)
Timo Sirainen [Fri, 6 Oct 2017 13:55:28 +0000 (16:55 +0300)]
acl: Fix checking create (k) permission in global acl-file
Just because the global ACL file hasn't changed since it was last refreshed
for another ACL object, it doesn't mean that those ACLs don't need to be
applied to this ACL object.
This didn't usually cause problems, because the initial ACL object refresh
was always done due to local-path refresh returning "needs a refresh".
The only exception was when acl_object_init_from_parent() was called,
because it added an empty non-NULL validity for the local-path, so the
"needs a refresh" wasn't returned. This happened only when trying to
CREATE or RENAME mailbox under a parent where user didn't have create
permissions.
This affected only when using a single global acl-file, not when using
global acl directory containing per-mailbox files.
lib: don't use foo_real()-style symbols in a header file
While there is precedent for symbols getting _real suffix to hide
implementation details, all the existing symbols were static until
the recent i_fd_close*() changes. This commit makes this true again.
Timo Sirainen [Thu, 5 Oct 2017 08:46:55 +0000 (11:46 +0300)]
director: Don't crash if DIRECTOR-REMOVE is received for itself
This triggers the director removal from the ring, which causes the
connection to be destroyed. But since we're still in the middle of handling
the connection it needs refcounting.
Timo Sirainen [Wed, 4 Oct 2017 12:08:07 +0000 (15:08 +0300)]
lib: istream-file/unix - don't ignore EINTR for blocking istream reads
Just fail the istream read entirely. Although there's a small possibility
that this interrupt was unwanted and should be retried, it's more likely
that a blocking istream is hanging and admin wants to stop the process.
If the EINTR is ignored all the time, it's not possible to abort a
blocking read with ^C or anything else than SIGKILL.