The Samba-Bugzilla – Attachment 8072 Details for
Bug 8878
libdns needs to timeout requests after a while
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
More elegant path as proposed by Volker
0001-libcli-dns-Time-out-requests-after-a-while.patch (text/plain), 1.14 KB, created by
Kai Blin
on 2012-10-14 10:28:42 UTC
(
hide
)
Description:
More elegant path as proposed by Volker
Filename:
MIME Type:
Creator:
Kai Blin
Created:
2012-10-14 10:28:42 UTC
Size:
1.14 KB
patch
obsolete
>From ebd9af9e2c884f65fd30ee102f9c6f85b16fa081 Mon Sep 17 00:00:00 2001 >From: Kai Blin <kai@samba.org> >Date: Sat, 13 Oct 2012 02:09:57 +0200 >Subject: [PATCH] libcli/dns: Time out requests after a while > >Time out UDP requests after DNS_REQUEST_TIMEOUT seconds. Currently set >to 2 seconds. > >This should fix bug #8878. >--- > libcli/dns/dns.c | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > >diff --git a/libcli/dns/dns.c b/libcli/dns/dns.c >index da65ce4..43e1c4e 100644 >--- a/libcli/dns/dns.c >+++ b/libcli/dns/dns.c >@@ -38,6 +38,8 @@ struct dns_udp_request_state { > size_t reply_len; > }; > >+#define DNS_REQUEST_TIMEOUT 2 >+ > /* Declare callback functions used below. */ > static void dns_udp_request_get_reply(struct tevent_req *subreq); > static void dns_udp_request_done(struct tevent_req *subreq); >@@ -92,6 +94,12 @@ struct tevent_req *dns_udp_request_send(TALLOC_CTX *mem_ctx, > return tevent_req_post(req, ev); > } > >+ if (!tevent_req_set_endtime(req, ev, >+ timeval_current_ofs(DNS_REQUEST_TIMEOUT, 0))) { >+ return tevent_req_post(req, ev); >+ } >+ >+ > tevent_req_set_callback(subreq, dns_udp_request_get_reply, req); > return req; > } >-- >1.7.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
mat
:
review+
Actions:
View
Attachments on
bug 8878
:
7467
|
8050
| 8072