Changeset 6109 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2013-08-03T03:12:25+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r6087 r6109 1076 1076 } else { 1077 1077 int osize = conn.getContentLength(); 1078 conn.disconnect(); 1079 1080 conn = Utils.openHttpConnection(new URI(u.toString() 1081 .replace("=", "%3D") /* do not URLencode whole string! */ 1082 .replaceFirst("/wiki/", "/w/index.php?redirect=no&title=") 1083 ).toURL()); 1084 conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000); 1078 if (osize > -1) { 1079 conn.disconnect(); 1080 1081 conn = Utils.openHttpConnection(new URI(u.toString() 1082 .replace("=", "%3D") /* do not URLencode whole string! */ 1083 .replaceFirst("/wiki/", "/w/index.php?redirect=no&title=") 1084 ).toURL()); 1085 conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000); 1086 } 1085 1087 1086 1088 /* redirect pages have different content length, but retrieving a "nonredirect" … … 1088 1090 * content lengths, so we have to be fuzzy.. (this is UGLY, recode if u know better) 1089 1091 */ 1090 if ( Math.abs(conn.getContentLength() - osize) > 200) {1092 if (conn.getContentLength() != -1 && osize > -1 && Math.abs(conn.getContentLength() - osize) > 200) { 1091 1093 Main.info("{0} is a mediawiki redirect", u); 1092 1094 conn.disconnect();
Note:
See TracChangeset
for help on using the changeset viewer.