src/irc_client.c
changeset 140 aa390e52eda8
parent 100 cfb7776bd6f0
child 156 6534a4ac957b
equal deleted inserted replaced
139:55b9dcc2b73a 140:aa390e52eda8
    52 
    52 
    53 err_t irc_client_add_net (struct irc_client *client, struct irc_net **net_ptr, const struct irc_net_info *_net_info, struct error_info *err)
    53 err_t irc_client_add_net (struct irc_client *client, struct irc_net **net_ptr, const struct irc_net_info *_net_info, struct error_info *err)
    54 {
    54 {
    55     struct irc_net *net;
    55     struct irc_net *net;
    56     struct irc_net_info net_info = {
    56     struct irc_net_info net_info = {
    57         .use_ssl    = _net_info->use_ssl,
    57         .ssl_cred   = _net_info->ssl_cred,
    58     };
    58     };
    59 
    59 
    60     // combine _net_info and defaults to get net_info
    60     // combine _net_info and defaults to get net_info
    61     if (_net_info->raw_sock)
    61     if (_net_info->raw_sock)
    62         RETURN_SET_ERROR_STR(err, ERR_IRC_NET_INFO, "raw_sock");
    62         RETURN_SET_ERROR_STR(err, ERR_IRC_NET_INFO, "raw_sock");
    66 
    66 
    67     if ((net_info.hostname = _net_info->hostname) == NULL)
    67     if ((net_info.hostname = _net_info->hostname) == NULL)
    68         RETURN_SET_ERROR_STR(err, ERR_IRC_NET_INFO, "hostname");
    68         RETURN_SET_ERROR_STR(err, ERR_IRC_NET_INFO, "hostname");
    69     
    69     
    70     if ((net_info.service = (_net_info->service ? _net_info->service : (
    70     if ((net_info.service = (_net_info->service ? _net_info->service : (
    71                     _net_info->use_ssl ? client->defaults.service_ssl : client->defaults.service
    71                     _net_info->ssl_cred ? client->defaults.service_ssl : client->defaults.service
    72             ))) == NULL)
    72             ))) == NULL)
    73         RETURN_SET_ERROR_STR(err, ERR_IRC_NET_INFO, "service");
    73         RETURN_SET_ERROR_STR(err, ERR_IRC_NET_INFO, "service");
    74 
    74 
    75     if (APPLY_REGISTER_INFO_DEFAULT(&net_info, _net_info, &client->defaults, nickname))
    75     if (APPLY_REGISTER_INFO_DEFAULT(&net_info, _net_info, &client->defaults, nickname))
    76         RETURN_SET_ERROR_STR(err, ERR_IRC_NET_INFO, "nickname");
    76         RETURN_SET_ERROR_STR(err, ERR_IRC_NET_INFO, "nickname");