Close and de-reference the current request and response. (Core)
(self)
| 277 | return next(self.iter_response) |
| 278 | |
| 279 | def close(self): |
| 280 | """Close and de-reference the current request and response. |
| 281 | |
| 282 | (Core) |
| 283 | """ |
| 284 | streaming = _cherrypy.serving.response.stream |
| 285 | self.cpapp.release_serving() |
| 286 | |
| 287 | # We avoid the expense of examining the iterator to see if it's |
| 288 | # closable unless we are streaming the response, as that's the |
| 289 | # only situation where we are going to have an iterator which |
| 290 | # may not have been exhausted yet. |
| 291 | if streaming and is_closable_iterator(self.iter_response): |
| 292 | iter_close = self.iter_response.close |
| 293 | try: |
| 294 | iter_close() |
| 295 | except Exception: |
| 296 | _cherrypy.log(traceback=True, severity=40) |
| 297 | |
| 298 | def run(self): |
| 299 | """Create a Request object using environ.""" |
no test coverage detected