| 316 | return True |
| 317 | |
| 318 | def start_response(self, status, headers, exc_info=None): |
| 319 | if exc_info: |
| 320 | try: |
| 321 | if self.status and self.headers_sent: |
| 322 | util.reraise(exc_info[0], exc_info[1], exc_info[2]) |
| 323 | finally: |
| 324 | exc_info = None |
| 325 | elif self.status is not None: |
| 326 | raise AssertionError("Response headers already set!") |
| 327 | |
| 328 | self.status = status |
| 329 | |
| 330 | # get the status code from the response here so we can use it to check |
| 331 | # the need for the connection header later without parsing the string |
| 332 | # each time. |
| 333 | try: |
| 334 | self.status_code = int(self.status.split()[0]) |
| 335 | except ValueError: |
| 336 | self.status_code = None |
| 337 | |
| 338 | self.process_headers(headers) |
| 339 | self.chunked = self.is_chunked() |
| 340 | return self.write |
| 341 | |
| 342 | def process_headers(self, headers): |
| 343 | for name, value in headers: |