nwritten = writev_recv(subreq, &err);
TALLOC_FREE(subreq);
if (nwritten == -1) {
+ if (err == EPIPE) {
+ 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 (err == EPIPE) {
+ close(cli->fd);
+ cli->fd = -1;
+ }
status = map_nt_error_from_unix(err);
goto fail;
}
}
struct rpc_sock_read_state {
+ struct rpc_transport_sock_state *transp;
ssize_t received;
};
if (req == NULL) {
return NULL;
}
-
+ if (sock_transp->fd == -1) {
+ tevent_req_nterror(req, NT_STATUS_CONNECTION_INVALID);
+ return tevent_req_post(req, ev);
+ }
+ state->transp = sock_transp;
subreq = async_recv_send(state, ev, sock_transp->fd, data, size, 0);
if (subreq == NULL) {
goto fail;
state->received = async_recv_recv(subreq, &err);
if (state->received == -1) {
+ if (err == EPIPE) {
+ close(state->transp->fd);
+ state->transp->fd = -1;
+ }
tevent_req_nterror(req, map_nt_error_from_unix(err));
return;
}
}
struct rpc_sock_write_state {
+ struct rpc_transport_sock_state *transp;
ssize_t sent;
};
if (req == NULL) {
return NULL;
}
+ if (sock_transp->fd == -1) {
+ tevent_req_nterror(req, NT_STATUS_CONNECTION_INVALID);
+ return tevent_req_post(req, ev);
+ }
+ state->transp = sock_transp;
subreq = async_send_send(state, ev, sock_transp->fd, data, size, 0);
if (subreq == NULL) {
goto fail;
state->sent = async_send_recv(subreq, &err);
if (state->sent == -1) {
+ if (err == EPIPE) {
+ close(state->transp->fd);
+ state->transp->fd = -1;
+ }
tevent_req_nterror(req, map_nt_error_from_unix(err));
return;
}