From bcc397b54b3cc2d2cd193f6186b4abdd52d8b6f3 Mon Sep 17 00:00:00 2001 From: Yifei Kong Date: Wed, 27 Dec 2023 13:58:20 +0800 Subject: [PATCH] Removed debugging printfs --- chrome/patches/curl-impersonate.patch | 30 ++++++++++++--------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/chrome/patches/curl-impersonate.patch b/chrome/patches/curl-impersonate.patch index b327b1fd..dfe102b2 100644 --- a/chrome/patches/curl-impersonate.patch +++ b/chrome/patches/curl-impersonate.patch @@ -998,7 +998,7 @@ index 219dcc2c0..7b04c6c36 100644 } diff --git a/lib/http2.c b/lib/http2.c -index c666192fc..74bfbc115 100644 +index c666192fc..5a90b28ea 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -50,6 +50,7 @@ @@ -1018,7 +1018,7 @@ index c666192fc..74bfbc115 100644 /* on receving from TLS, we prep for holding a full stream window */ #define H2_NW_RECV_CHUNKS (H2_STREAM_WINDOW_SIZE / H2_CHUNK_SIZE) /* on send into TLS, we just want to accumulate small frames */ -@@ -86,24 +87,87 @@ +@@ -86,24 +87,84 @@ * will block their received QUOTA in the connection window. And if we * run out of space, the server is blocked from sending us any data. * See #10988 for an issue with this. */ @@ -1047,20 +1047,17 @@ index c666192fc..74bfbc115 100644 + + // Use chrome's settings as default + char *http2_settings = "1:65536;2:0;4:6291456;6:262144"; -+ -+ printf("default settings is %s\n", http2_settings); + if(data->set.str[STRING_HTTP2_SETTINGS]) { + http2_settings = data->set.str[STRING_HTTP2_SETTINGS]; -+ printf("Changed settings to %s\n", http2_settings); + } -+ printf("USING settings %s\n", http2_settings); -+ -+ char *tmp = strdup(http2_settings); -+ -+ char *setting = strtok(tmp, delimiter); - iv[1].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE; - iv[1].value = H2_STREAM_WINDOW_SIZE; ++ // printf("USING settings %s\n", http2_settings); ++ ++ char *tmp = strdup(http2_settings); ++ char *setting = strtok(tmp, delimiter); ++ + // loop through the string to extract all other tokens + while(setting != NULL) { + // deal with each setting @@ -1115,7 +1112,7 @@ index c666192fc..74bfbc115 100644 } static size_t populate_binsettings(uint8_t *binsettings, -@@ -483,8 +547,23 @@ static CURLcode cf_h2_ctx_init(struct Curl_cfilter *cf, +@@ -483,8 +544,22 @@ static CURLcode cf_h2_ctx_init(struct Curl_cfilter *cf, } } @@ -1127,12 +1124,11 @@ index c666192fc..74bfbc115 100644 + + // Use chrome's value as default + int window_update = 15663105; -+ printf("default window update %d\n", window_update); + if(data->set.http2_window_update) { + window_update = data->set.http2_window_update; -+ printf("changed window update %d\n", window_update); + } -+ printf("Using window update %d\n", window_update); ++ ++ // printf("Using window update %d\n", window_update); + + rc = nghttp2_session_set_local_window_size( + ctx->h2, NGHTTP2_FLAG_NONE, 0, @@ -1141,7 +1137,7 @@ index c666192fc..74bfbc115 100644 if(rc) { failf(data, "nghttp2_session_set_local_window_size() failed: %s(%d)", nghttp2_strerror(rc), rc); -@@ -1616,11 +1695,17 @@ out: +@@ -1616,11 +1691,17 @@ out: return rv; } @@ -1160,7 +1156,7 @@ index c666192fc..74bfbc115 100644 } static int sweight_in_effect(const struct Curl_easy *data) -@@ -1642,9 +1727,11 @@ static void h2_pri_spec(struct Curl_easy *data, +@@ -1642,9 +1723,11 @@ static void h2_pri_spec(struct Curl_easy *data, struct Curl_data_priority *prio = &data->set.priority; struct stream_ctx *depstream = H2_STREAM_CTX(prio->parent); int32_t depstream_id = depstream? depstream->id:0; @@ -1173,7 +1169,7 @@ index c666192fc..74bfbc115 100644 data->state.priority = *prio; } -@@ -1661,20 +1748,25 @@ static CURLcode h2_progress_egress(struct Curl_cfilter *cf, +@@ -1661,20 +1744,25 @@ static CURLcode h2_progress_egress(struct Curl_cfilter *cf, struct stream_ctx *stream = H2_STREAM_CTX(data); int rv = 0;