diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-20 00:36:10 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-20 00:36:10 +0000 |
commit | 940ce958a6914fb9b70de3cf95a0c062063e2253 (patch) | |
tree | dc2c8cf28bba6d0211f52d3b9a7071523256884d /source4/libcli | |
parent | 25de3041e6926f4adca229862dfb7e85dad35809 (diff) | |
download | samba-940ce958a6914fb9b70de3cf95a0c062063e2253.tar.gz samba-940ce958a6914fb9b70de3cf95a0c062063e2253.tar.bz2 samba-940ce958a6914fb9b70de3cf95a0c062063e2253.zip |
make the socket send code a little clearer
(This used to be commit 48028fbb856ea7ee642f36ba9ed0d5815763f52b)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/raw/rawrequest.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c index 139f031178..4191d3775e 100644 --- a/source4/libcli/raw/rawrequest.c +++ b/source4/libcli/raw/rawrequest.c @@ -269,13 +269,17 @@ static void cli_req_grow_data(struct cli_request *req, unsigned new_size) */ BOOL cli_request_send(struct cli_request *req) { + uint_t ret; + if (IVAL(req->out.buffer, 0) == 0) { _smb_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE); } cli_request_calculate_sign_mac(req); - if (req->out.size != cli_sock_write(req->transport->socket, req->out.buffer, req->out.size)) { + ret = cli_sock_write(req->transport->socket, req->out.buffer, req->out.size); + + if (req->out.size != ret) { req->transport->error.etype = ETYPE_SOCKET; req->transport->error.e.socket_error = SOCKET_WRITE_ERROR; DEBUG(0,("Error writing %d bytes to server - %s\n", |