hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Qin Zang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HTTPCLIENT-927) "Narrowly avoided an infinite loop in execute" should not be logged as an error.
Date Thu, 25 Mar 2010 18:19:27 GMT
"Narrowly avoided an infinite loop in execute" should not be logged as an error.
--------------------------------------------------------------------------------

                 Key: HTTPCLIENT-927
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-927
             Project: HttpComponents HttpClient
          Issue Type: Improvement
          Components: HttpClient
    Affects Versions: 4.0.1
            Reporter: Qin Zang
             Fix For: 4.0.1


In the executeMethod(), upon received the "Redirect" as the HTTP Response Code, the code will
log an error if the maxRedirects was set to 0 as in the following code. This is not an error,
if someone want to stop the automatic redirect behavior. It should be logged as a warning
or debug message.

  178 if (isRedirectNeeded(method)) {
  179                       if (processRedirectResponse(method)) {
  180                           retry = true;
  181                           ++redirectCount;
  182                           if (redirectCount >= maxRedirects) {
  183                               LOG.error("Narrowly avoided an infinite loop in execute");
  184                               throw new RedirectException("Maximum redirects ("
  185                                   + maxRedirects + ") exceeded");
  186                           }
  187                           if (LOG.isDebugEnabled()) {
  188                               LOG.debug("Execute redirect " + redirectCount + " of "
+ maxRedirects);
  189                           }
  190                       }
  191                   }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message