222 broke writing LastHttpContent with a void promise, because it adds a listener to the promise.
Modification:
Unvoid the write promise if necessary, so that the SHUTDOWN_OUTPUT listener can be added safely. Since the write method is becoming a bit messy, I also added a (hopefully) exhaustive test for it, for all the different branches.
Result:
Writing with a void promise does not fail anymore.
Motivation:
222 broke writing LastHttpContent with a void promise, because it adds a listener to the promise.
Modification:
Unvoid the write promise if necessary, so that the SHUTDOWN_OUTPUT listener can be added safely. Since the write method is becoming a bit messy, I also added a (hopefully) exhaustive test for it, for all the different branches.
Result:
Writing with a void promise does not fail anymore.