Mercurial > dovecot > original-hg > dovecot-1.2
changeset 918:23b42ffe8756 HEAD
Removed cr_lookup_pos optimization with i_stream_next_line(). It breaks if
the stream is used with anything else and it's probably not worth fixing.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 07 Jan 2003 19:44:23 +0200 |
parents | 5f52674b3a58 |
children | 5ebec31b49e0 |
files | src/lib/istream-file.c src/lib/istream-internal.h src/lib/istream.c |
diffstat | 3 files changed, 3 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/istream-file.c Tue Jan 07 01:28:19 2003 +0200 +++ b/src/lib/istream-file.c Tue Jan 07 19:44:23 2003 +0200 @@ -118,11 +118,6 @@ stream->pos - stream->skip); stream->pos -= stream->skip; - if (stream->skip > stream->cr_lookup_pos) - stream->cr_lookup_pos = 0; - else - stream->cr_lookup_pos -= stream->skip; - stream->skip = 0; }
--- a/src/lib/istream-internal.h Tue Jan 07 01:28:19 2003 +0200 +++ b/src/lib/istream-internal.h Tue Jan 07 19:44:23 2003 +0200 @@ -21,7 +21,7 @@ unsigned char *w_buffer; /* may be NULL */ size_t buffer_size; - size_t skip, pos, cr_lookup_pos; + size_t skip, pos; }; struct istream *_i_stream_create(struct _istream *_buf, pool_t pool, int fd,
--- a/src/lib/istream.c Tue Jan 07 01:28:19 2003 +0200 +++ b/src/lib/istream.c Tue Jan 07 19:44:23 2003 +0200 @@ -81,7 +81,7 @@ } /* reset buffer data */ - _stream->skip = _stream->pos = _stream->cr_lookup_pos = 0; + _stream->skip = _stream->pos = 0; } void i_stream_set_read_limit(struct istream *stream, uoff_t v_offset) @@ -169,7 +169,7 @@ /* @UNSAFE */ ret_buf = NULL; - for (i = _stream->cr_lookup_pos; i < _stream->pos; i++) { + for (i = _stream->skip; i < _stream->pos; i++) { if (_stream->buffer[i] == 10) { /* got it */ if (i > 0 && _stream->buffer[i-1] == '\r') @@ -185,7 +185,6 @@ } } - _stream->cr_lookup_pos = i; return ret_buf; }