Buy commercial curl support from WolfSSL. We help you work
out your issues, debug your libcurl applications, use the API, port to new
platforms, add new features and more. With a team lead by the curl founder
himself.
Re: libcurl appconnect_time is greater than starttransfer when using HTTPS proxy
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Yongkang Huang via curl-users <curl-users_at_cool.haxx.se>
Date: Thu, 17 Jun 2021 22:45:34 +0000
Created https://github.com/curl/curl/pull/7274, see you there!
From: Yongkang Huang <ykang_at_fb.com>
Date: Thursday, June 17, 2021 at 2:26 PM
To: Daniel Stenberg <daniel_at_haxx.se>
Cc: Yongkang Huang via curl-users <curl-users_at_cool.haxx.se>
Subject: Re: libcurl appconnect_time is greater than starttransfer when using HTTPS proxy
Actually I think I found a bug in Curl_pgrsTime<https://github.com/curl/curl/blob/1a20689a56af29871a88c338ea0da3268038312c/lib/progress.c#L229>
Here is how Curl_pgrsTime(data, TIMER_APPCONNECT) work
delta = *data->progress.t_appconnect
delta += Curl_timediff_us(now, data->progress.t_startsingle);
If we call it twice with the same timerid (TIMER_APPCONNECT in this case because we use TLS-in-TLS), the timediff will add twice instead of just refresh to the second time we call Curl_pgrsTime(data, TIMER_APPCONNECT).
Working on a commit to fix.
From: Yongkang Huang <ykang_at_fb.com>
Date: Thursday, June 17, 2021 at 1:31 PM
To: Daniel Stenberg <daniel_at_haxx.se>
Cc: Yongkang Huang via curl-users <curl-users_at_cool.haxx.se>
Subject: Re: libcurl appconnect_time is greater than starttransfer when using HTTPS proxy
For some context we apply client authentication when connect to our HTTPs proxy, and here is the backtrace.<https://gist.github.com/MrDwZ/3d9396ca385d1ad85f45c06df4a48688>
I ran against gdb with the master branch, I added one debug print as show in this commit<https://github.com/MrDwZ/curl/commit/ff3e520a75af4084608a0df7d4e424e555c0eced>
I also build the dev curl and tested, seems the first call to Curl_ssl_connect_nonblocking when connect proxy set the right time, but somehow the second call to set SSL connection to destination set a wrong time.
sudo curl $([some proxy cert set up]) -v -s -w "_at_/home/ykang/curl-format.txt" -o /dev/null https://www.google.com 2>&1 | grep "time\|TIMER"
* TIMER_APPCONNECT set with value 208248, call in Curl_ssl_connect_nonblocking
* TIMER_APPCONNECT set with value 434095, call in Curl_ssl_connect_nonblocking
time_namelookup: 0.000040
time_connect: 0.199470
time_appconnect: 0.434095
time_pretransfer: 0.225913
time_starttransfer: 0.272836
time_total: 0.274885
Hope it helps!
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thursday, June 17, 2021 at 1:47 AM
To: Yongkang Huang <ykang_at_fb.com>
Cc: Yongkang Huang via curl-users <curl-users_at_cool.haxx.se>
Subject: Re: libcurl appconnect_time is greater than starttransfer when using HTTPS proxy
On Fri, 11 Jun 2021, Yongkang Huang wrote:
> curl 7.77.0 (x86_64-pc-linux-gnu) libcurl/7.77.0 OpenSSL/1.1.1g-fips zlib/1.2.11
>
> Still repro for me 😐, is there any way I can match the timestamp with the
> verbose output to see how it matched with proxy/dst response?
Set a break-point in Curl_pgrsTime() and see when the timestamps are stored.
--
/ daniel.haxx.se
| Commercial curl support up to 24x7 is available!
| Private help, bug fixes, support, ports, new features
| https://www.wolfssl.com/contact/<https://www.wolfssl.com/contact/>
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2021-06-18
Date: Thu, 17 Jun 2021 22:45:34 +0000
Created https://github.com/curl/curl/pull/7274, see you there!
From: Yongkang Huang <ykang_at_fb.com>
Date: Thursday, June 17, 2021 at 2:26 PM
To: Daniel Stenberg <daniel_at_haxx.se>
Cc: Yongkang Huang via curl-users <curl-users_at_cool.haxx.se>
Subject: Re: libcurl appconnect_time is greater than starttransfer when using HTTPS proxy
Actually I think I found a bug in Curl_pgrsTime<https://github.com/curl/curl/blob/1a20689a56af29871a88c338ea0da3268038312c/lib/progress.c#L229>
Here is how Curl_pgrsTime(data, TIMER_APPCONNECT) work
delta = *data->progress.t_appconnect
delta += Curl_timediff_us(now, data->progress.t_startsingle);
If we call it twice with the same timerid (TIMER_APPCONNECT in this case because we use TLS-in-TLS), the timediff will add twice instead of just refresh to the second time we call Curl_pgrsTime(data, TIMER_APPCONNECT).
Working on a commit to fix.
From: Yongkang Huang <ykang_at_fb.com>
Date: Thursday, June 17, 2021 at 1:31 PM
To: Daniel Stenberg <daniel_at_haxx.se>
Cc: Yongkang Huang via curl-users <curl-users_at_cool.haxx.se>
Subject: Re: libcurl appconnect_time is greater than starttransfer when using HTTPS proxy
For some context we apply client authentication when connect to our HTTPs proxy, and here is the backtrace.<https://gist.github.com/MrDwZ/3d9396ca385d1ad85f45c06df4a48688>
I ran against gdb with the master branch, I added one debug print as show in this commit<https://github.com/MrDwZ/curl/commit/ff3e520a75af4084608a0df7d4e424e555c0eced>
I also build the dev curl and tested, seems the first call to Curl_ssl_connect_nonblocking when connect proxy set the right time, but somehow the second call to set SSL connection to destination set a wrong time.
sudo curl $([some proxy cert set up]) -v -s -w "_at_/home/ykang/curl-format.txt" -o /dev/null https://www.google.com 2>&1 | grep "time\|TIMER"
* TIMER_APPCONNECT set with value 208248, call in Curl_ssl_connect_nonblocking
* TIMER_APPCONNECT set with value 434095, call in Curl_ssl_connect_nonblocking
time_namelookup: 0.000040
time_connect: 0.199470
time_appconnect: 0.434095
time_pretransfer: 0.225913
time_starttransfer: 0.272836
time_total: 0.274885
Hope it helps!
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thursday, June 17, 2021 at 1:47 AM
To: Yongkang Huang <ykang_at_fb.com>
Cc: Yongkang Huang via curl-users <curl-users_at_cool.haxx.se>
Subject: Re: libcurl appconnect_time is greater than starttransfer when using HTTPS proxy
On Fri, 11 Jun 2021, Yongkang Huang wrote:
> curl 7.77.0 (x86_64-pc-linux-gnu) libcurl/7.77.0 OpenSSL/1.1.1g-fips zlib/1.2.11
>
> Still repro for me 😐, is there any way I can match the timestamp with the
> verbose output to see how it matched with proxy/dst response?
Set a break-point in Curl_pgrsTime() and see when the timestamps are stored.
--
/ daniel.haxx.se
| Commercial curl support up to 24x7 is available!
| Private help, bug fixes, support, ports, new features
| https://www.wolfssl.com/contact/<https://www.wolfssl.com/contact/>
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2021-06-18