[exim-cvs] Replace recv() by read() (Bug 2656)

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Replace recv() by read() (Bug 2656)
Gitweb: https://git.exim.org/exim.git/commitdiff/f5107e39b94bd7d304dbe3ec766b5eecd647fe00
Commit:     f5107e39b94bd7d304dbe3ec766b5eecd647fe00
Parent:     0dfff3282dcfbee8f1568797c2acd4983674c0d9
Author:     Heiko Schlittermann (HS12-RIPE) <hs@???>
AuthorDate: Fri Oct 2 08:17:39 2020 +0200
Committer:  Heiko Schlittermann (HS12-RIPE) <hs@???>
CommitDate: Sun Oct 4 11:23:35 2020 +0200


    Replace recv() by read() (Bug 2656)
---
 src/src/smtp_in.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index c0b6b2a..3941667 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -1128,7 +1128,7 @@ if (cr != NULL)

 while (capacity > 0)
   {
-  do { ret = recv(fd, to, 1, 0); } while (ret == -1 && errno == EINTR);
+  do { ret = read(fd, to, 1); } while (ret == -1 && errno == EINTR);
   if (ret == -1)
     return -1;
   have++;
@@ -1253,7 +1253,7 @@ do
   don't do a PEEK into the data, actually slurp up enough to be
   "safe". Can't take it all because TLS-on-connect clients follow
   immediately with TLS handshake. */
-  ret = recv(fd, &hdr, PROXY_INITIAL_READ, 0);
+  ret = read(fd, &hdr, PROXY_INITIAL_READ);
   }
   while (ret == -1 && errno == EINTR);


@@ -1269,7 +1269,7 @@ if ((ret == PROXY_INITIAL_READ) && (memcmp(&hdr.v2, v2sig, sizeof(v2sig)) == 0))
   /* First get the length fields. */
   do
     {
-    retmore = recv(fd, (uschar*)&hdr + ret, PROXY_V2_HEADER_SIZE - PROXY_INITIAL_READ, 0);
+    retmore = read(fd, (uschar*)&hdr + ret, PROXY_V2_HEADER_SIZE - PROXY_INITIAL_READ);
     } while (retmore == -1 && errno == EINTR);
   if (retmore == -1)
     goto proxyfail;
@@ -1306,7 +1306,7 @@ if ((ret == PROXY_INITIAL_READ) && (memcmp(&hdr.v2, v2sig, sizeof(v2sig)) == 0))
     {
     do
       {
-      retmore = recv(fd, (uschar*)&hdr + ret, size-ret, 0);
+      retmore = read(fd, (uschar*)&hdr + ret, size-ret);
       } while (retmore == -1 && errno == EINTR);
     if (retmore == -1)
       goto proxyfail;