diff options
| author | 2011-01-08 15:06:23 +0100 | |
|---|---|---|
| committer | 2011-01-08 15:06:23 +0100 | |
| commit | 8f27d644fadcb8beb3dcd65c4a04073fa40fcdd2 (patch) | |
| tree | 47a4752c11811c2166350c032da3d18fa6d7d2ae /module/network | |
| parent | new buttons to (remove finished/restart failed) links (diff) | |
| download | pyload-8f27d644fadcb8beb3dcd65c4a04073fa40fcdd2.tar.xz | |
added check to remove byte order mark (fixes fileserv)
Diffstat (limited to 'module/network')
| -rw-r--r-- | module/network/HTTPChunk.py | 11 | 
1 files changed, 11 insertions, 0 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py index 1cc9841a6..07012d072 100644 --- a/module/network/HTTPChunk.py +++ b/module/network/HTTPChunk.py @@ -128,6 +128,9 @@ class HTTPChunk(HTTPRequest):          self.initHandle()          self.setInterface(self.p.interface, self.p.proxies) +        self.BOMChecked = False +        # check and remove byte order mark +      @property      def cj(self):          return self.p.cj @@ -174,6 +177,14 @@ class HTTPChunk(HTTPRequest):          self.headerParsed = True      def writeBody(self, buf): + +        #ignore BOM, it confuses unrar +        if not self.BOMChecked: +            byte = bytearray(buf[:3]) +            if tuple(byte) == (239,187,191): +                buf = buf[3:] +            self.BOMChecked = True +          size = len(buf)          self.arrived += size  | 
