# HG changeset patch # User rosfran # Date 1164675205 0 # Node ID 253b9171a70355998cd4ef57149be58f81965a45 # Parent 49bf9d28f38a74cf81f4d1a9810c464ef42bc4cb [svn r124] Fixes to the newly added BackendInfo issues. diff -r 49bf9d28f38a -r 253b9171a703 gmyth/src/gmyth_backendinfo.c --- a/gmyth/src/gmyth_backendinfo.c Tue Nov 28 00:15:37 2006 +0000 +++ b/gmyth/src/gmyth_backendinfo.c Tue Nov 28 00:53:25 2006 +0000 @@ -113,17 +113,18 @@ } GMythBackendInfo* -gmyth_backend_info_new_with_uri (const gchar *uri_str ) +gmyth_backend_info_new_with_uri ( const gchar *uri_str ) { GMythBackendInfo *backend_info = GMYTH_BACKEND_INFO (g_object_new(GMYTH_BACKEND_INFO_TYPE, NULL)); - GMythURI* uri = gmyth_uri_new( (gchar*)uri_str ); + GMythURI* uri = gmyth_uri_new( uri_str ); gmyth_backend_info_set_hostname (backend_info, gmyth_uri_get_host (uri ) ); gmyth_backend_info_set_username (backend_info, gmyth_uri_get_user( uri ) ); gmyth_backend_info_set_password (backend_info, gmyth_uri_get_password( uri ) ); - gmyth_backend_info_set_db_name (backend_info, gmyth_uri_get_path( uri ) ); + gmyth_backend_info_set_db_name (backend_info, strlen( gmyth_uri_get_fragment( uri ) ) > 0 + ? gmyth_uri_get_fragment( uri ) : gmyth_uri_get_query( uri ) ); gmyth_backend_info_set_port (backend_info, gmyth_uri_get_port( uri ) ); return backend_info; diff -r 49bf9d28f38a -r 253b9171a703 gmyth/src/gmyth_socket.c --- a/gmyth/src/gmyth_socket.c Tue Nov 28 00:15:37 2006 +0000 +++ b/gmyth/src/gmyth_socket.c Tue Nov 28 00:53:25 2006 +0000 @@ -505,8 +505,8 @@ if ( gmyth_socket->sd < 0 ) continue; - g_debug( "[%s] hostname = %s, sock_fd = %d, addr = %s, addr_len = %d, \ - ai_family = %d, ai_protocol = %d\n", + g_debug( "[%s] hostname = %s, sock_fd = %d, addr = %s, addr_len = %d, "\ + "ai_family = %d, ai_protocol = %d\n", __FUNCTION__, hostname, gmyth_socket->sd, inet_ntoa( sa->sin_addr ), addr_info0->ai_addrlen, addr_info0->ai_family, addr_info0->ai_protocol ); @@ -697,7 +697,8 @@ gchar *hostname_backend, int port, gboolean blocking_client) { if (!gmyth_socket_connect (gmyth_socket, hostname_backend, port)) { - g_warning ("[%s] Could not open socket to backend machine", __FUNCTION__); + g_warning ("[%s] Could not open socket to backend machine [%s]\n", __FUNCTION__, + hostname_backend ); return FALSE; } diff -r 49bf9d28f38a -r 253b9171a703 gmyth/src/gmyth_uri.c --- a/gmyth/src/gmyth_uri.c Tue Nov 28 00:15:37 2006 +0000 +++ b/gmyth/src/gmyth_uri.c Tue Nov 28 00:53:25 2006 +0000 @@ -80,7 +80,7 @@ } const GMythURI * -gmyth_uri_new( gchar *value ) +gmyth_uri_new( const gchar *value ) { GMythURI *uri = gmyth_uri_init(); @@ -202,6 +202,10 @@ queryLen -= uriLen - (currIdx+sharpIdx+1); uri->query = g_string_append_len( uri->query, value+currIdx+questionIdx+1, queryLen ); } + g_print( "[%s] host = %s, port = %d, path = %s, query = %s, fragment = %s, "\ + "user = %s, password = %s.\n", __FUNCTION__, uri->host->str, uri->port, + uri->path->str, uri->query->str, uri->fragment->str, + uri->user->str, uri->password->str ); return uri; diff -r 49bf9d28f38a -r 253b9171a703 gmyth/src/gmyth_uri.h --- a/gmyth/src/gmyth_uri.h Tue Nov 28 00:15:37 2006 +0000 +++ b/gmyth/src/gmyth_uri.h Tue Nov 28 00:53:25 2006 +0000 @@ -53,7 +53,7 @@ GString *query; } GMythURI; -const GMythURI *gmyth_uri_new( gchar *value ); +const GMythURI *gmyth_uri_new( const gchar *value ); gboolean gmyth_uri_is_equals( GMythURI* uri1, GMythURI* uri2 ); @@ -63,5 +63,7 @@ #define gmyth_uri_get_path(urip) (urip->path->str) #define gmyth_uri_get_user(urip) (urip->user->str) #define gmyth_uri_get_password(urip) (urip->password->str) +#define gmyth_uri_get_fragment(urip) (urip->fragment->str) +#define gmyth_uri_get_query(urip) (urip->query->str) #endif