< prev index next >

src/java.base/windows/native/libnet/DefaultProxySelector.c

Print this page
rev 52699 : 8214014: Remove vestiges of gopher: protocol proxy support


 279             if (wcsncmp(s, L"<local>", maxlen) == 0) {
 280                 /*
 281                  * All local intranet sites are bypassed - Microsoft consider all
 282                  * servers that do not contain a period in their name to be local.
 283                  */
 284                 if (wcschr(lpHost, '.') == NULL) {
 285                     goto noproxy;
 286                 }
 287             }
 288             s = wcstok_s(NULL, L"; ", &context);
 289         }
 290     }
 291 
 292     if (win_proxy != NULL) {
 293         wchar_t *context = NULL;
 294         int defport = 0;
 295         int nr_elems = 0;
 296 
 297         /* Set the default port value & proxy type from protocol. */
 298         if ((wcscmp(lpProto, L"http") == 0) ||
 299             (wcscmp(lpProto, L"ftp") == 0) ||
 300             (wcscmp(lpProto, L"gopher") == 0))
 301             defport = 80;
 302         if (wcscmp(lpProto, L"https") == 0)
 303             defport = 443;
 304         if (wcscmp(lpProto, L"socks") == 0) {
 305             defport = 1080;
 306             type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_socksID);
 307         } else {
 308             type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
 309         }
 310         if (type_proxy == NULL || (*env)->ExceptionCheck(env)) {
 311             goto noproxy;
 312         }
 313 
 314         nr_elems = createProxyList(win_proxy, lpProto, &head);
 315         if (nr_elems != 0 && head != NULL) {
 316             int index = 0;
 317             proxy_array = (*env)->NewObjectArray(env, nr_elems, proxy_class, NULL);
 318             if (proxy_array == NULL || (*env)->ExceptionCheck(env)) {
 319                 goto noproxy;
 320             }




 279             if (wcsncmp(s, L"<local>", maxlen) == 0) {
 280                 /*
 281                  * All local intranet sites are bypassed - Microsoft consider all
 282                  * servers that do not contain a period in their name to be local.
 283                  */
 284                 if (wcschr(lpHost, '.') == NULL) {
 285                     goto noproxy;
 286                 }
 287             }
 288             s = wcstok_s(NULL, L"; ", &context);
 289         }
 290     }
 291 
 292     if (win_proxy != NULL) {
 293         wchar_t *context = NULL;
 294         int defport = 0;
 295         int nr_elems = 0;
 296 
 297         /* Set the default port value & proxy type from protocol. */
 298         if ((wcscmp(lpProto, L"http") == 0) ||
 299             (wcscmp(lpProto, L"ftp") == 0))

 300             defport = 80;
 301         if (wcscmp(lpProto, L"https") == 0)
 302             defport = 443;
 303         if (wcscmp(lpProto, L"socks") == 0) {
 304             defport = 1080;
 305             type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_socksID);
 306         } else {
 307             type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID);
 308         }
 309         if (type_proxy == NULL || (*env)->ExceptionCheck(env)) {
 310             goto noproxy;
 311         }
 312 
 313         nr_elems = createProxyList(win_proxy, lpProto, &head);
 314         if (nr_elems != 0 && head != NULL) {
 315             int index = 0;
 316             proxy_array = (*env)->NewObjectArray(env, nr_elems, proxy_class, NULL);
 317             if (proxy_array == NULL || (*env)->ExceptionCheck(env)) {
 318                 goto noproxy;
 319             }


< prev index next >