[balsa] Fix occassional sio_ungetc() failures for a compressed connection.
- From: Pawel Salek <pawels src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [balsa] Fix occassional sio_ungetc() failures for a compressed connection.
- Date: Tue, 26 Jan 2010 21:56:43 +0000 (UTC)
commit 3bba3fee98457ae3e57217f0bff26258d7dbe1bc
Author: Pawel Salek <pawsa damage localdomain>
Date: Tue Jan 26 22:56:35 2010 +0100
Fix occassional sio_ungetc() failures for a compressed connection.
ChangeLog | 5 +++++
libbalsa/imap/siobuf.c | 8 ++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 77c7670..9f6a722 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-25 Pawel Salek
+
+ * libbalsa/imap/siobuf.c: fix occassional sio_ungetc() failures
+ for a compressed connection.
+
2010-01-25 Peter Bloomfield
* libbalsa/filter-funcs.c (lbcond_compare_string_conditions),
diff --git a/libbalsa/imap/siobuf.c b/libbalsa/imap/siobuf.c
index 2f92581..225bc0d 100644
--- a/libbalsa/imap/siobuf.c
+++ b/libbalsa/imap/siobuf.c
@@ -60,6 +60,8 @@ struct siobuf
int milliseconds; /* Timeout in ms */
char *read_buffer; /* client read buffer */
+ const char *read_buffer_start; /* client read buffer start, for
+ ungetc error checking. */
char *read_position; /* client read buffer pointer */
int read_unread; /* number of bytes unread in buffer */
@@ -584,6 +586,7 @@ sio_fill (struct siobuf *sio)
if (sio->read_unread < 0)
break;
}
+ sio->read_buffer_start = sio->read_position;
if (sio->read_unread <= 0)
return 0;
} else {
@@ -591,7 +594,8 @@ sio_fill (struct siobuf *sio)
if (sio->read_unread <= 0)
return 0;
sio->read_position = sio->read_buffer;
- }
+ sio->read_buffer_start = sio->read_position;
+ }
if (sio->monitor_cb != NULL && sio->read_unread > 0)
(*sio->monitor_cb) (sio->read_position, sio->read_unread,
@@ -638,7 +642,7 @@ sio_getc(struct siobuf *sio)
int
sio_ungetc(struct siobuf *sio)
{
- if(sio->read_position>sio->read_buffer) {
+ if(sio->read_position>sio->read_buffer_start) {
sio->read_position--;
sio->read_unread++;
return 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]