OSSP CVS Repository

ossp - Check-in [1134]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1134
Date: 2001-Oct-09 21:58:46 (local)
2001-Oct-09 19:58:46 (UTC)
User:rse
Branch:
Comment: According to STEVENS' "Unix Network Programming, Vol.1" (p.412) we have to close the socket if a connection timeout occured to make sure that the TCP three-way handshake does not proceed further.
Tickets:
Inspections:
Files:
ossp-pkg/sa/sa.c      1.23 -> 1.24     2 inserted, 0 deleted

ossp-pkg/sa/sa.c 1.23 -> 1.24

--- sa.c 2001/10/09 18:55:22     1.23
+++ sa.c 2001/10/09 19:58:46     1.24
@@ -1143,6 +1143,7 @@
             goto done;
         }
         else if (n == 0) {
+            close(sa->fdSocket); /* stop TCP three-way handshake */
             rv = SA_ERR_TMT;
             goto done;
         }
@@ -1159,6 +1160,7 @@
 
         /* optionally set errno */
         if (error != 0) {
+            close(sa->fdSocket); /* just in case */
             errno = error;
             rv = SA_ERR_SYS;
         }

CVSTrac 2.0.1