Skip to content

Commit e743509

Browse files
Revert "Fix a crash in the NetworkCurl. (#701)" (#706)
The commit caused a regression, the crash itself is a very exotic case. Crash is added to the known issues. Relates-To: OLPEDGE-1687 This reverts commit 4cdd52d. Signed-off-by: Mykhailo Kuchma <[email protected]>
1 parent b04b657 commit e743509

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

olp-cpp-sdk-core/src/http/curl/NetworkCurl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ void NetworkCurl::CompleteMessage(CURL* handle, CURLcode result) {
908908
return;
909909
}
910910

911+
lock.unlock();
911912
std::string error("Success");
912913
int status;
913914
if ((result == CURLE_OK) || (result == CURLE_HTTP_RETURNED_ERROR)) {
@@ -954,6 +955,7 @@ void NetworkCurl::CompleteMessage(CURL* handle, CURLcode result) {
954955
<< handles_[index].id << ", url=" << url
955956
<< " err=(" << status << ") " << error);
956957
handles_[index].count = 0;
958+
lock.lock();
957959
events_.emplace_back(EventInfo::Type::SEND_EVENT, &handles_[index]);
958960
return;
959961
}
@@ -966,7 +968,7 @@ void NetworkCurl::CompleteMessage(CURL* handle, CURLcode result) {
966968
.WithRequestId(handles_[index].id)
967969
.WithStatus(status)
968970
.WithError(error);
969-
ReleaseHandleUnlocked(&handles_[index]);
971+
ReleaseHandle(&handles_[index]);
970972
callback(response);
971973
} else {
972974
OLP_SDK_LOG_WARNING(kLogTag, "Complete message to unknown request");
@@ -1076,7 +1078,6 @@ void NetworkCurl::Run() {
10761078
lock.lock();
10771079
}
10781080
curl_multi_remove_handle(curl_, handles_[handle_index].handle);
1079-
ReleaseHandleUnlocked(&handles_[handle_index]);
10801081
} else {
10811082
OLP_SDK_LOG_ERROR(
10821083
kLogTag,

0 commit comments

Comments
 (0)