瀏覽代碼

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();