*** empty log message ***
This commit is contained in:
parent
3223e679cb
commit
8c51f383d7
|
@ -1,3 +1,5 @@
|
||||||
|
2010-05-26 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
|
* Misc. patches/cleanups thanks to SATOH Fumiyasu <fumiyas at osstech.jp>
|
||||||
2010-01-25 P. A. Bagyenda <bagyenda@dsmagic.com>
|
2010-01-25 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
* SunOS locking fixes (thanks to Ian Donaldson (iand at ekit-inc.com)
|
* SunOS locking fixes (thanks to Ian Donaldson (iand at ekit-inc.com)
|
||||||
2010-01-04 P. A. Bagyenda <bagyenda@dsmagic.com>
|
2010-01-04 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
|
|
|
@ -72,7 +72,7 @@ EXE_EXT=""
|
||||||
LIB_EXT="a"
|
LIB_EXT="a"
|
||||||
case "$host" in
|
case "$host" in
|
||||||
*-sun-solaris* | *SunOS* | *-pc-solaris*)
|
*-sun-solaris* | *SunOS* | *-pc-solaris*)
|
||||||
CFLAGS="$CFLAGS -DSunOS=1 -D_POSIX_PTHREAD_SEMANTICS"
|
CFLAGS="$CFLAGS -DSunOS=1 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
|
||||||
;;
|
;;
|
||||||
*-cygwin*)
|
*-cygwin*)
|
||||||
EXE_EXT=".exe"
|
EXE_EXT=".exe"
|
||||||
|
|
|
@ -1153,7 +1153,7 @@ static void pgdeliver(struct PGDeliverData_t *pgdata)
|
||||||
#define MAX_QLEN 10 /* we don't allow more than this number pending per thread. */
|
#define MAX_QLEN 10 /* we don't allow more than this number pending per thread. */
|
||||||
static void pgq_queue_run(char *dir,
|
static void pgq_queue_run(char *dir,
|
||||||
int (*deliver)(MmsEnvelope *),
|
int (*deliver)(MmsEnvelope *),
|
||||||
double sleepsecs, int num_threads, int *rstop)
|
double sleepsecs, int num_threads, volatile sig_atomic_t *rstop)
|
||||||
{
|
{
|
||||||
|
|
||||||
struct PGDeliverData_t pgdata;
|
struct PGDeliverData_t pgdata;
|
||||||
|
|
|
@ -19,7 +19,7 @@ static Octstr *shell_cmd;
|
||||||
#undef error
|
#undef error
|
||||||
#undef warning
|
#undef warning
|
||||||
#undef info
|
#undef info
|
||||||
static void default_logger(enum mbuni_event_type_t type, const char *subtype, int level, const char *file,
|
static void default_logger(enum mbuni_event_type_t type, const char *subtype, int err, const char *file,
|
||||||
int line,
|
int line,
|
||||||
const char *function,
|
const char *function,
|
||||||
const char *interface, Octstr *id,
|
const char *interface, Octstr *id,
|
||||||
|
@ -38,7 +38,7 @@ static void default_logger(enum mbuni_event_type_t type, const char *subtype, in
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
f(level, "%s:%d <%s> [%s] [%s] %s",
|
f(err, "%s:%d <%s> [%s] [%s] %s",
|
||||||
file, line, function,
|
file, line, function,
|
||||||
interface ? interface : "n/a",
|
interface ? interface : "n/a",
|
||||||
id ? octstr_get_cstr(id) : "n/a",
|
id ? octstr_get_cstr(id) : "n/a",
|
||||||
|
@ -46,7 +46,7 @@ static void default_logger(enum mbuni_event_type_t type, const char *subtype, in
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void shell_logger(enum mbuni_event_type_t type, const char *subtype, int level, const char *file,
|
static void shell_logger(enum mbuni_event_type_t type, const char *subtype, int err, const char *file,
|
||||||
int line, const char *function,
|
int line, const char *function,
|
||||||
const char *interface, Octstr *id,
|
const char *interface, Octstr *id,
|
||||||
Octstr *msg)
|
Octstr *msg)
|
||||||
|
@ -74,7 +74,7 @@ static void shell_logger(enum mbuni_event_type_t type, const char *subtype, int
|
||||||
|
|
||||||
|
|
||||||
cmd = octstr_format("%S '%s' '%s' %d '%s' '%s' %d '%S' '%S'",
|
cmd = octstr_format("%S '%s' '%s' %d '%s' '%s' %d '%S' '%S'",
|
||||||
shell_cmd, xtype, subtype ? subtype : "", level, interface ? interface : "", file, line, xid ? xid : octstr_imm(""), msg);
|
shell_cmd, xtype, subtype ? subtype : "", err, interface ? interface : "", file, line, xid ? xid : octstr_imm(""), msg);
|
||||||
system(octstr_get_cstr(cmd));
|
system(octstr_get_cstr(cmd));
|
||||||
|
|
||||||
octstr_destroy(cmd);
|
octstr_destroy(cmd);
|
||||||
|
@ -122,7 +122,7 @@ int mms_event_logger_init(MmsEventLoggerFuncs *funcs, Octstr *init_param)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void mms_event_logger(enum mbuni_event_type_t type, const char *subtype, int level, const char *file,
|
extern void mms_event_logger(enum mbuni_event_type_t type, const char *subtype, int err, const char *file,
|
||||||
int line, const char *function, char *interface, Octstr *id,
|
int line, const char *function, char *interface, Octstr *id,
|
||||||
char *fmt,...)
|
char *fmt,...)
|
||||||
{
|
{
|
||||||
|
@ -134,7 +134,7 @@ extern void mms_event_logger(enum mbuni_event_type_t type, const char *subtype,
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
log_handler->log_event(type,subtype, level, file, line, function, interface, id, x);
|
log_handler->log_event(type,subtype, err, file, line, function, interface, id, x);
|
||||||
|
|
||||||
octstr_destroy(x);
|
octstr_destroy(x);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
typedef enum mbuni_event_type_t {MBUNI_ERROR, MBUNI_INFO, MBUNI_WARNING} mbuni_event_type_t;
|
typedef enum mbuni_event_type_t {MBUNI_ERROR, MBUNI_INFO, MBUNI_WARNING} mbuni_event_type_t;
|
||||||
typedef struct MmsEventLoggerFuncs {
|
typedef struct MmsEventLoggerFuncs {
|
||||||
int (*init)(Octstr *init_param);
|
int (*init)(Octstr *init_param);
|
||||||
void (*log_event)(enum mbuni_event_type_t type, const char *subtype, int level, const char *file,
|
void (*log_event)(enum mbuni_event_type_t type, const char *subtype, int err, const char *file,
|
||||||
int line,
|
int line,
|
||||||
const char *function,
|
const char *function,
|
||||||
const char *interface, Octstr *id,
|
const char *interface, Octstr *id,
|
||||||
|
@ -35,18 +35,18 @@ extern int mms_event_logger_init(MmsEventLoggerFuncs *funcs, Octstr *init_param)
|
||||||
*/
|
*/
|
||||||
extern void mms_event_logger_cleanup(void);
|
extern void mms_event_logger_cleanup(void);
|
||||||
extern void mms_event_logger(enum mbuni_event_type_t type, const char *subtype,
|
extern void mms_event_logger(enum mbuni_event_type_t type, const char *subtype,
|
||||||
int level, const char *file,
|
int err, const char *file,
|
||||||
int line, const char *function,
|
int line, const char *function,
|
||||||
char *interface, Octstr *id,
|
char *interface, Octstr *id,
|
||||||
char *fmt,...);
|
char *fmt,...);
|
||||||
|
|
||||||
#define mms_error(level,intf,id,fmt,...) mms_event_logger(MBUNI_ERROR, NULL, (level), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
#define mms_error(err,intf,id,fmt,...) mms_event_logger(MBUNI_ERROR, NULL, (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||||
#define mms_info(level,intf,id,fmt,...) mms_event_logger(MBUNI_INFO, NULL, (level), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
#define mms_info(err,intf,id,fmt,...) mms_event_logger(MBUNI_INFO, NULL, (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||||
#define mms_warning(level,intf,id,fmt,...) mms_event_logger(MBUNI_WARNING, NULL, (level), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
#define mms_warning(err,intf,id,fmt,...) mms_event_logger(MBUNI_WARNING, NULL, (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||||
|
|
||||||
#define mms_error_ex(subtype,level,intf,id,fmt,...) mms_event_logger(MBUNI_ERROR, (subtype), (level), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
#define mms_error_ex(subtype,err,intf,id,fmt,...) mms_event_logger(MBUNI_ERROR, (subtype), (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||||
#define mms_info_ex(subtype,level,intf,id,fmt,...) mms_event_logger(MBUNI_INFO, (subtype), (level), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
#define mms_info_ex(subtype,err,intf,id,fmt,...) mms_event_logger(MBUNI_INFO, (subtype), (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||||
#define mms_warning_ex(subtype,level,intf,id,fmt,...) mms_event_logger(MBUNI_WARNING, (subtype), (level), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
#define mms_warning_ex(subtype,err,intf,id,fmt,...) mms_event_logger(MBUNI_WARNING, (subtype), (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||||
|
|
||||||
|
|
||||||
MmsEventLoggerFuncs shell_event_logger; /* For logging using a shell command. */
|
MmsEventLoggerFuncs shell_event_logger; /* For logging using a shell command. */
|
||||||
|
|
|
@ -1127,7 +1127,7 @@ static int run_dir(char *topdir, char *dir, struct Qthread_t *tlist, int num_thr
|
||||||
|
|
||||||
static void mms_queue_run(char *dir,
|
static void mms_queue_run(char *dir,
|
||||||
int (*deliver)(MmsEnvelope *),
|
int (*deliver)(MmsEnvelope *),
|
||||||
double sleepsecs, int num_threads, int *rstop)
|
double sleepsecs, int num_threads, volatile sig_atomic_t *rstop)
|
||||||
{
|
{
|
||||||
struct Qthread_t *tlist;
|
struct Qthread_t *tlist;
|
||||||
int i, qstop = 0;
|
int i, qstop = 0;
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
#ifndef _MMS_QUEUE_INCLUDED__
|
#ifndef _MMS_QUEUE_INCLUDED__
|
||||||
#define _MMS_QUEUE_INCLUDED__
|
#define _MMS_QUEUE_INCLUDED__
|
||||||
|
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
#include "mms_msg.h"
|
#include "mms_msg.h"
|
||||||
#include "mms_util.h"
|
#include "mms_util.h"
|
||||||
|
|
||||||
|
@ -146,7 +148,7 @@ typedef struct MmsQueueHandlerFuncs {
|
||||||
int (*deliver)(MmsEnvelope *),
|
int (*deliver)(MmsEnvelope *),
|
||||||
double sleepsecs,
|
double sleepsecs,
|
||||||
int num_threads,
|
int num_threads,
|
||||||
int *rstop);
|
volatile sig_atomic_t *rstop);
|
||||||
|
|
||||||
/* Get rid of memory used by this. Typically does internal cleanup then calls
|
/* Get rid of memory used by this. Typically does internal cleanup then calls
|
||||||
* the general structure free-ing function below.
|
* the general structure free-ing function below.
|
||||||
|
|
|
@ -1554,7 +1554,7 @@ done2:
|
||||||
return 1; /* always delete queue entry. */
|
return 1; /* always delete queue entry. */
|
||||||
}
|
}
|
||||||
|
|
||||||
void mmsbox_outgoing_queue_runner(int *rstop)
|
void mmsbox_outgoing_queue_runner(volatile sig_atomic_t *rstop)
|
||||||
{
|
{
|
||||||
qfs->mms_queue_run(octstr_get_cstr(outgoing_qdir),
|
qfs->mms_queue_run(octstr_get_cstr(outgoing_qdir),
|
||||||
sendMsg, queue_interval, maxthreads, rstop);
|
sendMsg, queue_interval, maxthreads, rstop);
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
/* XXX warning, do not octstr_destroy strings in HTTPCGIVar struct. They are destroyed by the http module! */
|
/* XXX warning, do not octstr_destroy strings in HTTPCGIVar struct. They are destroyed by the http module! */
|
||||||
|
|
||||||
int rstop = 0;
|
volatile sig_atomic_t rstop = 0;
|
||||||
static void quit_now(int notused)
|
static void quit_now(int notused)
|
||||||
{
|
{
|
||||||
rstop = 1;
|
rstop = 1;
|
||||||
|
@ -1360,7 +1360,7 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
|
||||||
octstr_get_cstr(qdir),
|
octstr_get_cstr(qdir),
|
||||||
"MMSBox",
|
"MMSBox",
|
||||||
NULL);
|
NULL);
|
||||||
mms_info(2, "mmsbox", NULL,"MMSBox: Queued message from service [%s], [transid [%s]: %s",
|
mms_info(0, "mmsbox", NULL,"MMSBox: Queued message from service [%s], [transid [%s]: %s",
|
||||||
octstr_get_cstr(svc_name),
|
octstr_get_cstr(svc_name),
|
||||||
otransid ? octstr_get_cstr(otransid) : "",
|
otransid ? octstr_get_cstr(otransid) : "",
|
||||||
octstr_get_cstr(x));
|
octstr_get_cstr(x));
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#define __MMSBOX_INCLUDED__
|
#define __MMSBOX_INCLUDED__
|
||||||
#include "mmsbox_cfg.h"
|
#include "mmsbox_cfg.h"
|
||||||
|
|
||||||
extern int rstop;
|
extern volatile sig_atomic_t rstop;
|
||||||
void mms_dlr_url_put(Octstr *msgid, char *rtype, Octstr *mmc_gid, Octstr *dlr_url, Octstr *transid);
|
void mms_dlr_url_put(Octstr *msgid, char *rtype, Octstr *mmc_gid, Octstr *dlr_url, Octstr *transid);
|
||||||
int mms_dlr_url_get(Octstr *msgid, char *rtype, Octstr *mmc_gid, Octstr **dlr_url, Octstr **transid);
|
int mms_dlr_url_get(Octstr *msgid, char *rtype, Octstr *mmc_gid, Octstr **dlr_url, Octstr **transid);
|
||||||
void mms_dlr_url_remove(Octstr *msgid, char *rtype, Octstr *mmc_gid);
|
void mms_dlr_url_remove(Octstr *msgid, char *rtype, Octstr *mmc_gid);
|
||||||
|
@ -25,7 +25,7 @@ Octstr *mmsbox_get_report_info(MmsMsg *m, MmscGrp *mmsc, Octstr *out_mmc_id,
|
||||||
time_t uaprof_tstamp,
|
time_t uaprof_tstamp,
|
||||||
Octstr *msgid);
|
Octstr *msgid);
|
||||||
void mmsc_receive_func(MmscGrp *m);
|
void mmsc_receive_func(MmscGrp *m);
|
||||||
void mmsbox_outgoing_queue_runner(int *rstop);
|
void mmsbox_outgoing_queue_runner(volatile sig_atomic_t *rstop);
|
||||||
|
|
||||||
/* Just a convenience, should go away in future! */
|
/* Just a convenience, should go away in future! */
|
||||||
#define mmsbox_url_fetch_content mms_url_fetch_content
|
#define mmsbox_url_fetch_content mms_url_fetch_content
|
||||||
|
|
|
@ -21,8 +21,8 @@ int mmsrelay(void);
|
||||||
int stop_mmsrelay(void);
|
int stop_mmsrelay(void);
|
||||||
|
|
||||||
|
|
||||||
extern void mbuni_global_queue_runner(int *stopflag);
|
extern void mbuni_global_queue_runner(volatile sig_atomic_t *stopflag);
|
||||||
extern void mbuni_mm1_queue_runner(int *stopflag);
|
extern void mbuni_mm1_queue_runner(volatile sig_atomic_t *stopflag);
|
||||||
extern MmscSettings *settings;
|
extern MmscSettings *settings;
|
||||||
extern List *proxyrelays;
|
extern List *proxyrelays;
|
||||||
|
|
||||||
|
|
|
@ -457,7 +457,7 @@ static int sendMsg(MmsEnvelope *e)
|
||||||
settings->qfs->mms_queue_free_env(e);
|
settings->qfs->mms_queue_free_env(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
mms_info(3, "MMSC.global", NULL, "Processed in %d secs", (int)(time(NULL) - tstart)); /* report processing time. */
|
mms_info(0, "MMSC.global", NULL, "Processed in %d secs", (int)(time(NULL) - tstart)); /* report processing time. */
|
||||||
|
|
||||||
return 1; /* Always deletes the queue entry. */
|
return 1; /* Always deletes the queue entry. */
|
||||||
}
|
}
|
||||||
|
@ -474,7 +474,7 @@ static void cdr_thread(void *unused)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mbuni_global_queue_runner(int *rstop)
|
void mbuni_global_queue_runner(volatile sig_atomic_t *rstop)
|
||||||
{
|
{
|
||||||
long cdr_thid;
|
long cdr_thid;
|
||||||
mms_setmobile_queuedir(octstr_get_cstr(settings->mm1_queuedir));
|
mms_setmobile_queuedir(octstr_get_cstr(settings->mm1_queuedir));
|
||||||
|
|
|
@ -363,7 +363,7 @@ static int sendNotify(MmsEnvelope *e)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write to log */
|
/* Write to log */
|
||||||
mms_info(2, "MM1", NULL, "%s Mobile Queue MMS Send Notify: From=%s, to=%s, msgsize=%d, reason=%s. Processed in %d secs",
|
mms_info(0, "MM1", NULL, "%s Mobile Queue MMS Send Notify: From=%s, to=%s, msgsize=%d, reason=%s. Processed in %d secs",
|
||||||
SEND_ERROR_STR(res),
|
SEND_ERROR_STR(res),
|
||||||
octstr_get_cstr(from), octstr_get_cstr(to), msize,
|
octstr_get_cstr(from), octstr_get_cstr(to), msize,
|
||||||
err ? octstr_get_cstr(err) : "",
|
err ? octstr_get_cstr(err) : "",
|
||||||
|
@ -399,7 +399,7 @@ static int sendNotify(MmsEnvelope *e)
|
||||||
return 1; /* Tell caller we dealt with envelope */
|
return 1; /* Tell caller we dealt with envelope */
|
||||||
}
|
}
|
||||||
|
|
||||||
void mbuni_mm1_queue_runner(int *rstop)
|
void mbuni_mm1_queue_runner(volatile sig_atomic_t *rstop)
|
||||||
{
|
{
|
||||||
settings->qfs->mms_queue_run(octstr_get_cstr(settings->mm1_queuedir),
|
settings->qfs->mms_queue_run(octstr_get_cstr(settings->mm1_queuedir),
|
||||||
sendNotify, settings->mm1_queue_interval, settings->maxthreads, rstop);
|
sendNotify, settings->mm1_queue_interval, settings->maxthreads, rstop);
|
||||||
|
|
|
@ -40,7 +40,7 @@ typedef struct MmsHTTPClientInfo {
|
||||||
} MmsHTTPClientInfo;
|
} MmsHTTPClientInfo;
|
||||||
|
|
||||||
static long mm7_thread = -1;
|
static long mm7_thread = -1;
|
||||||
static int rstop = 0;
|
static volatile sig_atomic_t rstop = 0;
|
||||||
|
|
||||||
static void free_clientInfo(MmsHTTPClientInfo *h, int freeh);
|
static void free_clientInfo(MmsHTTPClientInfo *h, int freeh);
|
||||||
static void fetchmms_proxy(MmsHTTPClientInfo *h);
|
static void fetchmms_proxy(MmsHTTPClientInfo *h);
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
static long qthread = -1;
|
static long qthread = -1;
|
||||||
|
|
||||||
static int rstop = 0; /* Set to 1 to stop relay. */
|
static volatile sig_atomic_t rstop = 0; /* Set to 1 to stop relay. */
|
||||||
|
|
||||||
int mmsrelay()
|
int mmsrelay()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue