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

vweb,net: fix vweb crash when the connection was closed prematurely (tested with Chrome on windows, refreshing as fast as possible)

This commit is contained in:
Delyan Angelov
2022-12-17 19:08:59 +02:00
parent e83a8416d5
commit 9f1239c56e
2 changed files with 10 additions and 1 deletions

View File

@ -151,6 +151,9 @@ pub fn (mut c TcpConn) read_deadline() !time.Time {
// write_ptr blocks and attempts to write all data
pub fn (mut c TcpConn) write_ptr(b &u8, len int) !int {
$if trace_tcp_sock_handle ? {
eprintln('>>> TcpConn.write_ptr | c: ${ptr_str(c)} | c.sock.handle: ${c.sock.handle} | b: ${ptr_str(b)} | len: ${len}')
}
$if trace_tcp ? {
eprintln(
'>>> TcpConn.write_ptr | c.sock.handle: ${c.sock.handle} | b: ${ptr_str(b)} len: ${len} |\n' +