]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: wget: drop Content-Length processing
authorJerome Forissier <jerome.forissier@linaro.org>
Tue, 5 Nov 2024 11:08:49 +0000 (12:08 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 13 Nov 2024 01:08:57 +0000 (19:08 -0600)
We don't do anything with Content-Length except a debug print, and the
strict_strtoul() call is incorrect (it always returns -EINVAL and leaves
content_length to zero due to the presence of trailing characters after
the decimal valuoe of Content-Length). So let's just drop this piece of
code.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
net/wget.c

index 635f82efbb308c365f5e85e32579798dd5986d39..361817ace65fb228b5a286cdf0656f31d33c1181 100644 (file)
@@ -26,7 +26,6 @@ static const char bootfile1[] = "GET ";
 static const char bootfile3[] = " HTTP/1.0\r\n\r\n";
 static const char http_eom[] = "\r\n\r\n";
 static const char http_ok[] = "200";
-static const char content_len[] = "Content-Length";
 static const char linefeed[] = "\r\n";
 static struct in_addr web_server_ip;
 static int our_port;
@@ -46,7 +45,6 @@ struct pkt_qd {
 #define PKTQ_SZ (PKTBUFSRX / 4)
 static struct pkt_qd pkt_q[PKTQ_SZ];
 static int pkt_q_idx;
-static unsigned long content_length;
 static unsigned int packets;
 
 static unsigned int initial_data_seq_num;
@@ -251,17 +249,6 @@ static void wget_connected(uchar *pkt, unsigned int tcp_seq_num,
                                   "wget: Connected Pkt %p hlen %x\n",
                                   pkt, hlen);
 
-                       pos = strstr((char *)pkt, content_len);
-                       if (!pos) {
-                               content_length = -1;
-                       } else {
-                               pos += sizeof(content_len) + 2;
-                               strict_strtoul(pos, 10, &content_length);
-                               debug_cond(DEBUG_WGET,
-                                          "wget: Connected Len %lu\n",
-                                          content_length);
-                       }
-
                        net_boot_file_size = 0;
 
                        if (len > hlen) {