diff options
Diffstat (limited to 'commands.c')
| -rw-r--r-- | commands.c | 12 | 
1 files changed, 7 insertions, 5 deletions
@@ -46,9 +46,8 @@ static void list_remote(GString *string, gchar *remotename, gchar *dirname, GErr  		return;  	} -	gchar **data = server_list(server, dirname); +	gchar **data = server_list(server, dirname, error);  	if(data == NULL) { -		*error = g_error_new(commands_quark(), 0, "couldn't retrieve list");  		return;  	} @@ -148,8 +147,11 @@ static void commands_find(GSocketConnection *connection, const gchar *cmd, GErro  		for(GSList *node = servers; node; node = g_slist_next(node)) {  			struct server *server = node->data;  			g_debug("fetching data from server %s", server->host); -			gchar **temp = server_find(server, data[1], data[2]); +			gchar **temp = server_find(server, data[1], data[2], error);  			if(temp == NULL) { +				g_warning((*error)->message); +				g_error_free(*error); +				*error = NULL;  				continue;  			}  			for(gint i = 0; i < g_strv_length(temp); i++) { @@ -186,7 +188,7 @@ static void commands_get(GSocketConnection *connection, const gchar *cmd, GError  	if(g_strv_length(data) != 5) {  		g_strfreev(data); -		*error = g_error_new(commands_quark(), 0, "syntax: get TYPE LOCALFILE REMOTEHOST REMOTEFILE"); +		*error = g_error_new(commands_quark(), 0, "syntax: get TYPE LOCALFILE REMOTENAME REMOTEFILE");  		return;  	} @@ -203,7 +205,7 @@ static void commands_get(GSocketConnection *connection, const gchar *cmd, GError  	gchar *localfile = g_uri_unescape_string(data[2], NULL);  	gchar *remotefile = g_uri_unescape_string(data[4], NULL); -	server_get(server, data[1], localfile, remotefile); +	server_get(server, data[1], localfile, remotefile, error);  	g_free(localfile);  	g_free(remotefile);  | 
