From 1d9ebac036193cedd61a11ccdde3f1ba24eee856 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 6 Jan 2010 19:03:32 -0800 Subject: [PATCH] Revert "Add method -> string lookup" This reverts commit b795f946860f7f38c089bd3efd2f2a131751a61e. (I don't like this feature, and I'm not using it.) --- http_parser.h | 22 ---------------------- test.c | 3 --- 2 files changed, 25 deletions(-) diff --git a/http_parser.h b/http_parser.h index ccc4f52..5855e89 100644 --- a/http_parser.h +++ b/http_parser.h @@ -135,28 +135,6 @@ size_t http_parse_responses(http_parser *parser, const char *data, size_t len); */ int http_should_keep_alive(http_parser *parser); -static inline const char * http_method_str (enum http_method method) -{ - switch (method) { - case HTTP_DELETE: return "DELETE"; - case HTTP_GET: return "GET"; - case HTTP_HEAD: return "HEAD"; - case HTTP_POST: return "POST"; - case HTTP_PUT: return "PUT"; - case HTTP_CONNECT: return "CONNECT"; - case HTTP_OPTIONS: return "OPTIONS"; - case HTTP_TRACE: return "TRACE"; - case HTTP_COPY: return "COPY"; - case HTTP_LOCK: return "LOCK"; - case HTTP_MKCOL: return "MKCOL"; - case HTTP_MOVE: return "MOVE"; - case HTTP_PROPFIND: return "PROPFIND"; - case HTTP_PROPPATCH: return "PROPPATCH"; - case HTTP_UNLOCK: return "UNLOCK"; - default: return (const char*)0; - } -} - #ifdef __cplusplus } #endif diff --git a/test.c b/test.c index 96e1849..6fdc372 100644 --- a/test.c +++ b/test.c @@ -1049,9 +1049,6 @@ main (void) printf("sizeof(http_parser) = %d\n", sizeof(http_parser)); - assert(strcmp(http_method_str(HTTP_GET), "GET") == 0); - assert(strcmp(http_method_str(HTTP_CONNECT), "CONNECT") == 0); - for (request_count = 0; requests[request_count].name; request_count++); for (response_count = 0; responses[response_count].name; response_count++);