tatsuhiro-t / spdylay

The experimental SPDY protocol version 2, 3 and 3.1 implementation in C
http://tatsuhiro-t.github.io/spdylay/
MIT License
603 stars 102 forks source link

Sending GOAWAY in on_stream_close_callback causes double free #47

Closed ChristopherRogers closed 11 years ago

ChristopherRogers commented 11 years ago

Due to the placement of the on_stream_close_callback() call in spdylay_session_close_stream, you can call GOAWAY inside of this handler and have the same method be called again, causing the stream data to be freed twice.

tatsuhiro-t commented 11 years ago

Do you call spdylay_submit_goaway() + spdylay_session_send() in the callback? Then, yes, it will cause memory error. Basically, spdylay_session_send and/or spdylay_session_recv must not be called from spdylay callbacks. I'll add this note in manual.

tatsuhiro-t commented 11 years ago

Documentation complete, so I close this issue.