[PATCH] keepalive: handle broken pipes gracefully during large POSTs

Dirkjan Ochtman dirkjan at ochtman.nl
Thu Nov 5 05:08:54 CST 2009


On Mon, Nov 2, 2009 at 19:30,  <durin42 at gmail.com> wrote:
> # HG changeset patch
> # User Augie Fackler <durin42 at gmail.com>
> # Date 1257177802 18000
> # Node ID 38e263556f1dfd4071c84fc6415aa149b5195259
> # Parent  8269fe2d48f6caa7808242803d64b7415ba0745a
> keepalive: handle broken pipes gracefully during large POSTs
>
> diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
> --- a/mercurial/keepalive.py
> +++ b/mercurial/keepalive.py
> @@ -495,10 +499,62 @@
>                 break
>         return list
>
> +def safesend(self, str):
> +    """Send `str' to the server.
> +
> +    Shamelessly ripped off from httplib to patch a bad behavior.
> +    """
> +    if getattr(self, '_broken_pipe_resp', None) is not None:
> +        return

I'm confused by this, since in Python trunk's httplib there's no
mention of _broken_pipe...

Cheers,

Dirkjan



More information about the Mercurial-devel mailing list