}
struct rpc_sock_read_state {
+ struct rpc_transport_sock_state *transp;
ssize_t received;
};
struct rpc_sock_read_state)) {
return NULL;
}
-
+ if (sock_transp->fd == -1) {
+ if (!async_post_ntstatus(result, ev, NT_STATUS_CONNECTION_INVALID)) {
+ goto fail;
+ }
+ return result;
+ }
+ 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;
+ }
TALLOC_FREE(subreq);
async_req_nterror(req, map_nt_error_from_unix(err));
return;
}
struct rpc_sock_write_state {
+ struct rpc_transport_sock_state *transp;
ssize_t sent;
};
struct rpc_sock_write_state)) {
return NULL;
}
+ if (sock_transp->fd == -1) {
+ if (!async_post_ntstatus(result, ev, NT_STATUS_CONNECTION_INVALID)) {
+ goto fail;
+ }
+ return result;
+ }
+ 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;
+ }
TALLOC_FREE(subreq);
async_req_nterror(req, map_nt_error_from_unix(err));
return;