From e3a451cb33cad9dada930fd5111bcc6c341d5a2b Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 16 Jan 2001 03:54:45 +0000 Subject: Chganged len back to be unsigned. And do a simple range check on the 2001-01-16 Not Zed * 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 --- camel/camel-remote-store.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'camel/camel-remote-store.c') diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c index 9e7a60e378..993d9b5778 100644 --- a/camel/camel-remote-store.c +++ b/camel/camel-remote-store.c @@ -241,6 +241,7 @@ static int socket_connect(struct hostent *h, int port) } else { fd_set rdset, wrset; long flags; + int fdmax; fcntl(fd, F_GETFL, &flags); fcntl(fd, F_SETFL, flags | O_NONBLOCK); @@ -258,9 +259,10 @@ static int socket_connect(struct hostent *h, int port) FD_ZERO(&wrset); FD_SET(fd, &wrset); FD_SET(cancel_fd, &rdset); + fdmax = MAX(fd, cancel_fd)+1; tv.tv_usec = 0; - tv.tv_sec = 30; - if (select((fd+cancel_fd)/2+1, &rdset, &wrset, 0, &tv) == 0) { + tv.tv_sec = 60*4; + if (select(fdmax, &rdset, &wrset, 0, &tv) == 0) { close(fd); errno = ETIMEDOUT; return -1; -- cgit v1.2.3