Number of bytes over wire for DownloadToString

9 views
Skip to first unread message

Florian Gauger

unread,
May 31, 2022, 5:47:56 AM5/31/22
to network-s...@chromium.org, Autobot Runtime team
Hi all,

We are using DownloadToStringOfUnboundedSizeUntilCrashAndDie and would like to get the number of bytes that were sent over the wire.

In the callback we tried using:
simle_url_loader->ResponseInfo()->content_length = -1
simle_url_loader->ResponseInfo()->encoded_body_length = -1
simle_url_loader->ResponseInfo()->encoded_data_length = 742
response_string->size() = 324,442

Is there a way to get the number of bytes that were sent over the wire that (more or less) correspond to the string size (324,442)? We don't need an exact number but a rough upper bound would be fine.

Thanks!
Florian

Florian Gauger

unread,
May 31, 2022, 7:54:05 AM5/31/22
to network-s...@chromium.org, Autobot Runtime team
For clarification: We are sending a http request and return a proto in the response body.

I assumed that we are using some form of default compression.

Florian Gauger

unread,
May 31, 2022, 8:15:20 AM5/31/22
to network-s...@chromium.org, Autobot Runtime team
It looks like headers->GetContentLength() contains a value in the range of what we expect. Is this correct and why is content_length not set? 

simle_url_loader->ResponseInfo()->content_length = -1
simle_url_loader->ResponseInfo()->encoded_body_length = -1
simle_url_loader->ResponseInfo()->encoded_data_length = 743
simle_url_loader->ResponseInfo()->headers->GetContentLength() = 204,180
response_string->size() = 654,957

Florian Gauger

unread,
Jun 8, 2022, 8:58:53 AM6/8/22
to network-s...@chromium.org, ba...@google.com, Autobot Runtime team
+Kenichi Ishibashi do you know more?
Reply all
Reply to author
Forward
0 new messages