diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-03-16 16:14:20 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-04-15 09:07:16 +0200 |
commit | 87aacbd6bf9d2676015021c79f73b2c3d6d4b2de (patch) | |
tree | bb6427a4328ccf1cecf5ef77fe4bcabe25dc0875 | |
parent | d5f067bfa00102408a8b8bd1db03c98b62e7808e (diff) | |
download | samba-87aacbd6bf9d2676015021c79f73b2c3d6d4b2de.tar.gz samba-87aacbd6bf9d2676015021c79f73b2c3d6d4b2de.tar.xz samba-87aacbd6bf9d2676015021c79f73b2c3d6d4b2de.zip |
s3:winbindd: move non event related code out of process_loop() in the the caller
metze
(cherry picked from commit 3b8dd79f2bc775ed94130565ec2c4383a4864348)
(cherry picked from commit ca31920af281ba9ea8f466ed0264118737a1b055)
-rw-r--r-- | source3/winbindd/winbindd.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index f5812f9e652..d090b6f994a 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -934,7 +934,6 @@ static bool remove_idle_client(void) static void process_loop(void) { - struct winbindd_cli_state *state; struct winbindd_fd_event *ev; fd_set r_fds, w_fds; int maxfd, listen_sock, listen_priv_sock, selret; @@ -951,10 +950,6 @@ static void process_loop(void) run_events(winbind_event_context(), 0, NULL, NULL); - /* refresh the trusted domain cache */ - - rescan_trusted_domains(); - /* Initialise fd lists for select() */ maxfd = MAX(listen_sock, listen_priv_sock); @@ -979,23 +974,6 @@ static void process_loop(void) timeout = timeval_min(&timeout, &ev_timeout); } - /* Set up client readers and writers */ - - state = winbindd_client_list(); - - while (state) { - - struct winbindd_cli_state *next = state->next; - - /* Dispose of client connection if it is marked as - finished */ - - if (state->finished) - remove_client(state); - - state = next; - } - for (ev = fd_events; ev; ev = ev->next) { if (ev->flags & EVENT_FD_READ) { FD_SET(ev->fd, &r_fds); @@ -1370,8 +1348,29 @@ int main(int argc, char **argv, char **envp) TALLOC_FREE(frame); 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); } |