diff options
Diffstat (limited to 'client/helloworld')
-rw-r--r-- | client/helloworld/main.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/client/helloworld/main.c b/client/helloworld/main.c index 079b957..d744851 100644 --- a/client/helloworld/main.c +++ b/client/helloworld/main.c @@ -349,12 +349,15 @@ int main(int argc, char **argv) { } } if ((r = lock())) { goto end; } - if ((r = ac_receive(connection, buffer, pos, bytes, &obj, &read))) { - bool again = r == AC_E_AGAIN; - if (!again) { - unlock(); - goto end; + while (pos < bytes) { + if ((r = ac_receive(connection, buffer, pos, bytes, &obj, &read))) { + bool again = r == AC_E_AGAIN; + if (!again) { + unlock(); + goto end; + } } + pos += read; } r = process(connection, obj); if ((r = unlock())) { goto end; } |