summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDerek Pryor2006-08-12 20:54:59 +0200
committerDerek Pryor2006-08-12 20:54:59 +0200
commit0f8870301920303fc00fe68897e18a5c6c5c5022 (patch)
tree7a08deb802672ce002ba08b03189ade2ea367d56 /src
parentPrint net device name when making request. (diff)
downloadipxe-0f8870301920303fc00fe68897e18a5c6c5c5022.tar.gz
ipxe-0f8870301920303fc00fe68897e18a5c6c5c5022.tar.xz
ipxe-0f8870301920303fc00fe68897e18a5c6c5c5022.zip
Bug fixes to the HTTP protocol code
Diffstat (limited to 'src')
-rw-r--r--src/net/tcp/http.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/net/tcp/http.c b/src/net/tcp/http.c
index 56e15af27..90c117d53 100644
--- a/src/net/tcp/http.c
+++ b/src/net/tcp/http.c
@@ -1,4 +1,5 @@
#include <stddef.h>
+#include <stdlib.h>
#include <string.h>
#include <vsprintf.h>
#include <assert.h>
@@ -158,13 +159,11 @@ static void http_newdata ( struct tcp_connection *conn, void *data,
*/
static void http_senddata ( struct tcp_connection *conn, void *buf, size_t len ) {
struct http_request *http = tcp_to_http ( conn );
- char buf[66]; // 16 request + 50 for filename
- size_t len;
switch ( http->state ){
case HTTP_REQUEST_FILE:
- len = snprintf(buf,66,"GET %s HTTP/1.0\r\n\r\n",http->filename);
- printf("%s\n",buf);
+ len = snprintf(buf,len,"GET %s HTTP/1.0\r\n\r\n",http->filename);
+ printf("%s\n",(char *)buf);
// string is: GET <file> HTTP/1.0\r\n\r\n
tcp_send ( conn, buf, len);