{
struct cli_state *cli = (struct cli_state *)p;
struct cli_request *req;
+ NTSTATUS status;
DEBUG(11, ("cli_state_handler called with flags %d\n", flags));
if (res == -1) {
DEBUG(10, ("ioctl(FIONREAD) failed: %s\n",
strerror(errno)));
+ status = map_nt_error_from_unix(errno);
goto sock_error;
}
if (available == 0) {
/* EOF */
+ status = NT_STATUS_END_OF_FILE;
goto sock_error;
}
if (new_size < old_size) {
/* wrap */
+ status = NT_STATUS_UNEXPECTED_IO_ERROR;
goto sock_error;
}
new_size);
if (tmp == NULL) {
/* nomem */
+ status = NT_STATUS_NO_MEMORY;
goto sock_error;
}
cli->evt_inbuf = tmp;
res = recv(cli->fd, cli->evt_inbuf + old_size, available, 0);
if (res == -1) {
DEBUG(10, ("recv failed: %s\n", strerror(errno)));
+ status = map_nt_error_from_unix(errno);
goto sock_error;
}
to_send - req->sent, 0);
if (sent < 0) {
+ status = map_nt_error_from_unix(errno);
goto sock_error;
}
sock_error:
for (req = cli->outstanding_requests; req; req = req->next) {
- req->async->state = ASYNC_REQ_ERROR;
- req->async->status = map_nt_error_from_unix(errno);
+ async_req_error(req->async, status);
}
TALLOC_FREE(cli->fd_event);
close(cli->fd);