info->sock = socket(res->ai_family,res->ai_socktype,res->ai_protocol);
assert(info->sock>0);
- assert(0==connect(info->sock,res->ai_addr,res->ai_addrlen));
+ if(0!=connect(info->sock,res->ai_addr,res->ai_addrlen)) {
+ exit(77);
+ }
assert(1==session_setup());
memcpy(info->infohash,infohash,PEER_INFOHASH_SIZE);
assert(1==peer_handshake(info));
assert(1==peer_handshake_received(info));
- assert(1==peer_bitfield(info));
-
close(info->sock);
peer_free(info);
}