1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-27 02:56:18 -04:00

Revert "Gradual rendering in pager mode. ELinks is almost as good as less."

I am reverting all /dev/fd recognition because of bug 917.
This reverts commit c283f8cfd9,
except src/protocol/file/file.c still needs #include "osdep/osdep.h"
for STRING_DIR_SEP.
This commit is contained in:
Kalle Olavi Niemitalo 2008-06-15 19:25:13 +03:00 committed by Kalle Olavi Niemitalo
parent 006b68716b
commit 69cae5d791
2 changed files with 8 additions and 40 deletions

View File

@ -307,8 +307,15 @@ read_encoded_file(struct string *filename, struct string *page)
encoding = guess_encoding(filename->source);
}
if (fd == -1)
if (fd == -1) {
#ifdef HAVE_SYS_CYGWIN_H
/* There is no /dev/stdin on Cygwin. */
if (!strlcmp(filename->source, filename->length, "/dev/stdin", 10)) {
fd = STDIN_FILENO;
} else
#endif
return state;
}
/* Some file was opened so let's get down to bi'ness */
set_bin(fd);

View File

@ -25,12 +25,10 @@
#include "intl/gettext/libintl.h"
#include "main/module.h"
#include "network/connection.h"
#include "network/socket.h"
#include "osdep/osdep.h"
#include "protocol/common.h"
#include "protocol/file/cgi.h"
#include "protocol/file/file.h"
#include "protocol/http/http.h"
#include "protocol/uri.h"
#include "util/conv.h"
#include "util/file.h"
@ -205,29 +203,6 @@ list_directory(struct connection *conn, unsigned char *dirpath,
return S_OK;
}
static void
read_special(struct connection *conn, int fd)
{
struct read_buffer *rb;
if (!init_http_connection_info(conn, 1, 0, 1)) {
abort_connection(conn, S_OUT_OF_MEM);
return;
}
set_nonblocking_fd(fd);
conn->socket->fd = fd;
rb = alloc_read_buffer(conn->socket);
if (!rb) {
abort_connection(conn, S_OUT_OF_MEM);
return;
}
memcpy(rb->data, "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\n\r\n", 45);
rb->length = 45;
rb->freespace -= 45;
conn->socket->state = SOCKET_END_ONCLOSE;
read_from_socket(conn->socket, rb, S_SENT, http_got_header);
}
/* To reduce redundant error handling code [calls to abort_connection()]
* most of the function is build around conditions that will assign the error
@ -286,20 +261,6 @@ file_protocol_handler(struct connection *connection)
}
} else {
if (!strcmp(name.source, "/dev/stdin")) {
done_string(&name);
read_special(connection, STDIN_FILENO);
return;
}
if (!strncmp(name.source, "/dev/fd/", 8)) {
int fd = atoi(name.source + 8);
if (fd > 0) {
done_string(&name);
read_special(connection, fd);
return;
}
}
state = read_encoded_file(&name, &page);
/* FIXME: If state is now S_ENCODE_ERROR we should try loading
* the file undecoded. --jonas */