vweb: fix body size calculation (#6122)

pull/6129/head
spaceface777 2020-08-13 19:55:33 +02:00 committed by GitHub
parent da7adb5b1b
commit 2353814821
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -255,7 +255,6 @@ fn handle_conn<T>(conn net.Socket, mut app T) {
mut body := '' mut body := ''
mut in_headers := true mut in_headers := true
mut len := 0 mut len := 0
mut body_len := 0
//for line in lines[1..] { //for line in lines[1..] {
for _ in 0..100 { for _ in 0..100 {
//println(j) //println(j)
@ -281,9 +280,8 @@ fn handle_conn<T>(conn net.Socket, mut app T) {
//println('GOT CL=$len') //println('GOT CL=$len')
} }
} else { } else {
body += sline + '\r\n' body += line
body_len += body.len if body.len >= len {
if body_len >= len {
break break
} }
//println('body:$body') //println('body:$body')