iov[0].iov_base = (void *)buf;
iov[0].iov_len = talloc_get_size(buf);
subreq = writev_send(state, state->ev, state->cli->outgoing,
- state->cli->fd, iov, 1);
+ state->cli->fd, false, iov, 1);
} else {
subreq = writev_send(state, state->ev, state->cli->outgoing,
- state->cli->fd, iov, iov_count);
+ state->cli->fd, false, iov, iov_count);
}
if (subreq == NULL) {
return NT_STATUS_NO_MEMORY;
nwritten = writev_recv(subreq, &err);
TALLOC_FREE(subreq);
if (nwritten == -1) {
+ if (state->cli->fd != -1) {
+ close(state->cli->fd);
+ state->cli->fd = -1;
+ }
tevent_req_nterror(req, map_nt_error_from_unix(err));
return;
}
received = read_smb_recv(subreq, talloc_tos(), &inbuf, &err);
TALLOC_FREE(subreq);
if (received == -1) {
+ if (cli->fd != -1) {
+ close(cli->fd);
+ cli->fd = -1;
+ }
status = map_nt_error_from_unix(err);
goto fail;
}