]> granicus.if.org Git - pdns/commitdiff
make nearMisses only account for the proper fd
authorBert Hubert <bert.hubert@netherlabs.nl>
Fri, 14 Apr 2006 22:50:31 +0000 (22:50 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Fri, 14 Apr 2006 22:50:31 +0000 (22:50 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@704 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/pdns_recursor.cc

index ee4a7548f3f19d3206b11a7837546f517af278c5..8added8a628e388776d7f7954898a1841b696f6f 100644 (file)
@@ -189,7 +189,7 @@ int makeClientSocket()
       port=queryPort;
       tries=1;
     }
-//    cout<<"sin->sin_port: "<<port<<endl;
+
     sin->sin_port = htons(port); 
     
     if (::bind(ret, (struct sockaddr *)&*sin, sizeof(*sin)) >= 0) 
@@ -1094,7 +1094,8 @@ int main(int argc, char **argv)
                  g_stats.unexpectedCount++;
                  
                  for(MT_t::waiters_t::iterator mthread=MT->d_waiters.begin(); mthread!=MT->d_waiters.end(); ++mthread) {
-                   if(!memcmp(&mthread->key.remote.sin_addr, &pident.remote.sin_addr, sizeof(pident.remote.sin_addr)) && !strcasecmp(pident.domain.c_str(), mthread->key.domain.c_str())) {
+                   if(pident.fd==mthread->key.fd && !memcmp(&mthread->key.remote.sin_addr, &pident.remote.sin_addr, sizeof(pident.remote.sin_addr)) && 
+                      !strcasecmp(pident.domain.c_str(), mthread->key.domain.c_str())) {
                      mthread->key.nearMisses++;
                    }
                  }