From 4e20d73bb52326261f8cf49c20d6de2edea309ee Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 15 Jan 2007 08:49:10 +0000 Subject: 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. --- src/include/gpxe/http.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/include/gpxe/http.h') 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 #include #include +#include /** 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 */ -- cgit v1.2.3-55-g7522