better TCP sequence numbers
This commit is contained in:
parent
f3f4613b4e
commit
cde1963e63
|
@ -745,18 +745,18 @@ void HandleTCPFrame(u8* data, int len)
|
|||
return;
|
||||
}
|
||||
|
||||
// send data over the socket
|
||||
if (tcpdatalen > 0)
|
||||
{
|
||||
u8* tcpdata = &tcpheader[tcpheaderlen];
|
||||
|
||||
// TODO: check those
|
||||
u32 seqnum = ntohl(*(u32*)&tcpheader[4]);
|
||||
u32 acknum = ntohl(*(u32*)&tcpheader[8]);
|
||||
sock->SeqNum = acknum;
|
||||
sock->AckNum = seqnum + tcpdatalen;
|
||||
|
||||
printf("TCP: socket %d sending %d bytes\n", sockid, tcpdatalen);
|
||||
// send data over the socket
|
||||
if (tcpdatalen > 0)
|
||||
{
|
||||
u8* tcpdata = &tcpheader[tcpheaderlen];
|
||||
|
||||
printf("TCP: socket %d sending %d bytes (flags=%04X)\n", sockid, tcpdatalen, flags);
|
||||
send(sock->Backend, (char*)tcpdata, tcpdatalen, 0);
|
||||
|
||||
// kind of a hack, there
|
||||
|
|
Loading…
Reference in New Issue