forked from I2P_Developers/i2p.i2p
Indentation
This commit is contained in:
@@ -131,16 +131,16 @@ samerr_t sam_connect(sam_sess_t *session, const char *samhost, uint16_t samport,
|
||||
samerr_t rc;
|
||||
|
||||
if (style == SAM_STREAM) {
|
||||
if (sam_closeback == NULL || sam_connectback == NULL ||
|
||||
sam_databack == NULL || sam_diedback == NULL ||
|
||||
sam_logback == NULL || sam_namingback == NULL ||
|
||||
sam_statusback == NULL) {
|
||||
if (sam_closeback == NULL || sam_connectback == NULL
|
||||
|| sam_databack == NULL || sam_diedback == NULL
|
||||
|| sam_logback == NULL || sam_namingback == NULL
|
||||
|| sam_statusback == NULL) {
|
||||
SAMLOGS("Please set callback functions before connecting");
|
||||
return SAM_CALLBACKS_UNSET;
|
||||
}
|
||||
} else if (style == SAM_DGRAM) {
|
||||
if (sam_dgramback == NULL || sam_diedback == NULL ||
|
||||
sam_logback == NULL || sam_namingback == NULL) {
|
||||
if (sam_dgramback == NULL || sam_diedback == NULL
|
||||
|| sam_logback == NULL || sam_namingback == NULL) {
|
||||
SAMLOGS("Please set callback functions before connecting");
|
||||
return SAM_CALLBACKS_UNSET;
|
||||
}
|
||||
@@ -667,7 +667,6 @@ static bool sam_readable(sam_sess_t *session)
|
||||
sam_diedback(session);
|
||||
return false;
|
||||
}
|
||||
/* it seems like there should be a better way to do this (i.e. not select)*/
|
||||
FD_ZERO(&rset);
|
||||
FD_SET(session->sock, &rset);
|
||||
tv.tv_sec = 0;
|
||||
@@ -957,10 +956,11 @@ retry:
|
||||
}
|
||||
a.s_addr = ((struct in_addr *)h->h_addr)->s_addr;
|
||||
#ifdef NO_INET_NTOP
|
||||
/* inet_ntoa() was very poorly designed! */
|
||||
char *tmp;
|
||||
tmp = inet_ntoa(a);
|
||||
assert(tmp != NULL);
|
||||
strlcpy(ipaddr, tmp, INET_ADDRSTRLEN); /* inet_ntoa() was very poorly designed */
|
||||
strlcpy(ipaddr, tmp, INET_ADDRSTRLEN);
|
||||
return true;
|
||||
#else
|
||||
if (inet_ntop(AF_INET, &a, ipaddr, INET_ADDRSTRLEN) != NULL) {
|
||||
@@ -1251,7 +1251,7 @@ const char *sam_winsock_strerror(int code)
|
||||
return "This is a nonrecoverable error";
|
||||
case WSANO_DATA:
|
||||
return "Valid name, no data record of requested type";
|
||||
/* None of this shit compiles under Mingw - who knows why...
|
||||
/* None of this shit compiles under Mingw - who knows why...
|
||||
case WSA_INVALID_HANDLE:
|
||||
return "Specified event object handle is invalid";
|
||||
case WSA_INVALID_PARAMETER:
|
||||
@@ -1269,8 +1269,7 @@ const char *sam_winsock_strerror(int code)
|
||||
case WSAINVALIDPROVIDER:
|
||||
return "Invalid service provider version number";
|
||||
case WSAPROVIDERFAILEDINIT:
|
||||
return "Unable to initialize a service provider";
|
||||
*/
|
||||
return "Unable to initialize a service provider"; */
|
||||
case WSASYSCALLFAILURE:
|
||||
return "System call failure";
|
||||
default:
|
||||
|
Reference in New Issue
Block a user