mirror of
https://github.com/nmap/nmap.git
synced 2026-10-21 19:32:18 +00:00
Fix HTTP proxy SSL mode
This commit is contained in:
parent
d546ada07a
commit
aea57f7849
2 changed files with 7 additions and 6 deletions
|
|
@ -92,7 +92,7 @@ int socket_buffer_read(struct socket_buffer *buf, char *out, size_t size)
|
|||
do {
|
||||
errno = 0;
|
||||
i = fdinfo_recv(&buf->fdn, buf->buffer, sizeof(buf->buffer));
|
||||
} while (i == -1 && errno == EINTR);
|
||||
} while (i == -1 && buf->fdn.lasterr == EINTR);
|
||||
if (i <= 0)
|
||||
return i;
|
||||
buf->end = buf->buffer + i;
|
||||
|
|
@ -130,7 +130,7 @@ char *socket_buffer_readline(struct socket_buffer *buf, size_t *n, size_t maxlen
|
|||
do {
|
||||
errno = 0;
|
||||
i = fdinfo_recv(&buf->fdn, buf->buffer, sizeof(buf->buffer));
|
||||
} while (i == -1 && errno == EINTR);
|
||||
} while (i == -1 && buf->fdn.lasterr == EINTR);
|
||||
if (i <= 0) {
|
||||
free(line);
|
||||
return NULL;
|
||||
|
|
@ -177,7 +177,7 @@ int socket_buffer_readcount(struct socket_buffer *buf, char *out, size_t size)
|
|||
do {
|
||||
errno = 0;
|
||||
i = fdinfo_recv(&buf->fdn, buf->buffer, sizeof(buf->buffer));
|
||||
} while (i == -1 && errno == EINTR);
|
||||
} while (i == -1 && buf->fdn.lasterr == EINTR);
|
||||
if (i <= 0)
|
||||
return -1;
|
||||
buf->end = buf->buffer + i;
|
||||
|
|
|
|||
|
|
@ -296,6 +296,8 @@ static void http_server_handler(int c)
|
|||
char *buf;
|
||||
|
||||
socket_buffer_init(&sock, c);
|
||||
block_socket(sock.fdn.fd);
|
||||
|
||||
#if HAVE_OPENSSL
|
||||
if (o.ssl) {
|
||||
sock.fdn.ssl = new_ssl(sock.fdn.fd);
|
||||
|
|
@ -307,7 +309,6 @@ static void http_server_handler(int c)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
block_socket(sock.fdn.fd);
|
||||
|
||||
code = http_read_request_line(&sock, &buf);
|
||||
if (code != 0) {
|
||||
|
|
@ -478,7 +479,7 @@ static int handle_connect(struct socket_buffer *client_sock,
|
|||
do {
|
||||
do {
|
||||
len = fdinfo_recv(&client_sock->fdn, buf, sizeof(buf));
|
||||
} while (len == -1 && socket_errno() == EINTR);
|
||||
} while (len == -1 && client_sock->fdn.lasterr == EINTR);
|
||||
if (len <= 0)
|
||||
goto end;
|
||||
|
||||
|
|
@ -499,7 +500,7 @@ static int handle_connect(struct socket_buffer *client_sock,
|
|||
|
||||
do {
|
||||
rc = fdinfo_send(&client_sock->fdn, buf, len);
|
||||
} while (rc == -1 && socket_errno() == EINTR);
|
||||
} while (rc == -1 && client_sock->fdn.lasterr == EINTR);
|
||||
if (rc == -1)
|
||||
goto end;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue