Mercurial > dropbear
comparison common-channel.c @ 1098:f95b6e87cd0c
Turn send_msg_channel_open_failure()'s text and lang into const char *
author | Gaël PORTAY <gael.portay@gmail.com> |
---|---|
date | Sat, 02 May 2015 14:56:57 +0200 |
parents | 93e29b0ef8dc |
children | aaf576b27a10 |
comparison
equal
deleted
inserted
replaced
1097:93e29b0ef8dc | 1098:f95b6e87cd0c |
---|---|
36 #include "listener.h" | 36 #include "listener.h" |
37 #include "runopts.h" | 37 #include "runopts.h" |
38 #include "netio.h" | 38 #include "netio.h" |
39 | 39 |
40 static void send_msg_channel_open_failure(unsigned int remotechan, int reason, | 40 static void send_msg_channel_open_failure(unsigned int remotechan, int reason, |
41 const unsigned char *text, const unsigned char *lang); | 41 const char *text, const char *lang); |
42 static void send_msg_channel_open_confirmation(struct Channel* channel, | 42 static void send_msg_channel_open_confirmation(struct Channel* channel, |
43 unsigned int recvwindow, | 43 unsigned int recvwindow, |
44 unsigned int recvmaxpacket); | 44 unsigned int recvmaxpacket); |
45 static void writechannel(struct Channel* channel, int fd, circbuffer *cbuf, | 45 static void writechannel(struct Channel* channel, int fd, circbuffer *cbuf, |
46 const unsigned char *moredata, unsigned int *morelen); | 46 const unsigned char *moredata, unsigned int *morelen); |
1037 } | 1037 } |
1038 | 1038 |
1039 /* Send a channel open failure message, with a corresponding reason | 1039 /* Send a channel open failure message, with a corresponding reason |
1040 * code (usually resource shortage or unknown chan type) */ | 1040 * code (usually resource shortage or unknown chan type) */ |
1041 static void send_msg_channel_open_failure(unsigned int remotechan, | 1041 static void send_msg_channel_open_failure(unsigned int remotechan, |
1042 int reason, const unsigned char *text, const unsigned char *lang) { | 1042 int reason, const char *text, const char *lang) { |
1043 | 1043 |
1044 TRACE(("enter send_msg_channel_open_failure")) | 1044 TRACE(("enter send_msg_channel_open_failure")) |
1045 CHECKCLEARTOWRITE(); | 1045 CHECKCLEARTOWRITE(); |
1046 | 1046 |
1047 buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_OPEN_FAILURE); | 1047 buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_OPEN_FAILURE); |
1048 buf_putint(ses.writepayload, remotechan); | 1048 buf_putint(ses.writepayload, remotechan); |
1049 buf_putint(ses.writepayload, reason); | 1049 buf_putint(ses.writepayload, reason); |
1050 buf_putstring(ses.writepayload, text, strlen((char*)text)); | 1050 buf_putstring(ses.writepayload, (const unsigned char *) text, strlen(text)); |
1051 buf_putstring(ses.writepayload, lang, strlen((char*)lang)); | 1051 buf_putstring(ses.writepayload, (const unsigned char *) lang, strlen(lang)); |
1052 | 1052 |
1053 encrypt_packet(); | 1053 encrypt_packet(); |
1054 TRACE(("leave send_msg_channel_open_failure")) | 1054 TRACE(("leave send_msg_channel_open_failure")) |
1055 } | 1055 } |
1056 | 1056 |