~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_pycurl.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2011, 2017 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
16
16
 
17
17
"""http/https transport using pycurl"""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
# TODO: test reporting of http errors
20
22
#
21
23
# TODO: Transport option to control caching of particular requests; broadly we
83
85
    """
84
86
    return pycurl.__dict__.get(symbol, default)
85
87
 
 
88
# Yes, weird but returned on weird http error (invalid status line)
 
89
CURLE_FTP_WEIRD_SERVER_REPLY = _get_pycurl_errcode(
 
90
    'E_FTP_WEIRD_SERVER_REPLY', 8)
86
91
CURLE_COULDNT_CONNECT = _get_pycurl_errcode('E_COULDNT_CONNECT', 7)
87
92
CURLE_COULDNT_RESOLVE_HOST = _get_pycurl_errcode('E_COULDNT_RESOLVE_HOST', 6)
88
93
CURLE_COULDNT_RESOLVE_PROXY = _get_pycurl_errcode('E_COULDNT_RESOLVE_PROXY', 5)
395
400
            if e[0] in (CURLE_COULDNT_RESOLVE_HOST,
396
401
                        CURLE_COULDNT_RESOLVE_PROXY,
397
402
                        CURLE_COULDNT_CONNECT,
 
403
                        CURLE_FTP_WEIRD_SERVER_REPLY,
398
404
                        CURLE_GOT_NOTHING,
399
405
                        CURLE_SSL_CACERT,
400
406
                        CURLE_SSL_CACERT_BADFILE,