about summary refs log tree commit homepage
path: root/ext
diff options
context:
space:
mode:
authorzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-28 15:37:54 +0000
committerzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-28 15:37:54 +0000
commit61d63bb0b7111af0093c6b3492241cfd419f55c2 (patch)
tree90c93fe91c5f261de30c8a5aabcec5ce07b7bf35 /ext
parentacd63226fe8481feee1271b26a16baca56d05331 (diff)
downloadunicorn-61d63bb0b7111af0093c6b3492241cfd419f55c2.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@129 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'ext')
-rw-r--r--ext/http11/http11.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/http11/http11.c b/ext/http11/http11.c
index 1abec65..7062a02 100644
--- a/ext/http11/http11.c
+++ b/ext/http11/http11.c
@@ -31,7 +31,7 @@ static VALUE global_server_protocol_value;
 static VALUE global_http_host;
 static VALUE global_mongrel_version;
 static VALUE global_server_software;
-
+static VALUE global_port_80;
 
 void http_field(void *data, const char *field, size_t flen, const char *value, size_t vlen)
 {
@@ -104,9 +104,12 @@ void header_done(void *data, const char *at, size_t length)
       rb_hash_aset(req, global_server_port,
                    rb_str_substr(temp, colon - RSTRING(temp)->ptr+1,
                                  RSTRING(temp)->len));
+    } else {
+      rb_hash_aset(req, global_server_name, temp);
+      rb_hash_aset(req, global_server_port, global_port_80);
     }
   }
-
+  
   rb_hash_aset(req, global_server_protocol, global_server_protocol_value);
   rb_hash_aset(req, global_server_software, global_mongrel_version);
 }
@@ -476,7 +479,7 @@ void Init_http11()
   DEF_GLOBAL(http_host, "HTTP_HOST");
   DEF_GLOBAL(mongrel_version, "Mongrel 0.3.12");
   DEF_GLOBAL(server_software, "SERVER_SOFTWARE");
-
+  DEF_GLOBAL(port_80, "80");
 
   cHttpParser = rb_define_class_under(mMongrel, "HttpParser", rb_cObject);
   rb_define_alloc_func(cHttpParser, HttpParser_alloc);