dont call sock_read() on the write path; the reader state

is SOCK_RMSG and sock_read() will be called from the poll loop
This commit is contained in:
Alexandre Ratchov 2012-11-07 09:54:02 +01:00
parent ebdfbab96a
commit b45b76b8e0
2 changed files with 4 additions and 14 deletions

View File

@ -1,7 +1,7 @@
all:
cd libsndio && ${MAKE}
cd aucat && ${MAKE}
# cd sndiod && ${MAKE}
cd sndiod && ${MAKE}
cd examples && ${MAKE}
install:

View File

@ -1633,20 +1633,10 @@ sock_write(struct sock *f)
log_puts(": copied RRET message\n");
}
#endif
/*
* XXX:
* the rule is to not mix read code paths and
* write code paths
*/
while (sock_read(f))
;
} else {
if (!sock_buildmsg(f))
return 0;
}
/*
* XXX: if sock_read blocks, we end-up here in
* the WMSG state
*/
if (!sock_buildmsg(f))
return 0;
break;
#ifdef DEBUG
default: