Changeset 94481 in webkit


Ignore:
Timestamp:
Sep 3, 2011 12:29:34 AM (13 years ago)
Author:
rniwa@webkit.org
Message:

Unreviewed, rolling out r94453.
http://trac.webkit.org/changeset/94453
https://bugs.webkit.org/show_bug.cgi?id=67557

Caused appcache test to fail on various bots (Requested by
rniwa on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-09-03

  • Scripts/webkitpy/layout_tests/port/webkit.py:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r94470 r94481  
     12011-09-03  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r94453.
     4        http://trac.webkit.org/changeset/94453
     5        https://bugs.webkit.org/show_bug.cgi?id=67557
     6
     7        Caused appcache test to fail on various bots (Requested by
     8        rniwa on #webkit).
     9
     10        * Scripts/webkitpy/layout_tests/port/webkit.py:
     11
    1122011-09-02  Michael Saboff  <msaboff@apple.com>
    213
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py

    r94458 r94481  
    510510            timeout=self._server_process.timed_out, error=error)
    511511
    512     LENGTH_HEADER = 'Content-Length: '
    513     HASH_HEADER = 'ActualHash: '
    514     TYPE_HEADER = 'Content-Type: '
    515     ENCODING_HEADER = 'Content-Transfer-Encoding: '
    516 
    517     def _read_line_until(self, deadline):
    518         return self._server_process.read_line(deadline - time.time())
    519 
    520512    def _read_block(self, deadline):
     513        LENGTH_HEADER = 'Content-Length: '
     514        HASH_HEADER = 'ActualHash: '
     515        TYPE_HEADER = 'Content-Type: '
     516        ENCODING_HEADER = 'Content-Transfer-Encoding: '
    521517        content_type = None
    522518        encoding = None
     
    525521
    526522        # Content is treated as binary data even though the text output is usually UTF-8.
    527         content = str()  # FIXME: Should be bytearray() once we require Python 2.6.
    528         line = self._read_line_until(deadline - time.time())
     523        content = ''
     524        timeout = deadline - time.time()
     525        line = self._server_process.read_line(timeout)
    529526        eof = False
    530527        while (not self._server_process.timed_out and not self.detected_crash() and not eof):
    531             chomped_line = line.rstrip()  # FIXME: This will remove trailing lines from test output.  Is that right?
     528            chomped_line = line.rstrip()
    532529            if chomped_line.endswith("#EOF"):
    533530                eof = True
     
    536533            if line.startswith(self.TYPE_HEADER) and content_type is None:
    537534                content_type = line.split()[1]
    538             elif line.startswith(self.ENCODING_HEADER) and encoding is None:
     535            elif line.startswith(ENCODING_HEADER) and encoding is None:
    539536                encoding = line.split()[1]
    540             elif line.startswith(self.LENGTH_HEADER) and content_length is None:
    541                 content_length = int(line[len(self.LENGTH_HEADER):])
    542                 # FIXME: In real HTTP there should probably be a blank line
    543                 # after headers before content, but DRT doesn't write one.
    544                 content = self._server_process.read(deadline - time.time(), content_length)
    545             elif line.startswith(self.HASH_HEADER):
     537            elif line.startswith(LENGTH_HEADER) and content_length is None:
     538                timeout = deadline - time.time()
     539                content_length = int(line[len(LENGTH_HEADER):])
     540                # FIXME: Technically there should probably be another blank
     541                # line here, but DRT doesn't write one.
     542                content = self._server_process.read(timeout, content_length)
     543            elif line.startswith(HASH_HEADER):
    546544                content_hash = line.split()[1]
    547545            elif line:
    548546                content += line
    549             if eof:
    550                 break
    551             line = self._read_line_until(deadline)
     547            if not eof:
     548                line = self._server_process.read_line(timeout)
     549                timeout = deadline - time.time()
    552550        return ContentBlock(content_type, encoding, content_hash, content)
    553551
Note: See TracChangeset for help on using the changeset viewer.