On Tue, Jan 26, 2010 at 8:22 PM, Kyle Kienapfel <[email protected]> wrote:
> There is a bug in gPXE though.
>
> This works in 1.0.0: chain http://www.netboot.me/
>
> 17:17 < Docteh> chain http://192.168.0.10 vs chain
> http://192.168.0.10/ aren't sending the same GET / request
You're absolutely right; thank you for tracking this down! A patch is
attached, or grab the staging branch oremanj-x-emptyuri. I anticipate
the fix will be added to gPXE git in less than a day.
-- Josh
diff --git a/src/core/uri.c b/src/core/uri.c
index 9666778..6a1f2e5 100644
--- a/src/core/uri.c
+++ b/src/core/uri.c
@@ -225,12 +225,13 @@ int unparse_uri ( char *buf, size_t size, struct uri *uri,
dump_uri ( uri );
DBG ( "\n" );
+ /* Ensure buffer is NUL-terminated */
+ if ( size )
+ buf[0] = '\0';
+
/* Special-case NULL URI */
- if ( ! uri ) {
- if ( size )
- buf[0] = '\0';
+ if ( ! uri )
return 0;
- }
/* Iterate through requested fields */
for ( i = URI_FIRST_FIELD; i <= URI_LAST_FIELD; i++ ) {
diff --git a/src/net/tcp/http.c b/src/net/tcp/http.c
index 807a0c3..a365b2a 100644
--- a/src/net/tcp/http.c
+++ b/src/net/tcp/http.c
@@ -452,11 +452,12 @@ static void http_step ( struct process *process ) {
/* Send GET request */
if ( ( rc = xfer_printf ( &http->socket,
- "GET %s HTTP/1.0\r\n"
+ "GET %s%s HTTP/1.0\r\n"
"User-Agent: gPXE/" VERSION "\r\n"
"%s%s%s"
"Host: %s\r\n"
"\r\n",
+ http->uri->path ? "" : "/",
request,
( user ?
"Authorization: Basic " : "" ),
_______________________________________________
gPXE mailing list
[email protected]
http://etherboot.org/mailman/listinfo/gpxe