Commits

Bryan O'Sullivan  committed 96f9fde

Don't try to send anything if we have no requests to send.

If we try sending an empty bytestring, the low-level writev system call will
throw an exception.

  • Participants
  • Parent commits e114938

Comments (0)

Files changed (1)

File src/Network/Riak/Connection/Internal.hs

 
 pipe :: (Request req, Show resp) =>
         (Connection -> IO resp) -> Connection -> [req] -> IO [resp]
+pipe _ _ [] = return []
 pipe receive conn@Connection{..} reqs = do
   ch <- newChan
   let numReqs = length reqs
 -- sending and receiving will be overlapped if possible, to improve
 -- concurrency and reduce latency.
 pipeline_ :: (Request req) => Connection -> [req] -> IO ()
+pipeline_ _ [] = return ()
 pipeline_ conn@Connection{..} reqs = do
   done <- newEmptyMVar
   _ <- forkIO $ do