mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 17:30:32 +00:00
[TCPIP]
Backup commit svn path=/branches/GSoC_2011/TcpIpDriver/; revision=52432
This commit is contained in:
parent
474c5138f8
commit
b8daab7cfb
4 changed files with 28 additions and 10 deletions
|
@ -41,9 +41,9 @@ BucketCompletionWorker(PVOID Context)
|
||||||
|
|
||||||
Complete(Bucket->Request.RequestContext, Bucket->Status, Bucket->Information);
|
Complete(Bucket->Request.RequestContext, Bucket->Status, Bucket->Information);
|
||||||
|
|
||||||
ExFreePoolWithTag(Bucket, TDI_BUCKET_TAG);
|
|
||||||
|
|
||||||
DereferenceObject(Bucket->AssociatedEndpoint);
|
DereferenceObject(Bucket->AssociatedEndpoint);
|
||||||
|
|
||||||
|
ExFreePoolWithTag(Bucket, TDI_BUCKET_TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
|
|
@ -303,6 +303,18 @@ NTSTATUS TCPConnect
|
||||||
{
|
{
|
||||||
connaddr.addr = RemoteAddress.Address.IPv4Address;
|
connaddr.addr = RemoteAddress.Address.IPv4Address;
|
||||||
|
|
||||||
|
Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG );
|
||||||
|
if( !Bucket )
|
||||||
|
{
|
||||||
|
UnlockObject(Connection, OldIrql);
|
||||||
|
return STATUS_NO_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bucket->Request.RequestNotifyObject = (PVOID)Complete;
|
||||||
|
Bucket->Request.RequestContext = Context;
|
||||||
|
|
||||||
|
InsertTailList( &Connection->ConnectRequest, &Bucket->Entry );
|
||||||
|
|
||||||
Status = TCPTranslateError(LibTCPConnect(Connection->SocketContext,
|
Status = TCPTranslateError(LibTCPConnect(Connection->SocketContext,
|
||||||
&connaddr,
|
&connaddr,
|
||||||
RemotePort));
|
RemotePort));
|
||||||
|
@ -311,7 +323,7 @@ NTSTATUS TCPConnect
|
||||||
|
|
||||||
if (Status == STATUS_PENDING)
|
if (Status == STATUS_PENDING)
|
||||||
{
|
{
|
||||||
Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG );
|
/*Bucket = ExAllocatePoolWithTag( NonPagedPool, sizeof(*Bucket), TDI_BUCKET_TAG );
|
||||||
if( !Bucket )
|
if( !Bucket )
|
||||||
{
|
{
|
||||||
UnlockObject(Connection, OldIrql);
|
UnlockObject(Connection, OldIrql);
|
||||||
|
@ -321,7 +333,7 @@ NTSTATUS TCPConnect
|
||||||
Bucket->Request.RequestNotifyObject = (PVOID)Complete;
|
Bucket->Request.RequestNotifyObject = (PVOID)Complete;
|
||||||
Bucket->Request.RequestContext = Context;
|
Bucket->Request.RequestContext = Context;
|
||||||
|
|
||||||
InsertTailList( &Connection->ConnectRequest, &Bucket->Entry );
|
InsertTailList( &Connection->ConnectRequest, &Bucket->Entry );*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,6 +402,9 @@ NTSTATUS TCPReceiveData
|
||||||
TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Called for %d bytes (on socket %x)\n",
|
TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Called for %d bytes (on socket %x)\n",
|
||||||
ReceiveLength, Connection->SocketContext));
|
ReceiveLength, Connection->SocketContext));
|
||||||
|
|
||||||
|
DbgPrint("[IP, TCPReceiveData] Called for %d bytes (on Connection->SocketContext = 0x%x)\n",
|
||||||
|
ReceiveLength, Connection->SocketContext);
|
||||||
|
|
||||||
LockObject(Connection, &OldIrql);
|
LockObject(Connection, &OldIrql);
|
||||||
|
|
||||||
/* Freed in TCPSocketState */
|
/* Freed in TCPSocketState */
|
||||||
|
@ -412,6 +427,7 @@ NTSTATUS TCPReceiveData
|
||||||
UnlockObject(Connection, OldIrql);
|
UnlockObject(Connection, OldIrql);
|
||||||
|
|
||||||
TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Leaving. Status = STATUS_PENDING\n"));
|
TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Leaving. Status = STATUS_PENDING\n"));
|
||||||
|
DbgPrint("[IP, TCPReceiveData] Leaving. Status = STATUS_PENDING\n");
|
||||||
|
|
||||||
return STATUS_PENDING;
|
return STATUS_PENDING;
|
||||||
}
|
}
|
||||||
|
@ -437,6 +453,7 @@ NTSTATUS TCPSendData
|
||||||
TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Connection = %x\n", Connection));
|
TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Connection = %x\n", Connection));
|
||||||
TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Connection->SocketContext = %x\n",
|
TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Connection->SocketContext = %x\n",
|
||||||
Connection->SocketContext));
|
Connection->SocketContext));
|
||||||
|
DbgPrint("[IP, TCPSendData] Called\n");
|
||||||
|
|
||||||
Status = TCPTranslateError(LibTCPSend(Connection->SocketContext,
|
Status = TCPTranslateError(LibTCPSend(Connection->SocketContext,
|
||||||
BufferData,
|
BufferData,
|
||||||
|
@ -476,6 +493,8 @@ NTSTATUS TCPSendData
|
||||||
|
|
||||||
TI_DbgPrint(DEBUG_TCP, ("[IP, TCPSendData] Leaving. Status = %x\n", Status));
|
TI_DbgPrint(DEBUG_TCP, ("[IP, TCPSendData] Leaving. Status = %x\n", Status));
|
||||||
|
|
||||||
|
DbgPrint("[IP, TCPSendData] Leaving. Status = %x\n", Status);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -494,9 +494,10 @@ LibTCPConnectCallback(void *arg)
|
||||||
tcp_recv(msg->Pcb, InternalRecvEventHandler);
|
tcp_recv(msg->Pcb, InternalRecvEventHandler);
|
||||||
tcp_sent(msg->Pcb, InternalSendEventHandler);
|
tcp_sent(msg->Pcb, InternalSendEventHandler);
|
||||||
|
|
||||||
msg->Error = tcp_connect(msg->Pcb, msg->IpAddress, ntohs(msg->Port), InternalConnectEventHandler);
|
//if (msg->Error == ERR_OK)
|
||||||
if (msg->Error == ERR_OK)
|
// msg->Error = ERR_INPROGRESS;
|
||||||
msg->Error = ERR_INPROGRESS;
|
err_t Error = tcp_connect(msg->Pcb, msg->IpAddress, ntohs(msg->Port), InternalConnectEventHandler);
|
||||||
|
msg->Error = Error == ERR_OK ? ERR_INPROGRESS : Error;
|
||||||
|
|
||||||
KeSetEvent(&msg->Event, IO_NO_INCREMENT, FALSE);
|
KeSetEvent(&msg->Event, IO_NO_INCREMENT, FALSE);
|
||||||
|
|
||||||
|
@ -527,8 +528,6 @@ LibTCPConnect(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port)
|
||||||
if (WaitForEventSafely(&msg->Event))
|
if (WaitForEventSafely(&msg->Event))
|
||||||
{
|
{
|
||||||
ret = msg->Error;
|
ret = msg->Error;
|
||||||
if (pcb->state != CLOSED && ret == ERR_INPROGRESS)
|
|
||||||
ret = ERR_OK;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ret = ERR_CLSD;
|
ret = ERR_CLSD;
|
||||||
|
|
Loading…
Reference in a new issue