- 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.

svn path=/branches/GSoC_2011/TcpIpDriver/; revision=51924
This commit is contained in:
Claudiu Mihail 2011-05-26 17:42:00 +00:00
parent f75011c71f
commit a9d9b3583e
5 changed files with 10 additions and 10 deletions

View file

@ -163,14 +163,17 @@ TCPAcceptEventHandler(void *arg, struct tcp_pcb *newpcb)
if (Status == STATUS_SUCCESS) if (Status == STATUS_SUCCESS)
{ {
DbgPrint("[IP, TCPAcceptEventHandler] newpcb->state = %s, newpcb->id = %d\n", DbgPrint("[IP, TCPAcceptEventHandler] newpcb->state = %s, listen_pcb->state = %s, newpcb->id = %d\n",
tcp_state_str[newpcb->state], newpcb->identifier); tcp_state_str[newpcb->state],
tcp_state_str[((struct tcp_pcb*)Connection->SocketContext)->state],
newpcb->identifier);
LockObject(Bucket->AssociatedEndpoint, &OldIrql); LockObject(Bucket->AssociatedEndpoint, &OldIrql);
Bucket->AssociatedEndpoint->SocketContext = newpcb; 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"); DbgPrint("[IP, TCPAcceptEventHandler] Trying to unlock Bucket->AssociatedEndpoint\n");
UnlockObject(Bucket->AssociatedEndpoint, OldIrql); UnlockObject(Bucket->AssociatedEndpoint, OldIrql);

View file

@ -530,8 +530,6 @@ tcp_listen_input(struct tcp_pcb_listen *pcb)
/* inherit socket options */ /* inherit socket options */
npcb->so_options = pcb->so_options & SOF_INHERITED; npcb->so_options = pcb->so_options & SOF_INHERITED;
npcb->listener = pcb;
/* Register the new PCB so that we can begin receiving segments /* Register the new PCB so that we can begin receiving segments
for it. */ for it. */
TCP_REG(&tcp_active_pcbs, npcb); TCP_REG(&tcp_active_pcbs, npcb);

View file

@ -278,7 +278,6 @@ struct tcp_pcb {
/* KEEPALIVE counter */ /* KEEPALIVE counter */
u8_t keep_cnt_sent; u8_t keep_cnt_sent;
u16_t identifier; u16_t identifier;
struct tcp_pcb_listen* listener;
}; };
struct tcp_pcb_listen { struct tcp_pcb_listen {

View file

@ -21,7 +21,7 @@ err_t LibTCPConnect(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port);
err_t LibTCPClose(struct tcp_pcb *pcb); err_t LibTCPClose(struct tcp_pcb *pcb);
err_t LibTCPGetPeerName(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t *port); 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); 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 */ /* IP functions */
void LibIPInsertPacket(void *ifarg, void *data, u32_t size); void LibIPInsertPacket(void *ifarg, void *data, u32_t size);

View file

@ -562,7 +562,7 @@ LibTCPClose(struct tcp_pcb *pcb)
} }
void 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); DbgPrint("[LibTCPAccept] (pcb, arg) = (0x%x, 0x%x)\n", pcb, arg);
@ -573,7 +573,7 @@ LibTCPAccept(struct tcp_pcb *pcb, void *arg)
tcp_sent(pcb, InternalSendEventHandler); tcp_sent(pcb, InternalSendEventHandler);
tcp_arg(pcb, arg); tcp_arg(pcb, arg);
tcp_accepted(pcb->listener); tcp_accepted(listen_pcb);
DbgPrint("[LibTCPAccept] Done\n"); DbgPrint("[LibTCPAccept] Done\n");
} }