Module: kamailio
Branch: master
Commit: 909e659dc33942a92e54bed37ee1387f121c63e6
URL:
https://github.com/kamailio/kamailio/commit/909e659dc33942a92e54bed37ee1387…
Author: Nikolay Ivanuschak <ivanuschak.nikolay(a)gmail.com>
Committer: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Date: 2024-12-10T09:25:37+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/909e659dc33942a92e54bed37ee1387…
Patch:
https://github.com/kamailio/kamailio/commit/909e659dc33942a92e54bed37ee1387…
---
diff --git a/src/modules/http_async_client/http_multi.c
b/src/modules/http_async_client/http_multi.c
index daceb932ec9..30ae016d720 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 */