[MERGE][bug #120768] https+urllib + proxy issues a CONNECT Request

Aaron Bentley aaron.bentley at utoronto.ca
Tue Jul 3 19:09:13 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vincent Ladeuil wrote:
> Note: the bug is really 120678, only the subject of my mails are
> wrong, I don't fix them to make BB happy.
> 
> Thanks for your faith and the review :)

>     aaron> In case self.close throws an exception that you can recover from.

> If an error occurs at that point... hmm, I can't think about any
> error occurring there (it's really httplib internal
> housekeeping)... and if one occurs, I don't want to keep that
> socket

So in that case, it's not throwing exceptions you can recover from, and
you don't really have to bother.


>     >> def update_auth(self, auth, key, value):
>     >> """Update a value in auth marking the auth as modified if needed"""
>     >> @@ -805,6 +908,16 @@
>     >> :param headers: The headers for the authentication error response.
>     >> :return: None or the response for the authenticated request.
>     >> """
>     >> +        # Don't try  to authenticate endlessly
>     >> +        if self._retry_count is None:
>     >> +            # The retry being recusrsive calls, None identify the first try
>     >> +            self._retry_count = 1
> 
>     aaron> Why not start the retry count at 0?
> 
> Indeed.

Actually, what I meant was to set the retry count to 0 in
AbstractAuthHandler, and then the code in auth_required would be.

self._retry_count += 1
if self._retry_count > self._max_retry:
    # Let's be ready for next round
    self._retry_count = 0
    return None

No need to check for None at all, so you get rid of this bit:

        if self._retry_count is None:
            self._retry_count = 1

Not a big deal, so I've sent it in without.  But I thought it would make
the code simpler.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGipDJ0F+nu1YWqI0RArUJAJ4hhvD0Fi+28pJpm2/oFA44Kjiy/ACfWAtB
+6HcLl1jO3A5wAaJIjhrV7U=
=GFyG
-----END PGP SIGNATURE-----



More information about the bazaar mailing list