diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index ac5418ca..e384ba04 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -414,6 +414,9 @@ LIBSSH_API void ssh_channel_set_blocking(ssh_channel channel, int blocking); LIBSSH_API void ssh_channel_set_counter(ssh_channel channel, ssh_counter counter); LIBSSH_API int ssh_channel_write(ssh_channel channel, const void *data, uint32_t len); +LIBSSH_API int ssh_channel_write_stderr(ssh_channel channel, + const void *data, + uint32_t len); LIBSSH_API uint32_t ssh_channel_window_size(ssh_channel channel); LIBSSH_API char *ssh_basename (const char *path); diff --git a/include/libssh/server.h b/include/libssh/server.h index 385a10a7..6564f7c7 100644 --- a/include/libssh/server.h +++ b/include/libssh/server.h @@ -316,9 +316,6 @@ LIBSSH_API int ssh_channel_request_send_exit_signal(ssh_channel channel, int core, const char *errmsg, const char *lang); -LIBSSH_API int ssh_channel_write_stderr(ssh_channel channel, - const void *data, - uint32_t len); LIBSSH_API int ssh_send_keepalive(ssh_session session); diff --git a/src/channels.c b/src/channels.c index 3b374fbb..c804bb46 100644 --- a/src/channels.c +++ b/src/channels.c @@ -3192,7 +3192,6 @@ void ssh_channel_set_counter(ssh_channel channel, } } -#if WITH_SERVER /** * @brief Blocking write on a channel stderr. * @@ -3210,6 +3209,8 @@ int ssh_channel_write_stderr(ssh_channel channel, const void *data, uint32_t len return channel_write_common(channel, data, len, 1); } +#if WITH_SERVER + /** * @brief Open a TCP/IP reverse forwarding channel. *