PeerSpec *peer) // RETURNED
{
struct sockaddr_in addr;
- struct hostent *ent;
+ struct hostent *ent = NULL;
struct in_addr host;
int sock = 0;
addr.sin_family = AF_INET;
if (connect(sock, (struct sockaddr *) &addr, sizeof(struct sockaddr_in)) != 0)
- { printf("connect returned error\n");
+ {
+ perror("connect returned error");
return errSecIO;
}
}
return rtn;
}
- /* NOT REACHED */
- return 0;
}
/*
UInt8 *currData = (UInt8 *)data;
int sock = (int)((long)connection);
OSStatus rtn = errSecSuccess;
- size_t bytesRead = 0;
ssize_t rrtn;
*dataLength = 0;
/* in any case, we're done with this call if rrtn <= 0 */
break;
}
- bytesRead = rrtn;
- bytesToGo -= bytesRead;
- currData += bytesRead;
+ bytesToGo -= rrtn;
+ currData += rrtn;
if(bytesToGo == 0) {
/* filled buffer with incoming data, done */