Subject: select change in 2000c

From: [email-masked]
Date: Fri, 13 Jul 2001 09:52:32 -0700

[resending this email from the imap list -- several folks there
suggested the c-client list may be more appropriate to imapd than the
imap list. Sorry for the duplication.]

Greetings; I am about to release an updated imap package for our users,
and I wanted to see what changes are between 2000 and 2000c (the version
I think we should ship at the moment).

One of the changes worries me:
-      i = select (sock+1,0,&fds,&efds,ti ? &tmo : 0);
+      i = select (sock+1,&fds,0,&efds,ti ? &tmo : 0);

This change is sort of non-trivial, and I would love to know what this
change represents. The archives aren't terribly helpful, what with
'select' apparantly an IMAP command. :-/ The only thread that I think
may be releated is here:
http://www.washington.edu/imap/listarch/2000/msg00140.html

Could someone please explain the reason for this change, simple enough
that someone who doesn't know the uw-imap internals could understand? :)
(Feel free to assume basic tcp/ip and programming, though.. :)

Thanks!
Seth Arnold

The more complete change:
diff -Naur imap-2000/src/osdep/unix/tcp_unix.c imap-2000c/src/osdep/unix/tcp_unix.c
--- imap-2000/src/osdep/unix/tcp_unix.c Tue Oct 24 16:41:24 2000
+++ imap-2000c/src/osdep/unix/tcp_unix.c        Tue Jul 10 17:14:27 2001
@@ -10,7 +10,7 @@
  *             Internet: [email-masked]
  *
  * Date:       1 August 1988
- * Last Edited:        24 October 2000
+ * Last Edited:        8 November 2000
  *
  * The IMAP toolkit provided in this Distribution is
  * Copyright 2000 University of Washington.
@@ -282,7 +282,7 @@
     FD_SET (sock,&efds);
     do {                       /* block under timeout */
       tmo.tv_sec = ti ? ti - now : 0;
-      i = select (sock+1,0,&fds,&efds,ti ? &tmo : 0);
+      i = select (sock+1,&fds,0,&efds,ti ? &tmo : 0);
       now = time (0);
     } while (((i < 0) && (errno == EINTR)) || (ti && !i && (ti > now)));
     if (i > 0) {               /* success, make sure really connected */
@@ -300,12 +300,6 @@
       return -1;
     }
   }
-  for (i = 65536; (i > 4096) &&        /* set receive buffer size to 64K */
-       setsockopt (sock,SOL_SOCKET,SO_RCVBUF,(void *) &i,sizeof(i));
-       i -= 1024);
-  for (i = 65536; (i > 4096) &&        /* set send buffer size to 64K */
-       setsockopt (sock,SOL_SOCKET,SO_SNDBUF,(void *) &i,sizeof(i));
-       i -= 1024);
   return sock;                 /* return the socket */
 }
 ^L

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: [email-masked]
Date: Mon, 16 Jul 2001 13:10:32 -0500 (CDT)

Select is a basic TCP/IP call.  While I haven't looked into the
C-Client and IMAP sources for a while I have made some comments
inline. 
  
Bill Suetholz

> -      i = select (sock+1,0,&fds,&efds,ti ? &tmo : 0);
This line doesn't check to see if anything is available for reading, instead
it checks to see if any sockets are able to be written to.

> +      i = select (sock+1,&fds,0,&efds,ti ? &tmo : 0);
This line checks to see if any file descriptors have any data waiting to 
be read, and doesn't check to see if any sockets can be written to.

> +++ imap-2000c/src/osdep/unix/tcp_unix.c        Tue Jul 10 17:14:27 2001

----------------------------------
E-Mail: [email-masked]
Date: 16-Jul-01
Time: 13:06:06

This message was sent by XFMail
----------------------------------