| 447 | } |
| 448 | |
| 449 | bool SFTPClient::sendKeepAliveIfNeeded(int &seconds_to_next) { |
| 450 | if (libssh2_keepalive_send(ssh_session_, &seconds_to_next) != 0) { |
| 451 | char *err_msg = nullptr; |
| 452 | libssh2_session_last_error(ssh_session_, &err_msg, nullptr, 0); |
| 453 | logger_->log_error("Failed to send keepalive to %s@%s:%hu, error: %s", |
| 454 | username_, |
| 455 | hostname_, |
| 456 | port_, |
| 457 | err_msg); |
| 458 | return false; |
| 459 | } |
| 460 | return true; |
| 461 | } |
| 462 | |
| 463 | SFTPError SFTPClient::getLastError() const { |
| 464 | return last_error_; |
no test coverage detected