1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-17 21:19:01 +00:00

Minor wrapping and whitespace fixes.

This commit is contained in:
henri
2012-01-13 12:59:18 +00:00
parent 520ff94839
commit 2cdd7e63f0
3 changed files with 15 additions and 11 deletions

View File

@@ -514,10 +514,10 @@ void handle_write_result(mspool *ms, msevent *nse, enum nse_status status) {
res = SSL_write(iod->ssl, str, bytesleft); res = SSL_write(iod->ssl, str, bytesleft);
else else
#endif #endif
if (nse->writeinfo.dest.ss_family == AF_UNSPEC ) if (nse->writeinfo.dest.ss_family == AF_UNSPEC)
res = send(nse->iod->sd, str, bytesleft, 0); res = send(nse->iod->sd, str, bytesleft, 0);
else else
res = sendto(nse->iod->sd, str, bytesleft, 0, (struct sockaddr *)&nse->writeinfo.dest, (int) nse->writeinfo.destlen); res = sendto(nse->iod->sd, str, bytesleft, 0, (struct sockaddr *)&nse->writeinfo.dest, (int)nse->writeinfo.destlen);
if (res == bytesleft) { if (res == bytesleft) {
nse->event_done = 1; nse->event_done = 1;
nse->status = NSE_STATUS_SUCCESS; nse->status = NSE_STATUS_SUCCESS;
@@ -685,7 +685,7 @@ static int do_actual_read(mspool *ms, msevent *nse) {
socket_count_read_inc(iod); socket_count_read_inc(iod);
update_events(iod, ms, X_EV(EV_READ, evclr), X_EV(evclr, EV_READ)); update_events(iod, ms, X_EV(EV_READ, evclr), X_EV(evclr, EV_READ));
nse->sslinfo.ssl_desire = err; nse->sslinfo.ssl_desire = err;
} else if (err == SSL_ERROR_WANT_WRITE ) { } else if (err == SSL_ERROR_WANT_WRITE) {
int evclr; int evclr;
evclr = socket_count_dec_ssl_desire(nse); evclr = socket_count_dec_ssl_desire(nse);

View File

@@ -449,6 +449,7 @@ void nse_readpcap(nsock_event nsee, const unsigned char **l2_data, size_t *l2_le
int nsi_pcap_linktype(nsock_iod nsiod) { int nsi_pcap_linktype(nsock_iod nsiod) {
msiod *nsi = (msiod *)nsiod; msiod *nsi = (msiod *)nsiod;
mspcap *mp = (mspcap *)nsi->pcap; mspcap *mp = (mspcap *)nsi->pcap;
assert(mp); assert(mp);
return (mp->datalink); return (mp->datalink);
} }
@@ -456,6 +457,7 @@ int nsi_pcap_linktype(nsock_iod nsiod) {
int nsi_is_pcap(nsock_iod nsiod) { int nsi_is_pcap(nsock_iod nsiod) {
msiod *nsi = (msiod *)nsiod; msiod *nsi = (msiod *)nsiod;
mspcap *mp = (mspcap *)nsi->pcap; mspcap *mp = (mspcap *)nsi->pcap;
return (mp != NULL); return (mp != NULL);
} }

View File

@@ -74,10 +74,11 @@ nsock_event_id nsock_readlines(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handle
if (ms->tracelevel > 0) { if (ms->tracelevel > 0) {
if (nsi->peerlen > 0) if (nsi->peerlen > 0)
nsock_trace(ms, "Read request for %d lines from IOD #%li [%s:%d] EID %li", nlines, nsi->id, nsock_trace(ms, "Read request for %d lines from IOD #%li [%s:%d] EID %li",
inet_ntop_ez(&nsi->peer, nsi->peerlen), nsi_peerport(nsi), nse->id); nlines, nsi->id, inet_ntop_ez(&nsi->peer, nsi->peerlen), nsi_peerport(nsi), nse->id);
else else
nsock_trace(ms, "Read request for %d lines from IOD #%li (peer unspecified) EID %li", nlines, nsi->id, nse->id); nsock_trace(ms, "Read request for %d lines from IOD #%li (peer unspecified) EID %li",
nlines, nsi->id, nse->id);
} }
nse->readinfo.read_type = NSOCK_READLINES; nse->readinfo.read_type = NSOCK_READLINES;
@@ -101,10 +102,11 @@ nsock_event_id nsock_readbytes(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handle
if (ms->tracelevel > 0) { if (ms->tracelevel > 0) {
if (nsi->peerlen > 0) if (nsi->peerlen > 0)
nsock_trace(ms, "Read request for %d bytes from IOD #%li [%s:%d] EID %li", nbytes, nsi->id, nsock_trace(ms, "Read request for %d bytes from IOD #%li [%s:%d] EID %li",
inet_ntop_ez(&nsi->peer, nsi->peerlen), nsi_peerport(nsi), nse->id); nbytes, nsi->id, inet_ntop_ez(&nsi->peer, nsi->peerlen), nsi_peerport(nsi), nse->id);
else else
nsock_trace(ms, "Read request for %d bytes from IOD #%li (peer unspecified) EID %li", nbytes, nsi->id, nse->id); nsock_trace(ms, "Read request for %d bytes from IOD #%li (peer unspecified) EID %li",
nbytes, nsi->id, nse->id);
} }
nse->readinfo.read_type = NSOCK_READBYTES; nse->readinfo.read_type = NSOCK_READBYTES;
@@ -128,8 +130,8 @@ nsock_event_id nsock_read(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handler han
if (ms->tracelevel > 0) { if (ms->tracelevel > 0) {
if (nsi->peerlen > 0) if (nsi->peerlen > 0)
nsock_trace(ms, "Read request from IOD #%li [%s:%d] (timeout: %dms) EID %li", nsi->id, nsock_trace(ms, "Read request from IOD #%li [%s:%d] (timeout: %dms) EID %li",
inet_ntop_ez(&nsi->peer, nsi->peerlen), nsi_peerport(nsi), timeout_msecs, nse->id); nsi->id, inet_ntop_ez(&nsi->peer, nsi->peerlen), nsi_peerport(nsi), timeout_msecs, nse->id);
else else
nsock_trace(ms, "Read request from IOD #%li (peer unspecified) (timeout: %dms) EID %li", nsock_trace(ms, "Read request from IOD #%li (peer unspecified) (timeout: %dms) EID %li",
nsi->id, timeout_msecs, nse->id); nsi->id, timeout_msecs, nse->id);