ewmscp  ..
Functions
throwcall::sftp Namespace Reference

Functions

template<typename T , typename ... Args>
void good0 (T call, libsshCommon &handler, const Args &... args)
 
template<typename T , typename t , typename ... Args>
badval (T call, t badvalue, libsshCommon &handler, const Args &... args)
 

Function Documentation

◆ badval()

template<typename T , typename t , typename ... Args>
T throwcall::sftp::badval ( call,
badvalue,
libsshCommon handler,
const Args &...  args 
)
inline

Definition at line 82 of file libsshCommon.h.

84  {
85  if (__builtin_expect(call == badvalue, false)) {
86  std::ostringstream msg;
87  conCatString(msg, "sftp error ", sftp_get_error(handler.sftp),
88  ", ssh error ", ssh_get_error(handler.session),
89  " ", args...);
90  handler.reconnectSessions();
91  throw std::runtime_error(msg.str());
92  }
93  return call;
94  };

References throwcall::conCatString(), libsshCommon::reconnectSessions(), libsshCommon::session, and libsshCommon::sftp.

Referenced by inputHandler::libssh::readerLibssh::checkUnchangedness(), libsshCommon::getStat(), libsshIoCommon::getStat(), libsshCommon::getVfsStat(), libsshCommon::pathExists(), inputHandler::libssh::readerLibssh::readerLibssh(), inputHandler::libssh::readLinkTarget(), outputHandler::libssh::rename(), inputHandler::libssh::SftpDirectory::SftpDirectory(), outputHandler::libssh::writerLibssh::writerLibssh(), inputHandler::libssh::readerLibssh::~readerLibssh(), and inputHandler::libssh::SftpDirectory::~SftpDirectory().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ good0()

template<typename T , typename ... Args>
void throwcall::sftp::good0 ( call,
libsshCommon handler,
const Args &...  args 
)
inline

Definition at line 70 of file libsshCommon.h.

72  {
73  if (__builtin_expect(call, 0)) {
74  handler.reconnectSessions();
75  std::ostringstream msg;
76  conCatString(msg, "sftp error ", sftp_get_error(handler.sftp),
77  ", ssh error ", ssh_get_error(handler.session),
78  " ", args...);
79  throw std::runtime_error(msg.str());
80  }
81  };

References throwcall::conCatString(), libsshCommon::reconnectSessions(), libsshCommon::session, and libsshCommon::sftp.

Referenced by outputHandler::libssh::createSymlink(), outputHandler::libssh::writerLibssh::doAttributePreservations(), outputHandler::libssh::ensureParentDirs(), libsshCommon::openSessions(), inputHandler::libssh::readerLibssh::readBlock(), outputHandler::libssh::remove(), outputHandler::libssh::renameSimple(), inputHandler::libssh::readerLibssh::seek(), outputHandler::libssh::writerLibssh::seek(), outputHandler::libssh::writerLibssh::sync(), outputHandler::libssh::writerLibssh::writeBlock(), and outputHandler::libssh::writerLibssh::writerLibssh().

Here is the call graph for this function:
Here is the caller graph for this function:
libsshCommon::session
ssh_session session
Definition: libsshCommon.h:27
errMsg::conCatString
void conCatString(std::ostringstream &msg, const T &begin)
Definition: errMsgQueue.h:134
libsshCommon::sftp
sftp_session sftp
Definition: libsshCommon.h:28
libsshCommon::reconnectSessions
void reconnectSessions()
Definition: libsshCommon.cpp:98