fixed timed message sending.

v0.5.xx
Alexander Vdolainen 10 years ago
parent 7f393c9432
commit 5ffcd38303

@ -83,7 +83,7 @@ static int __conn_read(conn_t *co, void *buf, size_t buf_len)
int rfd = SSL_get_fd(co->ssl), r;
fd_set readset;
fprintf(stderr, "\tListening ... on %s\n", co->uuid);
//fprintf(stderr, "\tListening ... on %s\n", co->uuid);
/* get prepare to select */
FD_ZERO(&readset);
FD_SET(rfd, &readset);
@ -1256,7 +1256,12 @@ static int __default_msg_return(void *cctx, sexp_t *sx)
usrtc_delete(chan->msgs_tree, &(smsg->pendingq_node));
pthread_rwlock_unlock(&(chan->msglock));
}
pthread_mutex_unlock(&(smsg->wait));
if(smsg->flags & ESXMSG_PENDING) pthread_mutex_unlock(&(smsg->wait));
else {
/* nobody want it */
destroy_sexp(smsg->initial_sx);
__destroy_msg(smsg);
}
}
__finish:

@ -225,8 +225,10 @@ static int __msg_reply(sxmsg_t *msg, sexp_t *sx, struct timespec *tio, int opcod
else pthread_mutex_timedlock(&(msg->wait), tio);
}
if(tio && (msg->flags & ESXMSG_PENDING))
if(tio && (msg->flags & ESXMSG_PENDING)) {
msg->flags &= ~ESXMSG_PENDING; /* we will not wait for it */
return SXOTIMEDOUT;
}
r = msg->opcode;

Loading…
Cancel
Save