Author: cmihail
Date: Thu May 26 17:42:00 2011
New Revision: 51924
URL:
http://svn.reactos.org/svn/reactos?rev=51924&view=rev
Log:
[TCPIP]
- Removed hack from lwIP code. Now the listening pcb is obtained in a way as to not affect
pllute lwIP code.
- Also there's still a little foreign code left in lwIP, but this can be easily
removed as it contains no functional purpose, except debugging.
Modified:
branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c
branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/tcp_in.c
branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/include/lwip/tcp.h
branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/include/rosip.h
branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/rostcp.c
Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/drive…
==============================================================================
--- branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c [iso-8859-1]
(original)
+++ branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/event.c [iso-8859-1] Thu
May 26 17:42:00 2011
@@ -163,14 +163,17 @@
if (Status == STATUS_SUCCESS)
{
- DbgPrint("[IP, TCPAcceptEventHandler] newpcb->state = %s,
newpcb->id = %d\n",
- tcp_state_str[newpcb->state], newpcb->identifier);
+ DbgPrint("[IP, TCPAcceptEventHandler] newpcb->state = %s,
listen_pcb->state = %s, newpcb->id = %d\n",
+ tcp_state_str[newpcb->state],
+ tcp_state_str[((struct
tcp_pcb*)Connection->SocketContext)->state],
+ newpcb->identifier);
LockObject(Bucket->AssociatedEndpoint, &OldIrql);
Bucket->AssociatedEndpoint->SocketContext = newpcb;
- DbgPrint("[IP, TCPAcceptEventHandler] LibTCPAccept coming up\n");
-
- LibTCPAccept(newpcb, Bucket->AssociatedEndpoint);
+
+ LibTCPAccept(newpcb,
+ (struct tcp_pcb*)Connection->SocketContext,
+ Bucket->AssociatedEndpoint);
DbgPrint("[IP, TCPAcceptEventHandler] Trying to unlock
Bucket->AssociatedEndpoint\n");
UnlockObject(Bucket->AssociatedEndpoint, OldIrql);
Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/tcp_in.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/drive…
==============================================================================
--- branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/tcp_in.c [iso-8859-1]
(original)
+++ branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/tcp_in.c [iso-8859-1] Thu May
26 17:42:00 2011
@@ -529,8 +529,6 @@
#endif /* LWIP_CALLBACK_API */
/* inherit socket options */
npcb->so_options = pcb->so_options & SOF_INHERITED;
-
- npcb->listener = pcb;
/* Register the new PCB so that we can begin receiving segments
for it. */
Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/include/lwip/tcp.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/drive…
==============================================================================
--- branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/include/lwip/tcp.h [iso-8859-1]
(original)
+++ branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/include/lwip/tcp.h [iso-8859-1]
Thu May 26 17:42:00 2011
@@ -278,7 +278,6 @@
/* KEEPALIVE counter */
u8_t keep_cnt_sent;
u16_t identifier;
- struct tcp_pcb_listen* listener;
};
struct tcp_pcb_listen {
Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/include/rosip.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/drive…
==============================================================================
--- branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/include/rosip.h [iso-8859-1]
(original)
+++ branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/include/rosip.h [iso-8859-1] Thu
May 26 17:42:00 2011
@@ -21,7 +21,7 @@
err_t LibTCPClose(struct tcp_pcb *pcb);
err_t LibTCPGetPeerName(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t *port);
err_t LibTCPGetHostName(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t *port);
-void LibTCPAccept(struct tcp_pcb *pcb, void *arg);
+void LibTCPAccept(struct tcp_pcb *pcb, struct tcp_pcb *listen_pcb, void *arg);
/* IP functions */
void LibIPInsertPacket(void *ifarg, void *data, u32_t size);
Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/rostcp.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/drive…
==============================================================================
--- branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/rostcp.c [iso-8859-1] (original)
+++ branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/rostcp.c [iso-8859-1] Thu May 26
17:42:00 2011
@@ -562,7 +562,7 @@
}
void
-LibTCPAccept(struct tcp_pcb *pcb, void *arg)
+LibTCPAccept(struct tcp_pcb *pcb, struct tcp_pcb *listen_pcb, void *arg)
{
DbgPrint("[LibTCPAccept] (pcb, arg) = (0x%x, 0x%x)\n", pcb, arg);
@@ -573,7 +573,7 @@
tcp_sent(pcb, InternalSendEventHandler);
tcp_arg(pcb, arg);
- tcp_accepted(pcb->listener);
+ tcp_accepted(listen_pcb);
DbgPrint("[LibTCPAccept] Done\n");
}