about summary refs log tree commit homepage
path: root/ext/unicorn_http/global_variables.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-05-05 16:42:26 -0700
committerEric Wong <normalperson@yhbt.net>2011-05-05 16:42:26 -0700
commit77a951c5da518dda471282635c98f3b572ca15db (patch)
tree7e87f472c615c6e5522d5a5efc79fe4c5cb7bd18 /ext/unicorn_http/global_variables.h
parent733cb68e444a6f324bb1ffda3839da98ef010c74 (diff)
downloadunicorn-77a951c5da518dda471282635c98f3b572ca15db.tar.gz
Rainbows! wants to be able to lower this eventually...
Diffstat (limited to 'ext/unicorn_http/global_variables.h')
-rw-r--r--ext/unicorn_http/global_variables.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/unicorn_http/global_variables.h b/ext/unicorn_http/global_variables.h
index cda7f24..aa0d777 100644
--- a/ext/unicorn_http/global_variables.h
+++ b/ext/unicorn_http/global_variables.h
@@ -1,7 +1,8 @@
 #ifndef global_variables_h
 #define global_variables_h
 static VALUE eHttpParserError;
-static VALUE eRequestURITooLongError;
+static VALUE e413;
+static VALUE e414;
 
 static VALUE g_rack_url_scheme;
 static VALUE g_request_method;
@@ -36,8 +37,7 @@ static VALUE g_http_11;
   static const char * const MAX_##N##_LENGTH_ERR = \
     "HTTP element " # N  " is longer than the " # length " allowed length."
 
-NORETURN(static void parser_error(const char *));
-NORETURN(static void raise_414(const char *));
+NORETURN(static void parser_raise(VALUE klass, const char *));
 
 /**
  * Validates the max length of given input and throws an HttpParserError
@@ -45,12 +45,12 @@ NORETURN(static void raise_414(const char *));
  */
 #define VALIDATE_MAX_LENGTH(len, N) do { \
   if (len > MAX_##N##_LENGTH) \
-    parser_error(MAX_##N##_LENGTH_ERR); \
+    parser_raise(eHttpParserError, MAX_##N##_LENGTH_ERR); \
 } while (0)
 
 #define VALIDATE_MAX_URI_LENGTH(len, N) do { \
   if (len > MAX_##N##_LENGTH) \
-    raise_414(MAX_##N##_LENGTH_ERR); \
+    parser_raise(e414, MAX_##N##_LENGTH_ERR); \
 } while (0)
 
 /** Defines global strings in the init method. */
@@ -66,7 +66,6 @@ DEF_MAX_LENGTH(REQUEST_URI, 1024 * 12);
 DEF_MAX_LENGTH(FRAGMENT, 1024); /* Don't know if this length is specified somewhere or not */
 DEF_MAX_LENGTH(REQUEST_PATH, 1024);
 DEF_MAX_LENGTH(QUERY_STRING, (1024 * 10));
-DEF_MAX_LENGTH(HEADER, (1024 * (80 + 32)));
 
 static void init_globals(void)
 {