From 3553fce60408e3a2d95c1461b515f07822798ad0 Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Sat, 20 Oct 2001 07:40:09 +0000 Subject: [PATCH] Thanks to Akos Maroy for this. These variables need to be uppercase always in order to comply with the HTTP specification. While not a problem internal to icecast, they were slipping into the log files and breaking some less-than-robust parsers. svn path=/trunk/httpp/; revision=2197 --- src/connection.c | 2 +- src/httpp/httpp.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/connection.c b/src/connection.c index df77bde6..8cb19672 100644 --- a/src/connection.c +++ b/src/connection.c @@ -326,7 +326,7 @@ static void *_handle_connection(void *arg) if (httpp_parse(parser, header, strlen(header))) { /* handle the connection or something */ - if (strcmp("ice", httpp_getvar(parser, HTTPP_VAR_PROTOCOL)) != 0 && strcmp("http", httpp_getvar(parser, HTTPP_VAR_PROTOCOL)) != 0) { + if (strcmp("ICE", httpp_getvar(parser, HTTPP_VAR_PROTOCOL)) != 0 && strcmp("HTTP", httpp_getvar(parser, HTTPP_VAR_PROTOCOL)) != 0) { printf("DEBUG: bad protocol\n"); connection_close(con); httpp_destroy(parser); diff --git a/src/httpp/httpp.c b/src/httpp/httpp.c index 3c588ef7..16db57e5 100644 --- a/src/httpp/httpp.c +++ b/src/httpp/httpp.c @@ -147,7 +147,7 @@ int httpp_parse(http_parser_t *parser, char *http_data, unsigned long len) if ((version != NULL) && ((tmp = strchr(version, '/')) != NULL)) { tmp[0] = '\0'; if ((strlen(version) > 0) && (strlen(&tmp[1]) > 0)) { - httpp_setvar(parser, HTTPP_VAR_PROTOCOL, _lowercase(version)); + httpp_setvar(parser, HTTPP_VAR_PROTOCOL, version); httpp_setvar(parser, HTTPP_VAR_VERSION, &tmp[1]); } else { free(data); @@ -161,22 +161,22 @@ int httpp_parse(http_parser_t *parser, char *http_data, unsigned long len) if (parser->req_type != httpp_req_none && parser->req_type != httpp_req_unknown) { switch (parser->req_type) { case httpp_req_get: - httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "get"); + httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "GET"); break; case httpp_req_post: - httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "post"); + httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "POST"); break; case httpp_req_head: - httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "head"); + httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "HEAD"); break; case httpp_req_source: - httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "source"); + httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "SOURCE"); break; case httpp_req_play: - httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "play"); + httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "PLAY"); break; case httpp_req_stats: - httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "stats"); + httpp_setvar(parser, HTTPP_VAR_REQ_TYPE, "STATS"); break; default: break;