diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-07-29 23:21:01 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-07-29 23:21:01 +0200 |
commit | bccb9b16a58c0f43ff03c39c81db9c0a17d4549b (patch) | |
tree | 46b82f2b2f7a0b2d6dfb16fba5880337ddc52b66 /libssh | |
parent | 1355029ec9059ef190b8c8bfd1cb2170b4112313 (diff) | |
download | libssh-bccb9b16a58c0f43ff03c39c81db9c0a17d4549b.tar.gz libssh-bccb9b16a58c0f43ff03c39c81db9c0a17d4549b.tar.xz libssh-bccb9b16a58c0f43ff03c39c81db9c0a17d4549b.zip |
Move channel_write_stderr to server.c.
Diffstat (limited to 'libssh')
-rw-r--r-- | libssh/channels.c | 19 | ||||
-rw-r--r-- | libssh/server.c | 17 |
2 files changed, 18 insertions, 18 deletions
diff --git a/libssh/channels.c b/libssh/channels.c index 8a5ab2ad..8b190b4e 100644 --- a/libssh/channels.c +++ b/libssh/channels.c @@ -858,7 +858,7 @@ error: return rc; } -static int channel_write_common(ssh_channel channel, const void *data, +int channel_write_common(ssh_channel channel, const void *data, uint32_t len, int is_stderr) { SSH_SESSION *session = channel->session; int origlen = len; @@ -959,23 +959,6 @@ int channel_write(ssh_channel channel, const void *data, uint32_t len) { } /** - * @brief Blocking write on channel for stderr. - * - * @param channel The channel to write to. - * - * @param data A pointer to the data to write. - * - * @param len The length of the buffer to write to. - * - * @return The number of bytes written, SSH_ERROR on error. - * - * @see channel_read() - */ -int channel_write_stderr(ssh_channel channel, const void *data, uint32_t len) { - return channel_write_common(channel, data, len, 1); -} - -/** * @brief Check if the channel is open or not. * * @param channel The channel to check. diff --git a/libssh/server.c b/libssh/server.c index 8df0a1b9..8e7a26a0 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -510,6 +510,23 @@ int ssh_accept(SSH_SESSION *session) { return 0; } +/** + * @brief Blocking write on channel for stderr. + * + * @param channel The channel to write to. + * + * @param data A pointer to the data to write. + * + * @param len The length of the buffer to write to. + * + * @return The number of bytes written, SSH_ERROR on error. + * + * @see channel_read() + */ +int channel_write_stderr(ssh_channel channel, const void *data, uint32_t len) { + return channel_write_common(channel, data, len, 1); +} + /** @} */ /* vim: set ts=2 sw=2 et cindent: */ |