)]}'
{"glance/common/client.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"ea614622c5fba9f126892ccd1bbef66158abb750","unresolved":false,"context_lines":[{"line_number":506,"context_line":"            elif _filelike(body) or self._iterable(body):"},{"line_number":507,"context_line":"                c.putrequest(method, path)"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"                use_sendfile \u003d self._sendable(body)"},{"line_number":510,"context_line":""},{"line_number":511,"context_line":"                # According to HTTP/1.1, Content-Length and Transfer-Encoding"},{"line_number":512,"context_line":"                # conflict."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAGn%2F%2F%2Bdk%3D","line":509,"updated":"2012-04-24 09:35:22.000000000","message":"for clarity, would this read slightly better as:\n\n  chunkable \u003d not self._sendable(body)\n  ...\n\n  for header, value in headers.items():\n\tif not (chunkable and header.lower() \u003d\u003d \u0027content-length\u0027):\n\t\tc.putheader(header, value)\n  ...\n\t\n  if chunkable:\n      # iterate and chunk\n      _chunkbody(c, iter)\n  else:\n      # send actual file without copying into userspace\n      _sendbody(c, iter)\n\ni.e. making the to-chunk-or-not-to-chunk question explicit in the conditional governing the omission of the content-length.","commit_id":"59e8cfa87c1fdf6a7edf418afeb0828af6694108"},{"author":{"_account_id":1395,"name":"Mike Lundy","email":"mike@fluffypenguin.org","username":"novas0x2a"},"change_message_id":"0654a1e7836acdfbcb8ba75d455d761c3f8b27f3","unresolved":false,"context_lines":[{"line_number":506,"context_line":"            elif _filelike(body) or self._iterable(body):"},{"line_number":507,"context_line":"                c.putrequest(method, path)"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"                use_sendfile \u003d self._sendable(body)"},{"line_number":510,"context_line":""},{"line_number":511,"context_line":"                # According to HTTP/1.1, Content-Length and Transfer-Encoding"},{"line_number":512,"context_line":"                # conflict."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAGn%2F%2F%2Bcs%3D","line":509,"in_reply_to":"AAAAGn%2F%2F%2Bdk%3D","updated":"2012-04-24 10:37:44.000000000","message":"I did it that way for two reasons:\n1) Chunked is the fallback path, so I wanted it last. You basically never want to use chunked, if you can help it.\n\n2) I was envisioning a third version: use_splice/elif use_sendfile/else chunked. Splice(2) is really awesome and can take non-seekable buffers (like stdin) and zerocopy them to sockets (unlike sendfile, which only supports mmap_buffer-\u003esocket).","commit_id":"59e8cfa87c1fdf6a7edf418afeb0828af6694108"}],"glance/tests/stubs.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"a629a9a65562abc251b825dab8ffb3f1432e2a4f","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        def endheaders(self):"},{"line_number":134,"context_line":"            hl \u003d [i.lower() for i in self.req.headers.keys()]"},{"line_number":135,"context_line":"            assert not (\u0027content-length\u0027 in hl and \\"},{"line_number":136,"context_line":"                        \u0027transfer-encoding\u0027 in hl), \\"},{"line_number":137,"context_line":"                \u0027Content-Length and Transfer-Encoding are mutally exclusive\u0027"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAGn%2F%2F%2Fgw%3D","line":135,"updated":"2012-04-16 20:17:29.000000000","message":"This backslash isn\u0027t necessary…","commit_id":"ecae6abeb57ed0680f0230a953df3e9ce1efe759"}],"glance/tests/unit/test_clients.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"a629a9a65562abc251b825dab8ffb3f1432e2a4f","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from glance.registry.db import models as db_models"},{"line_number":29,"context_line":"from glance.registry import client as rclient"},{"line_number":30,"context_line":"from glance.registry import context as rcontext"},{"line_number":31,"context_line":"from glance.tests import utils as test_utils"},{"line_number":32,"context_line":"from glance.tests.unit import base"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"CONF \u003d {\u0027sql_connection\u0027: \u0027sqlite://\u0027}"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAGn%2F%2F%2Fgs%3D","line":31,"updated":"2012-04-16 20:17:29.000000000","message":"This import should be after the following import","commit_id":"ecae6abeb57ed0680f0230a953df3e9ce1efe759"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"ea614622c5fba9f126892ccd1bbef66158abb750","unresolved":false,"context_lines":[{"line_number":1880,"context_line":"    def test_add_image_with_image_data_as_file_with_sendfile(self):"},{"line_number":1881,"context_line":"        self.add_image_with_image_data_as_file(sendfile\u003dTrue)"},{"line_number":1882,"context_line":""},{"line_number":1883,"context_line":"    def test_add_image_with_image_data_as_file_without_sendfile(self):"},{"line_number":1884,"context_line":"        self.add_image_with_image_data_as_file(sendfile\u003dFalse)"},{"line_number":1885,"context_line":""},{"line_number":1886,"context_line":"    def _add_image_as_iterable(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAGn%2F%2F%2BdY%3D","line":1883,"updated":"2012-04-24 09:35:22.000000000","message":"Should this test be skipped if sendfile is supported?\n\ni.e.\n\n  @test_utils.skip_if(base_client.SENDFILE_SUPPORTED, \u0027sendfile supported\u0027)","commit_id":"59e8cfa87c1fdf6a7edf418afeb0828af6694108"},{"author":{"_account_id":1395,"name":"Mike Lundy","email":"mike@fluffypenguin.org","username":"novas0x2a"},"change_message_id":"0654a1e7836acdfbcb8ba75d455d761c3f8b27f3","unresolved":false,"context_lines":[{"line_number":1880,"context_line":"    def test_add_image_with_image_data_as_file_with_sendfile(self):"},{"line_number":1881,"context_line":"        self.add_image_with_image_data_as_file(sendfile\u003dTrue)"},{"line_number":1882,"context_line":""},{"line_number":1883,"context_line":"    def test_add_image_with_image_data_as_file_without_sendfile(self):"},{"line_number":1884,"context_line":"        self.add_image_with_image_data_as_file(sendfile\u003dFalse)"},{"line_number":1885,"context_line":""},{"line_number":1886,"context_line":"    def _add_image_as_iterable(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAGn%2F%2F%2Bcw%3D","line":1883,"in_reply_to":"AAAAGn%2F%2F%2BdY%3D","updated":"2012-04-24 10:37:44.000000000","message":"No, test coverage should depend as little as possible on the machine it\u0027s running on; chunked encoding should work everywhere, so might as well make it tested everywhere. (Since basically every sane system has sendfile, skipping it would return to the no-one-tests-chunked-encoding situation).\n\nThe only reason the other case is skipped (since sendfile is mocked out anyway) is to call attention to the fact that the sendfile code path wasn\u0027t testable on the machine it ran on. It would be better if sendfile were not mocked at all, though, since that code path isn\u0027t really fully tested even on sendfile-present systems.","commit_id":"59e8cfa87c1fdf6a7edf418afeb0828af6694108"}]}
