The implementation of nsSocketTransport::OpenInputStream and OpenOutputStream should be revised to not involve the socket transport thread. It is completely unnecessary. OpenInputStream should return an nsIInputStream implementation that when Read calls PR_Read on the socket file descriptor directly, and likewise for OpenOutputStream. There is no advantage to the current worker- thread-in-conjunction-with-a-pipe scheme, so it should go away. This is a trivial change that will significantly reduce the complexity of nsSocketTransport.cpp. It is also a necessary step toward providing "true" synchronous channel i/o throughout necko.
This was fixed when dougt's branch landed.