http_win : fix buf length

Line 157 : buf[nr_read] = 0 
set the null character '\0'
pull/1119/head
unknown-v 2019-07-13 06:14:54 +02:00 committed by Alexander Medvednikov
parent 2811145437
commit 3281e44e84
1 changed files with 4 additions and 4 deletions

View File

@ -107,9 +107,9 @@ fn (req &Request) do() Response {
}
// println('LEN BEFORE SEND=$headers.len ; $headers')
# bool ret =HttpSendRequest(request, headers.str, -1, data.str, data.len);
# printf("RET=%d\n", ret);
# int e = GetLastError();
# printf("e=%d\n", e);
// # printf("RET=%d\n", ret);
// # int e = GetLastError();
// # printf("e=%d\n", e);
// Get response headers
// Todo call twice to get len
# LPSTR h_buf = malloc(1024);
@ -157,7 +157,7 @@ fn (req &Request) do() Response {
buf[nr_read] = 0
//C.printf('buf="%s"\n', buf)
s += tos(buf, nr_read + 1) // TODO perf
s += tos(buf, nr_read) // TODO perf
nr_read = 0
}
C.InternetCloseHandle(request)