diff options
| author | Alexander M Pickering <alex@cogarr.net> | 2024-11-12 17:20:58 -0600 |
|---|---|---|
| committer | Alexander M Pickering <alex@cogarr.net> | 2024-11-12 17:20:58 -0600 |
| commit | 80d885f2bc6c6c77d84f9d1c69a9bb20322f3022 (patch) | |
| tree | d26e586e7e405ad62e49810be1b34a3cbf842a32 | |
| parent | ac2438aca36b1e978470a5aff8a46a4bae6e5408 (diff) | |
| download | busybox-w32-packaging-80d885f2bc6c6c77d84f9d1c69a9bb20322f3022.tar.gz busybox-w32-packaging-80d885f2bc6c6c77d84f9d1c69a9bb20322f3022.tar.bz2 busybox-w32-packaging-80d885f2bc6c6c77d84f9d1c69a9bb20322f3022.zip | |
More debugging
| -rw-r--r-- | libressl.patch | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/libressl.patch b/libressl.patch index cdcbf53..03cb0bb 100644 --- a/libressl.patch +++ b/libressl.patch | |||
| @@ -135,7 +135,7 @@ index 9f1dd67ec..7e8da6df2 100644 | |||
| 135 | static void tls_xwrite(tls_state_t *tls, int len) | 135 | static void tls_xwrite(tls_state_t *tls, int len) |
| 136 | { | 136 | { |
| 137 | diff --git a/networking/wget.c b/networking/wget.c | 137 | diff --git a/networking/wget.c b/networking/wget.c |
| 138 | index 6a64836fb..97ca7382e 100644 | 138 | index 6a64836fb..b9a760149 100644 |
| 139 | --- a/networking/wget.c | 139 | --- a/networking/wget.c |
| 140 | +++ b/networking/wget.c | 140 | +++ b/networking/wget.c |
| 141 | @@ -169,7 +169,11 @@ | 141 | @@ -169,7 +169,11 @@ |
| @@ -252,7 +252,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 252 | 252 | ||
| 253 | return c; | 253 | return c; |
| 254 | } | 254 | } |
| 255 | @@ -636,6 +699,30 @@ static void parse_url(const char *src_url, struct host_info *h) | 255 | @@ -636,6 +699,31 @@ static void parse_url(const char *src_url, struct host_info *h) |
| 256 | */ | 256 | */ |
| 257 | } | 257 | } |
| 258 | 258 | ||
| @@ -264,6 +264,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 264 | + c = tlsgets_trim_sanitize(ctx, " %s\n"); | 264 | + c = tlsgets_trim_sanitize(ctx, " %s\n"); |
| 265 | + if(G.wget_buf[0] == '\0') | 265 | + if(G.wget_buf[0] == '\0') |
| 266 | + return NULL; | 266 | + return NULL; |
| 267 | + printf("While getting header, buf was: %s", G.wget_buf); | ||
| 267 | + for(s = G.wget_buf; isalnum(*s) || *s == '-' || *s == '.' || *s == '_'; ++s) | 268 | + for(s = G.wget_buf; isalnum(*s) || *s == '-' || *s == '.' || *s == '_'; ++s) |
| 268 | + *s |= 0x20; | 269 | + *s |= 0x20; |
| 269 | + if(*s != ':') | 270 | + if(*s != ':') |
| @@ -283,7 +284,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 283 | static char *get_sanitized_hdr(FILE *fp) | 284 | static char *get_sanitized_hdr(FILE *fp) |
| 284 | { | 285 | { |
| 285 | char *s, *hdrval; | 286 | char *s, *hdrval; |
| 286 | @@ -689,6 +776,7 @@ static void reset_beg_range_to_zero(void) | 287 | @@ -689,6 +777,7 @@ static void reset_beg_range_to_zero(void) |
| 287 | } | 288 | } |
| 288 | 289 | ||
| 289 | #if ENABLE_FEATURE_WGET_OPENSSL | 290 | #if ENABLE_FEATURE_WGET_OPENSSL |
| @@ -291,7 +292,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 291 | static int spawn_https_helper_openssl(const char *host, unsigned port) | 292 | static int spawn_https_helper_openssl(const char *host, unsigned port) |
| 292 | { | 293 | { |
| 293 | char *allocated = NULL; | 294 | char *allocated = NULL; |
| 294 | @@ -777,6 +865,38 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) | 295 | @@ -777,6 +866,38 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) |
| 295 | # endif | 296 | # endif |
| 296 | return sp[0]; | 297 | return sp[0]; |
| 297 | } | 298 | } |
| @@ -330,7 +331,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 330 | #endif | 331 | #endif |
| 331 | 332 | ||
| 332 | #if ENABLE_FEATURE_WGET_HTTPS | 333 | #if ENABLE_FEATURE_WGET_HTTPS |
| 333 | @@ -1151,6 +1271,7 @@ static void download_one_url(const char *url) | 334 | @@ -1151,6 +1272,7 @@ static void download_one_url(const char *url) |
| 334 | server.user = NULL; | 335 | server.user = NULL; |
| 335 | target.user = NULL; | 336 | target.user = NULL; |
| 336 | 337 | ||
| @@ -338,7 +339,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 338 | parse_url(url, &target); | 339 | parse_url(url, &target); |
| 339 | 340 | ||
| 340 | /* Use the proxy if necessary */ | 341 | /* Use the proxy if necessary */ |
| 341 | @@ -1172,6 +1293,7 @@ static void download_one_url(const char *url) | 342 | @@ -1172,6 +1294,7 @@ static void download_one_url(const char *url) |
| 342 | server.host = target.host; | 343 | server.host = target.host; |
| 343 | } | 344 | } |
| 344 | } | 345 | } |
| @@ -346,7 +347,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 346 | 347 | ||
| 347 | if (ENABLE_FEATURE_IPV6) | 348 | if (ENABLE_FEATURE_IPV6) |
| 348 | strip_ipv6_scope_id(target.host); | 349 | strip_ipv6_scope_id(target.host); |
| 349 | @@ -1191,6 +1313,7 @@ static void download_one_url(const char *url) | 350 | @@ -1191,6 +1314,7 @@ static void download_one_url(const char *url) |
| 350 | G.fname_out = fname_out_alloc = xstrdup(G.fname_out); | 351 | G.fname_out = fname_out_alloc = xstrdup(G.fname_out); |
| 351 | } | 352 | } |
| 352 | } | 353 | } |
| @@ -354,7 +355,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 354 | #if ENABLE_FEATURE_WGET_STATUSBAR | 355 | #if ENABLE_FEATURE_WGET_STATUSBAR |
| 355 | G.curfile = bb_get_last_path_component_nostrip(G.fname_out); | 356 | G.curfile = bb_get_last_path_component_nostrip(G.fname_out); |
| 356 | #endif | 357 | #endif |
| 357 | @@ -1206,15 +1329,19 @@ static void download_one_url(const char *url) | 358 | @@ -1206,15 +1330,19 @@ static void download_one_url(const char *url) |
| 358 | * We are not sure it exists on remote side */ | 359 | * We are not sure it exists on remote side */ |
| 359 | } | 360 | } |
| 360 | 361 | ||
| @@ -374,7 +375,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 374 | /*G.content_len = 0; - redundant, got_clen = 0 is enough */ | 375 | /*G.content_len = 0; - redundant, got_clen = 0 is enough */ |
| 375 | G.got_clen = 0; | 376 | G.got_clen = 0; |
| 376 | G.chunked = 0; | 377 | G.chunked = 0; |
| 377 | @@ -1229,37 +1356,64 @@ static void download_one_url(const char *url) | 378 | @@ -1229,37 +1357,64 @@ static void download_one_url(const char *url) |
| 378 | 379 | ||
| 379 | /* Open socket to http(s) server */ | 380 | /* Open socket to http(s) server */ |
| 380 | #if ENABLE_FEATURE_WGET_OPENSSL | 381 | #if ENABLE_FEATURE_WGET_OPENSSL |
| @@ -452,7 +453,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 452 | /* Send HTTP request */ | 453 | /* Send HTTP request */ |
| 453 | if (use_proxy) { | 454 | if (use_proxy) { |
| 454 | SENDFMT(sfp, "GET %s://%s/%s HTTP/1.1\r\n", | 455 | SENDFMT(sfp, "GET %s://%s/%s HTTP/1.1\r\n", |
| 455 | @@ -1270,6 +1424,7 @@ static void download_one_url(const char *url) | 456 | @@ -1270,6 +1425,7 @@ static void download_one_url(const char *url) |
| 456 | (option_mask32 & WGET_OPT_POST) ? "POST" : "GET", | 457 | (option_mask32 & WGET_OPT_POST) ? "POST" : "GET", |
| 457 | target.path); | 458 | target.path); |
| 458 | } | 459 | } |
| @@ -460,7 +461,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 460 | if (!USR_HEADER_HOST) | 461 | if (!USR_HEADER_HOST) |
| 461 | SENDFMT(sfp, "Host: %s\r\n", target.host); | 462 | SENDFMT(sfp, "Host: %s\r\n", target.host); |
| 462 | if (!USR_HEADER_USER_AGENT) | 463 | if (!USR_HEADER_USER_AGENT) |
| 463 | @@ -1280,6 +1435,7 @@ static void download_one_url(const char *url) | 464 | @@ -1280,6 +1436,7 @@ static void download_one_url(const char *url) |
| 464 | */ | 465 | */ |
| 465 | SENDFMT(sfp, "Connection: close\r\n"); | 466 | SENDFMT(sfp, "Connection: close\r\n"); |
| 466 | 467 | ||
| @@ -468,7 +469,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 468 | #if ENABLE_FEATURE_WGET_AUTHENTICATION | 469 | #if ENABLE_FEATURE_WGET_AUTHENTICATION |
| 469 | if (target.user && !USR_HEADER_AUTH) { | 470 | if (target.user && !USR_HEADER_AUTH) { |
| 470 | SENDFMT(sfp, "Proxy-Authorization: Basic %s\r\n"+6, | 471 | SENDFMT(sfp, "Proxy-Authorization: Basic %s\r\n"+6, |
| 471 | @@ -1291,6 +1447,7 @@ static void download_one_url(const char *url) | 472 | @@ -1291,6 +1448,7 @@ static void download_one_url(const char *url) |
| 472 | } | 473 | } |
| 473 | #endif | 474 | #endif |
| 474 | 475 | ||
| @@ -476,7 +477,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 476 | if (G.beg_range != 0 && !USR_HEADER_RANGE) | 477 | if (G.beg_range != 0 && !USR_HEADER_RANGE) |
| 477 | SENDFMT(sfp, "Range: bytes=%"OFF_FMT"u-\r\n", G.beg_range); | 478 | SENDFMT(sfp, "Range: bytes=%"OFF_FMT"u-\r\n", G.beg_range); |
| 478 | 479 | ||
| 479 | @@ -1300,6 +1457,7 @@ static void download_one_url(const char *url) | 480 | @@ -1300,6 +1458,7 @@ static void download_one_url(const char *url) |
| 480 | fputs(G.extra_headers, sfp); | 481 | fputs(G.extra_headers, sfp); |
| 481 | } | 482 | } |
| 482 | 483 | ||
| @@ -484,7 +485,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 484 | if (option_mask32 & WGET_OPT_POST_FILE) { | 485 | if (option_mask32 & WGET_OPT_POST_FILE) { |
| 485 | int fd = xopen_stdin(G.post_file); | 486 | int fd = xopen_stdin(G.post_file); |
| 486 | G.post_data = xmalloc_read(fd, NULL); | 487 | G.post_data = xmalloc_read(fd, NULL); |
| 487 | @@ -1314,15 +1472,18 @@ static void download_one_url(const char *url) | 488 | @@ -1314,15 +1473,18 @@ static void download_one_url(const char *url) |
| 488 | ); | 489 | ); |
| 489 | } | 490 | } |
| 490 | # if ENABLE_PLATFORM_MINGW32 | 491 | # if ENABLE_PLATFORM_MINGW32 |
| @@ -503,7 +504,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 503 | } else | 504 | } else |
| 504 | # else | 505 | # else |
| 505 | SENDFMT(sfp, | 506 | SENDFMT(sfp, |
| 506 | @@ -1338,6 +1499,7 @@ static void download_one_url(const char *url) | 507 | @@ -1338,6 +1500,7 @@ static void download_one_url(const char *url) |
| 507 | SENDFMT(sfp, "\r\n"); | 508 | SENDFMT(sfp, "\r\n"); |
| 508 | } | 509 | } |
| 509 | 510 | ||
| @@ -511,7 +512,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 511 | fflush(sfp); | 512 | fflush(sfp); |
| 512 | 513 | ||
| 513 | /* Tried doing this unconditionally. | 514 | /* Tried doing this unconditionally. |
| 514 | @@ -1345,31 +1507,60 @@ static void download_one_url(const char *url) | 515 | @@ -1345,31 +1508,60 @@ static void download_one_url(const char *url) |
| 515 | */ | 516 | */ |
| 516 | #if SSL_SUPPORTED | 517 | #if SSL_SUPPORTED |
| 517 | if (target.protocol == P_HTTPS) { | 518 | if (target.protocol == P_HTTPS) { |
| @@ -575,7 +576,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 575 | /* eat all remaining headers */; | 576 | /* eat all remaining headers */; |
| 576 | goto read_response; | 577 | goto read_response; |
| 577 | 578 | ||
| 578 | @@ -1441,7 +1632,8 @@ However, in real world it was observed that some web servers | 579 | @@ -1441,7 +1633,8 @@ However, in real world it was observed that some web servers |
| 579 | /* | 580 | /* |
| 580 | * Retrieve HTTP headers. | 581 | * Retrieve HTTP headers. |
| 581 | */ | 582 | */ |
| @@ -585,7 +586,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 585 | static const char keywords[] ALIGN1 = | 586 | static const char keywords[] ALIGN1 = |
| 586 | "content-length\0""transfer-encoding\0""location\0"; | 587 | "content-length\0""transfer-encoding\0""location\0"; |
| 587 | enum { | 588 | enum { |
| 588 | @@ -1497,6 +1689,7 @@ However, in real world it was observed that some web servers | 589 | @@ -1497,6 +1690,7 @@ However, in real world it was observed that some web servers |
| 589 | goto establish_session; | 590 | goto establish_session; |
| 590 | } | 591 | } |
| 591 | } | 592 | } |
| @@ -593,7 +594,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 593 | // if (status >= 300) | 594 | // if (status >= 300) |
| 594 | // bb_error_msg_and_die("bad redirection (no Location: header from server)"); | 595 | // bb_error_msg_and_die("bad redirection (no Location: header from server)"); |
| 595 | 596 | ||
| 596 | @@ -1514,6 +1707,7 @@ However, in real world it was observed that some web servers | 597 | @@ -1514,6 +1708,7 @@ However, in real world it was observed that some web servers |
| 597 | 598 | ||
| 598 | free(lsa); | 599 | free(lsa); |
| 599 | 600 | ||
| @@ -601,7 +602,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 601 | if (!(option_mask32 & WGET_OPT_SPIDER)) { | 602 | if (!(option_mask32 & WGET_OPT_SPIDER)) { |
| 602 | if (G.output_fd < 0) | 603 | if (G.output_fd < 0) |
| 603 | G.output_fd = xopen(G.fname_out, G.o_flags); | 604 | G.output_fd = xopen(G.fname_out, G.o_flags); |
| 604 | @@ -1536,6 +1730,7 @@ However, in real world it was observed that some web servers | 605 | @@ -1536,6 +1731,7 @@ However, in real world it was observed that some web servers |
| 605 | /* ftpcmd("QUIT", NULL, sfp); - why bother? */ | 606 | /* ftpcmd("QUIT", NULL, sfp); - why bother? */ |
| 606 | } | 607 | } |
| 607 | #endif | 608 | #endif |
| @@ -609,7 +610,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 609 | fclose(sfp); | 610 | fclose(sfp); |
| 610 | 611 | ||
| 611 | free(server.allocated); | 612 | free(server.allocated); |
| 612 | @@ -1544,11 +1739,13 @@ However, in real world it was observed that some web servers | 613 | @@ -1544,11 +1740,13 @@ However, in real world it was observed that some web servers |
| 613 | free(target.user); | 614 | free(target.user); |
| 614 | free(fname_out_alloc); | 615 | free(fname_out_alloc); |
| 615 | free(redirected_path); | 616 | free(redirected_path); |
| @@ -623,7 +624,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 623 | #if ENABLE_FEATURE_WGET_LONG_OPTIONS | 624 | #if ENABLE_FEATURE_WGET_LONG_OPTIONS |
| 624 | static const char wget_longopts[] ALIGN1 = | 625 | static const char wget_longopts[] ALIGN1 = |
| 625 | /* name, has_arg, val */ | 626 | /* name, has_arg, val */ |
| 626 | @@ -1590,6 +1787,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") | 627 | @@ -1590,6 +1788,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") |
| 627 | #endif | 628 | #endif |
| 628 | 629 | ||
| 629 | INIT_G(); | 630 | INIT_G(); |
| @@ -631,7 +632,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 631 | 632 | ||
| 632 | #if ENABLE_FEATURE_WGET_TIMEOUT | 633 | #if ENABLE_FEATURE_WGET_TIMEOUT |
| 633 | G.timeout_seconds = 900; | 634 | G.timeout_seconds = 900; |
| 634 | @@ -1626,6 +1824,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") | 635 | @@ -1626,6 +1825,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") |
| 635 | IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_data) | 636 | IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_data) |
| 636 | IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_file) | 637 | IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_file) |
| 637 | ); | 638 | ); |
| @@ -640,7 +641,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 640 | #if 0 /* option bits debug */ | 641 | #if 0 /* option bits debug */ |
| 641 | if (option_mask32 & WGET_OPT_RETRIES) bb_error_msg("-t NUM"); | 642 | if (option_mask32 & WGET_OPT_RETRIES) bb_error_msg("-t NUM"); |
| 642 | if (option_mask32 & WGET_OPT_nsomething) bb_error_msg("-nsomething"); | 643 | if (option_mask32 & WGET_OPT_nsomething) bb_error_msg("-nsomething"); |
| 643 | @@ -1670,6 +1870,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") | 644 | @@ -1670,6 +1871,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") |
| 644 | } | 645 | } |
| 645 | #endif | 646 | #endif |
| 646 | 647 | ||
| @@ -648,7 +649,7 @@ index 6a64836fb..97ca7382e 100644 | |||
| 648 | G.output_fd = -1; | 649 | G.output_fd = -1; |
| 649 | G.o_flags = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL; | 650 | G.o_flags = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL; |
| 650 | if (G.fname_out) { /* -O FILE ? */ | 651 | if (G.fname_out) { /* -O FILE ? */ |
| 651 | @@ -1691,8 +1892,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") | 652 | @@ -1691,8 +1893,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") |
| 652 | } | 653 | } |
| 653 | } | 654 | } |
| 654 | 655 | ||
