mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Minor space cleanups; use pid_t; abort_connection() will close_socket()
This commit is contained in:
parent
c6a0cef63a
commit
91f0abfbc1
@ -156,7 +156,7 @@ fsp_directory(FSP_SESSION *ses, struct uri *uri)
|
|||||||
}
|
}
|
||||||
|
|
||||||
printf("<html><head><title>%s</title><base href=\"%s\">"
|
printf("<html><head><title>%s</title><base href=\"%s\">"
|
||||||
"</head><body><pre>", buf.source, buf.source);
|
"</head><body><pre>", buf.source, buf.source);
|
||||||
|
|
||||||
dir = fsp_opendir(ses, data);
|
dir = fsp_opendir(ses, data);
|
||||||
if (!dir) goto end;
|
if (!dir) goto end;
|
||||||
@ -173,7 +173,7 @@ fsp_directory(FSP_SESSION *ses, struct uri *uri)
|
|||||||
} else {
|
} else {
|
||||||
dircolor[0] = 0;
|
dircolor[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!fsp_readdir_native(dir, &fentry, &fresult)) {
|
while (!fsp_readdir_native(dir, &fentry, &fresult)) {
|
||||||
if (!fresult) break;
|
if (!fresult) break;
|
||||||
printf("%10d\t<a href=\"%s\">", fentry.size, fentry.name);
|
printf("%10d\t<a href=\"%s\">", fentry.size, fentry.name);
|
||||||
@ -239,10 +239,10 @@ fsp_got_data(struct socket *socket, struct read_buffer *rb)
|
|||||||
abort_connection(conn, -errno);
|
abort_connection(conn, -errno);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
if (conn->from)
|
if (conn->from)
|
||||||
normalize_cache_entry(conn->cached, conn->from);
|
normalize_cache_entry(conn->cached, conn->from);
|
||||||
close_socket(socket);
|
|
||||||
abort_connection(conn, S_OK);
|
abort_connection(conn, S_OK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -253,6 +253,7 @@ fsp_got_data(struct socket *socket, struct read_buffer *rb)
|
|||||||
conn->tries = 0;
|
conn->tries = 0;
|
||||||
conn->from += len;
|
conn->from += len;
|
||||||
kill_buffer_data(rb, len);
|
kill_buffer_data(rb, len);
|
||||||
|
|
||||||
read_from_socket(socket, rb, S_TRANS, fsp_got_data);
|
read_from_socket(socket, rb, S_TRANS, fsp_got_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +264,7 @@ void
|
|||||||
fsp_protocol_handler(struct connection *conn)
|
fsp_protocol_handler(struct connection *conn)
|
||||||
{
|
{
|
||||||
int fsp_pipe[2] = { -1, -1 };
|
int fsp_pipe[2] = { -1, -1 };
|
||||||
int cpid;
|
pid_t cpid;
|
||||||
struct read_buffer *buf;
|
struct read_buffer *buf;
|
||||||
|
|
||||||
if (c_pipe(fsp_pipe)) {
|
if (c_pipe(fsp_pipe)) {
|
||||||
@ -304,7 +305,7 @@ fsp_protocol_handler(struct connection *conn)
|
|||||||
|
|
||||||
close_all_non_term_fd();
|
close_all_non_term_fd();
|
||||||
do_fsp(conn);
|
do_fsp(conn);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
conn->socket->fd = fsp_pipe[0];
|
conn->socket->fd = fsp_pipe[0];
|
||||||
close(fsp_pipe[1]);
|
close(fsp_pipe[1]);
|
||||||
|
Loading…
Reference in New Issue
Block a user