Browse Subversion Repository
Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/ssh.c
Parent Directory
| Revision Log
| Patch
| 7468 |
HWND hWnd = c->scp.progress_window; |
HWND hWnd = c->scp.progress_window; |
| 7469 |
scp_dlg_parm_t parm; |
scp_dlg_parm_t parm; |
| 7470 |
int rate, ProgStat; |
int rate, ProgStat; |
| 7471 |
|
DWORD stime; |
| 7472 |
|
int elapsed, prev_elapsed; |
| 7473 |
|
|
| 7474 |
//SendMessage(GetDlgItem(hWnd, IDC_FILENAME), WM_SETTEXT, 0, (LPARAM)c->scp.localfile); |
//SendMessage(GetDlgItem(hWnd, IDC_FILENAME), WM_SETTEXT, 0, (LPARAM)c->scp.localfile); |
| 7475 |
SendMessage(GetDlgItem(hWnd, IDC_FILENAME), WM_SETTEXT, 0, (LPARAM)c->scp.localfilefull); |
SendMessage(GetDlgItem(hWnd, IDC_FILENAME), WM_SETTEXT, 0, (LPARAM)c->scp.localfilefull); |
| 7476 |
|
|
| 7477 |
InitDlgProgress(hWnd, IDC_PROGBAR, &ProgStat); |
InitDlgProgress(hWnd, IDC_PROGBAR, &ProgStat); |
| 7478 |
|
|
| 7479 |
|
stime = GetTickCount(); |
| 7480 |
|
prev_elapsed = 0; |
| 7481 |
|
|
| 7482 |
do { |
do { |
| 7483 |
// Cancelボタンが押下されたらウィンドウが消える。 |
// Cancelボタンが押下されたらウィンドウが消える。 |
| 7484 |
if (is_canceled_window(hWnd)) |
if (is_canceled_window(hWnd)) |
| 7517 |
SendDlgItemMessage(hWnd, IDC_PROGBAR, PBM_SETPOS, (WPARAM)ProgStat, 0); |
SendDlgItemMessage(hWnd, IDC_PROGBAR, PBM_SETPOS, (WPARAM)ProgStat, 0); |
| 7518 |
} |
} |
| 7519 |
|
|
| 7520 |
|
elapsed = (GetTickCount() - stime) / 1000; |
| 7521 |
|
if (elapsed > prev_elapsed) { |
| 7522 |
|
if (elapsed > 2) { |
| 7523 |
|
rate = (int)(total_size / elapsed); |
| 7524 |
|
if (rate < 1200) { |
| 7525 |
|
_snprintf_s(s, sizeof(s), _TRUNCATE, "%d:%02d (%d %s)", elapsed / 60, elapsed % 60, rate, "Bytes/s"); |
| 7526 |
|
} |
| 7527 |
|
else if (rate < 1200000) { |
| 7528 |
|
_snprintf_s(s, sizeof(s), _TRUNCATE, "%d:%02d (%d.%02d %s)", elapsed / 60, elapsed % 60, rate / 1000, rate / 10 % 100, "KBytes/s"); |
| 7529 |
|
} |
| 7530 |
|
else { |
| 7531 |
|
_snprintf_s(s, sizeof(s), _TRUNCATE, "%d:%02d (%d.%02d %s)", elapsed / 60, elapsed % 60, rate / (1000 * 1000), rate / 100000 % 100, "MBytes/s"); |
| 7532 |
|
} |
| 7533 |
|
} |
| 7534 |
|
else { |
| 7535 |
|
_snprintf_s(s, sizeof(s), _TRUNCATE, "%d:%02d", elapsed / 60, elapsed % 60); |
| 7536 |
|
} |
| 7537 |
|
SendDlgItemMessage(hWnd, IDC_PROGTIME, WM_SETTEXT, 0, (LPARAM)s); |
| 7538 |
|
prev_elapsed = elapsed; |
| 7539 |
|
} |
| 7540 |
|
|
| 7541 |
} while (ret <= sizeof(buf)); |
} while (ret <= sizeof(buf)); |
| 7542 |
|
|
| 7543 |
// eof |
// eof |
| 7628 |
unsigned int buflen; |
unsigned int buflen; |
| 7629 |
int eof; |
int eof; |
| 7630 |
int rate, ProgStat; |
int rate, ProgStat; |
| 7631 |
|
DWORD stime; |
| 7632 |
|
int elapsed, prev_elapsed; |
| 7633 |
|
|
| 7634 |
InitDlgProgress(hWnd, IDC_PROGBAR, &ProgStat); |
InitDlgProgress(hWnd, IDC_PROGBAR, &ProgStat); |
| 7635 |
|
|
| 7636 |
|
stime = GetTickCount(); |
| 7637 |
|
prev_elapsed = 0; |
| 7638 |
|
|
| 7639 |
for (;;) { |
for (;;) { |
| 7640 |
// Cancelボタンが押下されたらウィンドウが消える。 |
// Cancelボタンが押下されたらウィンドウが消える。 |
| 7641 |
if (is_canceled_window(hWnd)) |
if (is_canceled_window(hWnd)) |
| 7675 |
SendDlgItemMessage(c->scp.progress_window, IDC_PROGBAR, PBM_SETPOS, (WPARAM)ProgStat, 0); |
SendDlgItemMessage(c->scp.progress_window, IDC_PROGBAR, PBM_SETPOS, (WPARAM)ProgStat, 0); |
| 7676 |
} |
} |
| 7677 |
|
|
| 7678 |
|
elapsed = (GetTickCount() - stime) / 1000; |
| 7679 |
|
if (elapsed > prev_elapsed) { |
| 7680 |
|
if (elapsed > 2) { |
| 7681 |
|
rate = (int)(c->scp.filercvsize / elapsed); |
| 7682 |
|
if (rate < 1200) { |
| 7683 |
|
_snprintf_s(s, sizeof(s), _TRUNCATE, "%d:%02d (%d %s)", elapsed / 60, elapsed % 60, rate, "Bytes/s"); |
| 7684 |
|
} |
| 7685 |
|
else if (rate < 1200000) { |
| 7686 |
|
_snprintf_s(s, sizeof(s), _TRUNCATE, "%d:%02d (%d.%02d %s)", elapsed / 60, elapsed % 60, rate / 1000, rate / 10 % 100, "KBytes/s"); |
| 7687 |
|
} |
| 7688 |
|
else { |
| 7689 |
|
_snprintf_s(s, sizeof(s), _TRUNCATE, "%d:%02d (%d.%02d %s)", elapsed / 60, elapsed % 60, rate / (1000 * 1000), rate / 10000 % 100, "MBytes/s"); |
| 7690 |
|
} |
| 7691 |
|
} |
| 7692 |
|
else { |
| 7693 |
|
_snprintf_s(s, sizeof(s), _TRUNCATE, "%d:%02d", elapsed / 60, elapsed % 60); |
| 7694 |
|
} |
| 7695 |
|
SendDlgItemMessage(hWnd, IDC_PROGTIME, WM_SETTEXT, 0, (LPARAM)s); |
| 7696 |
|
prev_elapsed = elapsed; |
| 7697 |
|
} |
| 7698 |
|
|
| 7699 |
if (eof) |
if (eof) |
| 7700 |
goto done; |
goto done; |
| 7701 |
|
|
|
|
Legend:
| Removed from v.4379 |
|
| changed lines |
| |
Added in v.4381 |
|
|
| |