mirror of
https://github.com/gospider007/requests.git
synced 2025-12-24 13:57:52 +08:00
sync
This commit is contained in:
6
conn.go
6
conn.go
@@ -23,8 +23,12 @@ func taskMain(conn http1.Conn, task *reqTask) (err error) {
|
||||
if err != nil {
|
||||
task.cnl(err)
|
||||
} else {
|
||||
var bodyContext context.Context
|
||||
if task.reqCtx.response != nil && task.reqCtx.response.Body != nil {
|
||||
bodyContext = task.reqCtx.response.Body.(*http1.Body).Context()
|
||||
}
|
||||
task.cnl(tools.ErrNoErr)
|
||||
if bodyContext := conn.BodyContext(); bodyContext != nil {
|
||||
if bodyContext != nil {
|
||||
select {
|
||||
case <-task.reqCtx.Context().Done():
|
||||
if context.Cause(task.reqCtx.Context()) != tools.ErrNoErr {
|
||||
|
||||
Reference in New Issue
Block a user