X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=libatalk%2Fdsi%2Fdsi_stream.c;h=711a037b5098925c59c77198bb6350d390d9b5a3;hp=98c9396f77cb58157867b907b0082618b2d9e1a8;hb=8e5e83dac34cf886996821a51dee5c971e7c51f2;hpb=c49d803fb9746aa417943627a463de2db2c639ed diff --git a/libatalk/dsi/dsi_stream.c b/libatalk/dsi/dsi_stream.c index 98c9396f..711a037b 100644 --- a/libatalk/dsi/dsi_stream.c +++ b/libatalk/dsi/dsi_stream.c @@ -400,7 +400,7 @@ ssize_t dsi_stream_read_file(DSI *dsi, const int fromfd, off_t offset, const siz #endif /* defined(SOLARIS) || defined(FREEBSD) */ #endif /* HAVE_SENDFILEV */ - if (dsi_peek(dsi)) { + if (dsi_peek(dsi) != 0) { ret = -1; goto exit; } @@ -533,7 +533,7 @@ int dsi_stream_send(DSI *dsi, void *buf, size_t length) break; else if (len < 0) { /* error */ if (errno == EAGAIN || errno == EWOULDBLOCK) { - if (!dsi_peek(dsi)) { + if (dsi_peek(dsi) == 0) { continue; } } @@ -596,7 +596,7 @@ int dsi_stream_receive(DSI *dsi) dsi->clientID = ntohs(dsi->header.dsi_requestID); /* make sure we don't over-write our buffers. */ - dsi->cmdlen = MIN(ntohl(dsi->header.dsi_len), DSI_CMDSIZ); + dsi->cmdlen = MIN(ntohl(dsi->header.dsi_len), dsi->server_quantum); if (dsi_stream_read(dsi, dsi->commands, dsi->cmdlen) != dsi->cmdlen) return 0;