mirror of
https://github.com/vlang/v.git
synced 2025-09-17 11:26:17 -04:00
net.http: support -d no_vschannel
on windows, to fix long waits, while connecting on some systems (#20265)
This commit is contained in:
parent
b944927f09
commit
76e1ac3db3
@ -7,6 +7,13 @@ import net.ssl
|
||||
import strings
|
||||
|
||||
fn (req &Request) ssl_do(port int, method Method, host_name string, path string) !Response {
|
||||
$if windows && !no_vschannel ? {
|
||||
return vschannel_ssl_do(req, port, method, host_name, path)
|
||||
}
|
||||
return net_ssl_do(req, port, method, host_name, path)
|
||||
}
|
||||
|
||||
fn net_ssl_do(req &Request, port int, method Method, host_name string, path string) !Response {
|
||||
mut ssl_conn := ssl.new_ssl_conn(
|
||||
verify: req.verify
|
||||
cert: req.cert
|
@ -15,7 +15,7 @@ pub struct C.TlsContext {}
|
||||
|
||||
fn C.new_tls_context() C.TlsContext
|
||||
|
||||
fn (req &Request) ssl_do(port int, method Method, host_name string, path string) !Response {
|
||||
fn vschannel_ssl_do(req &Request, port int, method Method, host_name string, path string) !Response {
|
||||
mut ctx := C.new_tls_context()
|
||||
C.vschannel_init(&ctx)
|
||||
mut buff := unsafe { malloc_noscan(C.vsc_init_resp_buff_size) }
|
Loading…
x
Reference in New Issue
Block a user