mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
protocol-esound/http/simple: Make sure callers can handle iochannel_write changes
With the new behaviour, you will not always get a callback after a successful write. Make sure the callers can properly handle this. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
97da92d894
commit
8127f8f9c5
3 changed files with 23 additions and 12 deletions
|
|
@ -235,7 +235,7 @@ static int do_write(connection *c) {
|
|||
|
||||
pa_memblockq_drop(c->output_memblockq, (size_t) r);
|
||||
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void do_work(connection *c) {
|
||||
|
|
@ -251,9 +251,13 @@ static void do_work(connection *c) {
|
|||
if (!c->sink_input && pa_iochannel_is_hungup(c->io))
|
||||
goto fail;
|
||||
|
||||
if (pa_iochannel_is_writable(c->io))
|
||||
if (do_write(c) < 0)
|
||||
while (pa_iochannel_is_writable(c->io)) {
|
||||
int r = do_write(c);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
if (r == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue