提交 886d4756 作者: Juan Batiz-Benet

http/client: log errors when stream copy fails

License: MIT
Signed-off-by: 's avatarJuan Batiz-Benet <juan@benet.ai>
上级 8c0ca5e3
...@@ -166,19 +166,14 @@ func (i internalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { ...@@ -166,19 +166,14 @@ func (i internalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
streamChans, _, _ := req.Option("stream-channels").Bool() streamChans, _, _ := req.Option("stream-channels").Bool()
if isChan && streamChans { if isChan && streamChans {
// w.WriteString(transferEncodingHeader + ": chunked\r\n") if err := copyChunks(applicationJson, w, out); err != nil {
// w.Header().Set(channelHeader, "1") log.Error("error while writing stream", err)
// w.WriteHeader(200)
err = copyChunks(applicationJson, w, out)
if err != nil {
log.Debug("copy chunks error: ", err)
} }
return return
} }
err = flushCopy(w, out) if err := flushCopy(w, out); err != nil {
if err != nil { log.Error("error while writing stream", err)
log.Debug("Flush copy returned an error: ", err)
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论