Skip to content
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

HTTP/3: miss connection information of remote and local #9286

Closed
Cering opened this issue Aug 10, 2022 · 1 comment
Closed

HTTP/3: miss connection information of remote and local #9286

Cering opened this issue Aug 10, 2022 · 1 comment
Labels
HTTP/3 h3 or quic related

Comments

@Cering
Copy link
Contributor

Cering commented Aug 10, 2022

I did this

  • Send http3 request, and print CURLINFO_PRIMARY_IP / CURLINFO_PRIMARY_PORT / CURLINFO_LOCAL_IP / CURLINFO_LOCAL_PORT
const char *url = "https://cloudflare-quic.com";
CURL *http_handle = curl_easy_init();
curl_easy_setopt(http_handle, CURLOPT_URL, url);
curl_easy_setopt(http_handle, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(http_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_3);

for(int i=0; i<2; i++) {
    CURLcode res = curl_easy_perform(http_handle);
    if(res == CURLE_OK) {
        char *primary_ip = NULL;
        curl_easy_getinfo(http_handle, CURLINFO_PRIMARY_IP, &primary_ip);
        long primary_port = 0L;
        curl_easy_getinfo(http_handle, CURLINFO_PRIMARY_PORT, &primary_port);
        char *local_ip = NULL;
        curl_easy_getinfo(http_handle, CURLINFO_LOCAL_IP, &local_ip);
        long local_port = 0L;
        curl_easy_getinfo(http_handle, CURLINFO_LOCAL_PORT, &local_port);
        long num_connects = 0L;
        curl_easy_getinfo(http_handle, CURLINFO_NUM_CONNECTS, &num_connects);

        printf("primary %s:%d, local %s:%d, connects: %d\n", primary_ip, primary_port, local_ip, local_port, num_connects);
    }
    else
        printf("curl error %d\n", res);
}

I expected the following

  • The output info shows that information of remote and local is empty
primary :443, local :-1, connects: 1
primary :443, local :-1, connects: 0

curl/libcurl version

libcurl/7.83.0 BoringSSL zlib/1.2.7 brotli/1.0.9 nghttp2/1.41.0 quiche/0.12.0

operating system

Linux mylinux 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

@Cering
Copy link
Contributor Author

Cering commented Aug 10, 2022

submit my solution in #9287

@bagder bagder added the HTTP/3 h3 or quic related label Aug 10, 2022
@bagder bagder closed this as completed in 6ba3047 Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HTTP/3 h3 or quic related
Development

Successfully merging a pull request may close this issue.

2 participants