diff options
Diffstat (limited to 'src/protocol/pubsub0/pub.c')
| -rw-r--r-- | src/protocol/pubsub0/pub.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/protocol/pubsub0/pub.c b/src/protocol/pubsub0/pub.c index be550439..c54274a6 100644 --- a/src/protocol/pubsub0/pub.c +++ b/src/protocol/pubsub0/pub.c @@ -267,9 +267,6 @@ pub0_sock_send(void *arg, nni_aio *aio) if (p->closed) { continue; } - if (nni_lmq_full(&p->sendq)) { - continue; - } if (p == nni_list_last(&sock->pipes)) { dup = msg; msg = NULL; @@ -277,6 +274,12 @@ pub0_sock_send(void *arg, nni_aio *aio) continue; } if (p->busy) { + if (nni_lmq_full(&p->sendq)) { + // Make space for the new message. + nni_msg * old; + (void) nni_lmq_getq(&p->sendq, &old); + nni_msg_free(old); + } nni_lmq_putq(&p->sendq, dup); } else { p->busy = true; |
