ip/torrent: fix silly readn() error check (thanks pr)
This commit is contained in:
parent
0b95092e3d
commit
eb81b7602c
1 changed files with 1 additions and 1 deletions
|
@ -404,7 +404,7 @@ peer(int fd, int incoming, char *addr)
|
||||||
}
|
}
|
||||||
if((incoming && !i) || (!incoming && i)){
|
if((incoming && !i) || (!incoming && i)){
|
||||||
n = 20 + 8 + sizeof(infohash);
|
n = 20 + 8 + sizeof(infohash);
|
||||||
if((n = readn(fd, buf, n)) != n)
|
if(readn(fd, buf, n) != n)
|
||||||
return 1;
|
return 1;
|
||||||
if(memcmp(buf, "\x13BitTorrent protocol", 20))
|
if(memcmp(buf, "\x13BitTorrent protocol", 20))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue