v icon indicating copy to clipboard operation
v copied to clipboard

http.get panics - ssl read timeout

Open tankf33der opened this issue 1 year ago • 4 comments

Describe the bug

Do not panic. Any browser works.

Reproduction Steps

import net.http

fn main() {
        h := http.get('https://nest.pijul.com/pijul/pijul/changes')!
        println(h)
}

Expected Behavior

Prints output.

Current Behavior

Panics.

$ ./records 
V panic: result not set (response does not start with HTTP/, line: ``)
v hash: e9c2314
/tmp/v_1000/records.01JM0J1PC67RNFMGA3BPVCQ7Q1.tmp.c:9153: at _v_panic: Backtrace
/tmp/v_1000/records.01JM0J1PC67RNFMGA3BPVCQ7Q1.tmp.c:9119: by panic_result_not_set
/tmp/v_1000/records.01JM0J1PC67RNFMGA3BPVCQ7Q1.tmp.c:19049: by main__main
/tmp/v_1000/records.01JM0J1PC67RNFMGA3BPVCQ7Q1.tmp.c:19357: by main

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.9 e9c2314

Environment details (OS name and version, etc.)

Manjaro Linux

[!NOTE] You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.

tankf33der avatar Feb 13 '25 21:02 tankf33der

Connected to Huly®: V_0.6-22137

huly-for-github[bot] avatar Feb 13 '25 21:02 huly-for-github[bot]

Looks like related to HTTP/2 support.

Image

felipensp avatar Feb 15 '25 14:02 felipensp

This panic is not about HTTP/2 support. As workaround you could use use_openssl and/or increase timeout (mbedtls_client_read_timeout_ms).

tankf33der avatar Feb 17 '25 15:02 tankf33der

This happens due to a timeout in the net.mbedtls library. The timeout is not handled correct and the net.http library is just returned an empty string. The empty string is what is being reported as: result not set (response does not start with HTTP/, line: ``)

martinskou avatar May 20 '25 12:05 martinskou