]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Remove dead sendData function
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Sat, 24 Aug 2013 12:38:26 +0000 (14:38 +0200)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Sat, 24 Aug 2013 12:41:57 +0000 (14:41 +0200)
Fix for Coverity CID 1029915, which claimed dead code inside the function,
but really, nobody calls it anymore.

pdns/misc.cc
pdns/misc.hh

index a64a00d0ef7d285cab9302eb1348b96bbb80bb1c..866711052b8be116977c1b59f8ed34574d69852e 100644 (file)
@@ -236,47 +236,6 @@ bool dottedEndsOn(const string &domain, const string &suffix)
   return true;
 }
 
-int sendData(const char *buffer, int replen, int outsock)
-{
-  uint16_t nlen=htons(replen);
-  Utility::iovec iov[2];
-  iov[0].iov_base=(char*)&nlen;
-  iov[0].iov_len=2;
-  iov[1].iov_base=(char*)buffer;
-  iov[1].iov_len=replen;
-  int ret=Utility::writev(outsock,iov,2);
-
-  if(ret <= 0)  // "EOF is error" - we can't deal with EAGAIN errors at this stage yet
-    return -1;
-
-  if(ret!=replen+2) {
-    // we can safely assume ret > 2, as 2 is < PIPE_BUF
-    
-    buffer += (ret - 2);
-    replen -= (ret - 2);
-
-    while (replen) {
-      ret = write(outsock, buffer, replen);
-      if(ret < 0) {
-        if(errno==EAGAIN) { // wait, we might've exhausted the window
-          while(waitForRWData(outsock, false, 1, 0)==0)
-            ;
-          continue;
-        }
-        return ret;
-      }
-      if(!ret)
-        return -1; // "EOF == error"
-      replen -= ret;
-      buffer += ret;
-    }
-    if(!replen)
-      return 0;
-    return -1;
-  }
-  return 0;
-}
-
 static void parseService4(const string &descr, ServiceTuple &st)
 {
   vector<string>parts;
index 3a665fc11340113a0e92ea18c738e8fb1abdbea1..1742d695a7143712c04c511b899cd0ec2546e109 100644 (file)
@@ -202,8 +202,6 @@ private:
   struct timeval d_set;
 };
 
-int sendData(const char *buffer, int replen, int outsock);
-
 inline void DTime::set()
 {
   Utility::gettimeofday(&d_set,0);