Show More
@@ -74,10 +74,15 b' class httprepository(repo.repository):' | |||
|
74 | 74 | q.update(args) |
|
75 | 75 | qs = '?%s' % urllib.urlencode(q) |
|
76 | 76 | cu = "%s%s" % (self._url, qs) |
|
77 | req = urllib2.Request(cu, data, headers) | |
|
78 | if data is not None: | |
|
79 | # len(data) is broken if data doesn't fit into Py_ssize_t | |
|
80 | # add the header ourself to avoid OverflowError | |
|
81 | size = data.__len__() | |
|
82 | self.ui.debug("sending %s bytes\n" % size) | |
|
83 | req.add_unredirected_header('Content-Length', '%d' % size) | |
|
77 | 84 | try: |
|
78 | if data: | |
|
79 | self.ui.debug("sending %s bytes\n" % len(data)) | |
|
80 | resp = self.urlopener.open(urllib2.Request(cu, data, headers)) | |
|
85 | resp = self.urlopener.open(req) | |
|
81 | 86 | except urllib2.HTTPError, inst: |
|
82 | 87 | if inst.code == 401: |
|
83 | 88 | raise util.Abort(_('authorization failed')) |
General Comments 0
You need to be logged in to leave comments.
Login now