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 3159 by maya, Tue Nov 18 06:24:09 2008 UTC revision 3162 by maya, Wed Nov 19 13:39:09 2008 UTC
# Line 7818  static unsigned __stdcall ssh_scp_thread Line 7818  static unsigned __stdcall ssh_scp_thread
7818          do {          do {
7819                  // Cancelボタンが押下されたらウィンドウが消える。                  // Cancelボタンが押下されたらウィンドウが消える。
7820                  if (IsWindowVisible(hWnd) == 0)                  if (IsWindowVisible(hWnd) == 0)
7821                          goto cancel_abort;                          goto scp_thread_cancel_abort;
7822    
7823                  // ファイルから読み込んだデータはかならずサーバへ送信する。                  // ファイルから読み込んだデータはかならずサーバへ送信する。
7824                  ret = fread(buf, 1, sizeof(buf), c->scp.localfp);                  ret = fread(buf, 1, sizeof(buf), c->scp.localfp);
# Line 7828  static unsigned __stdcall ssh_scp_thread Line 7828  static unsigned __stdcall ssh_scp_thread
7828                  do {                  do {
7829                          // socket or channelがクローズされたらスレッドを終わる                          // socket or channelがクローズされたらスレッドを終わる
7830                          if (pvar->socket == INVALID_SOCKET || c->scp.state == SCP_CLOSING || c->used == 0)                          if (pvar->socket == INVALID_SOCKET || c->scp.state == SCP_CLOSING || c->used == 0)
7831                                  goto abort;                                  goto scp_thread_abort;
7832    
7833                          if (ret > c->remote_window) {                          if (ret > c->remote_window) {
7834                                  Sleep(100);                                  Sleep(100);
# Line 7865  static unsigned __stdcall ssh_scp_thread Line 7865  static unsigned __stdcall ssh_scp_thread
7865    
7866          return 0;          return 0;
7867    
7868  cancel_abort:  scp_thread_cancel_abort:
7869          ssh2_channel_send_close(pvar, c);          ssh2_channel_send_close(pvar, c);
7870    
7871  abort:  scp_thread_abort:
7872    
7873          return 0;          return 0;
7874  }  }
# Line 7942  static unsigned __stdcall ssh_scp_receiv Line 7942  static unsigned __stdcall ssh_scp_receiv
7942          for (;;) {          for (;;) {
7943                  // Cancelボタンが押下されたらウィンドウが消える。                  // Cancelボタンが押下されたらウィンドウが消える。
7944                  if (IsWindowVisible(hWnd) == 0)                  if (IsWindowVisible(hWnd) == 0)
7945                          goto cancel_abort;                          goto scp_receive_cancel_abort;
7946    
7947                  if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) != 0) {                  if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) != 0) {
7948                          switch (msg.message) {                          switch (msg.message) {
# Line 7953  static unsigned __stdcall ssh_scp_receiv Line 7953  static unsigned __stdcall ssh_scp_receiv
7953    
7954                                  if (c->scp.filercvsize >= c->scp.filetotalsize) { // EOF                                  if (c->scp.filercvsize >= c->scp.filetotalsize) { // EOF
7955                                          free(data);  // free!                                          free(data);  // free!
7956                                          goto done;                                          goto scp_receive_done;
7957                                  }                                  }
7958    
7959                                  if (c->scp.filercvsize + buflen > c->scp.filetotalsize) { // overflow (include EOF)                                  if (c->scp.filercvsize + buflen > c->scp.filetotalsize) { // overflow (include EOF)
# Line 7974  static unsigned __stdcall ssh_scp_receiv Line 7974  static unsigned __stdcall ssh_scp_receiv
7974                                  SendMessage(GetDlgItem(c->scp.progress_window, IDC_PROGRESS), WM_SETTEXT, 0, (LPARAM)s);                                  SendMessage(GetDlgItem(c->scp.progress_window, IDC_PROGRESS), WM_SETTEXT, 0, (LPARAM)s);
7975    
7976                                  if (eof)                                  if (eof)
7977                                          goto done;                                          goto scp_receive_done;
7978    
7979                                  break;                                  break;
7980                          }                          }
# Line 7982  static unsigned __stdcall ssh_scp_receiv Line 7982  static unsigned __stdcall ssh_scp_receiv
7982                  Sleep(0);                  Sleep(0);
7983          }          }
7984    
7985  done:  scp_receive_done:
7986          c->scp.state = SCP_CLOSING;          c->scp.state = SCP_CLOSING;
7987          ShowWindow(c->scp.progress_window, SW_HIDE);          ShowWindow(c->scp.progress_window, SW_HIDE);
7988    
7989  cancel_abort:  scp_receive_cancel_abort:
7990          ssh2_channel_send_close(pvar, c);          ssh2_channel_send_close(pvar, c);
7991          return 0;          return 0;
7992  }  }

Legend:
Removed from v.3159  
changed lines
  Added in v.3162

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