mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
Move channel_write_stderr to server.c.
This commit is contained in:
@@ -285,7 +285,6 @@ int channel_request_env(ssh_channel channel, const char *name, const char *value
|
|||||||
int channel_request_exec(ssh_channel channel, const char *cmd);
|
int channel_request_exec(ssh_channel channel, const char *cmd);
|
||||||
int channel_request_sftp(ssh_channel channel);
|
int channel_request_sftp(ssh_channel channel);
|
||||||
int channel_write(ssh_channel channel, const void *data, uint32_t len);
|
int channel_write(ssh_channel channel, const void *data, uint32_t len);
|
||||||
int channel_write_stderr(ssh_channel channel, const void *data, uint32_t len);
|
|
||||||
int channel_send_eof(ssh_channel channel);
|
int channel_send_eof(ssh_channel channel);
|
||||||
int channel_is_eof(ssh_channel channel);
|
int channel_is_eof(ssh_channel channel);
|
||||||
int channel_read(ssh_channel channel, void *dest, uint32_t count, int is_stderr);
|
int channel_read(ssh_channel channel, void *dest, uint32_t count, int is_stderr);
|
||||||
|
|||||||
@@ -689,6 +689,8 @@ int channel_default_bufferize(ssh_channel channel, void *data, int len,
|
|||||||
int is_stderr);
|
int is_stderr);
|
||||||
uint32_t ssh_channel_new_id(SSH_SESSION *session);
|
uint32_t ssh_channel_new_id(SSH_SESSION *session);
|
||||||
ssh_channel ssh_channel_from_local(SSH_SESSION *session, uint32_t id);
|
ssh_channel ssh_channel_from_local(SSH_SESSION *session, uint32_t id);
|
||||||
|
int channel_write_common(ssh_channel channel, const void *data,
|
||||||
|
uint32_t len, int is_stderr);
|
||||||
|
|
||||||
/* options.c */
|
/* options.c */
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,8 @@ void ssh_bind_free(SSH_BIND *ssh_bind);
|
|||||||
*/
|
*/
|
||||||
int ssh_accept(SSH_SESSION *session);
|
int ssh_accept(SSH_SESSION *session);
|
||||||
|
|
||||||
|
int channel_write_stderr(ssh_channel channel, const void *data, uint32_t len);
|
||||||
|
|
||||||
/* messages.c */
|
/* messages.c */
|
||||||
|
|
||||||
#define SSH_AUTH_REQUEST 1
|
#define SSH_AUTH_REQUEST 1
|
||||||
|
|||||||
@@ -858,7 +858,7 @@ error:
|
|||||||
return rc;
|
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) {
|
uint32_t len, int is_stderr) {
|
||||||
SSH_SESSION *session = channel->session;
|
SSH_SESSION *session = channel->session;
|
||||||
int origlen = len;
|
int origlen = len;
|
||||||
@@ -958,23 +958,6 @@ int channel_write(ssh_channel channel, const void *data, uint32_t len) {
|
|||||||
return channel_write_common(channel, data, len, 0);
|
return channel_write_common(channel, data, len, 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if the channel is open or not.
|
* @brief Check if the channel is open or not.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -510,6 +510,23 @@ int ssh_accept(SSH_SESSION *session) {
|
|||||||
return 0;
|
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: */
|
/* vim: set ts=2 sw=2 et cindent: */
|
||||||
|
|||||||
Reference in New Issue
Block a user