Browse Source

ckdb - remove duplicate case code for socket data

master
kanoi 9 years ago
parent
commit
bc1e08cd01
  1. 31
      src/ckdb.c
  2. 2
      src/ckdb.h

31
src/ckdb.c

@ -3960,9 +3960,9 @@ static void process_sockd(PGconn *conn, K_ITEM *wq_item)
msgline->id, msgline->id,
msgline->now.tv_sec, ans); msgline->now.tv_sec, ans);
send_unix_msg(msgline->sockd, rep); send_unix_msg(msgline->sockd, rep);
close(msgline->sockd);
FREENULL(ans); FREENULL(ans);
FREENULL(rep); FREENULL(rep);
close(msgline->sockd);
free_msgline_data(ml_item, true, true); free_msgline_data(ml_item, true, true);
K_WLOCK(msgline_free); K_WLOCK(msgline_free);
@ -4270,33 +4270,6 @@ static void *socketer(__maybe_unused void *arg)
case CMD_PSHIFT: case CMD_PSHIFT:
case CMD_DSP: case CMD_DSP:
case CMD_BLOCKSTATUS: case CMD_BLOCKSTATUS:
if (!startup_complete) {
snprintf(reply, sizeof(reply),
"%s.%ld.loading.%s",
msgline->id,
now.tv_sec,
msgline->cmd);
send_unix_msg(sockd, reply);
} else {
msgline->sockd = sockd;
sockd = -1;
K_WLOCK(workqueue_free);
wq_item = k_unlink_head(workqueue_free);
DATA_WORKQUEUE(workqueue, wq_item);
workqueue->msgline_item = ml_item;
workqueue->by = by_default;
workqueue->code = (char *)__func__;
workqueue->inet = inet_default;
if (btc)
k_add_tail(btc_workqueue_store, wq_item);
else
k_add_tail(cmd_workqueue_store, wq_item);
K_WUNLOCK(workqueue_free);
wq_item = ml_item = NULL;
}
break;
/* Process, but reject (loading) until
* startup_complete */
case CMD_MARKS: case CMD_MARKS:
case CMD_QUERY: case CMD_QUERY:
if (!startup_complete) { if (!startup_complete) {
@ -4398,7 +4371,7 @@ static void *socketer(__maybe_unused void *arg)
k_add_head(workqueue_free, wq2_item); k_add_head(workqueue_free, wq2_item);
} }
K_WUNLOCK(workqueue_free); K_WUNLOCK(workqueue_free);
ml_item = NULL; wq_item = ml_item = NULL;
mutex_lock(&wq_waitlock); mutex_lock(&wq_waitlock);
pthread_cond_signal(&wq_waitcond); pthread_cond_signal(&wq_waitcond);
mutex_unlock(&wq_waitlock); mutex_unlock(&wq_waitlock);

2
src/ckdb.h

@ -55,7 +55,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.4" #define DB_VERSION "1.0.4"
#define CKDB_VERSION DB_VERSION"-1.702" #define CKDB_VERSION DB_VERSION"-1.703"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

Loading…
Cancel
Save