[ros-diffs] [cgutman] 36970: - Check the status of OskitTCPBind

cgutman at svn.reactos.org cgutman at svn.reactos.org
Sun Oct 26 00:44:56 CEST 2008


Author: cgutman
Date: Sat Oct 25 17:44:56 2008
New Revision: 36970

URL: http://svn.reactos.org/svn/reactos?rev=36970&view=rev
Log:
 - Check the status of OskitTCPBind

Modified:
    branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c
    branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c

Modified: branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c?rev=36970&r1=36969&r2=36970&view=diff
==============================================================================
--- branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1] Sat Oct 25 17:44:56 2008
@@ -87,13 +87,13 @@
 
     TI_DbgPrint(DEBUG_TCP,("AddressToBind - %x:%x\n", AddressToBind.sin_addr, AddressToBind.sin_port));
 
-    OskitTCPBind( Connection->SocketContext,
-		  Connection,
-		  &AddressToBind,
-		  sizeof(AddressToBind) );
+    Status = TCPTranslateError( OskitTCPBind( Connection->SocketContext,
+		                Connection,
+		                &AddressToBind,
+		                sizeof(AddressToBind) ) );
 
-    Status = TCPTranslateError( OskitTCPListen( Connection->SocketContext,
-						Backlog ) );
+    if (NT_SUCCESS(Status))
+        Status = TCPTranslateError( OskitTCPListen( Connection->SocketContext, Backlog ) );
 
     TcpipRecursiveMutexLeave( &TCPLock );
 

Modified: branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c
URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c?rev=36970&r1=36969&r2=36970&view=diff
==============================================================================
--- branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Sat Oct 25 17:44:56 2008
@@ -577,21 +577,24 @@
     AddressToConnect.sin_family = AF_INET;
     AddressToBind = AddressToConnect;
 
-    OskitTCPBind( Connection->SocketContext,
+    Status = TCPTranslateError
+        ( OskitTCPBind( Connection->SocketContext,
 		  Connection,
 		  &AddressToBind,
-		  sizeof(AddressToBind) );
-
-    memcpy( &AddressToConnect.sin_addr,
-	    &RemoteAddress.Address.IPv4Address,
-	    sizeof(AddressToConnect.sin_addr) );
-    AddressToConnect.sin_port = RemotePort;
-
-    Status = TCPTranslateError
-	( OskitTCPConnect( Connection->SocketContext,
-			   Connection,
-			   &AddressToConnect,
-			   sizeof(AddressToConnect) ) );
+		  sizeof(AddressToBind) ) );
+
+    if (NT_SUCCESS(Status)) {
+        memcpy( &AddressToConnect.sin_addr,
+	        &RemoteAddress.Address.IPv4Address,
+	        sizeof(AddressToConnect.sin_addr) );
+        AddressToConnect.sin_port = RemotePort;
+
+        Status = TCPTranslateError
+	    ( OskitTCPConnect( Connection->SocketContext,
+		       	       Connection,
+			       &AddressToConnect,
+			       sizeof(AddressToConnect) ) );
+    }
 
     TcpipRecursiveMutexLeave( &TCPLock );
 



More information about the Ros-diffs mailing list