reactos/drivers/net/afd/afd
diff -u -r1.1.2.1 -r1.1.2.2
--- connect.c 9 Jul 2004 04:41:18 -0000 1.1.2.1
+++ connect.c 11 Jul 2004 23:04:34 -0000 1.1.2.2
@@ -1,4 +1,4 @@
-/* $Id: connect.c,v 1.1.2.1 2004/07/09 04:41:18 arty Exp $
+/* $Id: connect.c,v 1.1.2.2 2004/07/11 23:04:34 arty Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/net/afd/afd/connect.c
@@ -51,12 +51,17 @@
* not need to relock. */
/* if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); */
+ AFD_DbgPrint(MID_TRACE,("Irp->IoStatus.Status = %x\n",
+ Irp->IoStatus.Status));
+
if( NT_SUCCESS(Irp->IoStatus.Status) ) {
FCB->PollState |= AFD_EVENT_CONNECT;
FCB->State = SOCKET_STATE_CONNECTED;
+ AFD_DbgPrint(MID_TRACE,("Going to connected state %d\n", FCB->State));
PollReeval( FCB->DeviceExt, FCB->FileObject );
} else {
FCB->PollState |= AFD_EVENT_CONNECT_FAIL;
+ AFD_DbgPrint(MID_TRACE,("Going to bound state\n"));
FCB->State = SOCKET_STATE_BOUND;
PollReeval( FCB->DeviceExt, FCB->FileObject );
}
@@ -89,6 +94,19 @@
FCB );
}
+ if( FCB->Send.Window &&
+ !IsListEmpty( &FCB->PendingIrpList[FUNCTION_SEND] ) ) {
+ NextIrpEntry = RemoveHeadList(&FCB->PendingIrpList[FUNCTION_SEND]);
+ NextIrp = CONTAINING_RECORD(NextIrpEntry, IRP,
+ Tail.Overlay.ListEntry);
+ AFD_DbgPrint(MID_TRACE,("Launching send request %x\n", NextIrp));
+ Status = AfdConnectedSocketWriteData
+ ( DeviceObject,
+ NextIrp,
+ IoGetCurrentIrpStackLocation( NextIrp ),
+ FALSE );
+ }
+
if( Status == STATUS_PENDING )
Status = STATUS_SUCCESS;
}
@@ -155,6 +173,8 @@
FCB->RemoteAddress = TaCopyTransportAddress( &ConnectReq->Address );
Status = WarmSocketForConnection( FCB );
+
+ FCB->State = SOCKET_STATE_CONNECTING;
if( NT_SUCCESS(Status) ) {
Status = TdiConnect( &FCB->PendingTdiIrp,
@@ -163,8 +183,6 @@
StreamSocketConnectComplete,
FCB );
}
-
- FCB->State = SOCKET_STATE_CONNECTING;
break;
default:
reactos/drivers/net/afd/afd
diff -u -r1.1.2.1 -r1.1.2.2
--- write.c 9 Jul 2004 04:41:18 -0000 1.1.2.1
+++ write.c 11 Jul 2004 23:04:35 -0000 1.1.2.2
@@ -1,4 +1,4 @@
-/* $Id: write.c,v 1.1.2.1 2004/07/09 04:41:18 arty Exp $
+/* $Id: write.c,v 1.1.2.2 2004/07/11 23:04:35 arty Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: drivers/net/afd/afd/write.c
@@ -144,6 +144,13 @@
if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp );
+ AFD_DbgPrint(MID_TRACE,("Socket state %d\n", FCB->State));
+
+ if( FCB->State != SOCKET_STATE_CONNECTED ) {
+ AFD_DbgPrint(MID_TRACE,("Queuing request\n"));
+ return LeaveIrpUntilLater( FCB, Irp, FUNCTION_SEND );
+ }
+
AFD_DbgPrint(MID_TRACE,("We already have %d bytes waiting.\n",
FCB->Send.BytesUsed));
@@ -151,6 +158,8 @@
SendReq->BufferCount,
FALSE );
+ AFD_DbgPrint(MID_TRACE,("FCB->Send.BytesUsed = %d\n", FCB->Send.BytesUsed));
+
if( !FCB->Send.BytesUsed ) {
SpaceAvail = FCB->Send.Size - FCB->Send.BytesUsed;