diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-09-01 10:33:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:17:02 -0500 |
commit | e7717f615ad72f436ff1266d5bd4f71f747eba02 (patch) | |
tree | 2b4eee708e763e93fa1f01bdd11d588948270bf4 /source4/librpc/rpc | |
parent | 6cb6d5cf94a4fc1cacfe03af92c89569ffb2c4e0 (diff) | |
download | samba-e7717f615ad72f436ff1266d5bd4f71f747eba02.tar.gz samba-e7717f615ad72f436ff1266d5bd4f71f747eba02.tar.bz2 samba-e7717f615ad72f436ff1266d5bd4f71f747eba02.zip |
r17990: added timeout checking on dcerpc connection establishment. This should
fix the problem on some build farm hosts where we were waiting forever
for a connection to DRSUAPI to be made, so the next test will start.
Next is to try and work out why the connection is timing out on some
hosts. That is probably a server bug, but at least with this change we
can see it.
(This used to be commit 45fccc6d229168058a2a02fe5fe6f0bc259d6afe)
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r-- | source4/librpc/rpc/dcerpc_connect.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c index 232cdd46e9..5ef8216d0b 100644 --- a/source4/librpc/rpc/dcerpc_connect.c +++ b/source4/librpc/rpc/dcerpc_connect.c @@ -736,6 +736,18 @@ static void continue_pipe_auth(struct composite_context *ctx) /* + handle timeouts of a dcerpc connect +*/ +static void dcerpc_connect_timeout_handler(struct event_context *ev, struct timed_event *te, + struct timeval t, void *private) +{ + struct composite_context *c = talloc_get_type(private, struct composite_context); + DEBUG(0,("DCERPC CONNECT TIMEOUT\n")); + composite_error(c, NT_STATUS_IO_TIMEOUT); + composite_done(c); +} + +/* start a request to open a rpc connection to a rpc pipe, using specified binding structure to determine the endpoint and options */ @@ -748,8 +760,6 @@ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx, struct composite_context *c; struct pipe_connect_state *s; struct event_context *new_ev = NULL; - struct composite_context *binding_req; - if (ev == NULL) { new_ev = event_context_init(parent_ctx); @@ -777,12 +787,17 @@ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx, s->binding = binding; s->table = table; s->credentials = credentials; + + event_add_timed(c->event_ctx, c, + timeval_current_ofs(DCERPC_REQUEST_TIMEOUT, 0), + dcerpc_connect_timeout_handler, c); switch (s->binding->transport) { case NCACN_NP: case NCACN_IP_TCP: case NCALRPC: if (!s->binding->endpoint) { + struct composite_context *binding_req; binding_req = dcerpc_epm_map_binding_send(c, s->binding, s->table, s->pipe->conn->event_ctx); composite_continue(c, binding_req, continue_map_binding, c); |