# HG changeset patch # User melunko # Date 1169212161 0 # Node ID a24bacc8d75275d2572b804832b3869f017f517f # Parent 890b023c759f430e1be5e9e4dcd6a5b45d7bc1c2 [svn r279] Removed some useless debug messages diff -r 890b023c759f -r a24bacc8d752 gmyth/src/gmyth_livetv.c --- a/gmyth/src/gmyth_livetv.c Fri Jan 19 00:51:49 2007 +0000 +++ b/gmyth/src/gmyth_livetv.c Fri Jan 19 13:09:21 2007 +0000 @@ -88,7 +88,7 @@ GMythLiveTV *livetv = GMYTH_LIVETV (object); - gmyth_debug ("[%s] Finalizing livetv", __FUNCTION__); + gmyth_debug ("Finalizing livetv"); if ( livetv->monitor != NULL ) { g_object_unref (livetv->monitor); @@ -412,7 +412,7 @@ goto error; } else { res = TRUE; - gmyth_debug ("[%s] GMythLiveTV: All requests to backend to start TV were OK, TV chain changed.\n", __FUNCTION__ ); + gmyth_debug ("GMythLiveTV: All requests to backend to start TV were OK, TV chain changed."); } livetv->setup_done = TRUE; @@ -501,7 +501,7 @@ void gmyth_livetv_stop_playing (GMythLiveTV *livetv) { - gmyth_debug ("[%s] Stopping the LiveTV...\n", __FUNCTION__); + gmyth_debug ("Stopping the LiveTV...\n"); if (livetv->is_livetv) { if ( !gmyth_recorder_stop_livetv (livetv->recorder) ) { @@ -519,9 +519,6 @@ GMythStringList *str_list = gmyth_string_list_new (); GString *message = g_string_new (""); - gmyth_debug ( "[%s]\n", __FUNCTION__ ); - //g_static_mutex_lock (&mutex); - // g_string_printf( message, "%s %d", GMYTHTV_RECORDER_HEADER, /* FIXME file_transfer->rec_id >= 0 ? file_transfer->rec_id : file_transfer->card_id );*/ livetv->recorder->recorder_num); diff -r 890b023c759f -r a24bacc8d752 gmyth/src/gmyth_remote_util.c --- a/gmyth/src/gmyth_remote_util.c Fri Jan 19 00:51:49 2007 +0000 +++ b/gmyth/src/gmyth_remote_util.c Fri Jan 19 13:09:21 2007 +0000 @@ -66,14 +66,14 @@ if ( num < 0 || port < 0 ) goto clean_up; - gmyth_debug ("[%s] Free recorder info received: num: %d, hostname: %s, port: %d", + gmyth_debug ("[%s] Free recorder info received: num: %d, hostname: %s, port: %d", __FUNCTION__, num, hostname->str, port); - recorder = gmyth_recorder_new (num, hostname, port); + recorder = gmyth_recorder_new (num, hostname, port); clean_up: - g_object_unref (strlist); + g_object_unref (strlist); - return recorder; + return recorder; } diff -r 890b023c759f -r a24bacc8d752 gmyth/src/gmyth_socket.c --- a/gmyth/src/gmyth_socket.c Fri Jan 19 00:51:49 2007 +0000 +++ b/gmyth/src/gmyth_socket.c Fri Jan 19 13:09:21 2007 +0000 @@ -129,7 +129,6 @@ else portStr = NULL; - gmyth_debug ("Address: %s, port: %d\n", addr, port); if ( ( errorn = getaddrinfo(addr, portStr, &hints, addrInfo) ) != 0 ) { g_printerr( "[%s] Socket ERROR: %s\n", __FUNCTION__, gai_strerror(errorn) ); } @@ -185,7 +184,7 @@ ifname = i->ifa_name; ifIdx = if_nametoindex(ifname); - /* gmyth_debug( "[%s] Interface name: %s, index: %d, address: %s\n", __FUNCTION__, ifname, ifIdx, addr ); */ + if ( current_connections == NULL || ( current_connections != NULL && g_list_find_custom( current_connections, (gchar *)addr, (GCompareFunc)gmyth_socket_find_match_address_uri ) == NULL ) ) @@ -258,7 +257,7 @@ g_strlcpy( ifaddr, inet_ntoa(((struct sockaddr_in*)&req.ifr_addr)->sin_addr), sizeof(struct ifaddr)-1 ); local_addrs = g_list_append( local_addrs, g_strdup( ifaddr ) ); - gmyth_debug( "[%s] ( from the /proc/net/dev) Interface name: %s, address: %s\n", __FUNCTION__, + gmyth_debug( "( from the /proc/net/dev) Interface name: %s, address: %s\n", ifname, ifaddr ); } fclose(fd); @@ -534,7 +533,7 @@ gmyth_debug ("CONNECTING %s:%d", hostname, port); if ( hostname == NULL ) - gmyth_debug ( "[%s] Invalid hostname parameter!\n", __FUNCTION__ ); + gmyth_debug ( "Invalid hostname parameter!\n"); /* store hostname and port number */ if (gmyth_socket->hostname != NULL) { @@ -691,16 +690,13 @@ } //g_static_mutex_lock( &mutex ); - gmyth_debug ("[%s] Sending command to backend: %s\n", __FUNCTION__, command->str); + gmyth_debug ("Sending command to backend: %s\n", command->str); buffer = g_strnfill( BUFLEN, ' ' ); g_snprintf( buffer, MYTH_PROTOCOL_FIELD_SIZE+1, "%-8d", command->len); - gmyth_debug ( "[%s] buffer = [%s]\n", __FUNCTION__, buffer ); command = g_string_prepend(command, buffer); - gmyth_debug ( "[%s] command = [%s]\n", __FUNCTION__, command->str ); - /* write bytes to socket */ io_status = g_io_channel_write_chars( gmyth_socket->sd_io_ch, command->str, command->len, &bytes_written, &error ); @@ -770,13 +766,11 @@ (blocking_client ? "Playback" : "Monitor"), hostname->str, with_events); - gmyth_debug ("[%s] Connection command sent to backend: %s", __FUNCTION__, base_str->str); - gmyth_socket_send_command (gmyth_socket, base_str); result = gmyth_socket_receive_response (gmyth_socket); if (result != NULL) { - gmyth_debug ("[%s] Response received from backend: %s", __FUNCTION__, result->str); + gmyth_debug ("Response received from backend: %s", result->str); g_string_free (result, TRUE); } @@ -804,7 +798,7 @@ { if (!gmyth_socket_connect_to_backend_and_events ( gmyth_socket, hostname_backend, port, blocking_client, FALSE) ) { - gmyth_debug ("[%s] Could not open socket to backend machine [%s]\n", __FUNCTION__, + gmyth_debug ("Could not open socket to backend machine [%s]\n", hostname_backend ); return FALSE; } @@ -827,7 +821,7 @@ { if (!gmyth_socket_connect_to_backend_and_events ( gmyth_socket, hostname_backend, port, blocking_client, TRUE) ) { - gmyth_debug ("[%s] Could not open socket to backend machine in order to receive events [%s]\n", __FUNCTION__, + gmyth_debug ("Could not open socket to backend machine in order to receive events [%s]\n", hostname_backend ); return FALSE; } @@ -1018,7 +1012,7 @@ //g_static_mutex_unlock( &mutex ); - gmyth_debug ("[%s] Response received from backend: {%s}\n", __FUNCTION__, buffer); + gmyth_debug ("Response received from backend: {%s}\n", buffer); if ( ( bytes_read != len ) || ( io_status == G_IO_STATUS_ERROR ) ) str = NULL; @@ -1053,8 +1047,6 @@ ptr_array = g_ptr_array_sized_new (g_list_length(str_list->glist)); - gmyth_debug ( "[%s] Number of parameters = %d\n", __FUNCTION__, g_list_length(str_list->glist) ); - // FIXME: change this implementation! tmp_list = str_list->glist; for(; tmp_list; tmp_list = tmp_list->next) { @@ -1070,7 +1062,7 @@ g_static_mutex_unlock( &mutex ); - gmyth_debug ( "[%s]\t\tSending the String list = %s\n", __FUNCTION__, str_array ); + gmyth_debug ( "[%s] Sending socket request: %s\n", __FUNCTION__, str_array ); // Sends message to backend // TODO: implement looping to send remaining data, and add timeout testing! diff -r 890b023c759f -r a24bacc8d752 gmyth/tests/gmyth_test_recorder.c --- a/gmyth/tests/gmyth_test_recorder.c Fri Jan 19 00:51:49 2007 +0000 +++ b/gmyth/tests/gmyth_test_recorder.c Fri Jan 19 13:09:21 2007 +0000 @@ -13,14 +13,15 @@ GMythRecorder* recorder; GMythSocket *socket = gmyth_socket_new (); - if (gmyth_socket_connect_with_timeout (socket, + if (gmyth_socket_connect_to_backend (socket, gmyth_backend_info_get_hostname (backend_info), - gmyth_backend_info_get_port (backend_info), 4) == FALSE) { + gmyth_backend_info_get_port (backend_info), TRUE) == FALSE) { g_debug ("Test recorder failed: Connection failed"); return FALSE; } recorder = remote_request_next_free_recorder (socket, -1); + gmyth_socket_close_connection (socket); if (recorder == NULL) { g_debug ("Recorder not available\n"); return FALSE; @@ -56,14 +57,15 @@ gint i, length; // Gets the free recorder - if (gmyth_socket_connect_with_timeout (socket, + if (gmyth_socket_connect_to_backend (socket, gmyth_backend_info_get_hostname (backend_info), - gmyth_backend_info_get_port (backend_info), 4) == FALSE) { + gmyth_backend_info_get_port (backend_info), TRUE) == FALSE) { g_debug ("Test recorder failed: Connection failed"); return FALSE; } recorder = remote_request_next_free_recorder (socket, -1); + gmyth_socket_close_connection (socket); if (recorder == NULL) { g_debug ("[%s] Recorder not available", __FUNCTION__); return FALSE;