[xiph-cvs] cvs commit: httpp httpp.c

Jack Moffitt jack at xiph.org
Sat Oct 20 00:40:10 PDT 2001



jack        01/10/20 00:40:10

  Modified:    src      connection.c
               .        httpp.c
  Log:
  Thanks to Akos Maroy <darkeye at tyrell.hu> 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.

Revision  Changes    Path
1.3       +1 -1      icecast/src/connection.c

Index: connection.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/connection.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- connection.c	2001/10/20 06:43:04	1.2
+++ connection.c	2001/10/20 07:40:09	1.3
@@ -326,7 +326,7 @@
                 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);

1.3       +7 -7      httpp/httpp.c

Index: httpp.c
===================================================================
RCS file: /usr/local/cvsroot/httpp/httpp.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- httpp.c	2001/10/20 04:41:54	1.2
+++ httpp.c	2001/10/20 07:40:09	1.3
@@ -147,7 +147,7 @@
         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 @@
         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;

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list