diff options
author | Ben Pfaff <blp@nicira.com> | 2010-01-06 14:20:19 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-01-06 14:20:19 -0800 |
commit | e0668bd1d448d6f17c20b9c7ba91344180809061 (patch) | |
tree | a70b637ed57ae4e63e2500f1faae5412a9a25747 /lib/stream.c | |
parent | 84ee7bcfdeed0abe9306e6375934b224b527f1d3 (diff) |
Check invariants earlier in vconn and stream code.
These invariants are checked by vconn_open() and stream_open(), but there
is no reason not to check them earlier also. vconn and stream creation
don't have to go through vconn_open() and stream_open(), so this ensures
that the invariants get checked either way.
Diffstat (limited to 'lib/stream.c')
-rw-r--r-- | lib/stream.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/stream.c b/lib/stream.c index 23b25f22..337fb5c7 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -476,6 +476,7 @@ stream_init(struct stream *stream, struct stream_class *class, : SCS_DISCONNECTED); stream->error = connect_status; stream->name = xstrdup(name); + assert(stream->state != SCS_CONNECTING || class->connect); } void |