david/ipxe
Archived
1
0
Commit Graph

39 Commits

Author SHA1 Message Date
Michael Brown
272e6ddc30 [http] Support HTTP redirection 2009-03-30 13:28:33 +01:00
Michael Brown
323cdf8c4c [xfer] Implement xfer_vreopen() to properly handle redirections
When handling a redirection event, we need to close the existing
connection before opening the new connection.
2009-03-30 13:24:56 +01:00
Michael Brown
54840039f6 [http] Send authentication information whenever username is present
Send authentication information if the username is present, even if
the password is empty.
2009-02-17 11:56:27 +00:00
Michael Brown
8ae1cac050 [xfer] Make consistent assumptions that xfer metadata can never be NULL
The documentation in xfer.h and xfer.c does not say that the metadata
parameter is optional in calls such as xfer_deliver_iob_meta() and the
deliver_iob() method.  However, some code in net/ is prepared to
accept a NULL pointer, and xfer_deliver_as_iob() passes a NULL pointer
directly to the deliver_iob() method.

Fix this mess of conflicting assumptions by making everything assume
that the metadata parameter is mandatory, and fixing
xfer_deliver_as_iob() to pass in a dummy metadata structure (as is
already done in xfer_deliver_iob()).
2009-02-15 08:44:22 +00:00
Michael Brown
816a32aaee [http] Allow for URI encodings within username and password 2009-02-13 16:26:43 +00:00
Michael Brown
ef70f87997 [http] Add support for HTTP Basic authentication 2009-02-13 15:43:17 +00:00
Michael Brown
dbe84c5aad [iobuf] Add iob_disown() and use it where it simplifies code
There are many functions that take ownership of the I/O buffer they
are passed as a parameter.  The caller should not retain a pointer to
the I/O buffer.  Use iob_disown() to automatically nullify the
caller's pointer, e.g.:

    xfer_deliver_iob ( xfer, iob_disown ( iobuf ) );

This will ensure that iobuf is set to NULL for any code after the call
to xfer_deliver_iob().

iob_disown() is currently used only in places where it simplifies the
code, by avoiding an extra line explicitly setting the I/O buffer
pointer to NULL.  It should ideally be used with each call to any
function that takes ownership of an I/O buffer.  (The SSA
optimisations will ensure that use of iob_disown() gets optimised away
in cases where the caller makes no further use of the I/O buffer
pointer anyway.)

If gcc ever introduces an __attribute__((free)), indicating that use
of a function argument after a function call should generate a
warning, then we should use this to identify all applicable function
call sites, and add iob_disown() as necessary.
2009-02-01 20:16:10 +00:00
H. Peter Anvin
b107637008 [http] gPXE is a HTTP/1.0 client, not a HTTP/1.1 client
gPXE is not compliant with the HTTP/1.1 specification (RFC 2616),
since it lacks support for "Transfer-Encoding: chunked".  gPXE is,
however, compliant with the HTTP/1.0 specification (RFC 1945), which
does not require "Transfer-Encoding: chunked" to be supported.

The only HTTP/1.1 feature that gPXE uses is the "Host:" header, but
servers universally accept that one from HTTP/1.0 clients as an
optional extension (it is obligatory for HTTP/1.1).  gPXE does not,
for example, appear to support connection caching.  Advertising as a
HTTP/1.0 client will typically make the server close the connection
immediately upon sending the last data, which is actually beneficial
if we aren't going to keep the connection alive anyway.
2008-03-31 05:01:08 -07:00
Michael Brown
f6a8158eed Make seek information part of the xfer metadata, rather than an entirely
separate xfer method.

Add missing .alloc_iob entries to several xfer_interface_operations
structures.
2008-01-08 16:46:55 +00:00
Michael Brown
9fd6a0418f Allowed zero-cost enforced ordering of features in startup banner
list.

