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 5587 by doda, Mon May 19 03:11:52 2014 UTC revision 5607 by maya, Sat Jun 7 04:56:18 2014 UTC
# Line 56  SOFTWARE, EVEN IF ADVISED OF THE POSSIBI Line 56  SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
56    
57  #include <sys/types.h>  #include <sys/types.h>
58  #include <sys/stat.h>  #include <sys/stat.h>
59    #include <sys/utime.h>
60  #include <assert.h>  #include <assert.h>
61    
62  #include <direct.h>  #include <direct.h>
# Line 159  static Channel_t *ssh2_channel_new(unsig Line 160  static Channel_t *ssh2_channel_new(unsig
160                  c->scp.progress_window = NULL;                  c->scp.progress_window = NULL;
161                  c->scp.thread = (HANDLE)-1;                  c->scp.thread = (HANDLE)-1;
162                  c->scp.localfp = NULL;                  c->scp.localfp = NULL;
163                    c->scp.filemtime = 0;
164                    c->scp.fileatime = 0;
165          }          }
166          if (type == TYPE_AGENT) {          if (type == TYPE_AGENT) {
167                  c->agent_msg = buffer_init();                  c->agent_msg = buffer_init();
# Line 241  static void ssh2_channel_delete(Channel_ Line 244  static void ssh2_channel_delete(Channel_
244    
245          if (c->type == TYPE_SCP) {          if (c->type == TYPE_SCP) {
246                  c->scp.state = SCP_CLOSING;                  c->scp.state = SCP_CLOSING;
247                  if (c->scp.localfp != NULL)                  if (c->scp.localfp != NULL) {
248                          fclose(c->scp.localfp);                          fclose(c->scp.localfp);
249                            if (c->scp.dir == FROMREMOTE) {
250                                    if (c->scp.fileatime > 0 && c->scp.filemtime > 0) {
251                                            struct _utimbuf filetime;
252                                            filetime.actime = c->scp.fileatime;
253                                            filetime.modtime = c->scp.filemtime;
254                                            _utime(c->scp.localfilefull, &filetime);
255                                    }
256                            }
257                    }
258                  if (c->scp.progress_window != NULL) {                  if (c->scp.progress_window != NULL) {
259                          DestroyWindow(c->scp.progress_window);                          DestroyWindow(c->scp.progress_window);
260                          c->scp.progress_window = NULL;                          c->scp.progress_window = NULL;
# Line 7298  static BOOL handle_SSH2_open_confirm(PTI Line 7310  static BOOL handle_SSH2_open_confirm(PTI
7310                          _snprintf_s(sbuf, sizeof(sbuf), _TRUNCATE, "scp -t %s", c->scp.remotefile);                          _snprintf_s(sbuf, sizeof(sbuf), _TRUNCATE, "scp -t %s", c->scp.remotefile);
7311    
7312                  } else {                                  } else {                
7313                          _snprintf_s(sbuf, sizeof(sbuf), _TRUNCATE, "scp -f %s", c->scp.remotefile);                          _snprintf_s(sbuf, sizeof(sbuf), _TRUNCATE, "scp -p -f %s", c->scp.remotefile);
7314    
7315                  }                  }
7316                  buffer_put_string(msg, sbuf, strlen(sbuf));                  buffer_put_string(msg, sbuf, strlen(sbuf));
# Line 8008  static BOOL SSH2_scp_fromremote(PTInstVa Line 8020  static BOOL SSH2_scp_fromremote(PTInstVa
8020                  }                  }
8021    
8022                  if (data[0] == 'T') {  // Tmtime.sec mtime.usec atime.sec atime.usec                  if (data[0] == 'T') {  // Tmtime.sec mtime.usec atime.sec atime.usec
8023                          // TODO:                          DWORD mtime, atime;
8024    
8025                            sscanf_s(data, "T%ld 0 %ld 0", &mtime, &atime);
8026    
8027                            // タイムスタンプを記録
8028                            c->scp.filemtime = mtime;
8029                            c->scp.fileatime = atime;
8030    
8031                          // リプライを返す                          // リプライを返す
8032                          goto reply;                          goto reply;

Legend:
Removed from v.5587  
changed lines
  Added in v.5607

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