net/http: log ServeContent errors reading from the content during Copy? #31932
Comments
I'm not quite sure what you are asking, could you please clarify? But if you need to do some more error checking, you could modify your sendContent to implement the ReaderFrom interface, and do the error checking like that. |
@beoran any example ??thanks |
@zhxqgithub, we can't call |
go/src/net/http/fs.go
Line 298 in f766b68
func serveContent was used by docker distribution project,I get 'unexpect eof error 'when I pull image for registry server may be related the bad network(just 20mb bandwidth).I can'not find any error in registry server log,it alwayls return response complete and 200 http status code.so i found error in io.CopyN after debug,it just copy only part of entire content due to ceph( the regitry storage backend ) rst the connection(mayby slow network).
I found same issue in 9709 ,however ,If it's not worth the cost of adding return error,can add error in ResponseWriter.like this
The text was updated successfully, but these errors were encountered: