src/irc_net.c
changeset 73 2780a73c71f3
parent 72 43084f103c2a
child 74 11ec458d1cbf
equal deleted inserted replaced
72:43084f103c2a 73:2780a73c71f3
   187     net->info = *info;
   187     net->info = *info;
   188     TAILQ_INIT(&net->channels);
   188     TAILQ_INIT(&net->channels);
   189     LIST_INIT(&net->users);
   189     LIST_INIT(&net->users);
   190 
   190 
   191     if (info->raw_sock) {
   191     if (info->raw_sock) {
   192         log_info("connected using raw socket: %p", info->raw_sock);
   192         log_debug("connected using raw socket: %p", info->raw_sock);
   193 
   193 
   194         sock = info->raw_sock;
   194         sock = info->raw_sock;
   195 
   195 
   196     } else if (info->use_ssl) {
   196     } else if (info->use_ssl) {
   197         log_info("connecting to [%s]:%s using SSL", info->hostname, info->service);
   197         log_debug("connecting to [%s]:%s using SSL", info->hostname, info->service);
   198 
   198 
   199         // XXX: over-simplified blocking connect
   199         // XXX: over-simplified blocking connect
   200         if (sock_ssl_connect(&sock, info->hostname, info->service, err))
   200         if (sock_ssl_connect(&sock, info->hostname, info->service, err))
   201             goto error;
   201             goto error;
   202 
   202 
   203     } else {
   203     } else {
   204         log_info("connecting to [%s]:%s", info->hostname, info->service);
   204         log_debug("connecting to [%s]:%s", info->hostname, info->service);
   205 
   205 
   206         // XXX: over-simplified blocking connect
   206         // XXX: over-simplified blocking connect
   207         if (sock_tcp_connect(&sock, info->hostname, info->service, err))
   207         if (sock_tcp_connect(&sock, info->hostname, info->service, err))
   208             goto error;
   208             goto error;
   209 
   209 
   216     // add our command handlers
   216     // add our command handlers
   217     if ((ERROR_CODE(err) = irc_conn_add_cmd_handlers (net->conn, _cmd_handlers, net)))
   217     if ((ERROR_CODE(err) = irc_conn_add_cmd_handlers (net->conn, _cmd_handlers, net)))
   218         goto error;
   218         goto error;
   219 
   219 
   220     // register
   220     // register
   221     log_info("connected, registering");
   221     log_debug("connected, registering");
   222 
   222 
   223     if ((ERROR_CODE(err) = irc_conn_register(net->conn, &info->register_info)))
   223     if ((ERROR_CODE(err) = irc_conn_register(net->conn, &info->register_info)))
   224         goto error;
   224         goto error;
   225     
   225     
   226     // ok
   226     // ok