mirror of
https://github.com/zhigang1992/cow.git
synced 2026-04-29 18:05:46 +08:00
Print chunk size in debug log.
This commit is contained in:
7
proxy.go
7
proxy.go
@@ -1142,7 +1142,6 @@ func sendBodyChunked(w io.Writer, r *bufio.Reader, rdSize int) (err error) {
|
||||
errl.Println("peek chunk size:", err)
|
||||
return
|
||||
}
|
||||
// debug.Printf("Chunk size line %s\n", s)
|
||||
smid := bytes.IndexByte(s, ';')
|
||||
if smid == -1 {
|
||||
smid = len(s)
|
||||
@@ -1155,6 +1154,12 @@ func sendBodyChunked(w io.Writer, r *bufio.Reader, rdSize int) (err error) {
|
||||
errl.Println("chunk size invalid:", err)
|
||||
return
|
||||
}
|
||||
if debug {
|
||||
// To debug getting malformed response status line with "0\r\n".
|
||||
if c, ok := w.(*clientConn); ok {
|
||||
debug.Printf("cli(%s) chunk size %d %#v\n", c.RemoteAddr(), size, string(s))
|
||||
}
|
||||
}
|
||||
if size == 0 {
|
||||
r.Skip(len(s))
|
||||
if err = skipCRLF(r); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user