mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05: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:
parent
006b68716b
commit
69cae5d791
@ -307,8 +307,15 @@ read_encoded_file(struct string *filename, struct string *page)
|
|||||||
encoding = guess_encoding(filename->source);
|
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;
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
/* Some file was opened so let's get down to bi'ness */
|
/* Some file was opened so let's get down to bi'ness */
|
||||||
set_bin(fd);
|
set_bin(fd);
|
||||||
|
@ -25,12 +25,10 @@
|
|||||||
#include "intl/gettext/libintl.h"
|
#include "intl/gettext/libintl.h"
|
||||||
#include "main/module.h"
|
#include "main/module.h"
|
||||||
#include "network/connection.h"
|
#include "network/connection.h"
|
||||||
#include "network/socket.h"
|
|
||||||
#include "osdep/osdep.h"
|
#include "osdep/osdep.h"
|
||||||
#include "protocol/common.h"
|
#include "protocol/common.h"
|
||||||
#include "protocol/file/cgi.h"
|
#include "protocol/file/cgi.h"
|
||||||
#include "protocol/file/file.h"
|
#include "protocol/file/file.h"
|
||||||
#include "protocol/http/http.h"
|
|
||||||
#include "protocol/uri.h"
|
#include "protocol/uri.h"
|
||||||
#include "util/conv.h"
|
#include "util/conv.h"
|
||||||
#include "util/file.h"
|
#include "util/file.h"
|
||||||
@ -205,29 +203,6 @@ list_directory(struct connection *conn, unsigned char *dirpath,
|
|||||||
return S_OK;
|
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()]
|
/* To reduce redundant error handling code [calls to abort_connection()]
|
||||||
* most of the function is build around conditions that will assign the error
|
* most of the function is build around conditions that will assign the error
|
||||||
@ -286,20 +261,6 @@ file_protocol_handler(struct connection *connection)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} 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);
|
state = read_encoded_file(&name, &page);
|
||||||
/* FIXME: If state is now S_ENCODE_ERROR we should try loading
|
/* FIXME: If state is now S_ENCODE_ERROR we should try loading
|
||||||
* the file undecoded. --jonas */
|
* the file undecoded. --jonas */
|
||||||
|
Loading…
Reference in New Issue
Block a user