diff options
author | Not Zed <NotZed@Ximian.com> | 2001-01-16 11:54:45 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-01-16 11:54:45 +0800 |
commit | e3a451cb33cad9dada930fd5111bcc6c341d5a2b (patch) | |
tree | 3bee6ca799aa5e36d8c6d1a0474ab7091e688a2e /camel/camel-stream-fs.c | |
parent | e202430d41d6b793e94d7ac0d252de826e80991b (diff) | |
download | gsoc2013-evolution-e3a451cb33cad9dada930fd5111bcc6c341d5a2b.tar.gz gsoc2013-evolution-e3a451cb33cad9dada930fd5111bcc6c341d5a2b.tar.zst gsoc2013-evolution-e3a451cb33cad9dada930fd5111bcc6c341d5a2b.zip |
Chganged len back to be unsigned. And do a simple range check on the
2001-01-16 Not Zed <NotZed@Ximian.com>
* camel-folder-summary.c (camel_folder_summary_decode_string):
Chganged len back to be unsigned. And do a simple range check on
the string value to try and detect corrupted summary files.
* providers/imap/camel-imap-command.c (imap_read_untagged): Handle
cancelled stream reads with an appropriate exception.
* providers/imap/camel-imap-private.h: Fix the include-once
macro. Doh, confliced with camel-private.h.
* providers/imap/camel-imap-store.c (imap_store_refresh_folders):
A copy of camel_remote_store_refresh_folders. We avoid locking
each folder when we call it though. This should be removed when i
can work out how to remove the folder lock from this function
easily.
* camel-stream-fs.c (stream_write): Fix n' argument of select.
(stream_read): Likewise.
* camel-remote-store.c (socket_connect): Bump the connect timeout
upto 4 minutes.
(socket_connect): Oops, fix the 'n' argument of select.
* camel-session.c (camel_cancel_cancel): If we are given no
cancellation node, then do it for all active ones.
svn path=/trunk/; revision=7526
Diffstat (limited to 'camel/camel-stream-fs.c')
-rw-r--r-- | camel/camel-stream-fs.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c index 7047670832..92c11435fa 100644 --- a/camel/camel-stream-fs.c +++ b/camel/camel-stream-fs.c @@ -227,13 +227,15 @@ stream_read (CamelStream *stream, char *buffer, size_t n) } else { fd_set rdset; long flags; + int fdmax; fcntl(stream_fs->fd, F_GETFL, &flags); fcntl(stream_fs->fd, F_SETFL, flags | O_NONBLOCK); FD_ZERO(&rdset); FD_SET(stream_fs->fd, &rdset); FD_SET(cancel_fd, &rdset); - select((stream_fs->fd+cancel_fd)/2+1, &rdset, 0, 0, NULL); + fdmax = MAX(stream_fs->fd, cancel_fd)+1; + select(fdmax, &rdset, 0, 0, NULL); if (FD_ISSET(cancel_fd, &rdset)) { fcntl(stream_fs->fd, F_SETFL, flags); errno = EINTR; @@ -277,6 +279,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n) } else { fd_set rdset, wrset; long flags; + int fdmax; fcntl(stream_fs->fd, F_GETFL, &flags); fcntl(stream_fs->fd, F_SETFL, flags | O_NONBLOCK); @@ -284,7 +287,8 @@ stream_write (CamelStream *stream, const char *buffer, size_t n) FD_ZERO(&wrset); FD_SET(stream_fs->fd, &wrset); FD_SET(cancel_fd, &rdset); - select((stream_fs->fd+cancel_fd)/2+1, &rdset, &wrset, 0, NULL); + fdmax = MAX(stream_fs->fd, cancel_fd)+1; + select(fdmax, &rdset, &wrset, 0, NULL); if (FD_ISSET(cancel_fd, &rdset)) { fcntl(stream_fs->fd, F_SETFL, flags); errno = EINTR; |