Changeset 32205 in osm for applications/editors
- Timestamp:
- 2016-05-30T10:11:58+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
r32060 r32205 105 105 */ 106 106 private void getCookie() throws IOException { 107 boolean cookied= false;107 boolean sucess = false; 108 108 int retries = cRetriesGetCookie; 109 109 try { 110 110 searchFormURL = new URL(baseURL + "/scpc/accueil.do"); 111 while ( cookied== false && retries > 0) {111 while (sucess == false && retries > 0) { 112 112 urlConn = (HttpURLConnection)searchFormURL.openConnection(); 113 113 urlConn.setRequestProperty("Connection", "close"); … … 118 118 BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream())); 119 119 while(in.readLine() != null) {} // read the buffer otherwise we sent POST too early 120 String headerName=null; 120 sucess = true; 121 String headerName; 121 122 for (int i=1; (headerName = urlConn.getHeaderFieldKey(i))!=null; i++) { 122 if (headerName.equals("Set-Cookie")) { 123 if (Main.isDebugEnabled()) { 124 Main.debug(headerName + ": " + urlConn.getHeaderField(i)); 125 } 126 if ("Set-Cookie".equals(headerName)) { 123 127 cookie = urlConn.getHeaderField(i); 124 cookie = cookie.substring(0, cookie.indexOf(";")); 125 cookieTimestamp = new Date().getTime(); 126 Main.info("received cookie=" + cookie + " at " + new Date(cookieTimestamp)); 127 cookied = true; 128 } 128 if (cookie.isEmpty()) { 129 Main.warn("received empty cookie"); 130 cookie = null; 131 } else { 132 cookie = cookie.substring(0, cookie.indexOf(';')); 133 cookieTimestamp = new Date().getTime(); 134 Main.info("received cookie=" + cookie + " at " + new Date(cookieTimestamp)); 135 break; 136 } 137 } 129 138 } 130 139 } else { -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java
r32060 r32205 61 61 Main.warn("removed a duplicated layer"); 62 62 } catch (WMSException e) { 63 Main.warn(e); 63 64 errorMessage = e.getMessage(); 64 65 wmsLayer.grabber.getWmsInterface().resetCookie();
Note:
See TracChangeset
for help on using the changeset viewer.