summaryrefslogtreecommitdiff
path: root/core/fs/pxe/http.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2011-05-02 23:36:41 -0700
committerH. Peter Anvin <hpa@zytor.com>2011-05-02 23:39:43 -0700
commit40068cfcbf723c9363194bf20a80b80a53c249fd (patch)
treeb5e0b3aaec9981ac7d97a030e07d32d9de6836de /core/fs/pxe/http.c
parent2da6006eedc7a1481b669090dc112411fbf8b384 (diff)
downloadsyslinux-40068cfcbf723c9363194bf20a80b80a53c249fd.tar.gz
pxe, http: support readdir (ls) over httpsyslinux-4.10-pre12
Use a heuristic http index parser (which is assumed to work with most webserver-generated indicies) to support ls over http. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core/fs/pxe/http.c')
-rw-r--r--core/fs/pxe/http.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/fs/pxe/http.c b/core/fs/pxe/http.c
index 3f2bb15a..1fd87aa6 100644
--- a/core/fs/pxe/http.c
+++ b/core/fs/pxe/http.c
@@ -145,6 +145,12 @@ void http_bake_cookies(void)
http_do_bake_cookies(cookie_buf);
}
+static const struct pxe_conn_ops http_conn_ops = {
+ .fill_buffer = tcp_fill_buffer,
+ .close = tcp_close_file,
+ .readdir = http_readdir,
+};
+
void http_open(struct url_info *url, int flags, struct inode *inode,
const char **redir)
{
@@ -179,7 +185,7 @@ void http_open(struct url_info *url, int flags, struct inode *inode,
return; /* http is broken... */
/* This is a straightforward TCP connection after headers */
- socket->ops = &tcp_conn_ops;
+ socket->ops = &http_conn_ops;
/* Reset all of the variables */
inode->size = content_length = -1;