OSSP CVS Repository

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

Check-in Number: 4605
Date: 2004-Jun-26 13:16:02 (local)
2004-Jun-26 11:16:02 (UTC)
User:rse
Branch:
Comment: Allow negative values for SA_OPTION_LINGER to cover the special case of l_onoff=1/l_linger=0 where a TCP RST based connection termination is performed on close(2).

Submitted by: Alexandre Balaban <abalaban@free.fr>

Tickets:
#48 LINGER on close
Inspections:
Files:
ossp-pkg/sa/ChangeLog      1.37 -> 1.38     7 inserted, 0 deleted
ossp-pkg/sa/THANKS      1.5 -> 1.6     1 inserted, 0 deleted
ossp-pkg/sa/sa.c      1.83 -> 1.84     2 inserted, 2 deleted
ossp-pkg/sa/sa.pod      1.40 -> 1.41     5 inserted, 2 deleted

ossp-pkg/sa/ChangeLog 1.37 -> 1.38

--- ChangeLog    2004/06/11 10:32:54     1.37
+++ ChangeLog    2004/06/26 11:16:02     1.38
@@ -11,6 +11,13 @@
   This is a list of all changes to OSSP sa.
   For a more brief summary please have a look at the NEWS file.
 
+  Changes between 1.2.1 and 1.2.2 (11-Jun-2004 to 26-Jun-2004)
+
+   o Allow negative values for SA_OPTION_LINGER to cover the
+     special case of l_onoff=1/l_linger=0 where a TCP RST
+     based connection termination is performed on close(2).
+     [Alexandre Balaban <abalaban@free.fr>]
+
   Changes between 1.2.0 and 1.2.1 (02-Apr-2003 to 11-Jun-2004)
 
    o Fix timeout implementation related to SO_RCVTIMEO/SO_SNDTIMEO.


ossp-pkg/sa/THANKS 1.5 -> 1.6

--- THANKS       2004/04/02 18:21:07     1.5
+++ THANKS       2004/06/26 11:16:02     1.6
@@ -17,6 +17,7 @@
   Credit has to be given to the following people who contributed ideas,
   bugfixes, hints, gave platform feedback, etc. (in alphabetical order):
 
+    o  Alexandre Balaban           <abalaban@free.fr>
     o  Ulrich Dessauer             <udessauer@agnitas.de>
     o  Brian T. Egleston           <brian@egleston.com>
     o  Michael van Elst            <mlelstv@serpens.de>


ossp-pkg/sa/sa.c 1.83 -> 1.84

--- sa.c 2004/06/11 10:30:34     1.83
+++ sa.c 2004/06/26 11:16:02     1.84
@@ -989,7 +989,7 @@
 #if defined(SO_LINGER)
                     struct linger linger;
                     linger.l_onoff  = (sa->optInfo[i].value == 0 ? 0 : 1);
-                    linger.l_linger = sa->optInfo[i].value;
+                    linger.l_linger = (sa->optInfo[i].value <= 0 ? 0 : sa->optInfo[i].value);
                     if (setsockopt(sa->fdSocket, SOL_SOCKET, SO_LINGER,
                                    (const void *)&linger,
                                    (socklen_t)sizeof(struct linger)) < 0)
@@ -1339,7 +1339,7 @@
         }
         case SA_OPTION_LINGER: {
 #if defined(SO_LINGER)
-            int amount = ((int)va_arg(ap, int) ? 1 : 0);
+            int amount = (int)va_arg(ap, int);
             sa->optInfo[SA_OPTION_LINGER].value = amount;
             sa->optInfo[SA_OPTION_LINGER].todo = TRUE;
 #else


ossp-pkg/sa/sa.pod 1.40 -> 1.41

--- sa.pod       2004/04/02 18:21:07     1.40
+++ sa.pod       2004/06/26 11:16:02     1.41
@@ -460,8 +460,11 @@
 disabling (I<yesno> == C<0>) Nagle's Algorithm (see RFC898).
 
 C<SA_OPTION_LINGER> (C<int> I<amount>) for enabling (I<amount> ==
-I<seconds> E<gt> C<0>) or disabling (I<amount> == C<0>) lingering on
-close (see C<SO_LINGER> of setsockopt(2)).
+I<seconds> != C<0>) or disabling (I<amount> == C<0>) lingering on close
+(see C<SO_LINGER> of setsockopt(2)). Notice: using I<seconds> E<ge> C<0>
+results in a regular (maximum of I<seconds> lasting) lingering on close
+while using I<seconds> E<le> C<0> results in the special case of a TCP
+RST based connection termination on close.
 
 C<SA_OPTION_REUSEADDR> (C<int> I<yesno>) for enabling (I<yesno> ==
 C<1>) or disabling (I<yesno> == C<0>) the reusability of the address on

CVSTrac 2.0.1