| 421 | } |
| 422 | |
| 423 | int OnHTTPError(const std::string& url, const std::string& reasonString, bool isSSL) |
| 424 | { |
| 425 | LPTSTR urlt = ConvertCppStringToTString(url); |
| 426 | LPTSTR rstt = ConvertCppStringToTString(reasonString); |
| 427 | LPCTSTR title; |
| 428 | static TCHAR buffer[8192]; |
| 429 | |
| 430 | if (isSSL) { |
| 431 | title = TmGetTString(IDS_SSL_ERROR_TITLE); |
| 432 | _tcscpy(buffer, TmGetTString(IDS_SSL_ERROR_1)); |
| 433 | _tcscat(buffer, urlt); |
| 434 | _tcscat(buffer, TEXT("\n\n")); |
| 435 | _tcscat(buffer, rstt); |
| 436 | _tcscat(buffer, TEXT("\n\n")); |
| 437 | _tcscat(buffer, TmGetTString(IDS_SSL_ERROR_2)); |
| 438 | _tcscat(buffer, TEXT("\n\n")); |
| 439 | _tcscat(buffer, TmGetTString(IDS_SSL_ERROR_3)); |
| 440 | } |
| 441 | else { |
| 442 | title = TmGetTString(IDS_CONNECT_ERROR_TITLE); |
| 443 | _tcscpy(buffer, TmGetTString(IDS_CONNECT_ERROR_1)); |
| 444 | _tcscat(buffer, urlt); |
| 445 | _tcscat(buffer, TEXT("\n\n")); |
| 446 | _tcscat(buffer, rstt); |
| 447 | _tcscat(buffer, TEXT("\n\n")); |
| 448 | _tcscat(buffer, TmGetTString(IDS_CONNECT_ERROR_2)); |
| 449 | _tcscat(buffer, TEXT("\n\n")); |
| 450 | _tcscat(buffer, TmGetTString(IDS_CONNECT_ERROR_3)); |
| 451 | } |
| 452 | |
| 453 | free(urlt); |
| 454 | free(rstt); |
| 455 | |
| 456 | size_t l = _tcslen(buffer); |
| 457 | return MessageBox(g_Hwnd, buffer, title, (isSSL ? MB_ABORTRETRYIGNORE : MB_RETRYCANCEL) | MB_ICONWARNING); |
| 458 | } |
| 459 | |
| 460 | void CloseCleanup(HWND hWnd) |
| 461 | { |
no test coverage detected