Added FEATURE() macros to most relevant (non-driver) files.
2007-08-02 14:51:03 +01:00
Michael Brown
67afe84292 Use otherwise-useless byte in DHCP feature option as a version number 2007-08-02 04:36:00 +01:00
Michael Brown
bf3d8fb1aa Allowed HTTPS to be a separately configurable feature. 2007-07-30 03:01:04 +01:00
Michael Brown
6fc9ed167e TLS now working again. 2007-07-30 02:48:38 +01:00
Holger Lubitz
e6cfa7ced9 make http_open static 2007-07-27 21:59:09 +02:00
Michael Brown
94415b7669 Added missing "static" declarations 2007-07-17 01:42:10 +01:00
Michael Brown
b34d4d0449 Separate the "is data ready" function of xfer_seek() into an
xfer_window() function, which can return a scalar rather than a
boolean.
2007-07-08 14:11:07 +01:00
Michael Brown
ca4c6f9eee Kill off unused request() method in data-xfer interface. 2007-07-08 02:10:54 +01:00
Holger Lubitz
7872b890fe convert to zalloc 2007-07-06 20:50:32 +02:00
Michael Brown
a5f33ea283 Added missing line to set return status code. 2007-07-03 21:22:12 +01:00
Michael Brown
95adce0ce1 Add concept of transfer metadata, to be used by UDP in order to
implement sendto()/recvfrom() equivalents.
2007-06-11 15:04:39 +01:00
Michael Brown
735e07268e Update HTTP to use data-xfer interface. 2007-05-29 15:37:09 +00:00
Michael Brown
af3149d18e Allow queries in GET requests 2007-02-01 21:01:47 +00:00
Michael Brown
a3695b1ff6 Placeholder for TLS insertion 2007-01-31 03:47:42 +00:00
Michael Brown
6d32f0e6e2 Changed to use the generic stream API. 2007-01-31 02:09:13 +00:00
Michael Brown
bde8878eef Keep HTTP progress updated, and display a progress indicator during the
download
2007-01-29 04:19:45 +00:00
Michael Brown
73b09ecba6 Use stdio.h instead of vsprintf.h 2007-01-19 01:13:12 +00:00
Michael Brown
4e3976711d A working name resolution framework 2007-01-18 22:38:13 +00:00
Michael Brown
6c72bf13a1 Presize the download buffer when we see the Content-Length header;
this saves around 70us per received packet (which is around 50% of the
overall packet processing time).
2007-01-18 13:26:57 +00:00
Michael Brown
08da93a311 Reorder functions to more closely reflect the flow of control 2007-01-18 13:10:26 +00:00
Michael Brown
dd6d94004f HTTP/DNS now working fully asynchronously. HTTP/IP addresses and any
other protocol won't work at the moment.
2007-01-18 03:39:45 +00:00
Michael Brown
143d14614d Quickly hack in DNS resolution as a proof of concept 2007-01-15 17:32:52 +00:00
Michael Brown
afa752f5fb Protocol's get() method no longer takes ownership of the URI. HTTP is the
exception rather than the rule; we may as well keep things clean for other
protocols.
2007-01-15 09:18:06 +00:00
Michael Brown
1f92c6b3e8 Must free http on the error path; nothing else will do it 2007-01-15 09:08:40 +00:00
Michael Brown
4e20d73bb5 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.
2007-01-15 08:49:10 +00:00
Michael Brown
497c3a5aad Fixed HTTP 2007-01-12 19:18:13 +00:00
Michael Brown
61ed298bc7 Merge changes from mcb-tcp-fixes branch. 2006-12-27 23:09:46 +00:00
Derek Pryor
562ab6d65c Bug fixes to the HTTP protocol code 2006-08-12 19:05:08 +00:00
Derek Pryor
0f88703019 Bug fixes to the HTTP protocol code 2006-08-12 18:54:59 +00:00
Derek Pryor
25ea34a8d7 New HTTP protocol and test code 2006-08-11 14:13:02 +00:00