fetchmail-friends
[Top] [All Lists]

[fetchmail]duplicate code in socket.c

2002-06-21 00:47:16
Here is a (trivial) patch to remove the duplicate code in SockWrite
and SockPeek to keep things consistent with SockRead.

Sunil Shetye.

===========================================
diff -Naur fetchmail-5.9.12.orig/socket.c fetchmail-5.9.12/socket.c
--- fetchmail-5.9.12.orig/socket.c      Fri Jun 21 11:34:05 2002
+++ fetchmail-5.9.12/socket.c   Fri Jun 21 11:49:17 2002
@@ -520,10 +520,8 @@
        if( NULL != ( ssl = SSLGetContext( sock ) ) )
                n = SSL_write(ssl, buf, len);
        else
-               n = fm_write(sock, buf, len);
-#else
-        n = fm_write(sock, buf, len);
-#endif
+#endif /* SSL_ENABLE */
+           n = fm_write(sock, buf, len);
         if (n <= 0)
             return -1;
         len -= n;
@@ -688,14 +686,10 @@
 
                        return 0;       /* Give him a '\0' character */
                }
-       } else {
-               n = fm_peek(sock, &ch, 1);
        }
-#else
-
-        n = fm_peek(sock, &ch, 1);
-
+       else
 #endif /* SSL_ENABLE */
+           n = fm_peek(sock, &ch, 1);
        if (n == -1)
                return -1;
 
===========================================

Sunil Shetye.


<Prev in Thread] Current Thread [Next in Thread>
  • [fetchmail]duplicate code in socket.c, Sunil Shetye <=