aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/session.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/session.c b/src/session.c
index 1ef8717a..e057cfbe 100644
--- a/src/session.c
+++ b/src/session.c
@@ -875,12 +875,22 @@ int ssh_send_debug (ssh_session session, const char *message, int always_display
int rc;
if (ssh_socket_is_open(session->socket)) {
- rc = ssh_buffer_pack(session->out_buffer,
- "bbsd",
- SSH2_MSG_DEBUG,
- always_display != 0 ? 1 : 0,
- message,
- 0); /* empty language tag */
+#ifdef WITH_SSH1
+ if (session->version == 1) {
+ rc = ssh_buffer_pack(session->out_buffer,
+ "bs",
+ SSH_MSG_DEBUG,
+ message);
+ } else
+#endif /* WITH_SSH1 */
+ {
+ rc = ssh_buffer_pack(session->out_buffer,
+ "bbsd",
+ SSH2_MSG_DEBUG,
+ always_display != 0 ? 1 : 0,
+ message,
+ 0); /* empty language tag */
+ }
if (rc != SSH_OK) {
ssh_set_error_oom(session);
goto error;