From 65bf229b6d9d28f097f5d71a4a6bd71424e17760 Mon Sep 17 00:00:00 2001 From: fredrik Date: Wed, 11 Apr 2007 11:02:37 +0000 Subject: [PATCH] Updated with new dc_connect. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@890 959494ce-11ee-0310-bf91-de5d638817bd --- clients/gaim/gaim-dolcon.c | 4 ++-- clients/gnome-trans-applet/conduit-dclib.c | 5 +---- clients/gtk2/main.c | 4 ++-- clients/test.c | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/clients/gaim/gaim-dolcon.c b/clients/gaim/gaim-dolcon.c index 7a71f7a..5aad9ae 100644 --- a/clients/gaim/gaim-dolcon.c +++ b/clients/gaim/gaim-dolcon.c @@ -365,7 +365,7 @@ static void gi_login(GaimAccount *act) return; } gaim_connection_update_progress(gc, "Connecting", 1, 3); - if((data->fd = dc_connect((char *)gaim_account_get_string(act, "server", "localhost"), -1)) < 0) + if((data->fd = dc_connect((char *)gaim_account_get_string(act, "server", "localhost"))) < 0) { gaim_connection_error(gc, "Could not connect to server"); return; @@ -500,7 +500,7 @@ static void init(GaimPlugin *pl) GaimAccountOption *opt; dc_init(); - opt = gaim_account_option_string_new("Server", "server", "localhost"); + opt = gaim_account_option_string_new("Server", "server", ""); protinfo.protocol_options = g_list_append(protinfo.protocol_options, opt); opt = gaim_account_option_int_new("Port", "port", -1); protinfo.protocol_options = g_list_append(protinfo.protocol_options, opt); diff --git a/clients/gnome-trans-applet/conduit-dclib.c b/clients/gnome-trans-applet/conduit-dclib.c index 2e8d0ae..2089f7f 100644 --- a/clients/gnome-trans-applet/conduit-dclib.c +++ b/clients/gnome-trans-applet/conduit-dclib.c @@ -273,14 +273,11 @@ static int init(struct conduit *conduit) static int connect(struct conduit *conduit) { struct data *data; - char *host; data = conduit->cdata; if(inuse != NULL) return(-1); - if((host = getenv("DCSERVER")) == NULL) - host = "localhost"; - if((data->fd = dc_connect(host, -1)) < 0) + if((data->fd = dc_connect(NULL)) < 0) return(-1); data->gdkread = gdk_input_add(data->fd, GDK_INPUT_READ, (void (*)(gpointer, int, GdkInputCondition))dcfdcb, conduit); updatewrite(conduit); diff --git a/clients/gtk2/main.c b/clients/gtk2/main.c index bd0cdda..643d975 100644 --- a/clients/gtk2/main.c +++ b/clients/gtk2/main.c @@ -1361,7 +1361,7 @@ void cb_main_lsres_activate(GtkWidget *widget, gpointer data) void dcconnect(char *host) { - dcfd = dc_connect(host, -1); + dcfd = dc_connect(host); if(dcfd < 0) { msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Could not connect:\n\n%s"), strerror(errno)); @@ -2575,7 +2575,7 @@ int main(int argc, char **argv) dc_init(); signal(SIGCHLD, SIG_IGN); pubhubaddr = sstrdup("http://www.hublist.org/PublicHubList.xml.bz2"); - dcserver = sstrdup("localhost"); + dcserver = sstrdup(""); if((pwent = getpwuid(getuid())) == NULL) { fprintf(stderr, "could not get your passwd data"); diff --git a/clients/test.c b/clients/test.c index 25deedb..e88dab4 100644 --- a/clients/test.c +++ b/clients/test.c @@ -19,7 +19,7 @@ int main(int argc, char **argv) struct dc_intresp *ires; dc_init(); - fd = dc_connect("localhost", -1); + fd = dc_connect(NULL); done = 0; while(!done) { -- 2.11.0