execCommand :: Session -- ^ Session to use
            -> String  -- ^ Command
            -> SimpleSSH Result
execCommand session command = do
  liftIOEither $ do
    commandC <- newCString command
    res      <- liftEitherCFree freeEitherResultC readResult $ execCommandC session commandC
    free commandC
    return res

-- | Send a file to the server and returns the number of bytes transferred.
--
-- One should be authenticated before sending files on a 'Session.
execCommand :: Session -- ^ Session to use
            -> String  -- ^ Command
            -> SimpleSSH Result
execCommand session command = do
  liftIOEither $ do
    commandC <- newCString command
    res      <- liftEitherCFree freeEitherResultC readResult $ execCommandC session commandC
    free commandC
    return res

-- | Send a file to the server and returns the number of bytes transferred.
--
-- One should be authenticated before sending files on a 'Session.
execCommand session command = do
  liftIOEither $ do
    commandC <- newCString command
    res      <- liftEitherCFree freeEitherResultC readResult $ execCommandC session commandC
    free commandC
    return res

-- | Send a file to the server and returns the number of bytes transferred.
--
-- One should be authenticated before sending files on a 'Session.