From d63cc82ea87d03d4fd35e23bd2574b6f7d07bb3a Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Sat, 19 Jul 2008 01:08:40 +0000 Subject: [PATCH] *** empty log message *** --- mbuni/extras/pgsql-queue/mms_pgsql_queue.c | 4 ++-- mbuni/mmlib/mms_mm7soap.c | 3 +-- mbuni/mmlib/mms_queue.c | 12 ++++++++++-- mbuni/mmlib/mms_uaprof.c | 9 +++++---- mbuni/mmsbox/mmsbox.c | 7 ++++++- mbuni/mmsbox/mmsbox_cfg.c | 2 +- mbuni/mmsbox/mmsbox_cfg.h | 2 +- mbuni/mmsc/mmsglobalsender.c | 10 ++++++---- mbuni/mmsc/mmsproxy.c | 3 +-- mbuni/mmsc/mmsrelay.c | 4 ++-- 10 files changed, 35 insertions(+), 21 deletions(-) diff --git a/mbuni/extras/pgsql-queue/mms_pgsql_queue.c b/mbuni/extras/pgsql-queue/mms_pgsql_queue.c index c9f9234..2920dbd 100644 --- a/mbuni/extras/pgsql-queue/mms_pgsql_queue.c +++ b/mbuni/extras/pgsql-queue/mms_pgsql_queue.c @@ -907,10 +907,10 @@ static void pgq_queue_run(char *dir, info(0, "pgsql_queue: Queue runner on [%s] shutdown, started...", dir); gwlist_remove_producer(items_list); - +#if 0 for (i=0;i= 0) + gwthread_join(tlist[i].thid); + for (i = 0; i 0) gwthread_join(sthread); - sleep(2); + info(0, "Shutdown complete.."); + mms_lib_shutdown(); return 0; } diff --git a/mbuni/mmsbox/mmsbox_cfg.c b/mbuni/mmsbox/mmsbox_cfg.c index 6b16453..1ef710d 100644 --- a/mbuni/mmsbox/mmsbox_cfg.c +++ b/mbuni/mmsbox/mmsbox_cfg.c @@ -579,7 +579,7 @@ Octstr *get_mmsbox_queue_dir(Octstr *from, List *to, MmscGrp *m, return 0; } -void mmsbox_cleanup_mmsc_settings(void) +void mmsbox_cleanup_settings(void) { /* eventually we will destroy the object. For now, we only cleanup queue module. */ if (qfs) diff --git a/mbuni/mmsbox/mmsbox_cfg.h b/mbuni/mmsbox/mmsbox_cfg.h index 8e17e3e..4539c87 100644 --- a/mbuni/mmsbox/mmsbox_cfg.h +++ b/mbuni/mmsbox/mmsbox_cfg.h @@ -118,7 +118,7 @@ extern MmscGrp *get_handler_mmc(Octstr *id, Octstr *to, Octstr *from); extern Octstr *get_mmsbox_queue_dir(Octstr *from, List *to, MmscGrp *m, Octstr **mmc_id); -extern void mmsbox_cleanup_mmsc_settings(void); +extern void mmsbox_cleanup_settings(void); typedef struct MmsBoxHTTPClientInfo { HTTPClient *client; diff --git a/mbuni/mmsc/mmsglobalsender.c b/mbuni/mmsc/mmsglobalsender.c index a0729db..4e24dfb 100644 --- a/mbuni/mmsc/mmsglobalsender.c +++ b/mbuni/mmsc/mmsglobalsender.c @@ -449,7 +449,7 @@ static void cdr_thread(void *unused) void mbuni_global_queue_runner(int *rstop) { - + long cdr_thid; mms_setmobile_queuedir(octstr_get_cstr(settings->mm1_queuedir)); mms_setsendmail_cmd(octstr_get_cstr(settings->sendmail)); @@ -460,14 +460,16 @@ void mbuni_global_queue_runner(int *rstop) /* Start the thread for CDR */ cdr_list = gwlist_create(); gwlist_add_producer(cdr_list); - gwthread_create(cdr_thread, NULL); + cdr_thid = gwthread_create(cdr_thread, NULL); settings->qfs->mms_queue_run(qdir, sendMsg, settings->queue_interval, settings->maxthreads, rstop); /* When it ends, wait a little for other stuff to stop... */ - sleep(2); gwlist_remove_producer(cdr_list); /* Stop CDR thread. */ - + + if (cdr_thid >= 0) + gwthread_join(cdr_thid); + sleep(2); gwlist_destroy(cdr_list, NULL); return; diff --git a/mbuni/mmsc/mmsproxy.c b/mbuni/mmsc/mmsproxy.c index 334ff9b..8efaab2 100644 --- a/mbuni/mmsc/mmsproxy.c +++ b/mbuni/mmsc/mmsproxy.c @@ -241,9 +241,8 @@ int main(int argc, char *argv[]) if (mm7_thread >= 0) gwthread_join(mm7_thread); - debug("proxy", 0, "Closed mm7 thread"); - mms_lib_shutdown(); info(0, "mmsproxy: Shutdown complete"); + mms_lib_shutdown(); return 0; } diff --git a/mbuni/mmsc/mmsrelay.c b/mbuni/mmsc/mmsrelay.c index 737343b..5fe0d14 100644 --- a/mbuni/mmsc/mmsrelay.c +++ b/mbuni/mmsc/mmsrelay.c @@ -85,7 +85,7 @@ int main(int argc, char *argv[]) info(0, "Starting Local Queue Runner..."); mbuni_mm1_queue_runner(&rstop); - gwthread_cancel(qthread); /* force it to die if not yet dead. */ + /* gwthread_cancel(qthread); force it to die if not yet dead. */ /* It terminates, so start dying... */ info(0, "Stopping profile engine..."); @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) sleep(2); /* Wait for them to die. */ info(0, "Final cleanup..."); - mms_cleanup_mmsc_settings(settings); + mms_cleanup_mmsc_settings(settings); /* Stop settings stuff and so on. */ info(0, "Queue runners shutdown, cleanup commenced..."); gwthread_join(qthread); /* Wait for it to die... */