-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
mbedtls: http.get_text returns nothing #23717
Comments
Connected to Huly®: V_0.6-22135 |
I tested several pages around your site and seems
For the above pages V's http returned data except for |
Simple enough theory to test... import net.http
fn main() {
res1 := http.get_text('https://nest.pijul.com/pijul/pijul/changes')
println(res1.len)
res2 := http.get_text('https://nest.pijul.com/pijul/pijul')
println(res2.len)
res3 := http.get_text('https://nest.pijul.com/pijul/pijul/tags')
println(res3.len)
res4 := http.get_text('https://nest.pijul.com/pijul/pijul/discussions')
println(res4.len)
} output is
So yes, definitely size related. |
I have this program trying to inspect some callbacks for both URLs, a small one and a large one: import net.http
fn progress(req &http.Request, chunk []u8, so_far u64) ! {
println('* request chunk:${chunk.len} read_so_far:${so_far}')
}
fn progress_body(req &http.Request, chunk []u8, so_far u64, expected_size u64, status_code int) ! {
println('* request_body chunk:${chunk.len} read_so_far:${so_far} exp:${expected_size} ${status_code}')
}
fn finish(req &http.Request, size u64) ! {
println('* finish size:${size}')
}
fn main() {
for url in [
'https://nest.pijul.com/pijul/pijul'
'https://nest.pijul.com/pijul/pijul/changes'
] {
println('url ${url}')
config := http.FetchConfig{
url: url
on_progress: progress
on_progress_body: progress_body
on_finish: finish
}
res := http.fetch(config)!
_ = res
}
} Result
Seems with the large |
...\_vlang_proj_\v-test> v run .\http.get_text.v
694794
28598
11639
23851 |
What is your platform changrui ? I also get first |
...\_vlang_proj_\v-test> v run .\http.get_text.v
694794
28598
11639
23851
|
|
@jorgeluismireles Using Ubuntu 24.04 on WLS2, I got the same result with you. |
Closing, it is related to #23719 missing HTTP/2 support. |
I protest, remote web server supports both protocols.
|
The remote server may support it, but V doesn't, currently, and there's already an open issue to add that support. |
I see
I don’t understand why you’re focusing on HTTP/2. I don’t see the reasoning behind it. Please show me how you arrived at this conclusion. Thank you. |
From your own post:
|
It seems to be about: |
Definitely mbed_tls related. I tried running my example again, only this time adding
|
Good catch, @JalonSolov |
I can make I found another server in Japan that my server in Germany can't communicate with in time, resulting in a timeout and empty result. |
One minor fix would be to increase the default timeouts in mbedtls to match the default timeouts in openssl. |
The net.mbedtls module has: const mbedtls_client_read_timeout_ms = $d('mbedtls_client_read_timeout_ms', 550) i.e. you can pass It is a worse workaround imho, compared to |
With my current ISP, I can go as low as: |
Tested with:
and later:
What is interesting to note, is that the OpenSSL version is faster, while doing the same work, Edit: I am wrong, optimisations does not seem to be directly related. Even with -prod, the openssl variant is faster:
|
Describe the bug
Works in browser, curl and wget.
Reproduction Steps
Expected Behavior
Return me long lines of HTML.
Current Behavior
Returns nothing.
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.
The text was updated successfully, but these errors were encountered: