MCPcopy
hub / github.com/pyload/pyload / writeHeader

Method writeHeader

module/network/HTTPChunk.py:209–223  ·  view source on GitHub ↗
(self, buf)

Source from the content-addressed store, hash-verified

207 return self.c
208
209 def writeHeader(self, buf):
210 self.header += buf
211 # @TODO forward headers?, this is possibly unneeeded, when we just parse valid 200 headers
212 # as first chunk, we will parse the headers
213 if not self.range and self.header.endswith("\r\n\r\n"):
214 self.parseHeader()
215 elif not self.range and buf.startswith("150") and "data connection" in buf: # ftp file size parsing
216 size = re.search(r'(\d+) bytes', buf)
217 if size:
218 self.p.size = int(size.group(1))
219 self.p.chunkSupport = True
220
221 self.headerParsed = True
222
223 return None #:All is fine
224
225 def writeBody(self, buf):
226 #:Ignore BOM, it confuses unrar

Callers

nothing calls this directly

Calls 2

parseHeaderMethod · 0.95
searchMethod · 0.45

Tested by

no test coverage detected