From: <sid...@us...> - 2010-06-02 20:55:31
|
Revision: 373 http://libyahoo2.svn.sourceforge.net/libyahoo2/?rev=373&view=rev Author: siddheshp Date: 2010-06-02 20:55:25 +0000 (Wed, 02 Jun 2010) Log Message: ----------- - Set 5050 as the default port for the sample_client - Actually make the fallback hosts and ports work Modified Paths: -------------- trunk/libyahoo2/src/libyahoo2.c trunk/libyahoo2/src/sample_client.c Modified: trunk/libyahoo2/src/libyahoo2.c =================================================================== --- trunk/libyahoo2/src/libyahoo2.c 2010-06-02 20:13:01 UTC (rev 372) +++ trunk/libyahoo2/src/libyahoo2.c 2010-06-02 20:55:25 UTC (rev 373) @@ -1726,7 +1726,6 @@ ccd = y_new0(struct connect_callback_data, 1); ccd->yd = yd; - ccd->server_i = -1; host = yss->pager_host; @@ -3610,7 +3609,7 @@ if (fallback_ports[ccd->i]) { char *host = yss->pager_host; - if (!host || ccd->server_i >= 0) + if (!host) host = yss->pager_host_list[ccd->server_i]; yss->pager_port = fallback_ports[ccd->i++]; @@ -3620,19 +3619,17 @@ if (tag > 0) ccd->tag = tag; - } else if (yss->pager_host_list && + } else if (yss->pager_host_list + && yss->pager_host_list[ccd->server_i]) { - (ccd->server_i < 0 - || yss->pager_host_list[ccd->server_i])) { - - if (ccd->server_i < 0) - ccd->server_i++; - /* Get back to the default port */ yss->pager_port = pager_port; + ccd->server_i++; + LOG(("Fallback: Connecting to %s:%d", yss->pager_host_list[ccd->server_i], yss->pager_port)); + ccd->i = 0; tag = YAHOO_CALLBACK(ext_yahoo_connect_async) (yd->client_id, - yss->pager_host_list[ccd->server_i++], yss->pager_port, + yss->pager_host_list[ccd->server_i], yss->pager_port, yahoo_connected, ccd, 0); } else { FREE(ccd); Modified: trunk/libyahoo2/src/sample_client.c =================================================================== --- trunk/libyahoo2/src/sample_client.c 2010-06-02 20:13:01 UTC (rev 372) +++ trunk/libyahoo2/src/sample_client.c 2010-06-02 20:55:25 UTC (rev 373) @@ -873,7 +873,7 @@ ylad->id = yahoo_init_with_attributes(ylad->yahoo_id, ylad->password, "local_host", local_host, - "pager_port", 23, + "pager_port", 5050, NULL); ylad->status = YAHOO_STATUS_OFFLINE; yahoo_login(ylad->id, login_mode); @@ -1184,7 +1184,7 @@ struct _conn *c; - LOG(("Connecting to %s", host)); + LOG(("Connecting to %s:%d", host, port)); if(!(server = gethostbyname(host))) { errno=h_errno; @@ -1240,7 +1240,7 @@ ext_yahoo_close(c); - callback(NULL, 0, data); + callback(NULL, errno, data); return -1; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |