We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpRequestID HttpTransThread::AddRequestToCatchList(const HttpRequestSharedPtr &request) { nbase::NAutoLock autolock(&message_loop_flag_lock_); request_current_sn_ -= 1; if (request_current_sn_ == INVALID_HTTPREQUESTID) request_current_sn_ = kREQUEST_ID_BASE; request_list_.insert(std::make_pair(request_current_sn_, std::make_pair(request.get(), request))); request->attach_release(ToWeakCallback(std::bind(&HttpTransThread::OnRequestRelease, this, request.get()))); return request_current_sn_; }
The text was updated successfully, but these errors were encountered:
request_list_.insert(std::make_pair(request_current_sn_, std::make_pair(request.get(), request))); map本身不管理内存,pair的second是监控生命期。这个不是问题了,在回话管理中管理生命期 但request_current_sn_还是没理解,这个id哪里变更
Sorry, something went wrong.
HttpRequestID HttpTransThread::AddRequestToCatchList(const HttpRequestSharedPtr &request) { nbase::NAutoLock autolock(&message_loop_flag_lock_); + request_current_sn_ -= 1; if (request_current_sn_ == INVALID_HTTPREQUESTID) request_current_sn_ = kREQUEST_ID_BASE; request_list_.insert(std::make_pair(request_current_sn_, std::make_pair(request.get(), request))); request->attach_release(ToWeakCallback(std::bind(&HttpTransThread::OnRequestRelease, this, request.get()))); return request_current_sn_; }
高亮处的 -= 就是变更。
No branches or pull requests
HttpRequestID HttpTransThread::AddRequestToCatchList(const HttpRequestSharedPtr &request)
{
nbase::NAutoLock autolock(&message_loop_flag_lock_);
request_current_sn_ -= 1;
if (request_current_sn_ == INVALID_HTTPREQUESTID)
request_current_sn_ = kREQUEST_ID_BASE;
request_list_.insert(std::make_pair(request_current_sn_, std::make_pair(request.get(), request)));
request->attach_release(ToWeakCallback(std::bind(&HttpTransThread::OnRequestRelease, this, request.get())));
return request_current_sn_;
}
The text was updated successfully, but these errors were encountered: