diff options
| author | Michael Brown | 2007-01-15 09:49:10 +0100 |
|---|---|---|
| committer | Michael Brown | 2007-01-15 09:49:10 +0100 |
| commit | 4e20d73bb52326261f8cf49c20d6de2edea309ee (patch) | |
| tree | 3d24466a78c4c8f53294384b76e62e871eb96def /src/include/gpxe/http.h | |
| parent | Add missing include (diff) | |
| download | ipxe-4e20d73bb52326261f8cf49c20d6de2edea309ee.tar.gz ipxe-4e20d73bb52326261f8cf49c20d6de2edea309ee.tar.xz ipxe-4e20d73bb52326261f8cf49c20d6de2edea309ee.zip | |
Gave asynchronous operations approximate POSIX signal semantics. This
will enable us to cascade async operations, which is necessary in order to
properly support DNS. (For example, an HTTP request may have to redirect
to a new location and will have to perform a new DNS lookup, so we can't
just rely on doing the name lookup at the time of parsing the initial
URL).
Anything other than HTTP is probably broken right now; I'll fix the others
up asap.
Diffstat (limited to 'src/include/gpxe/http.h')
| -rw-r--r-- | src/include/gpxe/http.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/include/gpxe/http.h b/src/include/gpxe/http.h index ca0afb942..49922e502 100644 --- a/src/include/gpxe/http.h +++ b/src/include/gpxe/http.h @@ -11,6 +11,7 @@ #include <gpxe/tcp.h> #include <gpxe/async.h> #include <gpxe/linebuf.h> +#include <gpxe/uri.h> /** HTTP default port */ #define HTTP_PORT 80 @@ -28,33 +29,29 @@ enum http_rx_state { * */ struct http_request { - /** Server address */ - struct sockaddr_tcpip server; - /** Server host name */ - const char *hostname; - /** Filename */ - const char *filename; + /** URI being fetched */ + struct uri *uri; /** Data buffer to fill */ struct buffer *buffer; + /** Asynchronous operation */ + struct async async; /** HTTP response code */ unsigned int response; /** HTTP Content-Length */ size_t content_length; + /** TCP application for this request */ + struct tcp_application tcp; /** Number of bytes already sent */ size_t tx_offset; /** RX state */ enum http_rx_state rx_state; /** Line buffer for received header lines */ struct line_buffer linebuf; - - /** TCP application for this request */ - struct tcp_application tcp; - /** Asynchronous operation */ - struct async_operation aop; }; -extern struct async_operation * http_get ( struct http_request *http ); +extern int http_get ( struct uri *uri, struct buffer *buffer, + struct async *parent ); #endif /* _GPXE_HTTP_H */ |
