Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7671

should avoid reverse dns resolution in AsyncHTTPConduit for the proxy host address

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.3, 3.2.4
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      currently it use

      HttpHost proxy = new HttpHost(isa.getHostName(), isa.getPort());
      

      and InetSocketAddress.getHostName will trigger dns reserve resolution when the proxy address is literal ip

      /**
           * Gets the {@code hostname}.
           * Note: This method may trigger a name service reverse lookup if the
           * address was created with a literal IP address.
           *
           * @return  the hostname part of the address.
           */
      

      This dns reserve resolution is time-consuming and should be avoid, as the proxy is specified by users, they can specify as hostname or literal ip per their requirement.

      We should use InetSocketAddress.getHostString instead, this will return what users has specified as is

      /**
           * Returns the hostname, or the String form of the address if it
           * doesn't have a hostname (it was created using a literal).
           * This has the benefit of <b>not</b> attempting a reverse lookup.
           *
           * @return the hostname, or String representation of the address.
           * @since 1.7
           */
      

        Attachments

          Activity

            People

            • Assignee:
              ffang Freeman Fang
              Reporter:
              ffang Freeman Fang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: