From 56c31ac07e737eb0566c21f08612c04371eb9e68 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 6 Sep 2009 14:29:51 -0700 Subject: http: use explicit elses for readability This should make code easier to read and follow. --- ext/unicorn_http/unicorn_http.rl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext') diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl index 07a9881..99f0ff6 100644 --- a/ext/unicorn_http/unicorn_http.rl +++ b/ext/unicorn_http/unicorn_http.rl @@ -188,6 +188,8 @@ static void write_value(VALUE req, struct http_parser *hp, } else if (f == g_http_trailer) { HP_FL_SET(hp, HASTRAILER); hp_invalid_if_trailer(hp); + } else { + assert(OBJ_FROZEN(f) && "unfrozen object returned"); } e = rb_hash_aref(req, f); @@ -391,6 +393,8 @@ static void finalize_header(struct http_parser *hp, VALUE req) rb_hash_aset(req, g_rack_url_scheme, temp); } else if (STR_CSTR_EQ(temp, "https")) { server_port = g_port_443; + } else { + assert(server_port == g_port_80 && "server_port not set"); } /* parse and set the SERVER_NAME and SERVER_PORT variables */ -- cgit v1.2.3-24-ge0c7