Permalink
Browse files

actually notice timeout during AXFR retrieve, thanks hkraal

  • Loading branch information...
1 parent 4f88dd9 commit 9c56e16a8847a19d275dfc5d1050cde302ed3981 @Habbie Habbie committed Jul 23, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 pdns/resolver.cc
View
@@ -460,8 +460,11 @@ void AXFRRetriever::timeoutReadn(uint16_t bytes)
int n=0;
int numread;
while(n<bytes) {
- if(waitForData(d_sock, 10-(time(0)-start))<0)
+ int res=waitForData(d_sock, 10-(time(0)-start));
+ if(res<0)
throw ResolverException("Reading data from remote nameserver over TCP: "+stringerror());
+ if(!res)
+ throw ResolverException("Timeout while reading data from remote nameserver over TCP");
numread=recv(d_sock, d_buf.get()+n, bytes-n, 0);
if(numread<0)

0 comments on commit 9c56e16

Please sign in to comment.