|
|
|
@ -316,10 +316,11 @@ static void ms_outq_drain_cb(struct ll_queue* q, void* arg) { |
|
|
|
if (e->dgram) u_free(e->dgram); |
|
|
|
if (e->dgram) u_free(e->dgram); |
|
|
|
queue_entry_free(e); |
|
|
|
queue_entry_free(e); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
uint16_t len = e->len; /* etcp_send может синхронно освободить e (ownership переходит в очередь) */ |
|
|
|
int r = etcp_send(conn, e); |
|
|
|
int r = etcp_send(conn, e); |
|
|
|
if (r != 0) { if (e->dgram) u_free(e->dgram); queue_entry_free(e); } |
|
|
|
if (r != 0) { if (e->dgram) u_free(e->dgram); queue_entry_free(e); } |
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_MEMBER_SYNC, "%s: outq drain peer=%016llx len=%u rc=%d left=%d", |
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_MEMBER_SYNC, "%s: outq drain peer=%016llx len=%u rc=%d left=%d", |
|
|
|
MS_ID, (unsigned long long)s->peer, e->len, r, queue_entry_count(s->out_q)); |
|
|
|
MS_ID, (unsigned long long)s->peer, len, r, queue_entry_count(s->out_q)); |
|
|
|
} |
|
|
|
} |
|
|
|
if (queue_entry_count(s->out_q) > 0 && conn && conn->send_input_q) |
|
|
|
if (queue_entry_count(s->out_q) > 0 && conn && conn->send_input_q) |
|
|
|
queue_waiter_wait(conn->send_input_q, &s->waiter, ms_outq_drain_cb, s); |
|
|
|
queue_waiter_wait(conn->send_input_q, &s->waiter, ms_outq_drain_cb, s); |
|
|
|
|