[xiph-commits] r9221 - icecast/branches/kh/icecast/src

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Fri May 6 18:08:00 PDT 2005


Author: karl
Date: 2005-05-06 18:07:56 -0700 (Fri, 06 May 2005)
New Revision: 9221

Modified:
   icecast/branches/kh/icecast/src/connection.c
   icecast/branches/kh/icecast/src/stats.h
   icecast/branches/kh/icecast/src/util.c
   icecast/branches/kh/icecast/src/util.h
Log:
sync-up and cleanup from recent merge


Modified: icecast/branches/kh/icecast/src/connection.c
===================================================================
--- icecast/branches/kh/icecast/src/connection.c	2005-05-06 15:57:15 UTC (rev 9220)
+++ icecast/branches/kh/icecast/src/connection.c	2005-05-07 01:07:56 UTC (rev 9221)
@@ -818,7 +818,6 @@
     int http_compliant_len = 0;
     char header[4096];
     http_parser_t *parser;
-    client_t *client;
 
     memset(shoutcast_password, 0, sizeof (shoutcast_password));
     /* Step one of shoutcast auth protocol, read encoder password (1 line) */
@@ -861,26 +860,19 @@
             "SOURCE %s HTTP/1.0\r\n%s", mount, header);
     parser = httpp_create_parser();
     httpp_initialize(parser, NULL);
-    client = client_create (con, parser);
-    if (client == NULL)
+    if (httpp_parse(parser, http_compliant, strlen(http_compliant)))
     {
-        connection_close (con);
-        httpp_destroy (parser);
-        free (http_compliant);
-        return;
+        client_t *client = client_create (con, parser);
+        if (client)
+        {
+            _handle_source_request (client, mount, SHOUTCAST_SOURCE_AUTH);
+            free (http_compliant);
+            return;
+        }
     }
-    if (httpp_parse(parser, http_compliant, strlen(http_compliant))) {
-        _handle_source_request (client, mount, SHOUTCAST_SOURCE_AUTH);
-        free(http_compliant);
-        return;
-    }
-    else {
-        ERROR0("Invalid source request");
-        client_send_400 (client, "Invalid source request");
-        free (http_compliant);
-        return;
-    }
-    return;
+    connection_close (con);
+    httpp_destroy (parser);
+    free (http_compliant);
 }
 
 static void *_handle_connection(void *arg)

Modified: icecast/branches/kh/icecast/src/stats.h
===================================================================
--- icecast/branches/kh/icecast/src/stats.h	2005-05-06 15:57:15 UTC (rev 9220)
+++ icecast/branches/kh/icecast/src/stats.h	2005-05-07 01:07:56 UTC (rev 9221)
@@ -21,12 +21,6 @@
 #include <libxml/tree.h>
 
 
-typedef struct _stats_connection_tag
-{
-    connection_t *con;
-    http_parser_t *parser;
-} stats_connection_t;
-
 typedef struct _stats_node_tag
 {
     char *name;

Modified: icecast/branches/kh/icecast/src/util.c
===================================================================
--- icecast/branches/kh/icecast/src/util.c	2005-05-06 15:57:15 UTC (rev 9220)
+++ icecast/branches/kh/icecast/src/util.c	2005-05-07 01:07:56 UTC (rev 9221)
@@ -146,7 +146,7 @@
     return ret;
 }
 
-const char *util_get_extension(const char *path) {
+char *util_get_extension(const char *path) {
     char *ext = strrchr(path, '.');
 
     if(ext == NULL)

Modified: icecast/branches/kh/icecast/src/util.h
===================================================================
--- icecast/branches/kh/icecast/src/util.h	2005-05-06 15:57:15 UTC (rev 9220)
+++ icecast/branches/kh/icecast/src/util.h	2005-05-07 01:07:56 UTC (rev 9221)
@@ -22,7 +22,7 @@
 int util_timed_wait_for_fd(int fd, int timeout);
 int util_read_header(int sock, char *buff, unsigned long len, int entire);
 int util_check_valid_extension(char *uri);
-const char *util_get_extension(const char *path);
+char *util_get_extension(const char *path);
 char *util_get_path_from_uri(char *uri);
 char *util_get_path_from_normalised_uri(const char *uri);
 char *util_normalise_uri(char *uri);



More information about the commits mailing list