diff options
author | Simon Rettberg | 2015-05-05 19:54:58 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-05-05 19:54:58 +0200 |
commit | aecca3e843139d06050e113411f670280ec86e64 (patch) | |
tree | c6148537cd5abfef5c3ac33a51e31145189f08f3 /src/server/sockhelper.h | |
parent | [Server] Added statistics of images and uptime to json. (diff) | |
download | dnbd3-aecca3e843139d06050e113411f670280ec86e64.tar.gz dnbd3-aecca3e843139d06050e113411f670280ec86e64.tar.xz dnbd3-aecca3e843139d06050e113411f670280ec86e64.zip |
[SERVER] Fix premature connection close for RPC replies
Diffstat (limited to 'src/server/sockhelper.h')
-rw-r--r-- | src/server/sockhelper.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/sockhelper.h b/src/server/sockhelper.h index b6b0b11..3f4d485 100644 --- a/src/server/sockhelper.h +++ b/src/server/sockhelper.h @@ -76,4 +76,11 @@ void sock_set_block(int sock); */ bool sock_append(poll_list_t *list, const int sock, bool wantRead, bool wantWrite); +/** + * Send the whole buffer, calling write() multiple times if neccessary. + * Give up after calling write() maxtries times. + * Set maxtries < 0 to try infinitely. + */ +ssize_t sock_sendAll(int sock, void *buffer, size_t len, int maxtries); + #endif /* SOCKHELPER_H_ */ |