/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2012-01-05 14:26:58 UTC
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120105142658-vek3v6pzlxb751s2
Tests passing for a first rough version of a cached branch config store. The changes here are too invasive and several parallel proposals have been made. 

@only_raises is evil and gave a hard time since any exception during
save_changes() was swallowed.

Possible improvements: 

- add some needs_write_lock decorators to crucial
  methods (_set_config_location ?) but keep locking the branch at higher levels

- decorate branch.unlock to call stack.save if last_lock() it True
  outside of @only_raises scope (evil decorator)

- add @needs_write_lock to stack.set and stack.remove (will probably get
  rid of most testing issues) we probably need a specialized decorator
  that can relay to the store and from there to the branch or whatever is
  needed. This will also helps bzr config to get it right. The
  get_mutable_section trick should not be needed anymore either.

- decorate branch.unlock to call stack.save if last_lock() it True outside
  of @only_raises scope (evil decorator)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2006-2011 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
21
21
responses.
22
22
"""
23
23
 
 
24
from __future__ import absolute_import
24
25
 
25
26
import httplib
26
27
from cStringIO import StringIO
28
29
 
29
30
from bzrlib import (
30
31
    errors,
31
 
    trace,
32
32
    osutils,
33
33
    )
34
34
 
109
109
            # To be on the safe side we allow it before any boundary line
110
110
            boundary_line = self._file.readline()
111
111
 
 
112
        if boundary_line == '':
 
113
            # A timeout in the proxy server caused the response to end early.
 
114
            # See launchpad bug 198646.
 
115
            raise errors.HttpBoundaryMissing(
 
116
                self._path,
 
117
                self._boundary)
 
118
 
112
119
        if boundary_line != '--' + self._boundary + '\r\n':
113
120
            # rfc822.unquote() incorrectly unquotes strings enclosed in <>
114
121
            # IIS 6 and 7 incorrectly wrap boundary strings in <>