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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.2.3, 3.2.4
    • None
    • None
    • 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

            ffang Freeman Yue Fang
            ffang Freeman Yue Fang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: