svnno****@sourc*****
svnno****@sourc*****
2010年 9月 27日 (月) 19:26:38 JST
Revision: 4106 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4106 Author: yutakapon Date: 2010-09-27 19:26:38 +0900 (Mon, 27 Sep 2010) Log Message: ----------- SSH2: Control menuã®Send breakã§ãSSHã¨ãã¦ã®ããã¬ã¼ã¯ä¿¡å·ããéä¿¡ããããã«ããã Modified Paths: -------------- trunk/ttssh2/ttxssh/ssh.c trunk/ttssh2/ttxssh/ssh.h trunk/ttssh2/ttxssh/ttxssh.c -------------- next part -------------- Modified: trunk/ttssh2/ttxssh/ssh.c =================================================================== --- trunk/ttssh2/ttxssh/ssh.c 2010-09-23 10:42:03 UTC (rev 4105) +++ trunk/ttssh2/ttxssh/ssh.c 2010-09-27 10:26:38 UTC (rev 4106) @@ -2833,6 +2833,55 @@ } +// u[NMðéB +// OpenSSH Ì"~B"É·éB½¾µASSH2ÌÝB +// (2010.9.27 yutaka) +int SSH_notify_break_signal(PTInstVar pvar) +{ + int ret = 0; + + if (SSHv1(pvar)) { + // ½àµÈ¢B + + } else if (SSHv2(pvar)) { + buffer_t *msg; + char *s; + unsigned char *outmsg; + int len; + Channel_t *c; + + c = ssh2_channel_lookup(pvar->shell_id); + if (c == NULL) + goto error; + + msg = buffer_init(); + if (msg == NULL) { + goto error; + } + buffer_put_int(msg, c->remote_id); + s = "break"; + buffer_put_string(msg, s, strlen(s)); + buffer_put_char(msg, 0); // wantconfirm + buffer_put_int(msg, 1000); + len = buffer_len(msg); + outmsg = begin_send_packet(pvar, SSH2_MSG_CHANNEL_REQUEST, len); + memcpy(outmsg, buffer_ptr(msg), len); + finish_send_packet(pvar); + buffer_free(msg); + + notify_verbose_message(pvar, "SSH2_MSG_CHANNEL_REQUEST was sent at SSH_notify_break_signal().", LOG_LEVEL_VERBOSE); + + ret = 1; + + } else { + // SSHÅÈ¢êͽàµÈ¢B + + } + +error: + return (ret); +} + int SSH_get_min_packet_size(PTInstVar pvar) { if (SSHv1(pvar)) { Modified: trunk/ttssh2/ttxssh/ssh.h =================================================================== --- trunk/ttssh2/ttxssh/ssh.h 2010-09-23 10:42:03 UTC (rev 4105) +++ trunk/ttssh2/ttxssh/ssh.h 2010-09-27 10:26:38 UTC (rev 4106) @@ -561,5 +561,6 @@ RSA *duplicate_RSA(RSA *src); DSA *duplicate_DSA(DSA *src); char *key_fingerprint(Key *key, enum fp_rep dgst_rep); +int SSH_notify_break_signal(PTInstVar pvar); #endif Modified: trunk/ttssh2/ttxssh/ttxssh.c =================================================================== --- trunk/ttssh2/ttxssh/ttxssh.c 2010-09-23 10:42:03 UTC (rev 4105) +++ trunk/ttssh2/ttxssh/ttxssh.c 2010-09-27 10:26:38 UTC (rev 4106) @@ -3947,6 +3947,12 @@ } switch (cmd) { + case 50430: // FIXME: ID_CONTROL_SENDBREAK(tt_res.h)ðwèµ½¢ªAwb_ðinclude·éÆA½dè`ÆÈéB + if (SSH_notify_break_signal(pvar)) + return 1; + else + return 0; // SSH2ųêÈ©Á½êÍA{Ì®ìðs¤×A[ðÔ·B + case ID_SSHSCPMENU: if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SSHSCP), hWin, TTXScpDialog, (LPARAM) pvar) == -1) {