Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Close async curl socket on premature error.

Kishore Nallanb44a37422998
diff --git a/src/http_client.cpp b/src/http_client.cpp
index ef11b57d..7b3c274b 100644
--- a/src/http_client.cpp
+++ b/src/http_client.cpp
@@ -279,6 +279,8 @@ size_t HttpClient::curl_write_async_done(void *context, curl_socket_t item) {
if(!req_res->res->is_alive) {
// underlying client request is dead, don't try to send anymore data
+ // also, close the socket as we've overridden the close socket handler!
+ close(item);
return 0;
}