]> code.citadel.org Git - citadel.git/blobdiff - citadel/clientsocket.c
SMTP Async I/O:
[citadel.git] / citadel / clientsocket.c
index 91094aa8a615295006c8d49da6addd7db698b5d1..572f28f17c1293d324b732e51b11261fbda33a28 100644 (file)
@@ -264,7 +264,9 @@ INLINE int sock_read(int *sock, char *buf, int bytes, int keep_reading_until_ful
  * sock_write() - send binary to server.
  * Returns the number of bytes written, or -1 for error.
  */
-int sock_write(int *sock, const char *buf, int nbytes)
+int sock_write(int *sock, const char *buf, int nbytes) 
+{ return sock_write_timeout(sock, buf, nbytes, 50); }
+int sock_write_timeout(int *sock, const char *buf, int nbytes, int timeout)
 {
        int nSuccessLess = 0;
        int bytes_written = 0;
@@ -272,7 +274,6 @@ int sock_write(int *sock, const char *buf, int nbytes)
        fd_set rfds;
         int fdflags;
        int IsNonBlock;
-       int timeout = 50;
        struct timeval tv;
        int selectresolution = 100;