Added missing "static" declarations
[people/sha0/gpxe.git] / src / net / tcp / http.c
index f81a9b5..88958af 100644 (file)
@@ -216,7 +216,7 @@ struct http_header_handler {
 };
 
 /** List of HTTP header handlers */
-struct http_header_handler http_header_handlers[] = {
+static struct http_header_handler http_header_handlers[] = {
        {
                .header = "Content-Length",
                .rx = http_rx_content_length,
@@ -279,7 +279,7 @@ struct http_line_handler {
 };
 
 /** List of HTTP line-based data handlers */
-struct http_line_handler http_line_handlers[] = {
+static struct http_line_handler http_line_handlers[] = {
        [HTTP_RX_RESPONSE]      = { .rx = http_rx_response },
        [HTTP_RX_HEADER]        = { .rx = http_rx_header },
 };
@@ -388,7 +388,7 @@ static void http_step ( struct process *process ) {
        const char *query = http->uri->query;
        int rc;
 
-       if ( xfer_ready ( &http->socket ) == 0 ) {
+       if ( xfer_window ( &http->socket ) ) {
                process_del ( &http->process );
                if ( ( rc = xfer_printf ( &http->socket,
                                          "GET %s%s%s HTTP/1.1\r\n"
@@ -424,8 +424,8 @@ static void http_socket_close ( struct xfer_interface *socket, int rc ) {
 static struct xfer_interface_operations http_socket_operations = {
        .close          = http_socket_close,
        .vredirect      = xfer_vopen,
-       .request        = ignore_xfer_request,
        .seek           = ignore_xfer_seek,
+       .window         = unlimited_xfer_window,
        .alloc_iob      = default_xfer_alloc_iob,
        .deliver_iob    = http_socket_deliver_iob,
        .deliver_raw    = xfer_deliver_as_iob,
@@ -451,8 +451,8 @@ static void http_xfer_close ( struct xfer_interface *xfer, int rc ) {
 static struct xfer_interface_operations http_xfer_operations = {
        .close          = http_xfer_close,
        .vredirect      = ignore_xfer_vredirect,
-       .request        = ignore_xfer_request,
        .seek           = ignore_xfer_seek,
+       .window         = unlimited_xfer_window,
        .alloc_iob      = default_xfer_alloc_iob,
        .deliver_iob    = xfer_deliver_as_raw,
        .deliver_raw    = ignore_xfer_deliver_raw,
@@ -475,10 +475,9 @@ int http_open ( struct xfer_interface *xfer, struct uri *uri ) {
                return -EINVAL;
 
        /* Allocate and populate HTTP structure */
-       http = malloc ( sizeof ( *http ) );
+       http = zalloc ( sizeof ( *http ) );
        if ( ! http )
                return -ENOMEM;
-       memset ( http, 0, sizeof ( *http ) );
        http->refcnt.free = http_free;
        xfer_init ( &http->xfer, &http_xfer_operations, &http->refcnt );
                http->uri = uri_get ( uri );