tcp.Conn:add Flush method and more lock protection

This commit is contained in:
Patricio Whittingslow
2026-01-01 10:32:13 -03:00
parent f8166aea05
commit c6e88b1c3b
5 changed files with 85 additions and 29 deletions
+7 -2
View File
@@ -297,11 +297,16 @@ func run() (err error) {
timeHTTPSend := timer("send HTTP request")
conn.SetDeadline(time.Now().Add(internetTimeout))
_, err = conn.Write(req)
timeHTTPSend()
timeHTTPRcv := timer("recv http request")
if err != nil {
return err
}
err = conn.Flush()
if err != nil {
return err
}
timeHTTPSend()
timeHTTPRcv := timer("recv http request")
rxbuf := make([]byte, 2048)
var page []byte