소스 검색

Fix redirect triggering multiple callbacks

ithewei 2 년 전
부모
커밋
2641e14db1
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      http/client/AsyncHttpClient.cpp

+ 2 - 0
http/client/AsyncHttpClient.cpp

@@ -87,6 +87,8 @@ int AsyncHttpClient::doTask(const HttpClientTaskPtr& task) {
                     req->headers["Host"] = req->host;
                     resp->Reset();
                     send(ctx->task);
+                    // NOTE: detatch from original channel->context
+                    ctx->task = NULL;
                 }
             } else {
                 ctx->successCallback();