1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00

Drop unnecessary cgi_pipes[2]

This commit is contained in:
Witold Filipczyk 2006-05-03 21:46:39 +02:00 committed by Witold Filipczyk
parent c3f17eadeb
commit e0103c2c68
3 changed files with 7 additions and 16 deletions

View File

@ -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);

View File

@ -51,7 +51,6 @@ struct connection {
int tries;
timer_id_T timer;
int cgi_pipes[2];
int stream_pipes[2];
unsigned int running:1;

View File

@ -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;