1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

http: allocate memory dynamically on Windows

This commit is contained in:
joe-conigliaro
2019-08-26 04:27:12 +10:00
committed by Alexander Medvednikov
parent ec4ff6e811
commit 836cc32d78
3 changed files with 21 additions and 11 deletions

View File

@@ -18,12 +18,10 @@ fn init_module() {}
fn (req &Request) ssl_do(port int, method, host_name, path string) Response {
C.vschannel_init()
// TODO: joe-c
// dynamically increase in vschannel.c if needed
mut buff := malloc(44000)
mut buff := malloc(C.vsc_init_resp_buff_size)
addr := host_name
sdata := req.build_request_headers(method, host_name, path)
length := int(C.request(port, addr.str, sdata.str, buff))
length := int(C.request(port, addr.str, sdata.str, &buff))
C.vschannel_cleanup()
return parse_response(string(buff, length))