Module: kamailio Branch: 5.8 Commit: 5981059909f6d767fcad60d639dbeff5f54bfe3f URL: https://github.com/kamailio/kamailio/commit/5981059909f6d767fcad60d639dbeff5...
Author: Nikolay Ivanuschak ivanuschak.nikolay@gmail.com Committer: Federico Cabiddu federico.cabiddu@gmail.com Date: 2024-12-11T07:49:35+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/5981059909f6d767fcad60d639dbeff5... Patch: https://github.com/kamailio/kamailio/commit/5981059909f6d767fcad60d639dbeff5...
---
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 */