"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core/servers.c" between
irssi-1.2.2.tar.gz and irssi-1.2.3.tar.gz

About: irssi is a terminal based IRC client that also supports SILC and ICB protocols via plugins.

servers.c  (irssi-1.2.2):servers.c  (irssi-1.2.3)
skipping to change at line 208 skipping to change at line 208
} }
static void server_real_connect(SERVER_REC *server, IPADDR *ip, static void server_real_connect(SERVER_REC *server, IPADDR *ip,
const char *unix_socket) const char *unix_socket)
{ {
GIOChannel *handle; GIOChannel *handle;
IPADDR *own_ip = NULL; IPADDR *own_ip = NULL;
const char *errmsg; const char *errmsg;
char *errmsg2; char *errmsg2;
char ipaddr[MAX_IP_LEN]; char ipaddr[MAX_IP_LEN];
int port; int port = 0;
g_return_if_fail(ip != NULL || unix_socket != NULL); g_return_if_fail(ip != NULL || unix_socket != NULL);
signal_emit("server connecting", 2, server, ip); signal_emit("server connecting", 2, server, ip);
if (server->connrec->no_connect) if (server->connrec->no_connect)
return; return;
if (ip != NULL) { if (ip != NULL) {
own_ip = IPADDR_IS_V6(ip) ? server->connrec->own_ip6 : server->co nnrec->own_ip4; own_ip = IPADDR_IS_V6(ip) ? server->connrec->own_ip6 : server->co nnrec->own_ip4;
port = server->connrec->proxy != NULL ? port = server->connrec->proxy != NULL ?
server->connrec->proxy_port : server->connrec->port; server->connrec->proxy_port : server->connrec->port;
handle = server->connrec->use_tls ? handle = net_connect_ip(ip, port, own_ip);
net_connect_ip_ssl(ip, port, own_ip, server) : net_connec
t_ip(ip, port, own_ip);
} else { } else {
handle = net_connect_unix(unix_socket); handle = net_connect_unix(unix_socket);
} }
if (server->connrec->use_tls && handle != NULL) {
server->handle = net_sendbuffer_create(handle, 0);
handle = net_start_ssl(server);
if (handle == NULL) {
net_sendbuffer_destroy(server->handle, TRUE);
server->handle = NULL;
} else {
server->handle->handle = handle;
}
}
if (handle == NULL) { if (handle == NULL) {
/* failed */ /* failed */
errmsg = g_strerror(errno); errmsg = g_strerror(errno);
errmsg2 = NULL; errmsg2 = NULL;
if (errno == EADDRNOTAVAIL) { if (errno == EADDRNOTAVAIL) {
if (own_ip != NULL) { if (own_ip != NULL) {
/* show the IP which is causing the error */ /* show the IP which is causing the error */
net_ip2host(own_ip, ipaddr); net_ip2host(own_ip, ipaddr);
errmsg2 = g_strconcat(errmsg, ": ", ipaddr, NULL) ; errmsg2 = g_strconcat(errmsg, ": ", ipaddr, NULL) ;
} }
server->no_reconnect = TRUE; server->no_reconnect = TRUE;
} }
if (server->connrec->use_tls && errno == ENOSYS) if (server->connrec->use_tls && errno == ENOSYS)
server->no_reconnect = TRUE; server->no_reconnect = TRUE;
server->connection_lost = TRUE; server->connection_lost = TRUE;
server_connect_failed(server, errmsg2 ? errmsg2 : errmsg); server_connect_failed(server, errmsg2 ? errmsg2 : errmsg);
g_free(errmsg2); g_free(errmsg2);
} else { } else {
server->handle = net_sendbuffer_create(handle, 0); if (!server->connrec->use_tls)
server->handle = net_sendbuffer_create(handle, 0);
if (server->connrec->use_tls) if (server->connrec->use_tls)
server_connect_callback_init_ssl(server, handle); server_connect_callback_init_ssl(server, handle);
else else
server->connect_tag = server->connect_tag =
g_input_add(handle, G_INPUT_WRITE | G_INPUT_READ, g_input_add(handle, G_INPUT_WRITE | G_INPUT_READ,
(GInputFunction) (GInputFunction)
server_connect_callback_init, server_connect_callback_init,
server); server);
} }
} }
 End of changes. 4 change blocks. 
5 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)