[xiph-commits] r9453 - icecast/trunk/httpp

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Tue Jun 14 19:32:28 PDT 2005


Author: karl
Date: 2005-06-14 19:32:26 -0700 (Tue, 14 Jun 2005)
New Revision: 9453

Modified:
   icecast/trunk/httpp/httpp.c
   icecast/trunk/httpp/httpp.h
Log:
store the original full uri if there are query parameters. small cleanup to
prototype definitions


Modified: icecast/trunk/httpp/httpp.c
===================================================================
--- icecast/trunk/httpp/httpp.c	2005-06-15 02:13:43 UTC (rev 9452)
+++ icecast/trunk/httpp/httpp.c	2005-06-15 02:32:26 UTC (rev 9453)
@@ -357,6 +357,7 @@
     if (uri != NULL && strlen(uri) > 0) {
         char *query;
         if((query = strchr(uri, '?')) != NULL) {
+            httpp_setvar(parser, HTTPP_VAR_RAWURI, uri);
             *query = 0;
             query++;
             parse_query(parser, query);
@@ -424,7 +425,7 @@
     return 1;
 }
 
-void httpp_setvar(http_parser_t *parser, char *name, char *value)
+void httpp_setvar(http_parser_t *parser, const char *name, const char *value)
 {
     http_var_t *var;
 
@@ -445,7 +446,7 @@
     }
 }
 
-char *httpp_getvar(http_parser_t *parser, char *name)
+char *httpp_getvar(http_parser_t *parser, const char *name)
 {
     http_var_t var;
     http_var_t *found;
@@ -455,7 +456,7 @@
         return NULL;
 
     fp = &found;
-    var.name = name;
+    var.name = (char*)name;
     var.value = NULL;
 
     if (avl_get_by_key(parser->vars, &var, fp) == 0)

Modified: icecast/trunk/httpp/httpp.h
===================================================================
--- icecast/trunk/httpp/httpp.h	2005-06-15 02:13:43 UTC (rev 9452)
+++ icecast/trunk/httpp/httpp.h	2005-06-15 02:32:26 UTC (rev 9453)
@@ -14,6 +14,7 @@
 #define HTTPP_VAR_PROTOCOL "__protocol"
 #define HTTPP_VAR_VERSION "__version"
 #define HTTPP_VAR_URI "__uri"
+#define HTTPP_VAR_RAWURI "__rawuri"
 #define HTTPP_VAR_REQ_TYPE "__req_type"
 #define HTTPP_VAR_ERROR_MESSAGE "__errormessage"
 #define HTTPP_VAR_ERROR_CODE "__errorcode"
@@ -60,8 +61,8 @@
 int httpp_parse(http_parser_t *parser, char *http_data, unsigned long len);
 int httpp_parse_icy(http_parser_t *parser, char *http_data, unsigned long len);
 int httpp_parse_response(http_parser_t *parser, char *http_data, unsigned long len, char *uri);
-void httpp_setvar(http_parser_t *parser, char *name, char *value);
-char *httpp_getvar(http_parser_t *parser, char *name);
+void httpp_setvar(http_parser_t *parser, const char *name, const char *value);
+char *httpp_getvar(http_parser_t *parser, const char *name);
 void httpp_set_query_param(http_parser_t *parser, char *name, char *value);
 char *httpp_get_query_param(http_parser_t *parser, char *name);
 void httpp_destroy(http_parser_t *parser);



More information about the commits mailing list