Uploaded image for project: 'JSword'
  1. JSword
  2. JS-149

Possible bug in WebResource proxy code

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7
    • Component/s: o.c.common.util
    • Labels:
      None
    • Environment:

      Android

      Description

      I don't know if this is correct or not but thought I would raise it in case because it looks a little odd.

      Should the ProxySelectorRoutePlanner and setRoutePlanner lines below be in the preceding proxy related if statement. Also, the last line isn't indented correctly which could cause confusion.

      public WebResource(URI theURI, String theProxyHost, Integer theProxyPort, int theTimeout) {
      uri = theURI;
      client = new DefaultHttpClient();
      HttpParams params = client.getParams();

      // Allowable time between packets
      HttpConnectionParams.setSoTimeout(params, theTimeout);
      // Allowable time to get a connection
      HttpConnectionParams.setConnectionTimeout(params, theTimeout);

      // Configure proxy info if necessary and defined
      if (theProxyHost != null && theProxyHost.length() > 0)

      { // Configure the host and port HttpHost proxy = new HttpHost(theProxyHost, theProxyPort == null ? -1 : theProxyPort.intValue()); ConnRouteParams.setDefaultProxy(params, proxy); }

      ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
      client.getConnectionManager().getSchemeRegistry(),
      ProxySelector.getDefault());
      ((AbstractHttpClient) client).setRoutePlanner(routePlanner);
      }

        Attachments

          Activity

            People

            • Assignee:
              dmsmith DM Smith
              Reporter:
              mjdenham Martin Denham
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: