check if writable preparing a DATA packet

This commit is contained in:
Alexandre Ratchov 2014-03-05 20:09:34 +01:00
parent 25e29a8cf2
commit f59de2770d
1 changed files with 1 additions and 1 deletions

View File

@ -1416,7 +1416,7 @@ sock_buildmsg(struct sock *f)
/*
* If data available, build a DATA message.
*/
if (f->slot != NULL && f->slot->sub.buf.used > 0 && f->wmax > 0) {
if (f->slot != NULL && f->wmax > 0 && f->slot->sub.buf.used > 0) {
size = f->slot->sub.buf.used;
if (size > AMSG_DATAMAX)
size = AMSG_DATAMAX;