The current code we use for HTTP edge receptor reveals a synchronization problem:
The loop ends with a call to CLOSE_STREAM, which can end up shutting down the stream before the response from the other thread gets sent. This shows up with the system throwing a "bad stream type" error because the stream gets deallocated and pointer to bogus memory.
This means we have to do two things:
[ ] add some way to do reference counting on stream objects so that we don't get reads on deallocated memory
[ ] re-write the HTTP edge receptor code to synchronize properly on only close the stream when everything is really done.
The current code we use for HTTP edge receptor reveals a synchronization problem:
The loop ends with a call to CLOSE_STREAM, which can end up shutting down the stream before the response from the other thread gets sent. This shows up with the system throwing a "bad stream type" error because the stream gets deallocated and pointer to bogus memory.
This means we have to do two things: