038c2831447440bf0bef89b43dd0968afc298abc |
|
30-Jan-2018 |
Stephan Bosch <stephan.bosch@dovecot.fi> |
lib: istream: Allow switching to a specific ioloop. |
50977ed6891faabe013ffd1905667b91261c3eb9 |
|
25-Jan-2018 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: i_stream_read_more() - assert it can't return -2 |
a215abacb2d2d1e1bcd475756aab809038ae4277 |
|
07-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add i_stream_get_last_read_time() |
19557f192d37cd54a1a090a8a26d9d47265e4413 |
|
01-Nov-2017 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
global: Fix spelling mistakes in comments
Original work by @andreasschulze and @jsoref |
e0fab14602b73ff590b2a9c5d9e67e2dfb5d1f9e |
|
01-Nov-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: i_stream_read() - Use snapshots
This guarantees that data returned by i_stream_get_data() won't be freed
until the next i_stream_read() returns >0. This is mainly important,
because often the error handling for <=0 doesn't update the buffer
pointers correctly and it leads to complicated bugs where already freed
memory is attempted to be read (but never written). |
1bc075e2e4ed422f9590c95c3ae223422b97ce6a |
|
30-Oct-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
global: Rename i_stream_is_eof() to i_stream_read_eof()
This describes its behavior a bit better. |
6a170d6d781094bdc75f027b6456dde160fbde39 |
|
30-Oct-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Improve i_stream_is_eof() comment |
7b29ccd796fc75af86f827192d2f8c0e8f0087bb |
|
30-Oct-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Update struct istream comments |
0b6924ad1943fe5c6917fc49f675d8f316b0d939 |
|
05-Oct-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add i_stream_set_blocking() |
a9a928e40e3b691924c8e5e444e3e1a4320aa3bd |
|
12-Aug-2016 |
Stephan Bosch <stephan@rename-it.nl> |
lib: Implemented i_stream_create_copy_from_data().
Unlike i_stream_create_from_data(), this function makes a copy of the provided data block. This way, the application does not need to worry about keeping it allocated for the lifetime of the stream.
The copied data is allocated durably on the system pool and freed once the stream is destroyed. |
6657aee0bb6c603b4ee5111388b93c1a8a9ad680 |
|
02-Aug-2016 |
Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi> |
lib: return non-NULL pointer in i_stream_get_data when size is 0 |
87a6b7df39d6822a5a8289a62f32deabff9b75e4 |
|
06-Jul-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Updated istream's stream_errno comments. |
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. |
71aed7ba87b5fd5e96e97a22d89ac025b883d60a |
|
01-Jun-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: i_stream_get_max_buffer_size() checks also parents' max sizes
This fixes i_stream_get_max_buffer_size() to work correctly with
istream-chain. |
573424407a2d3c1453638a643583a7cf10c129e1 |
|
16-May-2016 |
Phil Carmody <phil@dovecot.fi> |
lib: istream - more migration to i_stream_read_bytes()
This time a coccinelle semantic patch, again hand checked:
git grep 'i_stream_read_data' | sed s/:.*// | \
while read f; do spatch --sp-file istream.cocci --in-place "$f" ; done
-- 8< --- istream.cocci ---
@@
expression e1, e2, e3, e4;
@@
- i_stream_read_data(e1, e2, e3, e4 - 1)
+ i_stream_read_bytes(e1, e2, e3, e4)
-- 8< --- end
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
534e41e436a7546f36f61e0dc49c0c191d850f6b |
|
16-May-2016 |
Phil Carmody <phil@dovecot.fi> |
lib: istream - migrate to i_stream_read_bytes()
Scripted to pick off the low hanging fruit, one liners with an explicit
'-1' in the final parameter, but hand-checked.
git grep 'i_stream_read_data.*, [^,]*- \?1)' | sed s/:.*// | \
xargs sed -i -e 's/i_stream_read_data(\(.*\), \(.*\), \(.*\), \(.*[^ ]\) \?- \?1)/i_stream_read_bytes(\1, \2, \3, \4)/'
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
09142ea11662746ea07475b1a4f69a6a406fb996 |
|
16-May-2016 |
Phil Carmody <phil@dovecot.fi> |
lib: istream - provide alternatives to i_stream_read_data()
Providing as a parameter the number of bytes that you would be
disappointed to receive was confusing compared to providing the
number that you would be happy to receive. This lets us get rid
of all the '-1's in the callers. The callers which used 0 as
a parameter were so common that it's worth providing a separate
API just to simplify their demands.
Deep down, these are still the same underlying function. Currently
we route the new API through the old one, but eventually, the old
API can be routed through the new one, so that the friendlier
interface has the simplest implementation.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
5af5137f6dc0c9f358b7813e941e26f7bd735b3a |
|
06-May-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Added i_stream_get_disconnect_reason() |
463f6ea04af934a68facaca0ff089bc306de3f98 |
|
11-Feb-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Added i_stream_set_persistent_buffers() |
46ce4d9273e6df12ef1912bbdb1c8b84b104f394 |
|
11-Jan-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: i_stream_get_error() now returns "EOF" if stream_errno==0 and eof==TRUE.
This can be used to replace a lot of code like:
input->stream_errno == 0 ? "EOF" : i_stream_get_error(input)
with simply:
i_stream_get_error(input) |
212a34c06ff45952c008ae9eec387ced783de6cf |
|
09-Feb-2015 |
Phil Carmody <phil@dovecot.fi> |
lib: istream create helpers for common cases
Several clients want to create streams from buffer_t and
string_t, we may as well make it easy for them
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
4106a25399703eb6cbb166dcbd5bb932cb2f7ad2 |
|
19-Jun-2014 |
Timo Sirainen <tss@iki.fi> |
lib: i_stream_get_data() should also reset eof=FALSE if it truncates the output. |
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(). |
4c096615cb86a826fda377b87df22c579bfe5525 |
|
03-Apr-2014 |
Timo Sirainen <tss@iki.fi> |
Added io_add_istream() and related functionality for combining the ioloop/istream.
The idea here is that it's possible to implement asynchronous istreams when
there isn't a file descriptor that can be used to reliably receive updates. |
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. |
1a0ece3e873e3864269ed7eaed957dc10c56d25f |
|
07-Apr-2013 |
Timo Sirainen <tss@iki.fi> |
istream API change: Added support for multiple destroy callbacks. |
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). |
a0b6b441fc679e562e79be0fb2819ffc24ab5b74 |
|
14-Jan-2013 |
Timo Sirainen <tss@iki.fi> |
i_stream_read_next_line() now sets stream_errno=ENOBUFS if input buffer gets full.
Previously the caller couldn't easily separate this condition from "more
data needed", potentially causing infinite loops. |
0c1835a90dd1dcedaeaedd1cd91672299cbeb5be |
|
30-Sep-2012 |
Timo Sirainen <tss@iki.fi> |
Added [io]_stream_create_error() for creating streams that always fail reads/writes. |
01f4ee4a0243f3fe9af763e1a540cd5cff0d63f5 |
|
28-Aug-2012 |
Timo Sirainen <tss@iki.fi> |
i_stream_stat() API changed.
This fixes also one missing error check. |
bdcb00145ad87765e3fd22d4ebc4d2c029a326b9 |
|
22-Aug-2012 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_create_range() |
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. |
6f08b98ac63c25b747120d0c8f8e319b4e26ab0f |
|
12-Aug-2012 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_last_line_crlf() |
3785910c303507db5f629684e6dde2cc7f83668e |
|
25-Jun-2012 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_get_data_size(). Used it where possible. |
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 |
c28f6aa0b70af4811c9ace9114fe827c2f503455 |
|
14-Dec-2011 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_unset_destroy_callback() |
923115fd382904fa13bb09bf307bf2835b52df60 |
|
01-Oct-2010 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_get_absolute_offset(). |
0a49b316fc729e5d57268ffa63c7122ac73f994c |
|
12-Aug-2010 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_get_max_buffer_size(). |
09801f106cd531a28b4e03ec665e44c421264560 |
|
15-Jul-2010 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_create_file() for creating istream from lazily opened file. |
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188e |
|
06-Mar-2010 |
Timo Sirainen <tss@iki.fi> |
i/ostreams can now have a name (e.g. file path).
--HG--
branch : HEAD |
7662010b03ffe5f2a6ecf4b4eb220d1c65efea76 |
|
13-Aug-2009 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_set_init_buffer_size().
--HG--
branch : HEAD |
da2aa032ccfa8e7e4a4380ef738014549f4d2c2d |
|
28-Jun-2009 |
Timo Sirainen <tss@iki.fi> |
Added struct istream.readable_fd, which is used to determine if sendfile() can be used.
--HG--
branch : HEAD |
a3c197999dfe2b0c8ea38cb77cfa5e95026005c0 |
|
20-Mar-2009 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_is_eof().
--HG--
branch : HEAD |
4b9f99761df5014c659cd87fddaf6854af428cfc |
|
25-Feb-2009 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_get_size(). Use it instead of i_stream_stat() where possible.
--HG--
branch : HEAD |
51e1a1c280ccb461a15827f7987d09cb9708b6e3 |
|
19-Nov-2008 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_set_return_partial_line().
--HG--
branch : HEAD |
699fdc186f982f70d990820796eaa0f12133e27c |
|
08-Jul-2008 |
Timo Sirainen <tss@iki.fi> |
i_stream_read_data() comment update.
--HG--
branch : HEAD |
282a436a74d8835edb45cc019b1c916013013fd3 |
|
20-Jun-2008 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_add_data().
--HG--
branch : HEAD |
68a4946b12583b88fa802e52ebee45cd96056772 |
|
20-Jun-2008 |
Timo Sirainen <tss@iki.fi> |
Added more consts, ATTR_CONSTs and ATTR_PUREs.
--HG--
branch : HEAD |
10c96a244935de4add8213ba0b894178dfb889a5 |
|
22-Dec-2007 |
Timo Sirainen <tss@iki.fi> |
Removed v_start_offset parameter from i_stream_create_limit(). We'll always
use input->v_offset now.
--HG--
branch : HEAD |
5ac0b0bf32898c63da086ae169674ecac151a31e |
|
22-Dec-2007 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_set_destroy_callback().
--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 |
2526d52441ef368215ab6bf04fd0356d3b09d235 |
|
02-Aug-2007 |
Timo Sirainen <tss@iki.fi> |
Renamed i_stream_create_file() to i_stream_create_fd().
--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 |
c06f4017027263cf3a08becc551f5126409e2a83 |
|
05-Feb-2007 |
Timo Sirainen <tss@iki.fi> |
Added istream->blocking setting. It's now used to assert-crash early if a
blocking stream unexpectedly returns "need more data".
--HG--
branch : HEAD |
8d80659e504ffb34bb0c6a633184fece35751b18 |
|
28-Jun-2006 |
Timo Sirainen <tss@iki.fi> |
Array API redesigned to work using unions. It now provides type safety
without having to enable DEBUG, as long as the compiler supports typeof().
Its API changed a bit. It now allows directly accessing the array contents,
although that's not necessarily recommended. Changed existing array usage to
be type safe in a bit more places. Removed array_t completely. Also did
s/modifyable/modifiable/.
--HG--
branch : HEAD |
49e358eebea107aad9919dcc4bd88cee8519ba2e |
|
30-May-2006 |
Timo Sirainen <tss@iki.fi> |
Include <sys/stat.h> before using struct stat, because some systems may use
a macro to define struct stat to something else.
--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 |
08fb191d6148feb3ed14e2d6c625cd248dd1c1d4 |
|
04-Nov-2005 |
Timo Sirainen <tss@iki.fi> |
API description update
--HG--
branch : HEAD |
7d207b1e77a7b5e3fda640e353acfc86d261fedf |
|
08-Oct-2005 |
Timo Sirainen <tss@iki.fi> |
Added exact parameter to i_stream_stat()
--HG--
branch : HEAD |
602a0434db30d8e3292d1c161a803d96a879a74f |
|
30-Sep-2005 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_seek_mark() and used it
--HG--
branch : HEAD |
137ea7ca34005345aa2304a940149b7f3774d727 |
|
07-Aug-2005 |
Timo Sirainen <tss@iki.fi> |
s/occured/occurred/
--HG--
branch : HEAD |
07e4875d250e7a7157cd99132aafc773cf3cdf83 |
|
29-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
Replaced i_stream_get_size() with i_stream_stat(). Added i_stream_sync().
--HG--
branch : HEAD |
e0c3d5460d1cc0c440cb7723c8c2eef8d0afe9b9 |
|
29-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
i_stream_next_line() works now even if the stream buffer can't be directly
modified.
--HG--
branch : HEAD |
411d6baa37f31d90730e90c4a28c43e1974bbe58 |
|
28-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
Added seekable variable to struct istream.
--HG--
branch : HEAD |
7e1f68ad71d3485f1882142837b01f7a98ca8467 |
|
20-Oct-2004 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_have_bytes_left().
--HG--
branch : HEAD |
65cb456a072219fa35b55695d476b0bf51e2d735 |
|
15-Sep-2004 |
Timo Sirainen <tss@iki.fi> |
i_stream_read_data(): return 0 if i_stream_read() returned 0.
--HG--
branch : HEAD |
9e095dd6a77097356aca8216356d4d71ef1bea45 |
|
22-Aug-2004 |
Timo Sirainen <tss@iki.fi> |
Removed istream.disconnected, it's too much of a special case and the only
place where it's needed will be removed soon. Added istream.eof back, it's
more useful.
--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 |
8bdf70ab07588d57373f5f19abb8577985ff358a |
|
18-Jun-2004 |
Timo Sirainen <tss@iki.fi> |
Renamed istream->eof to istream->disconnected which is what it currently
does.
--HG--
branch : HEAD |
dd62b77c932d1b518f2a3e4bf80e36542becc256 |
|
09-Nov-2003 |
Timo Sirainen <tss@iki.fi> |
istream rewrite. instead of directly setting any limits to stream, you now
have to use i_stream_create_limit() to existing stream. this should make the
istreams much easier to create and understand how they work.
--HG--
branch : HEAD |
6449bd276af37b3e0b81a9c47ecd01f39a2cba53 |
|
05-Nov-2003 |
Timo Sirainen <tss@iki.fi> |
Added istream->eof. istream->v_size is now set to 0 with files.
--HG--
branch : HEAD |
89e195dfb5c4b0efd9b9f459771a4467674e5b1f |
|
10-Mar-2003 |
Timo Sirainen <tss@iki.fi> |
Added i_stream_read_next_line()
--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 |
a3ea111cfdbfd4f32baeb0bd7f1d72568c60a023 |
|
04-Jan-2003 |
Timo Sirainen <tss@iki.fi> |
Use unsigned char* when accessing non-NUL terminating strings. Compiler
warnings would then notify about accidentally passing them to functions which
require them NUL-terminated. Changed a few functions to use void* to avoid
unneeded casting.
--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 |