According to Rob Kremer:
> I finally tracked down the redirect bug with https in htdig-3.2.0b4-20020728.
> 
> htdig/Document.cc - Line 515
> 
> FROM:
> if (transportConnect == HTTPConnect || transportConnect == externalConnect)
>              redirected_to =  ((HtHTTP_Response *)response)->GetLocation();
> 
> 
> TO:
> if (transportConnect == HTTPConnect || transportConnect == externalConnect ||
>      transportConnect == HTTPSConnect)
>              redirected_to =  ((HtHTTP_Response *)response)->GetLocation();
> 
> transportConnect can actually be set to 5 different values:
>    externalConnect
>    HTTPSConnect
>    HTTPConnect
>    FileConnect
>    NNTPConnect
> 
> I don't know if FileConnect or NNTPConnect should be included in this also.

Well, I can't see FileConnect or NNTPConnect ever needing to generate
redirects at this point.  Neither of them currently sets _location in any
case.  This is perhaps beside the point, though.  As any Transport class
that sets _location should have a valid reason to do so, and any class that
doesn't have reason to set it should leave it as an empty String, then I
don't really see any point in testing transportConnect to see if it's on
a list of allowed classes.  Why not just set

         redirected_to = response->GetLocation();

unconditionally?

Am I missing something, or is there a good reason for this "if" test?
I also don't see the need for the cast of response to HtHTTP_Response
in the code.  GetLocation is part of the Transport class, just like
GetDocumentLength et al.  Gabriele, is this some of your code?  Can you or
anyone else shed some light on the rationale for doing things this way?

I can make a quick fix in time for the next snapshot, but I'd like this
fixed properly so it won't come back and bite us next time we add a
Transport subclass.

-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/
Dept. Physiology, U. of Manitoba  Winnipeg, MB  R3E 3J7  (Canada)


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a 
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html

Reply via email to