-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent appconnect_time reporting over HTTP #3760
Comments
Which is because there was no "SSL/SSH connect/handshake" performed so it never stores any appconnect timestamp then. In the case of reused connections it always stores it since it then doesn't check if the existing connection uses SSL or SSH... But yeah, maybe we should avoid the zero case and instead just have that use the |
Exactly, it's just a matter of consistence. With recycled connections (either HTTP or HTTPS) cURL already behaves like that, and I am calculating the actual SSL handshake time by subtracting time_connect to time_appconnect. I noticed the inconsistency because I was seeing negative timings when doing this subtraction while performing HTTP requests. |
This doesn't seem like a bug to me or I don't understand the issue. [1]: Note that |
Ok, let me try to elaborate this a bit more (sorry, not a native speaker). My point is that for HTTP requests As far as I know all
With this understanding, on my system I was relying on |
Prior to this change non-ssl/non-ssh connections that were reused set TIMER_APPCONNECT [1]. Arguably that was incorrect since no SSL/SSH handshake took place. [1]: TIMER_APPCONNECT is publicly known as CURLINFO_APPCONNECT_TIME in libcurl and %{time_appconnect} in the curl tool. It is documented as "the time until the SSL/SSH handshake is completed". Reported-by: Marcel Hernandez Ref: curl#3760 Closes #xxxx
Prior to this change non-ssl/non-ssh connections that were reused set TIMER_APPCONNECT [1]. Arguably that was incorrect since no SSL/SSH handshake took place. [1]: TIMER_APPCONNECT is publicly known as CURLINFO_APPCONNECT_TIME in libcurl and %{time_appconnect} in the curl tool. It is documented as "the time until the SSL/SSH handshake is completed". Reported-by: Marcel Hernandez Ref: curl#3760
Prior to this change non-ssl/non-ssh connections that were reused set TIMER_APPCONNECT [1]. Arguably that was incorrect since no SSL/SSH handshake took place. [1]: TIMER_APPCONNECT is publicly known as CURLINFO_APPCONNECT_TIME in libcurl and %{time_appconnect} in the curl tool. It is documented as "the time until the SSL/SSH handshake is completed". Reported-by: Marcel Hernandez Ref: curl#3760
Prior to this change non-ssl/non-ssh connections that were reused set TIMER_APPCONNECT [1]. Arguably that was incorrect since no SSL/SSH handshake took place. [1]: TIMER_APPCONNECT is publicly known as CURLINFO_APPCONNECT_TIME in libcurl and %{time_appconnect} in the curl tool. It is documented as "the time until the SSL/SSH handshake is completed". Reported-by: Marcel Hernandez Ref: curl#3760 Closes #xxxx
Prior to this change non-ssl/non-ssh connections that were reused set TIMER_APPCONNECT [1]. Arguably that was incorrect since no SSL/SSH handshake took place. [1]: TIMER_APPCONNECT is publicly known as CURLINFO_APPCONNECT_TIME in libcurl and %{time_appconnect} in the curl tool. It is documented as "the time until the SSL/SSH handshake is completed". Reported-by: Marcel Hernandez Ref: curl#3760 Closes #xxxx
Prior to this change non-ssl/non-ssh connections that were reused set TIMER_APPCONNECT [1]. Arguably that was incorrect since no SSL/SSH handshake took place. [1]: TIMER_APPCONNECT is publicly known as CURLINFO_APPCONNECT_TIME in libcurl and %{time_appconnect} in the curl tool. It is documented as "the time until the SSL/SSH handshake is completed". Reported-by: Marcel Hernandez Ref: curl#3760 Closes #xxxx
Prior to this change non-ssl/non-ssh connections that were reused set TIMER_APPCONNECT [1]. Arguably that was incorrect since no SSL/SSH handshake took place. [1]: TIMER_APPCONNECT is publicly known as CURLINFO_APPCONNECT_TIME in libcurl and %{time_appconnect} in the curl tool. It is documented as "the time until the SSL/SSH handshake is completed". Reported-by: Marcel Hernandez Ref: #3760 Closes #3773
I believe this has been addressed since #3773 was merged. Can anyone confirm? |
What I fixed is different from what he reported which is why I ref'd this rather than closed it. Basically in a nutshell he expected appconnect to always be greater than connect:
In my opinion though the diagram may infer that we have it documented correctly, "The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed." therefore it may be 0 |
Yes, it hasn't been fixed the way I hoped but in master the time reporting is now consistent (in the original example now both plain HTTP requests will report APPCONNECT as 0.000000, instead of both reporting the same timing as CONNECT as I wanted). I think the disagreement stems from the fact that I think of CONNECT, APPCONNECT, PRETRANSFER etc. as "stages" of curl_easy_perform() that are always executed in the same order, even if they don't involve any work (because of the diagram from the documentation that I pasted above), whereas you both think of APPCONNECT as just an "operation" that may or may not happen, so then it makes sense to leave it at 0 when it's not done at all. |
This is now consistent. |
I did this
Contents of curl-format.txt:
I expected the following
On the second run the
appconnect_time
of the first request should have been0.010850
instead of0.000000
.The documentation states that
appconnect_time
is "the time, in seconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed". However, seems that when cURL has to open a new TCP connection and the protocol is plain HTTP the reported timing is just 0.curl/libcurl version
operating system
Alpine Linux 3.9.3
The text was updated successfully, but these errors were encountered: