Changeset 324 for py-tcpmultiplexer
- Timestamp:
- Jul 19, 2011, 10:22:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
py-tcpmultiplexer/TCPMultiplexer.py
r323 r324 135 135 dataheader[urlid] = f.read(44) 136 136 elif datatype == 'mjpeg': 137 data = f.read(1024 * 1024)138 139 # Get the required headers 137 data = f.read(1024) 138 139 # Get the required headers and acurate datasize 140 140 headers = [] 141 datasize = 1024 * 1024 141 142 for header in data.splitlines(): 142 143 if not header.strip(): … … 146 147 else: 147 148 continue 149 if header.startswith('DataLen:') or header.startswith('Content-length:'): 150 datasize = int(header.split(':')[1]) 148 151 headers.append(header) 149 152 boundry = headers[0] 153 154 logger.info("Data Length: %s", datasize) 150 155 logger.info("Boundry line: %s", boundry) 151 156 logger.info("Image headers %s", headers) 152 157 158 data = data + f.read(datasize * 2) 153 159 valid_image = boundry + data.split(boundry)[1] 154 160 dataheader[urlid] = valid_image + '\n'.join(headers) + '\n'
Note:
See TracChangeset
for help on using the changeset viewer.