b56679429b82dfea1ceecc40efea50dd8e4e0ac5 |
|
16-Feb-2018 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add o_stream_uncork_flush() to both uncork and flush |
8aa8399893c66b40e2790a4568256807a6ec6742 |
|
30-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib: ostream: Allow switching to a specific ioloop. |
7660a5183e89459d255dc5873894ff08806711d5 |
|
15-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add o_stream_abort() |
f8b6c3d6bc9d63665af5e0a3c8b604438e4c3a4e |
|
07-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add o_stream_get_last_write_time() |
d6193a892452ae87548f5745dada01f82816765d |
|
01-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add o_stream_set_finish_also_parent() and _finish_via_child()
These allow controlling on both directions whether o_stream_finish() should
be finishing the parent stream. If either one is set to FALSE, the parent
stream isn't finished. Which one of these to use depends on the situation. |
5ec4fc44e8d4e2160f07b1a7f4fce1ccfec3f6c1 |
|
30-Oct-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Automatically flush ostream when it's closed
Also verify that it unexpectedly didn't get fully flushed. |
4805c8a7d4bfcafa0282c31b2982757f852f8568 |
|
30-Oct-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Remove o_stream_nfinish() |
84717f00ddbf5cd0ebe3f285090d5e97e458e19c |
|
30-Oct-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add o_stream_finish()
This marks the ostream as fully finished, with no further writes coming to
it. Otherwise it behaves like o_stream_flush().
The ostream.flush() methods are supposed to write their trailer (if the
ostream has one) when they see that ostream.finished is set. These will be
implemented by the following commits. |
34d5077c37dc6224a2d430a72ae51a3f38e9e4f6 |
|
30-Oct-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: o_stream_flush() - check for send overflows and reset error handling
This begins the removal of o_stream_nfinish(). |
b688884f23be2333bea1a8bd4ee849336aebedaa |
|
30-Oct-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Remove o_stream_nflush()
None of its previous callers were calling it correctly, so it's better to
remove it entirely to avoid more of such wrong calls. |
23c8c511f98924acfc7048e9dc4ccc982c34e320 |
|
30-Oct-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: o_stream_uncork() - call o_stream_nflush() instead of o_stream_flush()
Otherwise flush errors may be unintentionally ignored. This change requires
that all the o_stream_uncork() callers must call o_stream_nfinish()
afterwards, unless the ostream is set to ignore errors. |
0dffa25d211be541ee3c953b23566a1a990789df |
|
06-Jun-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: unsigned int:1 -> bool:1
perl -i -pe 's/unsigned int ([^,:;]+):1;/bool $1:1;/' **/*.[ch] |
e93184a9055c2530366dfe617e07199603c399dd |
|
06-Jun-2016 |
Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi> |
lib: remove autoclose parameter from [io]_stream_create_fd
Use [io]_stream_create_fd_autoclose() for autoclose. |
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. |
bf87a5247ca33660ab8f20c12556ad16d7159395 |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Added comment to what ostream.offset actually is |
b90fb7f78aca271243c26074ddd6587cce112a1e |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Added o_stream_nsend_istream() |
6adf683655750bcb809275cd65dc75fd12214198 |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Simplified and clarified o_stream_send_istream() API |
8b2cf1c1bd8ddcea0525b62fd35ba76e136828a1 |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Added ostream.blocking boolean
Similar to istream.blocking. |
9de176ef7f3d28ff486c2a8805110b84389e4f19 |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Don't silently ignore partial writes for o_stream_nsend()
Normally o_stream_nsend() should be used only for blocking streams or
streams with infinite (or "enough") buffer space. |
f988b93c2ef773987bcdcbfb4cca39b955e3a392 |
|
18-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Removed ostream.last_failed_errno
It's been identical to ostream.stream_errno for a while now. |
981139bb2e446bb2050c1158614725f8413fd709 |
|
17-Jan-2015 |
Timo Sirainen <tss@iki.fi> |
lib: Added o_stream_create_passthrough() for creating simple wrapper ostreams |
eb98a038ca8b0ef33d1d11794803ce09547496fa |
|
17-Jan-2015 |
Timo Sirainen <tss@iki.fi> |
lib: Added o_stream_add_destroy_callback() |
d77fb3be552eefbfb9cdd43ff23d794796d7a36c |
|
09-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib: Updated comment to o_stream_send_istream() |
43834f87bf431198f986e86052a4f6e558fdb07d |
|
13-Jun-2014 |
Timo Sirainen <tss@iki.fi> |
lib: Added [io]_stream_create_fd_*autoclose()
These make it clearer that the fd parameter will be closed automatically
when the stream is closed.
Eventually (in v2.3) we'll want to get rid of the autoclose boolean
parameter in [io]_stream_create_fd(). |
10ff47d5d6146995e16da00d36eca7d162064a7b |
|
21-May-2014 |
Timo Sirainen <tss@iki.fi> |
lib: Added o_stream_is_corked(). |
556f95092c3bc850517d5ab2bb502024a55645f1 |
|
23-Apr-2014 |
Timo Sirainen <tss@iki.fi> |
Added o_stream_get_max_buffer_size() |
f4735bf7ec2019fdc730e9ebdb39e5a4ea580405 |
|
22-Sep-2013 |
Timo Sirainen <tss@iki.fi> |
lib: Added [io]_stream_create_error_str() |
862ec874f9373e3e499e237d3b9f71fdf1413fee |
|
19-Sep-2013 |
Timo Sirainen <tss@iki.fi> |
iostream: Added ability to set/get error strings for streams. |
e2ce8d4a6ac5d82a906178148453e7613fab9ba0 |
|
13-Mar-2013 |
Timo Sirainen <tss@iki.fi> |
iostreams: Added close_parent flag to close() handler and clarified close/destroy APIs.
This makes it unambiguous how things work: Unless you explicitly call
[io]_stream_close(), the parent streams won't be closed. This is what most
(hopefully all!) of the existing code expects.
I was wondering a bit if [io]_stream_destroy() should simply have been
removed and replaced with [io]_stream_unref() calls, since they would have
worked basically everywhere, but there might be some places where it's
better to have explicitly closed the stream (and where closing the parent
stream doesn't matter). |
0c1835a90dd1dcedaeaedd1cd91672299cbeb5be |
|
30-Sep-2012 |
Timo Sirainen <tss@iki.fi> |
Added [io]_stream_create_error() for creating streams that always fail reads/writes. |
27a44fcfd8d19bffe0f267f20a2b5d3fe7600fdd |
|
19-Aug-2012 |
Timo Sirainen <tss@iki.fi> |
Removed CONTEXT_TYPE_SAFETY macro and reimplemented its functionality better.
gcc/clang now gives a compiler error in many places if callback isn't
exactly what was expected. It's also now much easier to add more of these
checks. |
8b247780e911909a9fdc47f69ce6d1478902ad98 |
|
11-Aug-2012 |
Timo Sirainen <tss@iki.fi> |
Added o_stream_get_fd(). |
ceb43cc04edb94445fab8f914bc4da6d740403d1 |
|
30-Jun-2012 |
Timo Sirainen <tss@iki.fi> |
o_stream_nsend() comment update |
e2a88d59c0d47d63ce1ad5b1fd95e487124a3fd4 |
|
24-Jun-2012 |
Timo Sirainen <tss@iki.fi> |
Added o_stream_nsend*() and related functions to make delayed error handling safer.
Once o_stream_nsend*() is called, o_stream_nfinish() must be called before
stream is destroyed to finish checking if there were any errors. If
something failed and the stream is just wanted to be closed,
o_stream_ignore_last_errors() can be called.
For streams where errors don't really make any difference (network sockets)
you can call o_stream_set_no_error_handling() immediately after creating the
stream. |
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4 |
|
23-Jun-2012 |
Timo Sirainen <tss@iki.fi> |
Marked functions parameters that are allowed to be NULL. Some APIs were also changed.
The non-obvious APIs where NULL parameter was changed to "" are
master_service_init() and auth_master_user_list_init().
These checks can currently be enabled only on a patched clang:
http://llvm.org/bugs/show_bug.cgi?id=6786 |
71da447014454c84828d9dface77219875554d7d |
|
07-Sep-2011 |
Timo Sirainen <tss@iki.fi> |
Added o_stream_switch_ioloop() and implemented it to all ostreams. |
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188e |
|
06-Mar-2010 |
Timo Sirainen <tss@iki.fi> |
i/ostreams can now have a name (e.g. file path).
--HG--
branch : HEAD |
de954ff15b495be13007a8aca2c09fd1d356a283 |
|
16-Oct-2009 |
Timo Sirainen <tss@iki.fi> |
Added o_stream_get_buffer_avail_size().
--HG--
branch : HEAD |
b565a6a7a66fb9f224d00c06a950e3c1c585c18e |
|
30-Jun-2009 |
Timo Sirainen <tss@iki.fi> |
Added o_stream_create_buffer() for having output stream write to a buffer.
--HG--
branch : HEAD |
8cdb3234fe3c77e477c7a0e6934678f58fc54d4d |
|
25-Feb-2009 |
Timo Sirainen <tss@iki.fi> |
Added o_stream_pwrite().
--HG--
branch : HEAD |
683eebe490bbe5caec246c535a10ea9f93f5c330 |
|
27-Aug-2008 |
Timo Sirainen <tss@iki.fi> |
Updated o_stream_flush() comment.
--HG--
branch : HEAD |
68a4946b12583b88fa802e52ebee45cd96056772 |
|
20-Jun-2008 |
Timo Sirainen <tss@iki.fi> |
Added more consts, ATTR_CONSTs and ATTR_PUREs.
--HG--
branch : HEAD |
6cc0546c058f3e6253c6f99727b28dd602712974 |
|
24-Nov-2007 |
Timo Sirainen <tss@iki.fi> |
Added last_failed_errno to ostream to make error handling easier with files.
--HG--
branch : HEAD |
252db51b6c0a605163326b3ea5d09e9936ca3b29 |
|
15-Sep-2007 |
Timo Sirainen <tss@iki.fi> |
Renamed struct _[io]stream to struct [io]stream_private. Also removed _
prefix from _[io]stream_*() functions.
--HG--
branch : HEAD |
c25356d5978632df6203437e1953bcb29e0c736f |
|
16-Sep-2007 |
Timo Sirainen <tss@iki.fi> |
Changed .h ifdef/defines to use <NAME>_H format.
--HG--
branch : HEAD |
93fa87cf1a96c4f279ec4f5c311820313ba12c34 |
|
02-Aug-2007 |
Timo Sirainen <tss@iki.fi> |
Split o_stream_create_file() to _create_fd() and _create_fd_file().
--HG--
branch : HEAD |
fe363b433b8038a69b55169da9dca27892ad7d18 |
|
24-Jul-2007 |
Timo Sirainen <tss@iki.fi> |
Removed memory pool parameter from iostreams. Default pool was almost always
used, and the stream usually required destroying anyway so it didn't even
make freeing memory easier.
--HG--
branch : HEAD |
d7e72877b7a5085c3addf9729d0bfbe1b5357853 |
|
11-Mar-2007 |
Timo Sirainen <tss@iki.fi> |
Updated o_stream_send_istream() comments
--HG--
branch : HEAD |
59151b71059df1190acd75d8717ed04a7920c862 |
|
15-Dec-2006 |
Timo Sirainen <tss@iki.fi> |
Added context parameter type safety checks for most callback APIs.
--HG--
branch : HEAD |
cd56a23e21f1df3f79648cf07e2f4385e2fadebb |
|
25-Feb-2006 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_destroy() and o_stream_destroy() and used them instead of
*_stream_unref() where possible. Fixes at least one problem with io_remove()
being called after socket was closed, which caused problems with epoll.
--HG--
branch : HEAD |
d5cebe7f98e63d4e2822863ef2faa4971e8b3a5d |
|
14-Jan-2006 |
Timo Sirainen <tss@iki.fi> |
deinit, unref, destroy, close, free, etc. functions now take a pointer to
their data pointer, and set it to NULL. This makes double-frees less likely
to cause security holes.
--HG--
branch : HEAD |
6ef7e31619edfaa17ed044b45861d106a86191ef |
|
13-Jan-2006 |
Timo Sirainen <tss@iki.fi> |
Added "bool" type and changed all ints that were used as booleans to bool.
--HG--
branch : HEAD |
0ce5f96804e81cb0f857e7df32c0272f1eed9377 |
|
25-Sep-2005 |
Timo Sirainen <tss@iki.fi> |
Changed iov_count to be unsigned int, it's large enough. Added overflow-flag
which gets sent if send() failed to both send and buffer the given data.
--HG--
branch : HEAD |
5238111c460098d9cc8cc22527026138a278b9a4 |
|
26-Apr-2005 |
Timo Sirainen <tss@iki.fi> |
o_stream_uncork() was previously always setting IO_WRITE handler even if
there was no reason for it. This was relied on in imap/pop3 code when a
handler could just send as much data as it can without actually buffering
anything.
So, removed the IO_WRITE handler forcing. It's only set if there's actually
data in buffer or if flush_pending is set (via o_stream_set_flush_pending()
or by returning 0 from flush callback handler).
All in all, a minor optimization.
--HG--
branch : HEAD |
211ed7806d8715ec2280ffbf5d10f0d6e4f1beb2 |
|
20-Oct-2004 |
Timo Sirainen <tss@iki.fi> |
Changed ostream's flush callback to have return value which can tell if
there are more bytes to be sent even if there is none in output buffer
itself. Fixes FETCH commands which used o_stream_send_istream() getting
stuck.
--HG--
branch : HEAD |
2767104d81e97a109f0aa9758792bfa1da325a97 |
|
15-Aug-2004 |
Timo Sirainen <tss@iki.fi> |
We never do blocking reads/writes to network anymore. Changed imap and pop3
processes to use a single I/O loop.
Not much tested yet, and currently LIST/LSUB may eat too much memory and
APPEND eats all CPU.
--HG--
branch : HEAD |
9b7eeffb5752b500ac62ba1fd01c4a8c4ada14e9 |
|
28-Jun-2004 |
Timo Sirainen <tss@iki.fi> |
Allow giving 0 max_buffer_size, in which case "optimal" size is used.
--HG--
branch : HEAD |
007d354a674fb3ddf49db160cf050cf61270a1a0 |
|
23-May-2003 |
Timo Sirainen <tss@iki.fi> |
Removed I/O priorities. They were pretty much useless and were just getting
in way.
--HG--
branch : HEAD |
03f5c621d06d6b6d77a145196c9633a7aa64dc78 |
|
19-Feb-2003 |
Timo Sirainen <tss@iki.fi> |
o_stream_send_istream() is now safe to use for moving data within file.
--HG--
branch : HEAD |
daf029d2a627daa39d05507140f385162828172e |
|
23-Jan-2003 |
Timo Sirainen <tss@iki.fi> |
More type safety to i/o streams
--HG--
branch : HEAD |
f923659c0e5298263d80622c99f4dc4132b4675b |
|
11-Jan-2003 |
Timo Sirainen <tss@iki.fi> |
Naming change for function typedefs.
--HG--
branch : HEAD |
c0435c854a0e7246373b9752d163095cc4fbe985 |
|
05-Jan-2003 |
Timo Sirainen <tss@iki.fi> |
Naming style changes, finally got tired of most of the typedefs. Also the
previous enum -> macro change reverted so that we don't use the highest bit
anymore, that's incompatible with old indexes so they will be rebuilt.
--HG--
branch : HEAD |
555ebb032f9b8f0cdb66f27ce7374734833e7cac |
|
19-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Buffer related cleanups. Use PATH_MAX instead of hardcoded 1024 for paths.
Added str_path() and str_ppath() functions. i_snprintf() now returns only -1
or 0 depending on if buffer got full. dec2str() returns the string allocated
from data stack. Instead of just casting to (long) or (int), we now use
dec2str() with printf-like functions. Added o_stream_send_str(). Added
strocpy() and replaced all strcpy()s and strncpy()s with it.
Pretty much untested, hope it doesn't break too badly :)
--HG--
branch : HEAD |
ecc81625167ed96c04c02aa190a1ea5baa65b474 |
|
06-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Renamed IBuffer and OBuffer to IStream and OStream which describes their
functionality better. I tried to keep the variable names and comments also
sensible.
--HG--
branch : HEAD |