Browse Source

Append all new sender_ends in csender instead of only the first

master
Con Kolivas 10 years ago
parent
commit
ed44843e37
  1. 12
      src/connector.c

12
src/connector.c

@ -590,7 +590,7 @@ static void *sender(void *arg)
rename_proc("csender"); rename_proc("csender");
while (42) { while (42) {
sender_send_t *sender_send, *sending, *tmp; sender_send_t *sending, *tmp;
/* Check all sends to see if they can be written out */ /* Check all sends to see if they can be written out */
DL_FOREACH_SAFE(sends, sending, tmp) { DL_FOREACH_SAFE(sends, sending, tmp) {
@ -611,13 +611,11 @@ static void *sender(void *arg)
timeraddspec(&timeout_ts, &polltime); timeraddspec(&timeout_ts, &polltime);
cond_timedwait(&cdata->sender_cond, &cdata->sender_lock, &timeout_ts); cond_timedwait(&cdata->sender_cond, &cdata->sender_lock, &timeout_ts);
} }
sender_send = cdata->sender_sends; if (cdata->sender_sends) {
if (sender_send) DL_CONCAT(sends, cdata->sender_sends);
DL_DELETE(cdata->sender_sends, sender_send); cdata->sender_sends = NULL;
}
mutex_unlock(&cdata->sender_lock); mutex_unlock(&cdata->sender_lock);
if (sender_send)
DL_APPEND(sends, sender_send);
} }
/* We shouldn't get here unless there's an error */ /* We shouldn't get here unless there's an error */
childsighandler(15); childsighandler(15);

Loading…
Cancel
Save