From 079fb995bbfbfeb6ed61584bbc565293e73a15da Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Fri, 8 Nov 2024 17:12:53 -0600 Subject: more debugging --- libressl.patch | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/libressl.patch b/libressl.patch index 8f061e2..b359476 100644 --- a/libressl.patch +++ b/libressl.patch @@ -135,7 +135,7 @@ index 9f1dd67ec..7e8da6df2 100644 static void tls_xwrite(tls_state_t *tls, int len) { diff --git a/networking/wget.c b/networking/wget.c -index 6a64836fb..a99bf8dcb 100644 +index 6a64836fb..39a69d0b7 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -169,7 +169,8 @@ @@ -345,15 +345,29 @@ index 6a64836fb..a99bf8dcb 100644 fflush(sfp); /* Tried doing this unconditionally. -@@ -1358,6 +1414,7 @@ static void download_one_url(const char *url) +@@ -1358,14 +1414,21 @@ static void download_one_url(const char *url) * Retrieve HTTP response line and check for "200" status code. */ read_response: + printf("wget download_one_url 27\n"); fgets_trim_sanitize(sfp, " %s\n"); ++ printf("wget download_one_url 27-1\n"); str = G.wget_buf; -@@ -1441,6 +1498,7 @@ However, in real world it was observed that some web servers ++ printf("wget download_one_url 27-2\n"); + str = skip_non_whitespace(str); ++ printf("wget download_one_url 27-3\n"); + str = skip_whitespace(str); ++ printf("wget download_one_url 27-4\n"); + // FIXME: no error check + // xatou wouldn't work: "200 OK" ++ printf("wget download_one_url 27-5\n"); + status = atoi(str); ++ printf("wget download_one_url 27-6\n"); + switch (status) { + case 0: + case 100: +@@ -1441,6 +1504,7 @@ However, in real world it was observed that some web servers /* * Retrieve HTTP headers. */ @@ -361,7 +375,7 @@ index 6a64836fb..a99bf8dcb 100644 while ((str = get_sanitized_hdr(sfp)) != NULL) { static const char keywords[] ALIGN1 = "content-length\0""transfer-encoding\0""location\0"; -@@ -1497,6 +1555,7 @@ However, in real world it was observed that some web servers +@@ -1497,6 +1561,7 @@ However, in real world it was observed that some web servers goto establish_session; } } @@ -369,7 +383,7 @@ index 6a64836fb..a99bf8dcb 100644 // if (status >= 300) // bb_error_msg_and_die("bad redirection (no Location: header from server)"); -@@ -1514,6 +1573,7 @@ However, in real world it was observed that some web servers +@@ -1514,6 +1579,7 @@ However, in real world it was observed that some web servers free(lsa); @@ -377,7 +391,7 @@ index 6a64836fb..a99bf8dcb 100644 if (!(option_mask32 & WGET_OPT_SPIDER)) { if (G.output_fd < 0) G.output_fd = xopen(G.fname_out, G.o_flags); -@@ -1536,6 +1596,7 @@ However, in real world it was observed that some web servers +@@ -1536,6 +1602,7 @@ However, in real world it was observed that some web servers /* ftpcmd("QUIT", NULL, sfp); - why bother? */ } #endif @@ -385,7 +399,7 @@ index 6a64836fb..a99bf8dcb 100644 fclose(sfp); free(server.allocated); -@@ -1544,11 +1605,13 @@ However, in real world it was observed that some web servers +@@ -1544,11 +1611,13 @@ However, in real world it was observed that some web servers free(target.user); free(fname_out_alloc); free(redirected_path); @@ -399,7 +413,7 @@ index 6a64836fb..a99bf8dcb 100644 #if ENABLE_FEATURE_WGET_LONG_OPTIONS static const char wget_longopts[] ALIGN1 = /* name, has_arg, val */ -@@ -1590,6 +1653,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1590,6 +1659,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") #endif INIT_G(); @@ -407,7 +421,7 @@ index 6a64836fb..a99bf8dcb 100644 #if ENABLE_FEATURE_WGET_TIMEOUT G.timeout_seconds = 900; -@@ -1626,6 +1690,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1626,6 +1696,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_data) IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_file) ); @@ -416,7 +430,7 @@ index 6a64836fb..a99bf8dcb 100644 #if 0 /* option bits debug */ if (option_mask32 & WGET_OPT_RETRIES) bb_error_msg("-t NUM"); if (option_mask32 & WGET_OPT_nsomething) bb_error_msg("-nsomething"); -@@ -1670,6 +1736,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1670,6 +1742,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") } #endif @@ -424,7 +438,7 @@ index 6a64836fb..a99bf8dcb 100644 G.output_fd = -1; G.o_flags = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL; if (G.fname_out) { /* -O FILE ? */ -@@ -1691,8 +1758,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1691,8 +1764,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") } } -- cgit v1.2.3-55-g6feb