mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
fsp: Call close_socket(socket) rather than close(socket->fd).
This commit is contained in:
parent
fb184a4cd0
commit
3ba31763a9
@ -338,8 +338,13 @@ fsp_got_header(struct socket *socket, struct read_buffer *rb)
|
|||||||
|
|
||||||
conn->cached = get_cache_entry(conn->uri);
|
conn->cached = get_cache_entry(conn->uri);
|
||||||
if (!conn->cached) {
|
if (!conn->cached) {
|
||||||
close(socket->fd);
|
/* Even though these are pipes rather than real
|
||||||
close(conn->data_socket->fd);
|
* sockets, call close_socket instead of close, to
|
||||||
|
* ensure that abort_connection won't try to close the
|
||||||
|
* file descriptors again. (Could we skip the calls
|
||||||
|
* and assume abort_connection will do them?) */
|
||||||
|
close_socket(socket);
|
||||||
|
close_socket(conn->data_socket);
|
||||||
abort_connection(conn, S_OUT_OF_MEM);
|
abort_connection(conn, S_OUT_OF_MEM);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -372,8 +377,8 @@ fsp_got_header(struct socket *socket, struct read_buffer *rb)
|
|||||||
|
|
||||||
buf = alloc_read_buffer(conn->data_socket);
|
buf = alloc_read_buffer(conn->data_socket);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
close(socket->fd);
|
close_socket(socket);
|
||||||
close(conn->data_socket->fd);
|
close_socket(conn->data_socket);
|
||||||
abort_connection(conn, S_OUT_OF_MEM);
|
abort_connection(conn, S_OUT_OF_MEM);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -452,8 +457,8 @@ fsp_protocol_handler(struct connection *conn)
|
|||||||
close(header_pipe[1]);
|
close(header_pipe[1]);
|
||||||
buf2 = alloc_read_buffer(conn->socket);
|
buf2 = alloc_read_buffer(conn->socket);
|
||||||
if (!buf2) {
|
if (!buf2) {
|
||||||
close(fsp_pipe[0]);
|
close_socket(conn->data_socket);
|
||||||
close(header_pipe[0]);
|
close_socket(conn->socket);
|
||||||
abort_connection(conn, S_OUT_OF_MEM);
|
abort_connection(conn, S_OUT_OF_MEM);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user