mirror of
https://github.com/rkd77/elinks.git
synced 2025-04-18 00:47:36 -04:00
Drop unnecessary cgi_pipes[2]
This commit is contained in:
parent
c3f17eadeb
commit
e0103c2c68
@ -303,7 +303,6 @@ init_connection(struct uri *uri, struct uri *proxied_uri, struct uri *referrer,
|
||||
|
||||
conn->content_encoding = ENCODING_NONE;
|
||||
conn->stream_pipes[0] = conn->stream_pipes[1] = -1;
|
||||
conn->cgi_pipes[0] = conn->cgi_pipes[1] = -1;
|
||||
init_list(conn->downloads);
|
||||
conn->est_length = -1;
|
||||
conn->timer = TIMER_ID_UNDEF;
|
||||
@ -401,12 +400,6 @@ free_connection_data(struct connection *conn)
|
||||
|
||||
shutdown_connection_stream(conn);
|
||||
|
||||
if (conn->cgi_pipes[0] >= 0)
|
||||
close(conn->cgi_pipes[0]);
|
||||
if (conn->cgi_pipes[1] >= 0)
|
||||
close(conn->cgi_pipes[1]);
|
||||
conn->cgi_pipes[0] = conn->cgi_pipes[1] = -1;
|
||||
|
||||
mem_free_set(&conn->info, NULL);
|
||||
|
||||
kill_timer(&conn->timer);
|
||||
|
@ -51,7 +51,6 @@ struct connection {
|
||||
|
||||
int tries;
|
||||
timer_id_T timer;
|
||||
int cgi_pipes[2];
|
||||
int stream_pipes[2];
|
||||
|
||||
unsigned int running:1;
|
||||
|
@ -73,8 +73,8 @@ close_pipe_and_read(struct socket *data_socket)
|
||||
rb->freespace -= 17;
|
||||
|
||||
conn->unrestartable = 1;
|
||||
close(conn->cgi_pipes[1]);
|
||||
data_socket->fd = conn->cgi_pipes[1] = -1;
|
||||
close(data_socket->fd);
|
||||
data_socket->fd = -1;
|
||||
|
||||
conn->socket->state = SOCKET_END_ONCLOSE;
|
||||
read_from_socket(conn->socket, rb, S_SENT, http_got_header);
|
||||
@ -119,9 +119,6 @@ send_post_data(struct connection *conn)
|
||||
if (n)
|
||||
add_bytes_to_string(&data, buffer, n);
|
||||
|
||||
/* Use data socket for passing the pipe. It will be cleaned up in
|
||||
* close_pipe_and_read(). */
|
||||
conn->data_socket->fd = conn->cgi_pipes[1];
|
||||
|
||||
write_to_socket(conn->data_socket, data.source, data.length,
|
||||
S_SENT, close_pipe_and_read);
|
||||
@ -383,9 +380,11 @@ execute_cgi(struct connection *conn)
|
||||
mem_free(script);
|
||||
|
||||
close(pipe_read[1]); close(pipe_write[0]);
|
||||
conn->cgi_pipes[0] = pipe_read[0];
|
||||
conn->cgi_pipes[1] = pipe_write[1];
|
||||
conn->socket->fd = conn->cgi_pipes[0];
|
||||
conn->socket->fd = pipe_read[0];
|
||||
|
||||
/* Use data socket for passing the pipe. It will be cleaned up in
|
||||
* close_pipe_and_read(). */
|
||||
conn->data_socket->fd = pipe_read[1];
|
||||
|
||||
send_request(conn);
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user