| 117 | } |
| 118 | |
| 119 | static av_cold int libssh_create_sftp_session(LIBSSHContext *libssh) |
| 120 | { |
| 121 | if (!(libssh->sftp = sftp_new(libssh->session))) { |
| 122 | av_log(libssh, AV_LOG_ERROR, "SFTP session creation failed: %s\n", ssh_get_error(libssh->session)); |
| 123 | return AVERROR(ENOMEM); |
| 124 | } |
| 125 | |
| 126 | if (sftp_init(libssh->sftp) != SSH_OK) { |
| 127 | av_log(libssh, AV_LOG_ERROR, "Error initializing sftp session: %s\n", ssh_get_error(libssh->session)); |
| 128 | return AVERROR(EIO); |
| 129 | } |
| 130 | |
| 131 | return 0; |
| 132 | } |
| 133 | |
| 134 | static av_cold int libssh_open_file(LIBSSHContext *libssh, int flags, const char *file) |
| 135 | { |
no test coverage detected