diff --git a/nsock/src/nsock_core.c b/nsock/src/nsock_core.c index 47293144b..fc48f7443 100644 --- a/nsock/src/nsock_core.c +++ b/nsock/src/nsock_core.c @@ -1003,9 +1003,9 @@ void process_event(struct npool *nsp, gh_list_t *evlist, struct nevent *nse, int if (!nse->iod->ssl && match_w) handle_write_result(nsp, nse, NSE_STATUS_SUCCESS); - if (event_timedout(nse)) - handle_write_result(nsp, nse, NSE_STATUS_TIMEOUT); - break; + if (event_timedout(nse)) + handle_write_result(nsp, nse, NSE_STATUS_TIMEOUT); + break; case NSE_TYPE_TIMER: if (event_timedout(nse)) diff --git a/nsock/src/nsock_write.c b/nsock/src/nsock_write.c index 0b68c10f1..8ad20427d 100644 --- a/nsock/src/nsock_write.c +++ b/nsock/src/nsock_write.c @@ -142,18 +142,18 @@ nsock_event_id nsock_write(nsock_pool ms_pool, nsock_iod ms_iod, if (datalen < 0) datalen = (int)strlen(data); - if (NsockLogLevel == NSOCK_LOG_DBG_ALL && datalen < 80) { - memcpy(displaystr, ": ", 2); - memcpy(displaystr + 2, data, datalen); - displaystr[2 + datalen] = '\0'; - replacenonprintable(displaystr + 2, datalen, '.'); - } else { - displaystr[0] = '\0'; - } + if (NsockLogLevel == NSOCK_LOG_DBG_ALL && datalen < 80) { + memcpy(displaystr, ": ", 2); + memcpy(displaystr + 2, data, datalen); + displaystr[2 + datalen] = '\0'; + replacenonprintable(displaystr + 2, datalen, '.'); + } else { + displaystr[0] = '\0'; + } - nsock_log_info("Write request for %d bytes to IOD #%li EID %li [%s]%s", - datalen, nsi->id, nse->id, get_peeraddr_string(nsi), - displaystr); + nsock_log_info("Write request for %d bytes to IOD #%li EID %li [%s]%s", + datalen, nsi->id, nse->id, get_peeraddr_string(nsi), + displaystr); fs_cat(&nse->iobuf, data, datalen); diff --git a/payload.cc b/payload.cc index eaca2e552..6350138fc 100644 --- a/payload.cc +++ b/payload.cc @@ -196,10 +196,10 @@ static unsigned short *parse_portlist(const char *portlist, unsigned int *count) l = strtol(portlist, &tail, 10); if (portlist == tail || errno != 0 || l < 0 || l > 65535) return NULL; - if (!(bitmap[l / 32] & (1 << (l % 32)))) { - bitmap[l / 32] |= (1 << (l % 32)); - (*count)++; - } + if (!(bitmap[l / 32] & (1 << (l % 32)))) { + bitmap[l / 32] |= (1 << (l % 32)); + (*count)++; + } if (*tail == '\0') break; else if (*tail == ',')