1
0
Fork 0

*** empty log message ***

This commit is contained in:
bagyenda 2009-01-22 14:17:10 +00:00
parent 25d8d878c7
commit c2c0ce7fe3
1 changed files with 3 additions and 3 deletions

View File

@ -350,7 +350,7 @@ static MmsEnvelope *pgq_queue_readenvelope_ex(char *qf, char *mms_queuedir, int
int64_t qid;
long num_attempts, i, n;
time_t sendt, created, lastt, edate;
char cmd[4*QFNAMEMAX], _qf[QFNAMEMAX*2+1], tmp[128];
char cmd[4*QFNAMEMAX], _qf[QFNAMEMAX*2+1];
char data_file[4*QFNAMEMAX+1];
Octstr *from = NULL;
@ -366,13 +366,13 @@ static MmsEnvelope *pgq_queue_readenvelope_ex(char *qf, char *mms_queuedir, int
n = strlen(qf);
PQescapeStringConn(c, _qf, qf, n < QFNAMEMAX ? n : QFNAMEMAX, NULL);
strncpy(tmp, (check_send_time) ? " AND send_time <= current_timestamp " : "", sizeof tmp); /* handle checking of due time */
/* read and block, to ensure no one else touches it. */
sprintf(cmd, "SELECT id,cdate,lastt,sendt,edate,num_attempts,sender,data FROM "
" mms_messages_view WHERE qdir='%s' AND qfname = '%s' %s FOR UPDATE %s",
mms_queuedir, _qf,
tmp,
check_send_time ? " AND send_time <= current_timestamp " : "",
shouldblock ? "" : "NOWAIT"); /* nice little PostgreSQL 8.x addition. */
r = PQexec(c, cmd);