1238
1238
self._write_protocol_version()
1239
1239
self._write_headers(self._headers)
1240
1240
self._write_structure(args)
1241
self._write_chunked_body_start()
1242
# XXX: handle errors while iterating the body stream
1243
# XXX: notice if the server has sent an early error reply before we
1244
# have finished sending the stream. We would notice at the end
1245
# anyway, but if the medium can deliver it early then it's good to
1246
# short-circuit the whole request...
1248
self._write_prefixed_body(part)
1250
self._write_success_status()
1241
# TODO: notice if the server has sent an early error reply before we
1242
# have finished sending the stream. We would notice at the end
1243
# anyway, but if the medium can deliver it early then it's good
1244
# to short-circuit the whole request...
1247
self._write_prefixed_body(part)
1250
# Iterating the stream failed. Cleanly abort the request.
1251
self._write_error_status()
1252
# Currently the client unconditionally sends ('error',) as the
1254
self._write_structure(('error',))
1251
1255
self._write_end()
1252
1256
self._medium_request.finished_writing()