Browse Source

Fix redirect triggering multiple callbacks

ithewei 2 năm trước cách đây
mục cha
commit
2641e14db1
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  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();