[svn r279] Removed some useless debug messages trunk
authormelunko
Fri Jan 19 13:09:21 2007 +0000 (2007-01-19)
branchtrunk
changeset 278a24bacc8d752
parent 277 890b023c759f
child 279 5a224299ab37
[svn r279] Removed some useless debug messages
gmyth/src/gmyth_livetv.c
gmyth/src/gmyth_remote_util.c
gmyth/src/gmyth_socket.c
gmyth/tests/gmyth_test_recorder.c
     1.1 --- a/gmyth/src/gmyth_livetv.c	Fri Jan 19 00:51:49 2007 +0000
     1.2 +++ b/gmyth/src/gmyth_livetv.c	Fri Jan 19 13:09:21 2007 +0000
     1.3 @@ -88,7 +88,7 @@
     1.4  
     1.5  	GMythLiveTV *livetv = GMYTH_LIVETV (object);
     1.6  
     1.7 -	gmyth_debug ("[%s] Finalizing livetv", __FUNCTION__);
     1.8 +	gmyth_debug ("Finalizing livetv");
     1.9  
    1.10  	if ( livetv->monitor != NULL ) {
    1.11  		g_object_unref (livetv->monitor);
    1.12 @@ -412,7 +412,7 @@
    1.13  		goto error;
    1.14  	} else {
    1.15  		res = TRUE;
    1.16 -		gmyth_debug ("[%s] GMythLiveTV: All requests to backend to start TV were OK, TV chain changed.\n", __FUNCTION__ );
    1.17 +		gmyth_debug ("GMythLiveTV: All requests to backend to start TV were OK, TV chain changed.");
    1.18  	}
    1.19  	
    1.20  	livetv->setup_done = TRUE;
    1.21 @@ -501,7 +501,7 @@
    1.22  void
    1.23  gmyth_livetv_stop_playing (GMythLiveTV *livetv) 
    1.24  {
    1.25 -	gmyth_debug ("[%s] Stopping the LiveTV...\n", __FUNCTION__);
    1.26 +	gmyth_debug ("Stopping the LiveTV...\n");
    1.27  
    1.28  	if (livetv->is_livetv) {
    1.29  		if ( !gmyth_recorder_stop_livetv (livetv->recorder) ) {
    1.30 @@ -519,9 +519,6 @@
    1.31    GMythStringList *str_list = gmyth_string_list_new ();
    1.32    GString *message = g_string_new ("");
    1.33  
    1.34 -  gmyth_debug ( "[%s]\n", __FUNCTION__ );
    1.35 -  //g_static_mutex_lock (&mutex);
    1.36 -  //
    1.37    g_string_printf( message, "%s %d", GMYTHTV_RECORDER_HEADER,
    1.38        /* FIXME file_transfer->rec_id >= 0 ? file_transfer->rec_id : file_transfer->card_id );*/
    1.39          livetv->recorder->recorder_num);
     2.1 --- a/gmyth/src/gmyth_remote_util.c	Fri Jan 19 00:51:49 2007 +0000
     2.2 +++ b/gmyth/src/gmyth_remote_util.c	Fri Jan 19 13:09:21 2007 +0000
     2.3 @@ -66,14 +66,14 @@
     2.4      if ( num < 0 || port < 0 )
     2.5      	goto clean_up;
     2.6  
     2.7 -	gmyth_debug ("[%s] Free recorder info received: num: %d, hostname: %s, port: %d", 
     2.8 +    gmyth_debug ("[%s] Free recorder info received: num: %d, hostname: %s, port: %d", 
     2.9  				__FUNCTION__, num, hostname->str, port);
    2.10  	
    2.11 -	recorder = gmyth_recorder_new (num, hostname, port);
    2.12 +    recorder = gmyth_recorder_new (num, hostname, port);
    2.13  
    2.14  clean_up:
    2.15  	
    2.16 -	g_object_unref (strlist);
    2.17 +    g_object_unref (strlist);
    2.18  	
    2.19 -	return recorder;
    2.20 +    return recorder;
    2.21  }
     3.1 --- a/gmyth/src/gmyth_socket.c	Fri Jan 19 00:51:49 2007 +0000
     3.2 +++ b/gmyth/src/gmyth_socket.c	Fri Jan 19 13:09:21 2007 +0000
     3.3 @@ -129,7 +129,6 @@
     3.4      else
     3.5  				portStr = NULL;
     3.6  
     3.7 -    gmyth_debug ("Address: %s, port: %d\n", addr, port);
     3.8      if ( ( errorn = getaddrinfo(addr, portStr, &hints, addrInfo) ) != 0 ) {
     3.9  		g_printerr( "[%s] Socket ERROR: %s\n", __FUNCTION__, gai_strerror(errorn) );
    3.10      }
    3.11 @@ -185,7 +184,7 @@
    3.12  
    3.13  			ifname = i->ifa_name;
    3.14  			ifIdx = if_nametoindex(ifname);
    3.15 -			/* gmyth_debug( "[%s] Interface name: %s, index: %d, address: %s\n", __FUNCTION__, ifname, ifIdx, addr ); */
    3.16 +
    3.17  			if ( current_connections == NULL || ( current_connections != NULL && 
    3.18  					g_list_find_custom( current_connections, (gchar *)addr, 
    3.19  						(GCompareFunc)gmyth_socket_find_match_address_uri ) == NULL ) )
    3.20 @@ -258,7 +257,7 @@
    3.21  		g_strlcpy( ifaddr, inet_ntoa(((struct sockaddr_in*)&req.ifr_addr)->sin_addr), sizeof(struct ifaddr)-1 );
    3.22  		local_addrs = g_list_append( local_addrs, g_strdup( ifaddr ) );
    3.23  
    3.24 -		gmyth_debug( "[%s] ( from the /proc/net/dev) Interface name: %s, address: %s\n", __FUNCTION__, 
    3.25 +		gmyth_debug( "( from the /proc/net/dev) Interface name: %s, address: %s\n", 
    3.26  								ifname, ifaddr );
    3.27  	}
    3.28  	fclose(fd);
    3.29 @@ -534,7 +533,7 @@
    3.30      gmyth_debug ("CONNECTING %s:%d", hostname, port);
    3.31  
    3.32      if ( hostname == NULL )
    3.33 -        gmyth_debug ( "[%s] Invalid hostname parameter!\n", __FUNCTION__ );
    3.34 +        gmyth_debug ( "Invalid hostname parameter!\n");
    3.35  
    3.36      /* store hostname and port number */
    3.37      if (gmyth_socket->hostname != NULL) {
    3.38 @@ -691,16 +690,13 @@
    3.39      }
    3.40  
    3.41      //g_static_mutex_lock( &mutex );
    3.42 -    gmyth_debug ("[%s] Sending command to backend: %s\n", __FUNCTION__, command->str);
    3.43 +    gmyth_debug ("Sending command to backend: %s\n", command->str);
    3.44  
    3.45      buffer = g_strnfill( BUFLEN, ' ' );
    3.46      g_snprintf( buffer, MYTH_PROTOCOL_FIELD_SIZE+1, "%-8d", command->len);
    3.47 -    gmyth_debug ( "[%s] buffer = [%s]\n", __FUNCTION__, buffer  );
    3.48  
    3.49      command = g_string_prepend(command, buffer);
    3.50  
    3.51 -    gmyth_debug ( "[%s] command = [%s]\n", __FUNCTION__, command->str  );
    3.52 -
    3.53      /* write bytes to socket */    
    3.54      io_status = g_io_channel_write_chars( gmyth_socket->sd_io_ch, command->str, 
    3.55  	    command->len, &bytes_written, &error );
    3.56 @@ -770,13 +766,11 @@
    3.57  		(blocking_client ? "Playback" : "Monitor"),
    3.58  		hostname->str, with_events);
    3.59  
    3.60 -	gmyth_debug ("[%s] Connection command sent to backend: %s", __FUNCTION__, base_str->str);
    3.61 -
    3.62  	gmyth_socket_send_command (gmyth_socket, base_str);
    3.63  	result = gmyth_socket_receive_response (gmyth_socket);
    3.64  
    3.65  	if (result != NULL) {
    3.66 -	    gmyth_debug ("[%s] Response received from backend: %s", __FUNCTION__, result->str);
    3.67 +	    gmyth_debug ("Response received from backend: %s", result->str);
    3.68  	    g_string_free (result, TRUE);
    3.69  	}
    3.70  
    3.71 @@ -804,7 +798,7 @@
    3.72  {
    3.73      if (!gmyth_socket_connect_to_backend_and_events ( gmyth_socket, hostname_backend, port,
    3.74      		blocking_client, FALSE) ) {
    3.75 -		gmyth_debug ("[%s] Could not open socket to backend machine [%s]\n", __FUNCTION__,
    3.76 +		gmyth_debug ("Could not open socket to backend machine [%s]\n",
    3.77  					hostname_backend );
    3.78  		return FALSE;
    3.79      }
    3.80 @@ -827,7 +821,7 @@
    3.81  {
    3.82      if (!gmyth_socket_connect_to_backend_and_events ( gmyth_socket, hostname_backend, port,
    3.83      		blocking_client, TRUE) ) {
    3.84 -		gmyth_debug ("[%s] Could not open socket to backend machine in order to receive events [%s]\n", __FUNCTION__,
    3.85 +		gmyth_debug ("Could not open socket to backend machine in order to receive events [%s]\n",
    3.86  					hostname_backend );
    3.87  		return FALSE;
    3.88      }
    3.89 @@ -1018,7 +1012,7 @@
    3.90  
    3.91      //g_static_mutex_unlock( &mutex );
    3.92  
    3.93 -    gmyth_debug ("[%s] Response received from backend: {%s}\n", __FUNCTION__, buffer);
    3.94 +    gmyth_debug ("Response received from backend: {%s}\n", buffer);
    3.95  
    3.96      if ( ( bytes_read != len ) || ( io_status == G_IO_STATUS_ERROR ) )
    3.97  		str = NULL;
    3.98 @@ -1053,8 +1047,6 @@
    3.99  
   3.100      ptr_array = g_ptr_array_sized_new (g_list_length(str_list->glist));
   3.101  
   3.102 -    gmyth_debug ( "[%s] Number of parameters = %d\n", __FUNCTION__, g_list_length(str_list->glist) );    
   3.103 -
   3.104      // FIXME: change this implementation!
   3.105      tmp_list = str_list->glist;
   3.106      for(; tmp_list; tmp_list = tmp_list->next) {
   3.107 @@ -1070,7 +1062,7 @@
   3.108  
   3.109      g_static_mutex_unlock( &mutex );
   3.110  
   3.111 -    gmyth_debug ( "[%s]\t\tSending the String list = %s\n", __FUNCTION__, str_array );
   3.112 +    gmyth_debug ( "[%s] Sending socket request: %s\n", __FUNCTION__, str_array );
   3.113  
   3.114      // Sends message to backend	
   3.115      // TODO: implement looping to send remaining data, and add timeout testing!    
     4.1 --- a/gmyth/tests/gmyth_test_recorder.c	Fri Jan 19 00:51:49 2007 +0000
     4.2 +++ b/gmyth/tests/gmyth_test_recorder.c	Fri Jan 19 13:09:21 2007 +0000
     4.3 @@ -13,14 +13,15 @@
     4.4      GMythRecorder* recorder;
     4.5      GMythSocket *socket = gmyth_socket_new ();
     4.6  
     4.7 -    if (gmyth_socket_connect_with_timeout (socket, 
     4.8 +    if (gmyth_socket_connect_to_backend (socket, 
     4.9  	    gmyth_backend_info_get_hostname (backend_info),
    4.10 -	    gmyth_backend_info_get_port (backend_info), 4) == FALSE) {
    4.11 +	    gmyth_backend_info_get_port (backend_info), TRUE) == FALSE) {
    4.12  	g_debug ("Test recorder failed: Connection failed");
    4.13  	return FALSE;
    4.14      }
    4.15  
    4.16      recorder = remote_request_next_free_recorder (socket, -1);
    4.17 +    gmyth_socket_close_connection (socket);
    4.18      if (recorder == NULL) {
    4.19  	g_debug ("Recorder not available\n");
    4.20  	return FALSE;
    4.21 @@ -56,14 +57,15 @@
    4.22      gint i, length;
    4.23  
    4.24      // Gets the free recorder
    4.25 -    if (gmyth_socket_connect_with_timeout (socket, 
    4.26 +    if (gmyth_socket_connect_to_backend (socket, 
    4.27  	    gmyth_backend_info_get_hostname (backend_info),
    4.28 -	    gmyth_backend_info_get_port (backend_info), 4) == FALSE) {
    4.29 +	    gmyth_backend_info_get_port (backend_info), TRUE) == FALSE) {
    4.30  	g_debug ("Test recorder failed: Connection failed");
    4.31  	return FALSE;
    4.32      }
    4.33  
    4.34      recorder = remote_request_next_free_recorder (socket, -1);
    4.35 +    gmyth_socket_close_connection (socket);
    4.36      if (recorder == NULL) {
    4.37  	g_debug ("[%s] Recorder not available", __FUNCTION__);
    4.38  	return FALSE;