diff options
Diffstat (limited to 'ot_udp.c')
-rw-r--r-- | ot_udp.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -23,10 +23,10 @@ void handle_udp4( int64 serversocket ) { | |||
23 | ot_torrent *torrent; | 23 | ot_torrent *torrent; |
24 | ot_hash *hash = NULL; | 24 | ot_hash *hash = NULL; |
25 | char remoteip[4]; | 25 | char remoteip[4]; |
26 | ot_dword *inpacket = (ot_dword*)static_inbuf; | 26 | uint32_t *inpacket = (uint32_t*)static_inbuf; |
27 | ot_dword *outpacket = (ot_dword*)static_outbuf; | 27 | uint32_t *outpacket = (uint32_t*)static_outbuf; |
28 | ot_dword numwant, left, event; | 28 | uint32_t numwant, left, event; |
29 | ot_word port, remoteport; | 29 | uint16_t port, remoteport; |
30 | size_t r, r_out; | 30 | size_t r, r_out; |
31 | 31 | ||
32 | r = socket_recv4( serversocket, static_inbuf, sizeof( static_inbuf ), remoteip, &remoteport); | 32 | r = socket_recv4( serversocket, static_inbuf, sizeof( static_inbuf ), remoteip, &remoteport); |
@@ -59,7 +59,7 @@ void handle_udp4( int64 serversocket ) { | |||
59 | left = inpacket[64/4] | inpacket[68/4]; | 59 | left = inpacket[64/4] | inpacket[68/4]; |
60 | 60 | ||
61 | event = ntohl( inpacket[80/4] ); | 61 | event = ntohl( inpacket[80/4] ); |
62 | port = *(ot_word*)( static_inbuf + 96 ); | 62 | port = *(uint16_t*)( static_inbuf + 96 ); |
63 | hash = (ot_hash*)( static_inbuf + 16 ); | 63 | hash = (ot_hash*)( static_inbuf + 16 ); |
64 | 64 | ||
65 | OT_SETIP( &peer, remoteip ); | 65 | OT_SETIP( &peer, remoteip ); |