summaryrefslogtreecommitdiff
path: root/src/pulsecore/protocol-http.c
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2013-06-24 17:29:26 +0200
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2013-06-24 22:11:40 +0300
commit8127f8f9c55fe4aa7c1d330beb406fa4100b478c (patch)
tree98f0a9d8733fbc2536c00dafeb47ca676a1ce8f4 /src/pulsecore/protocol-http.c
parent97da92d894c2a29bc3ccf60dc904e4099b30f47e (diff)
downloadpulseaudio-8127f8f9c55fe4aa7c1d330beb406fa4100b478c.tar.gz
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>
Diffstat (limited to 'src/pulsecore/protocol-http.c')
-rw-r--r--src/pulsecore/protocol-http.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/pulsecore/protocol-http.c b/src/pulsecore/protocol-http.c
index 1dcf01071..7d49bf822 100644
--- a/src/pulsecore/protocol-http.c
+++ b/src/pulsecore/protocol-http.c
@@ -168,7 +168,7 @@ static int do_write(struct connection *c) {
pa_memblockq_drop(c->output_memblockq, (size_t) r);
- return 0;
+ return 1;
}
/* Called from main context */
@@ -178,9 +178,13 @@ static void do_work(struct connection *c) {
if (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;