Skip to content

Instantly share code, notes, and snippets.

View liviuchircu's full-sized avatar
📬
Eat. Sleep. Email. Code. Repeat.

Liviu Chircu liviuchircu

📬
Eat. Sleep. Email. Code. Repeat.
View GitHub Profile
diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c
index 45c1f56..49f086d 100644
--- a/modules/dispatcher/dispatch.c
+++ b/modules/dispatcher/dispatch.c
@@ -342,14 +342,14 @@ err1:
/* variables used to generate the pvar name */
static int ds_has_pattern = 0;
-static str ds_pattern_suffix = str_init("");
static str ds_pattern_prefix = str_init("");
diff --git a/modules/python/python_iface.c b/modules/python/python_iface.c
index 4e0fc23..01b1d63 100644
--- a/modules/python/python_iface.c
+++ b/modules/python/python_iface.c
@@ -19,13 +19,13 @@
*
*/
+#include <Python.h>
+
@liviuchircu
liviuchircu / gist:4d11849693a659760b7e
Created April 5, 2015 14:34
sipmsgops 1.11 patch
diff --git a/modules/sipmsgops/sipmsgops.c b/modules/sipmsgops/sipmsgops.c
index 893c42c..bc7e1bb 100644
--- a/modules/sipmsgops/sipmsgops.c
+++ b/modules/sipmsgops/sipmsgops.c
@@ -386,19 +386,17 @@ static int filter_body_f(struct sip_msg* msg, char* _content_type,
return -1;
}
-int parse_pvs_header(struct sip_msg *msg, gparam_p gp)
+int get_pvs_header_value(struct sip_msg *msg, gparam_p gp, pv_value_p ret)
diff --git a/main.c b/main.c
index b183bde..9a3df06 100644
--- a/main.c
+++ b/main.c
@@ -884,6 +884,7 @@ static int main_loop(void)
for(i=0;i<si->children;i++){
chd_rank++;
+ usleep(10000);
if ( (pid=internal_fork( "UDP receiver"))<0 ) {
#!/usr/bin/python
from os import listdir, walk
from os.path import isfile, join, isdir, expanduser
from threading import Thread, Lock
total = None
lock = Lock()
def do_count(l, _dir, ext):
@liviuchircu
liviuchircu / rest_client.patch
Last active August 29, 2015 14:20
rest_client local HTTP
diff --git a/modules/rest_client/rest_cb.c b/modules/rest_client/rest_cb.c
index 891834a..5bbc208 100644
--- a/modules/rest_client/rest_cb.c
+++ b/modules/rest_client/rest_cb.c
@@ -48,6 +48,7 @@ size_t write_func(char *ptr, size_t size, size_t nmemb, void *body)
buff->s = pkg_realloc(buff->s, buff->len + len + 1);
if (!buff->s) {
+ buff->len = 0;
LM_ERR("No more pkg memory!\n");
@liviuchircu
liviuchircu / gist:a29956c5010e1608c2f4
Last active August 29, 2015 14:20
fix for crash on debug=4
commit c9b94aed0e00fac0e156851e5400db978bca1179
Author: Liviu Chircu <liviu@opensips.org>
Date: Tue May 5 20:44:55 2015 +0300
sipmsgops: fix possible crash with debug=4
Introduced in commit 445d90bc7
Reported by Hieu Ta
(cherry picked from commit 2e9b36c0031e619899aa2544c7e23caff5b49b80)
@liviuchircu
liviuchircu / gist:79ae8f502c7c98cc3912
Last active August 29, 2015 14:20
ASYNC TCP + DBG_QM_MALLOC fixes
diff --git a/mem/q_malloc.c b/mem/q_malloc.c
index 1c58167..add562d 100644
--- a/mem/q_malloc.c
+++ b/mem/q_malloc.c
@@ -440,6 +440,11 @@ void qm_free(struct qm_block* qm, void* p)
unsigned long size;
#endif
+ if (!p) {
+ LM_DBG("free(NULL) called\n");
From c4d0abf3b556a818ec4e58d535ab3751ed9ffded Mon Sep 17 00:00:00 2001
From: Liviu Chircu <liviu@opensips.org>
Date: Fri, 4 Dec 2015 19:04:08 +0200
Subject: [PATCH] Fix declarations for all clusterer api variables
Reported by Dragomir Haralambiev
---
modules/dialog/dlg_replication.c | 2 ++
modules/dialog/dlg_replication.h | 2 +-
modules/ratelimit/ratelimit.c | 1 +
@liviuchircu
liviuchircu / solaris_bad_compile.patch
Last active January 14, 2016 09:39
Fix compile issues on Solaris
diff --git a/dprint.h b/dprint.h
index 6a75f79..4c5cdde 100644
--- a/dprint.h
+++ b/dprint.h
@@ -52,8 +52,6 @@
#include <syslog.h>
#include <time.h>
-#include "pt.h"
-