diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2011-05-26 21:56:42 +0200 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2011-05-26 21:56:42 +0200 |
commit | 809b3adeba94c1128c7a2ed5354ade305156b8b8 (patch) | |
tree | 7bf0d4e99f18415a9e18829551f850bc46337e50 | |
parent | 34b05fd2dc7ead24386b24e9471fad729cb4189b (diff) | |
download | libssh-809b3adeba94c1128c7a2ed5354ade305156b8b8.tar.gz libssh-809b3adeba94c1128c7a2ed5354ade305156b8b8.tar.xz libssh-809b3adeba94c1128c7a2ed5354ade305156b8b8.zip |
Fix compilation without server and sftp modes
-rw-r--r-- | src/messages.c | 20 | ||||
-rw-r--r-- | tests/torture.c | 7 |
2 files changed, 26 insertions, 1 deletions
diff --git a/src/messages.c b/src/messages.c index 408afa0b..656da77b 100644 --- a/src/messages.c +++ b/src/messages.c @@ -71,6 +71,26 @@ static ssh_message ssh_message_new(ssh_session session){ return msg; } +#ifndef WITH_SERVER + +/* Reduced version of the reply default that only reply with + * SSH_MSG_UNIMPLEMENTED + */ +static int ssh_message_reply_default(ssh_message msg) { + ssh_log(msg->session, SSH_LOG_FUNCTIONS, "Reporting unknown packet"); + + if (buffer_add_u8(msg->session->out_buffer, SSH2_MSG_UNIMPLEMENTED) < 0) + goto error; + if (buffer_add_u32(msg->session->out_buffer, + htonl(msg->session->recv_seq-1)) < 0) + goto error; + return packet_send(msg->session); + error: + return SSH_ERROR; +} + +#endif + static int ssh_execute_message_callback(ssh_session session, ssh_message msg) { int ret; if(session->ssh_message_callback != NULL) { diff --git a/tests/torture.c b/tests/torture.c index ff57c64a..1dbae46d 100644 --- a/tests/torture.c +++ b/tests/torture.c @@ -216,6 +216,8 @@ failed: return NULL; } +#ifdef WITH_SFTP + struct torture_sftp *torture_sftp_session(ssh_session session) { struct torture_sftp *t; char template[] = "/tmp/ssh_torture_XXXXXX"; @@ -282,7 +284,10 @@ void torture_sftp_close(struct torture_sftp *t) { free(t->testdir); free(t); } -#endif +#endif /* WITH_SFTP */ + +#endif /* _WIN32 */ + int torture_libssh_verbosity(void){ return verbosity; |