Module: kamailio
Branch: 5.7
Commit: e85d6e5dd499dce586e72fdca2ee7cbff6520327
URL:
https://github.com/kamailio/kamailio/commit/e85d6e5dd499dce586e72fdca2ee7cb…
Author: Nikolay Ivanuschak <ivanuschak.nikolay(a)gmail.com>
Committer: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Date: 2024-12-11T07:49:52+01:00
http_async_client: fixed crash on curl callback
---
Modified: src/modules/http_async_client/http_multi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e85d6e5dd499dce586e72fdca2ee7cb…
Patch:
https://github.com/kamailio/kamailio/commit/e85d6e5dd499dce586e72fdca2ee7cb…
---
diff --git a/src/modules/http_async_client/http_multi.c
b/src/modules/http_async_client/http_multi.c
index a57aba9c951..a46b7262506 100644
--- a/src/modules/http_async_client/http_multi.c
+++ b/src/modules/http_async_client/http_multi.c
@@ -157,10 +157,12 @@ void event_cb(int fd, short kind, void *userp)
/* CURLMOPT_SOCKETFUNCTION */
int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
{
+ struct http_m_cell *cell;
struct http_m_global *g = (struct http_m_global *)cbp;
- struct http_m_cell *cell = (struct http_m_cell *)sockp;
const char *whatstr[] = {"none", "IN", "OUT",
"INOUT", "REMOVE"};
+ cell = http_m_cell_lookup(e);
+
LM_DBG("socket callback: s=%d e=%p what=%s\n", s, e, whatstr[what]);
if(what == CURL_POLL_REMOVE) {
/* if cell is NULL the handle has been removed by the event callback for timeout */