Added state and flags to spdylay_stream

This commit is contained in:
Tatsuhiro Tsujikawa 2012-01-24 23:18:50 +09:00
parent 5ececcd8e7
commit fa549aa3a7
2 changed files with 10 additions and 0 deletions

View File

@ -27,6 +27,7 @@
void spdylay_stream_init(spdylay_stream *stream, int32_t stream_id) void spdylay_stream_init(spdylay_stream *stream, int32_t stream_id)
{ {
stream->stream_id = stream_id; stream->stream_id = stream_id;
stream->state = SPDYLAY_STREAM_OPENING;
} }
void spdylay_stream_free(spdylay_stream *stream) void spdylay_stream_free(spdylay_stream *stream)

View File

@ -31,8 +31,17 @@
#include <spdylay/spdylay.h> #include <spdylay/spdylay.h>
typedef enum {
SPDYLAY_STREAM_OPENING,
SPDYLAY_STREAM_OPENED,
SPDYLAY_STREAM_CLOSING
} spdylay_stream_state;
typedef struct { typedef struct {
int32_t stream_id; int32_t stream_id;
spdylay_stream_state state;
/* Use same value in frame */
uint8_t flags;
} spdylay_stream; } spdylay_stream;
void spdylay_stream_init(spdylay_stream *stream, int32_t stream_id); void spdylay_stream_init(spdylay_stream *stream, int32_t stream_id);