#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
+static void remove_client(struct winbindd_cli_state *state);
+
static bool opt_nocache = False;
static bool interactive = False;
state->out_queue, state->sock,
&state->response);
if (req == NULL) {
- state->finished = true;
+ remove_client(state);
return;
}
tevent_req_set_callback(req, winbind_client_response_written, state);
if (ret == -1) {
DEBUG(2, ("Could not write response to client: %s\n",
strerror(err)));
- state->finished = true;
+ remove_client(state);
return;
}
req = wb_req_read_send(state, winbind_event_context(), state->sock,
WINBINDD_MAX_EXTRA_DATA);
if (req == NULL) {
- state->finished = true;
+ remove_client(state);
return;
}
tevent_req_set_callback(req, winbind_client_request_read, state);
if (ret == -1) {
DEBUG(2, ("Could not read client request: %s\n",
strerror(err)));
- state->finished = true;
+ remove_client(state);
return;
}
process_request(state);
TALLOC_FREE(frame);
/* Loop waiting for requests */
while (1) {
- struct winbindd_cli_state *state;
-
frame = talloc_stackframe();
/* refresh the trusted domain cache */
rescan_trusted_domains();
- /* Dispose of client connection if it is marked as
- finished */
- state = winbindd_client_list();
- while (state) {
- struct winbindd_cli_state *next = state->next;
-
- if (state->finished) {
- remove_client(state);
- }
-
- state = next;
- }
-
process_loop();
TALLOC_FREE(frame);
struct winbindd_cli_state *prev, *next; /* Linked list pointers */
int sock; /* Open socket from client */
pid_t pid; /* pid of client */
- bool finished; /* Can delete from list */
bool write_extra_data; /* Write extra_data field */
time_t last_access; /* Time of last access (read or write) */
bool privileged; /* Is the client 'privileged' */