Skip to content

Commit

Permalink
Removed debugging printfs
Browse files Browse the repository at this point in the history
  • Loading branch information
perklet committed Dec 27, 2023
1 parent d72803a commit bcc397b
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions chrome/patches/curl-impersonate.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@
Expand All @@ -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. */
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
}
}

Expand All @@ -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,
Expand All @@ -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;
}

Expand All @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit bcc397b

Please sign in to comment.