Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
          +++ new/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
↓ open down ↓ 351 lines elided ↑ open up ↑
 352  352  
 353  353          /* Setting up a tunnel */
 354  354          SETUP,
 355  355  
 356  356          /* Tunnel has been successfully setup */
 357  357          TUNNELING
 358  358      }
 359  359  
 360  360      private TunnelState tunnelState = TunnelState.NONE;
 361  361  
 362      -    /* Redefine timeouts from java.net.URLConnection as we nee -1 to mean
      362 +    /* Redefine timeouts from java.net.URLConnection as we need -1 to mean
 363  363       * not set. This is to ensure backward compatibility.
 364  364       */
 365      -    private int connectTimeout = -1;
 366      -    private int readTimeout = -1;
      365 +    private int connectTimeout = NetworkClient.DEFAULT_CONNECT_TIMEOUT;
      366 +    private int readTimeout = NetworkClient.DEFAULT_READ_TIMEOUT;
 367  367  
 368  368      /* Logging support */
 369  369      private static final PlatformLogger logger =
 370  370              PlatformLogger.getLogger("sun.net.www.protocol.http.HttpURLConnection");
 371  371  
 372  372      /*
 373  373       * privileged request password authentication
 374  374       *
 375  375       */
 376  376      private static PasswordAuthentication
↓ open down ↓ 657 lines elided ↑ open up ↑
1034 1034                          // Response code is 2nd token on the line
1035 1035                          if (sa.length > 1)
1036 1036                              responseCode = Integer.parseInt(sa[1]);
1037 1037                      } catch (NumberFormatException numberFormatException) {
1038 1038                      }
1039 1039                  }
1040 1040                  if (responseCode != 100) {
1041 1041                      throw new ProtocolException("Server rejected operation");
1042 1042                  }
1043 1043              }
1044      -            if (oldTimeout > 0) {
1045      -                http.setReadTimeout(oldTimeout);
1046      -            }
     1044 +            
     1045 +            http.setReadTimeout(oldTimeout);
     1046 +
1047 1047              responseCode = -1;
1048 1048              responses.reset();
1049 1049              // Proceed
1050 1050      }
1051 1051  
1052 1052      /*
1053 1053       * Allowable input/output sequences:
1054 1054       * [interpreted as POST/PUT]
1055 1055       * - get output, [write output,] get input, [read input]
1056 1056       * - get output, [write output]
↓ open down ↓ 2237 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX