cccd (0.3beta4-6.2) cddbp.c

Summary

 cddbp.c |   33 ++++++++++++---------------------
 1 file changed, 12 insertions(+), 21 deletions(-)

    
download this patch

Patch contents

--- cccd-0.3beta4.orig/cddbp.c
+++ cccd-0.3beta4/cddbp.c
@@ -54,11 +54,9 @@
 
   /* Greetings! */
 #ifdef DEBUG
-  printf("=> cddb hello %s %s %s %s\n",
-	 getenv("USER"), getenv("HOSTNAME"), clientname, version);
+  printf("=> cddb hello unknown localhost %s %s\n", clientname, version);
 #endif
-  fprintf(socket, "cddb hello %s %s %s %s\n",
-	  getenv("USER"), getenv("HOSTNAME"), clientname, version);
+  fprintf(socket, "cddb hello unknown localhost %s %s\n", clientname, version);
 
   buffer = get_string_piece(socket, '\n');
 #ifdef DEBUG
@@ -74,7 +72,7 @@
 
 
 int cddbp_query(FILE * socket, const char *disk_id, int tracknum,
-		long int offset[tracknum], int duration, int *matches,
+		long int offset[], int duration, int *matches,
 		char ***category_buffer, char ***title_buffer,
 		char ***id_buffer)
 {
@@ -169,7 +167,7 @@
 {
   char *buffer;
   int code;
-/* int i; /* debugging aid */
+/* int i; */ /* debugging aid */
 
 #ifdef DEBUG
   printf("=> cddb read %s %s\n", category, disk_id);
@@ -195,7 +193,7 @@
     buffer = get_string_piece(socket, '\n');
 #ifdef DEBUG
     printf("<= %s", buffer);
-/* for (i=0; buffer[i] != '\0'; i++) printf("%x ",buffer[i]); /* we want hex */
+/* for (i=0; buffer[i] != '\0'; i++) printf("%x ",buffer[i]); */ /* we want hex */
 #endif
     string_append(result_buffer, buffer);
     free(buffer);
@@ -249,7 +247,7 @@
 
 
 int http_query(const char *server, int port, const char *URL,
-	       const char *cd_id, int tracknum, long int offset[tracknum],
+	       const char *cd_id, int tracknum, long int offset[],
 	       int duration, int *matches,
 	       char ***category_buffer, char ***title_buffer,
 	       char ***id_buffer, const char *client, const char *version)
@@ -266,8 +264,8 @@
     strcpy(tmp, "");
   }
 
-  sprintf(tmp, "+%d&hello=%s+%s+%s+%s&proto=1 HTTP/1.0\r\n\r\n", duration,
-	  getenv("USER"), getenv("HOST"), client, version);
+  sprintf(tmp, "+%d&hello=unknown+localhost+%s+%s&proto=1 HTTP/1.0\r\n\r\n",
+          duration, client, version);
   strcat(buffer, tmp);
   free(tmp);
 
@@ -358,16 +356,11 @@
   FILE *sock;
 
 #ifdef DEBUG
-  printf("=> GET /%s?cmd=cddb+read+%s+%s&hello=%s+%s+%s+%s&proto=1 HTTP/1.0\r\n\r\n",
-	 URL, category, disk_id, getenv("USER"), getenv("HOST"), client,
-	 version);
+  printf("=> GET /%s?cmd=cddb+read+%s+%s&hello=unknown+localhost+%s+%s&proto=1 HTTP/1.0\r\n\r\n", URL, category, disk_id, client, version);
 #endif
 
   sock = socket_init(server, port);
-  fprintf(sock,
-   "GET /%s?cmd=cddb+read+%s+%s&hello=%s+%s+%s+%s&proto=1 HTTP/1.0\r\n\r\n",
-	  URL, category, disk_id, getenv("USER"), getenv("HOST"), client,
-	  version);
+  fprintf(sock, "GET /%s?cmd=cddb+read+%s+%s&hello=unknown+localhost+%s+%s&proto=1 HTTP/1.0\r\n\r\n", URL, category, disk_id, client, version);
 
   buffer = get_ascii_file(sock);
 #ifdef DEBUG
@@ -409,13 +402,11 @@
   FILE *sock;
 
 #ifdef DEBUG
-  printf("=> GET /%s?cmd=stat&hello=%s+%s+%s+%s&proto=1 HTTP/1.0\r\n\r\n",
-	 URL, getenv("USER"), getenv("HOST"), client, version);
+  printf("=> GET /%s?cmd=stat&hello=unknown+localhost+%s+%s&proto=1 HTTP/1.0\r\n\r\n", URL, client, version);
 #endif
 
   sock = socket_init(server, port);
-  fprintf(sock, "GET /%s?cmd=stat&hello=%s+%s+%s+%s&proto=1 HTTP/1.0\r\n\r\n",
-	  URL, getenv("USER"), getenv("HOST"), client, version);
+  fprintf(sock, "GET /%s?cmd=stat&hello=unknown+localhost+%s+%s&proto=1 HTTP/1.0\r\n\r\n", URL, client, version);
 
   buffer = get_ascii_file(sock);
 #ifdef DEBUG