summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-06-12 08:02:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:15 -0500
commit501d97c653fbed6a88bad63045301ac834524e22 (patch)
tree5a1b20e87a684e4dc865d913c4d78b84aaab2b5e /source3/nsswitch
parent9ae6e51616cb37f4de0e45645fda8315278149be (diff)
downloadsamba-501d97c653fbed6a88bad63045301ac834524e22.tar.gz
samba-501d97c653fbed6a88bad63045301ac834524e22.tar.bz2
samba-501d97c653fbed6a88bad63045301ac834524e22.zip
r23426: Correct a comment. The default timeout is not 1min, but 30s. While
there, do some reformatting. Jeremy, I think we should also kill the child. It might hang in something (an fcntl lock for example) that the next child might run into immediately again. (This used to be commit 6729a4df4b57f638161ec55f9b1edd0bc8bb947e)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_dual.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/source3/nsswitch/winbindd_dual.c b/source3/nsswitch/winbindd_dual.c
index 54525f8da1..0c8491084d 100644
--- a/source3/nsswitch/winbindd_dual.c
+++ b/source3/nsswitch/winbindd_dual.c
@@ -192,7 +192,7 @@ static void async_request_timeout_handler(struct event_context *ctx,
static void async_request_sent(void *private_data_data, BOOL success)
{
- uint32_t timeout = 30;
+ uint32_t timeout;
struct winbindd_async_request *state =
talloc_get_type_abort(private_data_data, struct winbindd_async_request);
@@ -212,31 +212,35 @@ static void async_request_sent(void *private_data_data, BOOL success)
sizeof(state->response->result),
async_reply_recv, state);
- /*
- * Normal timeouts are 30s, but auth requests may take a long
- * time to timeout.
- */
+ timeout = 30;
- if (state->request->cmd == WINBINDD_PAM_AUTH ||
- state->request->cmd == WINBINDD_PAM_AUTH_CRAP ) {
+ if (state->request->cmd == WINBINDD_PAM_AUTH
+ || state->request->cmd == WINBINDD_PAM_AUTH_CRAP ) {
+
+ /*
+ * Normal timeouts are 30s, but auth requests may take a long
+ * time to timeout.
+ */
timeout = 300;
}
/*
- * Set up a timeout of 1 minute for the response.
- * If we don't get it close the child socket and
- * report failure.
+ * Set up a timeout of for the response. If we don't get it close the
+ * child socket and report failure.
*/
- state->reply_timeout_event = event_add_timed(winbind_event_context(),
- NULL,
- timeval_current_ofs(timeout,0),
- "async_request_timeout",
- async_request_timeout_handler,
- state);
+ state->reply_timeout_event = event_add_timed(
+ winbind_event_context(),
+ NULL,
+ timeval_current_ofs(timeout,0),
+ "async_request_timeout",
+ async_request_timeout_handler,
+ state);
+
if (!state->reply_timeout_event) {
- smb_panic("async_request_sent: failed to add timeout handler.\n");
+ smb_panic("async_request_sent: failed to add timeout "
+ "handler.\n");
}
}