Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/ssh.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3351 by yutakapon, Mon Apr 27 14:10:05 2009 UTC revision 3375 by r850, Mon May 4 10:35:13 2009 UTC
# Line 3709  int SSH_scp_transaction(PTInstVar pvar, Line 3709  int SSH_scp_transaction(PTInstVar pvar,
3709                  goto error;                  goto error;
3710          }          }
3711    
3712          if (direction == TOLOCAL) {  // copy local to remote          if (direction == TOREMOTE) {  // copy local to remote
3713                  fp = fopen(sendfile, "rb");                  fp = fopen(sendfile, "rb");
3714                  if (fp == NULL) {                  if (fp == NULL) {
3715                          char buf[80];                          char buf[80];
# Line 3806  error: Line 3806  error:
3806    
3807  int SSH_start_scp(PTInstVar pvar, char *sendfile, char *dstfile)  int SSH_start_scp(PTInstVar pvar, char *sendfile, char *dstfile)
3808  {  {
3809          return SSH_scp_transaction(pvar, sendfile, dstfile, TOLOCAL);          return SSH_scp_transaction(pvar, sendfile, dstfile, TOREMOTE);
3810  }  }
3811    
3812  int SSH_start_scp_receive(PTInstVar pvar, char *filename)  int SSH_start_scp_receive(PTInstVar pvar, char *filename)
# Line 7753  static BOOL handle_SSH2_open_confirm(PTI Line 7753  static BOOL handle_SSH2_open_confirm(PTI
7753    
7754          if (c->type == TYPE_SCP) {          if (c->type == TYPE_SCP) {
7755                  char sbuf[MAX_PATH + 30];                  char sbuf[MAX_PATH + 30];
7756                  if (c->scp.dir == TOLOCAL) {                  if (c->scp.dir == TOREMOTE) {
7757                          _snprintf_s(sbuf, sizeof(sbuf), _TRUNCATE, "scp -t %s", c->scp.remotefile);                          _snprintf_s(sbuf, sizeof(sbuf), _TRUNCATE, "scp -t %s", c->scp.remotefile);
7758    
7759                  } else {                                  } else {                
# Line 8184  abort: Line 8184  abort:
8184  }  }
8185    
8186    
8187  static void SSH2_scp_tolocal(PTInstVar pvar, Channel_t *c, unsigned char *data, unsigned int buflen)  static void SSH2_scp_toremote(PTInstVar pvar, Channel_t *c, unsigned char *data, unsigned int buflen)
8188  {  {
8189          if (c->scp.state == SCP_INIT) {          if (c->scp.state == SCP_INIT) {
8190                  char buf[128];                  char buf[128];
# Line 8387  static void SSH2_scp_response(PTInstVar Line 8387  static void SSH2_scp_response(PTInstVar
8387                  if (SSH2_scp_fromremote(pvar, c, data, buflen) == FALSE)                  if (SSH2_scp_fromremote(pvar, c, data, buflen) == FALSE)
8388                          goto error;                          goto error;
8389    
8390          } else  if (c->scp.dir == TOLOCAL) {          } else  if (c->scp.dir == TOREMOTE) {
8391                  if (buflen == 1 && data[0] == '\0') {  // OK                  if (buflen == 1 && data[0] == '\0') {  // OK
8392                          SSH2_scp_tolocal(pvar, c, data, buflen);                          SSH2_scp_toremote(pvar, c, data, buflen);
8393                  } else {                  } else {
8394                          goto error;                          goto error;
8395                  }                  }

Legend:
Removed from v.3351  
changed lines
  Added in v.3375

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26