misc. fixes for extras
This commit is contained in:
parent
e1f24fdeee
commit
3059138928
|
@ -13,7 +13,7 @@ ifeq ($(ARCH),Darwin)
|
|||
LIB_EXT=dylib
|
||||
CFLAGS+=-DDARWIN=1 -arch ppc -arch i386
|
||||
else
|
||||
XLDFLAGS=-shared
|
||||
XLDFLAGS=-shared -Wl,-undefined,suppress
|
||||
LIB_EXT=so
|
||||
endif
|
||||
|
||||
|
|
|
@ -42,8 +42,13 @@ static int pgq_init_module(Octstr *conninfo)
|
|||
gwlist_add_producer(free_conns);
|
||||
for (i = 0; i<n;i++) {
|
||||
PGconn *c = PQconnectdb(octstr_get_cstr(conninfo));
|
||||
if (c)
|
||||
if (c && PQstatus(c) == CONNECTION_OK)
|
||||
gwlist_produce(free_conns, c);
|
||||
else {
|
||||
error(0, "pgsql_queue.init: failed to connect to db: %s",
|
||||
PQerrorMessage(c));
|
||||
PQfinish(c);
|
||||
}
|
||||
}
|
||||
|
||||
srand(time(NULL));
|
||||
|
|
|
@ -1456,8 +1456,7 @@ static int fetch_url_with_auth(HTTPCaller *c, int method, Octstr *url, List *req
|
|||
|
||||
if (qop ||
|
||||
(algo != NULL && octstr_str_case_compare(algo, "MD5-sess") == 0)) {
|
||||
cnonce = octstr_create("");
|
||||
octstr_append_data(cnonce, (void *)&t, sizeof t);
|
||||
cnonce = octstr_create_from_data((void *)&t, sizeof t);
|
||||
octstr_binary_to_hex(cnonce,0);
|
||||
}
|
||||
|
||||
|
|
|
@ -277,7 +277,7 @@ MmscSettings *mms_load_mmsc_settings(mCfg *cfg, List **proxyrelays)
|
|||
m->mms_detokenizefuncs->mms_gettoken == NULL ||
|
||||
m->mms_detokenizefuncs->mms_detokenizer_fini == NULL)
|
||||
panic(0, "Missing or NULL functions in detokenizer module!");
|
||||
if (m->mms_detokenizefuncs->mms_detokenizer_init(octstr_get_cstr(m->detokenizer_params)))
|
||||
if (m->mms_detokenizefuncs->mms_detokenizer_init(octstr_get_cstr(m->detokenizer_params)) != 0)
|
||||
panic(0, "Detokenizer module failed to initialize");
|
||||
} else
|
||||
m->mms_detokenizefuncs = NULL;
|
||||
|
@ -466,18 +466,15 @@ Octstr *mms_find_sender_msisdn(Octstr *send_url,
|
|||
Octstr *phonenum = http_header_value(request_hdrs,
|
||||
msisdn_header);
|
||||
|
||||
if (!phonenum || octstr_len(phonenum) == 0) {
|
||||
if (phonenum == NULL || octstr_len(phonenum) == 0) {
|
||||
List *l = octstr_split(send_url, octstr_imm("/"));
|
||||
int len = gwlist_len(l);
|
||||
Octstr *xip = http_header_value(request_hdrs,
|
||||
requestip_header);
|
||||
int len = gwlist_len(l);
|
||||
|
||||
if (xip == NULL)
|
||||
xip = ip ? octstr_duplicate(ip) : NULL;
|
||||
if (detokenizerfuncs && (len > 1 || xip))
|
||||
phonenum = detokenizerfuncs->mms_detokenize(len > 1 ?
|
||||
gwlist_get(l, len - 1) :
|
||||
send_url,
|
||||
phonenum = detokenizerfuncs->mms_detokenize(len > 1 ? gwlist_get(l, len - 1) : send_url,
|
||||
xip);
|
||||
|
||||
gwlist_destroy(l, (gwlist_item_destructor_t *)octstr_destroy);
|
||||
|
|
|
@ -191,10 +191,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
|
||||
debug("mmsproxy", 0,
|
||||
" Request, ip=%s, base_client_addr=%s, client_addr=%s ",
|
||||
" Request, ip=%s, base_client_addr=%s, client_addr=%s, url=%s ",
|
||||
h.ip ? octstr_get_cstr(h.ip) : "",
|
||||
h.base_client_addr ? octstr_get_cstr(h.base_client_addr) : "",
|
||||
h.client_addr ? octstr_get_cstr(h.client_addr) : "");
|
||||
h.client_addr ? octstr_get_cstr(h.client_addr) : "",
|
||||
octstr_get_cstr(h.url));
|
||||
|
||||
/* Dump headers, url etc. */
|
||||
#if 0
|
||||
|
|
Loading…
Reference in New Issue