diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-08-17 13:16:26 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-08-17 13:24:33 +0100 |
commit | 518a98eb56f073c4fd1f20c730e474a6f2c8c2e9 (patch) | |
tree | 68b8afa4064fe1c2b95a9a959f8808f881594d0f /src/config | |
parent | 09236e603055b1833c85a6a5a99de401e32df7fc (diff) | |
download | ipxe-518a98eb56f073c4fd1f20c730e474a6f2c8c2e9.tar.gz |
[http] Rewrite HTTP core to support content encodings
Rewrite the HTTP core to allow for the addition of arbitrary content
encoding mechanisms, such as PeerDist and gzip.
The core now exposes http_open() which can be used to create requests
with an explicitly selected HTTP method, an optional requested content
range, and an optional request body. A simple wrapper provides the
preexisting behaviour of creating either a GET request or an
application/x-www-form-urlencoded POST request (if the URI includes
parameters).
The HTTP SAN interface is now implemented using the generic block
device translator. Individual blocks are requested using http_open()
to create a range request.
Server connections are now managed via a connection pool; this allows
for multiple requests to the same server (e.g. for SAN blocks) to be
completely unaware of each other. Repeated HTTPS connections to the
same server can reuse a pooled connection, avoiding the per-connection
overhead of establishing a TLS session (which can take several seconds
if using a client certificate).
Support for HTTP SAN booting and for the Basic and Digest
authentication schemes is now optional and can be controlled via the
SANBOOT_PROTO_HTTP, HTTP_AUTH_BASIC, and HTTP_AUTH_DIGEST build
configuration options in config/general.h.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/config.c | 3 | ||||
-rw-r--r-- | src/config/config_http.c | 42 | ||||
-rw-r--r-- | src/config/defaults/pcbios.h | 1 | ||||
-rw-r--r-- | src/config/general.h | 8 |
4 files changed, 54 insertions, 0 deletions
diff --git a/src/config/config.c b/src/config/config.c index 120a1d4fd..1dd912c1d 100644 --- a/src/config/config.c +++ b/src/config/config.c @@ -140,6 +140,9 @@ REQUIRE_OBJECT ( slam ); #ifdef SANBOOT_PROTO_ISCSI REQUIRE_OBJECT ( iscsi ); #endif +#ifdef SANBOOT_PROTO_HTTP +REQUIRE_OBJECT ( httpblock ); +#endif /* * Drag in all requested resolvers diff --git a/src/config/config_http.c b/src/config/config_http.c new file mode 100644 index 000000000..f1f1b59ce --- /dev/null +++ b/src/config/config_http.c @@ -0,0 +1,42 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + * + * You can also choose to distribute this program under the terms of + * the Unmodified Binary Distribution Licence (as given in the file + * COPYING.UBDL), provided that you have satisfied its requirements. + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +#include <config/general.h> + +/** @file + * + * HTTP extensions + * + */ + +PROVIDE_REQUIRING_SYMBOL(); + +/* + * Drag in HTTP extensions + */ +#ifdef HTTP_AUTH_BASIC +REQUIRE_OBJECT ( httpbasic ); +#endif +#ifdef HTTP_AUTH_DIGEST +REQUIRE_OBJECT ( httpdigest ); +#endif diff --git a/src/config/defaults/pcbios.h b/src/config/defaults/pcbios.h index 4ad812108..3ed8343ce 100644 --- a/src/config/defaults/pcbios.h +++ b/src/config/defaults/pcbios.h @@ -35,6 +35,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #define SANBOOT_PROTO_AOE /* AoE protocol */ #define SANBOOT_PROTO_IB_SRP /* Infiniband SCSI RDMA protocol */ #define SANBOOT_PROTO_FCP /* Fibre Channel protocol */ +#define SANBOOT_PROTO_HTTP /* HTTP SAN protocol */ #define USB_HCD_XHCI /* xHCI USB host controller */ #define USB_HCD_EHCI /* EHCI USB host controller */ diff --git a/src/config/general.h b/src/config/general.h index 35a9030ec..1ebea57e1 100644 --- a/src/config/general.h +++ b/src/config/general.h @@ -67,6 +67,14 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); //#undef SANBOOT_PROTO_AOE /* AoE protocol */ //#undef SANBOOT_PROTO_IB_SRP /* Infiniband SCSI RDMA protocol */ //#undef SANBOOT_PROTO_FCP /* Fibre Channel protocol */ +//#undef SANBOOT_PROTO_HTTP /* HTTP SAN protocol */ + +/* + * HTTP extensions + * + */ +#define HTTP_AUTH_BASIC /* Basic authentication */ +#define HTTP_AUTH_DIGEST /* Digest authentication */ /* * 802.11 cryptosystems and handshaking protocols |