The MinGW.org Installation Manager Tool
Révision | 155d03aea26c303a2a6bb281324de6f2e6b173d2 (tree) |
---|---|
l'heure | 2017-09-05 05:21:54 |
Auteur | Keith Marshall <keith@user...> |
Commiter | Keith Marshall |
Improve probability of establishing successful URL connections.
@@ -1,3 +1,14 @@ | ||
1 | +2017-09-04 Keith Marshall <keith@users.osdn.me> | |
2 | + | |
3 | + Improve probability of establishing successful URL connections. | |
4 | + | |
5 | + * src/pkginet.cpp (pkgInternetAgent::OpenURL): Add... | |
6 | + (INTERNET_FLAG_KEEP_CONNECTION, INTERNET_FLAG_IGNORE_CERT_CN_INVALID) | |
7 | + (INTERNET_FLAG_IGNORE_CERT_DATE_INVALID, INTERNET_FLAG_PRAGMA_NOCACHE) | |
8 | + (INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS) | |
9 | + (INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP): ...these flags, when calling | |
10 | + the InternetOpenUrl() function. | |
11 | + | |
1 | 12 | 2017-09-01 Keith Marshall <keith@users.osdn.me> |
2 | 13 | |
3 | 14 | Increment version for first OSDN hosted release. |
@@ -4,7 +4,7 @@ | ||
4 | 4 | * $Id$ |
5 | 5 | * |
6 | 6 | * Written by Keith Marshall <keithmarshall@users.sourceforge.net> |
7 | - * Copyright (C) 2009-2013, MinGW.org Project | |
7 | + * Copyright (C) 2009-2013, 2017, MinGW.org Project | |
8 | 8 | * |
9 | 9 | * |
10 | 10 | * Implementation of the package download machinery for mingw-get. |
@@ -458,7 +458,14 @@ HINTERNET pkgInternetAgent::OpenURL( const char *URL ) | ||
458 | 458 | * specify it anyway, on the off-chance that it may introduce |
459 | 459 | * an undocumented benefit beyond wishful thinking. |
460 | 460 | */ |
461 | - SessionHandle, URL, NULL, 0, INTERNET_FLAG_EXISTING_CONNECT, 0 | |
461 | + SessionHandle, URL, NULL, 0, | |
462 | + INTERNET_FLAG_EXISTING_CONNECT | |
463 | + | INTERNET_FLAG_IGNORE_CERT_CN_INVALID | |
464 | + | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | |
465 | + | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS | |
466 | + | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP | |
467 | + | INTERNET_FLAG_KEEP_CONNECTION | |
468 | + | INTERNET_FLAG_PRAGMA_NOCACHE, 0 | |
462 | 469 | ); |
463 | 470 | if( ResourceHandle == NULL ) |
464 | 471 | { |
@@ -469,11 +476,14 @@ HINTERNET pkgInternetAgent::OpenURL( const char *URL ) | ||
469 | 476 | { |
470 | 477 | /* ...in which case, we diagnose failure to open the URL. |
471 | 478 | */ |
479 | + unsigned int status = GetLastError(); | |
472 | 480 | DEBUG_INVOKE_IF( DEBUG_REQUEST( DEBUG_TRACE_INTERNET_REQUESTS ), |
473 | 481 | dmh_printf( "%s\nConnection failed(status=%u); abandoned.\n", |
474 | - URL, GetLastError() ) | |
482 | + URL, status ) | |
483 | + ); | |
484 | + dmh_notify( | |
485 | + DMH_ERROR, "%s:cannot open URL; status = %u\n", URL, status | |
475 | 486 | ); |
476 | - dmh_notify( DMH_ERROR, "%s:cannot open URL\n", URL ); | |
477 | 487 | } |
478 | 488 | else DEBUG_INVOKE_IF( DEBUG_REQUEST( DEBUG_TRACE_INTERNET_REQUESTS ), |
479 | 489 | dmh_printf( "%s\nConnecting ... failed(status=%u); retrying in %ds...\n", |