add_to_client_hash(nick, source_p);
/* fd_desc is long enough */
- comm_note(client_p->localClient->F->fd, "Nick: %s", nick);
+ rb_note(client_p->localClient->F->fd, "Nick: %s", nick);
if(source_p->flags & FLAGS_SENTUSER)
{
}
/* fd_desc is long enough */
- comm_note(client_p->localClient->F->fd, "Nick: %s", nick);
+ rb_note(client_p->localClient->F->fd, "Nick: %s", nick);
return;
}
del_all_accepts(target_p);
- comm_note(target_p->localClient->F->fd, "Nick: %s", target_p->name);
+ rb_note(target_p->localClient->F->fd, "Nick: %s", target_p->name);
return 0;
}
else
{
send_signon(NULL, target_p, nick, user, host, CurrentTime, login);
- comm_note(target_p->localClient->F->fd, "Nick: %s", target_p->name);
+ rb_note(target_p->localClient->F->fd, "Nick: %s", target_p->name);
}
return 0;
{'D', stats_deny, 1, 0, },
{'e', stats_exempt, 1, 0, },
{'E', stats_events, 1, 1, },
- {'f', comm_dump, 1, 1, },
- {'F', comm_dump, 1, 1, },
+ {'f', rb_dump, 1, 1, },
+ {'F', rb_dump, 1, 1, },
{'g', stats_pending_glines, 1, 0, },
{'G', stats_glines, 1, 0, },
{'h', stats_hubleaf, 0, 0, },
#include "s_user.h"
#include "blacklist.h"
-dlink_list blacklist_list = { NULL, NULL, 0 };
+rb_dlink_list blacklist_list = { NULL, NULL, 0 };
/* private interfaces */
static struct Blacklist *find_blacklist(char *name)
{
- dlink_node *nptr;
+ rb_dlink_node *nptr;
- DLINK_FOREACH(nptr, blacklist_list.head)
+ RB_DLINK_FOREACH(nptr, blacklist_list.head)
{
struct Blacklist *blptr = (struct Blacklist *) nptr->data;
else
unref_blacklist(blcptr->blacklist);
- dlinkDelete(&blcptr->node, &blcptr->client_p->preClient->dnsbl_queries);
+ rb_dlinkDelete(&blcptr->node, &blcptr->client_p->preClient->dnsbl_queries);
/* yes, it can probably happen... */
- if (dlink_list_length(&blcptr->client_p->preClient->dnsbl_queries) == 0 && blcptr->client_p->flags & FLAGS_SENTUSER && !EmptyString(blcptr->client_p->name))
+ if (rb_dlink_list_length(&blcptr->client_p->preClient->dnsbl_queries) == 0 && blcptr->client_p->flags & FLAGS_SENTUSER && !EmptyString(blcptr->client_p->name))
{
char buf[USERLEN + 1];
strlcpy(buf, blcptr->client_p->username, sizeof buf);
sscanf(client_p->sockhost, "%d.%d.%d.%d", &ip[3], &ip[2], &ip[1], &ip[0]);
/* becomes 2.0.0.127.torbl.ahbl.org or whatever */
- ircsnprintf(buf, IRCD_BUFSIZE, "%d.%d.%d.%d.%s", ip[0], ip[1], ip[2], ip[3], blptr->host);
+ rb_snprintf(buf, IRCD_BUFSIZE, "%d.%d.%d.%d.%s", ip[0], ip[1], ip[2], ip[3], blptr->host);
gethost_byname_type(buf, &blcptr->dns_query, T_A);
- dlinkAdd(blcptr, &blcptr->node, &client_p->preClient->dnsbl_queries);
+ rb_dlinkAdd(blcptr, &blcptr->node, &client_p->preClient->dnsbl_queries);
blptr->refcount++;
}
if (blptr == NULL)
{
blptr = MyMalloc(sizeof(struct Blacklist));
- dlinkAddAlloc(blptr, &blacklist_list);
+ rb_dlinkAddAlloc(blptr, &blacklist_list);
}
else
blptr->status &= ~CONF_ILLEGAL;
blptr->refcount--;
if (blptr->status & CONF_ILLEGAL && blptr->refcount <= 0)
{
- dlinkFindDestroy(blptr, &blacklist_list);
+ rb_dlinkFindDestroy(blptr, &blacklist_list);
MyFree(blptr);
}
}
void lookup_blacklists(struct Client *client_p)
{
- dlink_node *nptr;
+ rb_dlink_node *nptr;
/* We don't do IPv6 right now, sorry! */
if (client_p->localClient->ip.ss_family == AF_INET6)
return;
- DLINK_FOREACH(nptr, blacklist_list.head)
+ RB_DLINK_FOREACH(nptr, blacklist_list.head)
{
struct Blacklist *blptr = (struct Blacklist *) nptr->data;
void abort_blacklist_queries(struct Client *client_p)
{
- dlink_node *ptr, *next_ptr;
+ rb_dlink_node *ptr, *next_ptr;
struct BlacklistClient *blcptr;
if (client_p->preClient == NULL)
return;
- DLINK_FOREACH_SAFE(ptr, next_ptr, client_p->preClient->dnsbl_queries.head)
+ RB_DLINK_FOREACH_SAFE(ptr, next_ptr, client_p->preClient->dnsbl_queries.head)
{
blcptr = ptr->data;
- dlinkDelete(&blcptr->node, &client_p->preClient->dnsbl_queries);
+ rb_dlinkDelete(&blcptr->node, &client_p->preClient->dnsbl_queries);
unref_blacklist(blcptr->blacklist);
delete_resolver_queries(&blcptr->dns_query);
MyFree(blcptr);
void destroy_blacklists(void)
{
- dlink_node *ptr, *next_ptr;
+ rb_dlink_node *ptr, *next_ptr;
struct Blacklist *blptr;
- DLINK_FOREACH_SAFE(ptr, next_ptr, blacklist_list.head)
+ RB_DLINK_FOREACH_SAFE(ptr, next_ptr, blacklist_list.head)
{
blptr = ptr->data;
blptr->hits = 0; /* keep it simple and consistent */
else
{
MyFree(ptr->data);
- dlinkDestroy(ptr, &blacklist_list);
+ rb_dlinkDestroy(ptr, &blacklist_list);
}
}
}
local_tm = localtime(&sb.st_mtime);
if(local_tm != NULL)
- ircsnprintf(user_motd_changed, sizeof(user_motd_changed),
+ rb_snprintf(user_motd_changed, sizeof(user_motd_changed),
"%d/%d/%d %d:%d",
local_tm->tm_mday, local_tm->tm_mon + 1,
1900 + local_tm->tm_year, local_tm->tm_hour,
while((ldirent = readdir(helpfile_dir)) != NULL)
{
- ircsnprintf(filename, sizeof(filename), "%s/%s", HPATH, ldirent->d_name);
+ rb_snprintf(filename, sizeof(filename), "%s/%s", HPATH, ldirent->d_name);
cacheptr = cache_file(filename, ldirent->d_name, HELP_OPER);
irc_dictionary_add(help_dict_oper, cacheptr->name, cacheptr);
}
while((ldirent = readdir(helpfile_dir)) != NULL)
{
- ircsnprintf(filename, sizeof(filename), "%s/%s", UHPATH, ldirent->d_name);
+ rb_snprintf(filename, sizeof(filename), "%s/%s", UHPATH, ldirent->d_name);
cacheptr = cache_file(filename, ldirent->d_name, HELP_USER);
irc_dictionary_add(help_dict_user, cacheptr->name, cacheptr);
{
is_member = IsMember(client_p, chptr);
- cur_len = mlen = ircsprintf(lbuf, form_str(RPL_NAMREPLY),
+ cur_len = mlen = rb_sprintf(lbuf, form_str(RPL_NAMREPLY),
me.name, client_p->name,
channel_pub_or_secret(chptr), chptr->chname);
t = lbuf + mlen;
}
- tlen = ircsprintf(t, "%s%s ", find_channel_status(msptr, stack),
+ tlen = rb_sprintf(t, "%s%s ", find_channel_status(msptr, stack),
target_p->name);
cur_len += tlen;
/* if the buffers havent been built, do it here */
if(s == NULL)
{
- ircsprintf(src_host, "%s!%s@%s", who->name, who->username, who->host);
- ircsprintf(src_iphost, "%s!%s@%s", who->name, who->username, who->sockhost);
+ rb_sprintf(src_host, "%s!%s@%s", who->name, who->username, who->host);
+ rb_sprintf(src_iphost, "%s!%s@%s", who->name, who->username, who->sockhost);
s = src_host;
s2 = src_iphost;
/* if host mangling mode enabled, also check their real host */
if(!strcmp(who->host, who->localClient->mangledhost))
{
- ircsprintf(src_althost, "%s!%s@%s", who->name, who->username, who->orighost);
+ rb_sprintf(src_althost, "%s!%s@%s", who->name, who->username, who->orighost);
s3 = src_althost;
}
/* if host mangling mode not enabled and no other spoof,
* also check the mangled form of their host */
else if (!IsDynSpoof(who))
{
- ircsprintf(src_althost, "%s!%s@%s", who->name, who->username, who->localClient->mangledhost);
+ rb_sprintf(src_althost, "%s!%s@%s", who->name, who->username, who->localClient->mangledhost);
s3 = src_althost;
}
}
/* if the buffers havent been built, do it here */
if(s == NULL)
{
- ircsprintf(src_host, "%s!%s@%s", who->name, who->username, who->host);
- ircsprintf(src_iphost, "%s!%s@%s", who->name, who->username, who->sockhost);
+ rb_sprintf(src_host, "%s!%s@%s", who->name, who->username, who->host);
+ rb_sprintf(src_iphost, "%s!%s@%s", who->name, who->username, who->sockhost);
s = src_host;
s2 = src_iphost;
/* if host mangling mode enabled, also check their real host */
if(!strcmp(who->host, who->localClient->mangledhost))
{
- ircsprintf(src_althost, "%s!%s@%s", who->name, who->username, who->orighost);
+ rb_sprintf(src_althost, "%s!%s@%s", who->name, who->username, who->orighost);
s3 = src_althost;
}
/* if host mangling mode not enabled and no other spoof,
* also check the mangled form of their host */
else if (!IsDynSpoof(who))
{
- ircsprintf(src_althost, "%s!%s@%s", who->name, who->username, who->localClient->mangledhost);
+ rb_sprintf(src_althost, "%s!%s@%s", who->name, who->username, who->localClient->mangledhost);
s3 = src_althost;
}
}
s_assert(source_p->localClient != NULL);
- ircsprintf(src_host, "%s!%s@%s", source_p->name, source_p->username, source_p->host);
- ircsprintf(src_iphost, "%s!%s@%s", source_p->name, source_p->username, source_p->sockhost);
+ rb_sprintf(src_host, "%s!%s@%s", source_p->name, source_p->username, source_p->host);
+ rb_sprintf(src_iphost, "%s!%s@%s", source_p->name, source_p->username, source_p->sockhost);
if(source_p->localClient->mangledhost != NULL)
{
/* if host mangling mode enabled, also check their real host */
if(!strcmp(source_p->host, source_p->localClient->mangledhost))
{
- ircsprintf(src_althost, "%s!%s@%s", source_p->name, source_p->username, source_p->orighost);
+ rb_sprintf(src_althost, "%s!%s@%s", source_p->name, source_p->username, source_p->orighost);
use_althost = 1;
}
/* if host mangling mode not enabled and no other spoof,
* also check the mangled form of their host */
else if (!IsDynSpoof(source_p))
{
- ircsprintf(src_althost, "%s!%s@%s", source_p->name, source_p->username, source_p->localClient->mangledhost);
+ rb_sprintf(src_althost, "%s!%s@%s", source_p->name, source_p->username, source_p->localClient->mangledhost);
use_althost = 1;
}
}
if (!MyClient(client_p))
return NULL;
- ircsprintf(src_host, "%s!%s@%s", client_p->name, client_p->username, client_p->host);
- ircsprintf(src_iphost, "%s!%s@%s", client_p->name, client_p->username, client_p->sockhost);
+ rb_sprintf(src_host, "%s!%s@%s", client_p->name, client_p->username, client_p->host);
+ rb_sprintf(src_iphost, "%s!%s@%s", client_p->name, client_p->username, client_p->sockhost);
DLINK_FOREACH(ptr, client_p->user->channel.head)
{
*mbuf++ = 'l';
if(!IsClient(client_p) || IsMember(client_p, chptr))
- pbuf += ircsprintf(pbuf, " %d", chptr->mode.limit);
+ pbuf += rb_sprintf(pbuf, " %d", chptr->mode.limit);
}
if(*chptr->mode.key)
*mbuf++ = 'k';
if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr))
- pbuf += ircsprintf(pbuf, " %s", chptr->mode.key);
+ pbuf += rb_sprintf(pbuf, " %s", chptr->mode.key);
}
if(chptr->mode.join_num)
*mbuf++ = 'j';
if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr))
- pbuf += ircsprintf(pbuf, " %d:%d", chptr->mode.join_num,
+ pbuf += rb_sprintf(pbuf, " %d:%d", chptr->mode.join_num,
chptr->mode.join_time);
}
*mbuf++ = 'f';
if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr))
- pbuf += ircsprintf(pbuf, " %s", chptr->mode.forward);
+ pbuf += rb_sprintf(pbuf, " %s", chptr->mode.forward);
}
*mbuf = '\0';
nocap = chcap_combos[j].cap_no;
if(cap & CAP_TS6)
- mbl = preflen = ircsprintf(modebuf, ":%s TMODE %ld %s ",
+ mbl = preflen = rb_sprintf(modebuf, ":%s TMODE %ld %s ",
use_id(source_p), (long) chptr->channelts,
chptr->chname);
else
- mbl = preflen = ircsprintf(modebuf, ":%s MODE %s ",
+ mbl = preflen = rb_sprintf(modebuf, ":%s MODE %s ",
source_p->name, chptr->chname);
/* loop the list of - modes we have */
if(arg != NULL)
{
- len = ircsprintf(pbuf, "%s ", arg);
+ len = rb_sprintf(pbuf, "%s ", arg);
pbuf += len;
pbl += len;
mc++;
if(IsPerson(source_p))
- ircsprintf(who, "%s!%s@%s", source_p->name, source_p->username, source_p->host);
+ rb_sprintf(who, "%s!%s@%s", source_p->name, source_p->username, source_p->host);
else
strlcpy(who, source_p->name, sizeof(who));
if (*mask == '$')
{
- mask_pos += ircsprintf(mask_buf + mask_pos, "%s", mask) + 1;
+ mask_pos += rb_sprintf(mask_buf + mask_pos, "%s", mask) + 1;
t = mask_buf + old_mask_pos + 1;
if (*t == '!')
*t = '~';
host[HOSTLEN] = '\0';
}
- mask_pos += ircsprintf(mask_buf + mask_pos, "%s!%s@%s", nick, user, host) + 1;
+ mask_pos += rb_sprintf(mask_buf + mask_pos, "%s!%s@%s", nick, user, host) + 1;
/* restore mask, since we may need to use it again later */
if(at)
if(EmptyString(lstr) || (limit = atoi(lstr)) <= 0)
return;
- ircsprintf(limitstr, "%d", limit);
+ rb_sprintf(limitstr, "%d", limit);
mode_changes[mode_count].letter = c;
mode_changes[mode_count].dir = MODE_ADD;
return;
if(IsServer(source_p))
- mlen = ircsprintf(modebuf, ":%s MODE %s ", fakesource_p->name, chptr->chname);
+ mlen = rb_sprintf(modebuf, ":%s MODE %s ", fakesource_p->name, chptr->chname);
else
- mlen = ircsprintf(modebuf, ":%s!%s@%s MODE %s ",
+ mlen = rb_sprintf(modebuf, ":%s!%s@%s MODE %s ",
source_p->name, source_p->username,
source_p->host, chptr->chname);
if(mode_changes[i].arg != NULL)
{
paracount++;
- len = ircsprintf(pbuf, "%s ", mode_changes[i].arg);
+ len = rb_sprintf(pbuf, "%s ", mode_changes[i].arg);
pbuf += len;
paralen += len;
}
}
if(client_p->localClient->F)
- comm_close(client_p->localClient->F->fd);
+ rb_close(client_p->localClient->F->fd);
if(client_p->localClient->passwd)
{
"No response from %s, closing link",
log_client_name(client_p, HIDE_IP));
}
- (void) ircsnprintf(scratch, sizeof(scratch),
+ (void) rb_snprintf(scratch, sizeof(scratch),
"Ping timeout: %d seconds",
(int) (CurrentTime - client_p->localClient->lasttime));
switch (showip)
{
case SHOW_IP:
- ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
+ rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
client->name, client->username,
client->sockhost);
break;
case MASK_IP:
- ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@255.255.255.255]",
+ rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@255.255.255.255]",
client->name, client->username);
break;
default:
- ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
+ rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
client->name, client->username, client->host);
}
return nbuf;
#ifdef HIDE_SERVERS_IPS
if(EmptyString(target_p->name))
{
- ircsnprintf(nbuf, sizeof(nbuf), "[%s@255.255.255.255]",
+ rb_snprintf(nbuf, sizeof(nbuf), "[%s@255.255.255.255]",
target_p->username);
return nbuf;
}
switch (showip)
{
case SHOW_IP:
- ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
+ rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
target_p->name, target_p->username,
target_p->sockhost);
break;
case MASK_IP:
- ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@255.255.255.255]",
+ rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@255.255.255.255]",
target_p->name, target_p->username);
default:
- ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
+ rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]",
target_p->name, target_p->username,
target_p->host);
}
switch (showip)
{
case SHOW_IP:
- ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@%s]", target_p->name,
+ rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]", target_p->name,
target_p->username, target_p->sockhost);
break;
case MASK_IP:
- ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@255.255.255.255]",
+ rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@255.255.255.255]",
target_p->name, target_p->username);
default:
- ircsnprintf(nbuf, sizeof(nbuf), "%s[%s@%s]", target_p->name,
+ rb_snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]", target_p->name,
target_p->username, target_p->host);
}
if(client_p->flags & FLAGS_SENDQEX)
strlcpy(abt->notice, "Max SendQ exceeded", sizeof(abt->notice));
else
- ircsnprintf(abt->notice, sizeof(abt->notice), "Write error: %s", strerror(errno));
+ rb_snprintf(abt->notice, sizeof(abt->notice), "Write error: %s", strerror(errno));
abt->client = client_p;
SetIOError(client_p);
strcat(comment1, source_p->name);
}
if (IsPerson(from))
- ircsnprintf(newcomment, sizeof(newcomment), "by %s: %s",
+ rb_snprintf(newcomment, sizeof(newcomment), "by %s: %s",
from->name, comment);
if(source_p->serv != NULL)
/* Always show source here, so the server notices show
* which side initiated the split -- jilles
*/
- ircsnprintf(newcomment, sizeof(newcomment), "by %s: %s",
+ rb_snprintf(newcomment, sizeof(newcomment), "by %s: %s",
from == source_p ? me.name : from->name, comment);
if (!IsIOError(source_p))
sendto_one(source_p, "SQUIT %s :%s", use_id(source_p),
if(!IsIOError(client_p))
send_queued_write(client_p->localClient->F->fd, client_p);
- comm_close(client_p->localClient->F->fd);
+ rb_close(client_p->localClient->F->fd);
client_p->localClient->F = NULL;
}
if(-1 < client_p->localClient->ctrlfd)
{
- comm_close(client_p->localClient->ctrlfd);
+ rb_close(client_p->localClient->ctrlfd);
client_p->localClient->ctrlfd = -1;
}
* for reading even though it ends up being an EOF. -avalon
*/
char errmsg[255];
- int current_error = comm_get_sockerr(client_p->localClient->F->fd);
+ int current_error = rb_get_sockerr(client_p->localClient->F->fd);
SetIOError(client_p);
if(error == 0)
strlcpy(errmsg, "Remote host closed the connection", sizeof(errmsg));
else
- ircsnprintf(errmsg, sizeof(errmsg), "Read error: %s", strerror(current_error));
+ rb_snprintf(errmsg, sizeof(errmsg), "Read error: %s", strerror(current_error));
exit_client(client_p, client_p, &me, errmsg);
}
ret = gnutls_handshake(session);
if (ret < 0)
{
- comm_close(fd);
+ rb_close(fd);
gnutls_deinit(session);
return -1;
}
* SOFTWARE.
*/
-#define SPRINTF(x) ((size_t)ircsprintf x)
+#define SPRINTF(x) ((size_t)rb_sprintf x)
/*
* WARNING: Don't even consider trying to compile this on a system where
if(inet_pton4(src, dst))
{
char tmp[HOSTIPLEN];
- ircsprintf(tmp, "::ffff:%s", src);
+ rb_sprintf(tmp, "::ffff:%s", src);
return (inet_pton6(tmp, dst));
}
else
eventRun();
- comm_select(250);
+ rb_select(250);
}
}
{
unsigned int pid = (unsigned int) getpid();
- ircsnprintf(buff, sizeof(buff), "%u\n", pid);
+ rb_snprintf(buff, sizeof(buff), "%u\n", pid);
if((fputs(buff, fb) == -1))
{
ilog(L_MAIN, "Error writing %u to pid file %s (%s)",
fdlist_init();
if(!server_state_foreground)
{
- comm_close_all();
+ rb_close_all();
}
init_main_logfile();
eventAddIsh("collect_zipstats", collect_zipstats, NULL, ZIPSTATS_TIME);
/* Setup the timeout check. I'll shift it later :) -- adrian */
- eventAddIsh("comm_checktimeouts", comm_checktimeouts, NULL, 1);
+ eventAddIsh("rb_checktimeouts", rb_checktimeouts, NULL, 1);
eventAdd("check_rehash", check_rehash, NULL, 1);
if(!EmptyString(date_field))
{
aconf->passwd = MyMalloc(strlen(pass_field) + strlen(date_field) + 4);
- ircsprintf(aconf->passwd, "%s (%s)", pass_field, date_field);
+ rb_sprintf(aconf->passwd, "%s (%s)", pass_field, date_field);
}
else
DupString(aconf->passwd, pass_field);
#endif
port = ntohs(((const struct sockaddr_in *)&listener->addr)->sin_port);
- ircsnprintf(buf, sizeof(buf), "%s[%s/%u]", me.name, listener->name, port);
+ rb_snprintf(buf, sizeof(buf), "%s[%s/%u]", me.name, listener->name, port);
return buf;
}
* At first, open a new socket
*/
- fd = comm_socket(listener->addr.ss_family, SOCK_STREAM, 0, "Listener socket");
+ fd = rb_socket(listener->addr.ss_family, SOCK_STREAM, 0, "Listener socket");
#ifdef IPV6
if(listener->addr.ss_family == AF_INET6)
report_error("setting SO_REUSEADDR for listener %s:%s",
get_listener_name(listener),
get_listener_name(listener), errno);
- comm_close(fd);
+ rb_close(fd);
return 0;
}
report_error("binding listener socket %s:%s",
get_listener_name(listener),
get_listener_name(listener), errno);
- comm_close(fd);
+ rb_close(fd);
return 0;
}
report_error("listen failed for %s:%s",
get_listener_name(listener),
get_listener_name(listener), errno);
- comm_close(fd);
+ rb_close(fd);
return 0;
}
return;
if(listener->fd >= 0)
{
- comm_close(listener->fd);
+ rb_close(listener->fd);
listener->fd = -1;
}
strlcpy(new_client->host, new_client->sockhost, sizeof(new_client->host));
- new_client->localClient->F = comm_add_fd(fd);
+ new_client->localClient->F = rb_add_fd(fd);
new_client->localClient->listener = listener;
++listener->ref_count;
* be accepted until some old is closed first.
*/
- fd = comm_accept(listener->fd, (struct sockaddr *)&sai, &addrlen);
+ fd = rb_accept(listener->fd, (struct sockaddr *)&sai, &addrlen);
if(fd < 0)
{
/* Re-register a new IO request for the next accept .. */
- comm_setselect(listener->fd, FDLIST_SERVICE,
+ rb_setselect(listener->fd, FDLIST_SERVICE,
COMM_SELECT_READ, accept_connection, listener, 0);
return;
}
* check for connection limit
* TBD: this is stupid... either we have a socket or we don't. -nenolod
*/
- if((comm_get_maxconnections() - 10) < fd)
+ if((rb_get_maxconnections() - 10) < fd)
{
++ServerStats->is_ref;
/*
}
write(fd, "ERROR :All connections in use\r\n", 32);
- comm_close(fd);
+ rb_close(fd);
/* Re-register a new IO request for the next accept .. */
- comm_setselect(listener->fd, FDLIST_SERVICE,
+ rb_setselect(listener->fd, FDLIST_SERVICE,
COMM_SELECT_READ, accept_connection, listener, 0);
return;
}
if(ConfigFileEntry.dline_with_reason)
{
- if (ircsnprintf(buf, sizeof(buf), "ERROR :*** Banned: %s\r\n", aconf->passwd) >= (sizeof(buf)-1))
+ if (rb_snprintf(buf, sizeof(buf), "ERROR :*** Banned: %s\r\n", aconf->passwd) >= (sizeof(buf)-1))
{
buf[sizeof(buf) - 3] = '\r';
buf[sizeof(buf) - 2] = '\n';
}
}
else
- ircsprintf(buf, "ERROR :You have been D-lined.\r\n");
+ rb_sprintf(buf, "ERROR :You have been D-lined.\r\n");
write(fd, buf, strlen(buf));
- comm_close(fd);
+ rb_close(fd);
/* Re-register a new IO request for the next accept .. */
- comm_setselect(listener->fd, FDLIST_SERVICE,
+ rb_setselect(listener->fd, FDLIST_SERVICE,
COMM_SELECT_READ, accept_connection, listener, 0);
return;
}
add_connection(listener, fd, (struct sockaddr *)&sai, aconf ? 1 : 0);
/* Re-register a new IO request for the next accept .. */
- comm_setselect(listener->fd, FDLIST_SERVICE, COMM_SELECT_READ,
+ rb_setselect(listener->fd, FDLIST_SERVICE, COMM_SELECT_READ,
accept_connection, listener, 0);
}
len = strlen(ldirent->d_name);
if((len > 3) && !strcmp(ldirent->d_name+len-3, SHARED_SUFFIX))
{
- (void) ircsnprintf(module_fq_name, sizeof(module_fq_name), "%s/%s", AUTOMODPATH, ldirent->d_name);
+ (void) rb_snprintf(module_fq_name, sizeof(module_fq_name), "%s/%s", AUTOMODPATH, ldirent->d_name);
(void) load_a_module(module_fq_name, warn, 0);
}
for (i = 0; core_module_table[i]; i++)
{
- ircsnprintf(module_name, sizeof(module_name), "%s/%s%s", MODPATH,
+ rb_snprintf(module_name, sizeof(module_name), "%s/%s%s", MODPATH,
core_module_table[i], SHARED_SUFFIX);
if(load_a_module(module_name, warn, 1) == -1)
{
mpath = pathst->data;
- ircsnprintf(modpath, sizeof(modpath), "%s/%s", mpath->path, path);
+ rb_snprintf(modpath, sizeof(modpath), "%s/%s", mpath->path, path);
if((strstr(modpath, "../") == NULL) && (strstr(modpath, "/..") == NULL))
{
if(stat(modpath, &statbuf) == 0)
if(monptr == NULL)
return;
- ircsnprintf(buf, sizeof(buf), "%s!%s@%s",
+ rb_snprintf(buf, sizeof(buf), "%s!%s@%s",
client_p->name, client_p->username, client_p->host);
sendto_monitor(monptr, form_str(RPL_MONONLINE), me.name, "*", buf);
return;
/* and finally, reset the flood check */
- comm_setflush(fd, 1000, flood_recalc, client_p);
+ rb_setflush(fd, 1000, flood_recalc, client_p);
}
/*
nodata:
/* If we get here, we need to register for another COMM_SELECT_READ */
- comm_setselect(fd, FDLIST_SERVER, COMM_SELECT_READ, read_ctrl_packet, server, 0);
+ rb_setselect(fd, FDLIST_SERVER, COMM_SELECT_READ, read_ctrl_packet, server, 0);
}
/*
{
if((length == -1) && ignoreErrno(errno))
{
- comm_setselect(client_p->localClient->F->fd, FDLIST_IDLECLIENT,
+ rb_setselect(client_p->localClient->F->fd, FDLIST_IDLECLIENT,
COMM_SELECT_READ, read_packet, client_p, 0);
return;
}
/* If we get here, we need to register for another COMM_SELECT_READ */
if(PARSE_AS_SERVER(client_p))
{
- comm_setselect(client_p->localClient->F->fd, FDLIST_SERVER, COMM_SELECT_READ,
+ rb_setselect(client_p->localClient->F->fd, FDLIST_SERVER, COMM_SELECT_READ,
read_packet, client_p, 0);
}
else
{
- comm_setselect(client_p->localClient->F->fd, FDLIST_IDLECLIENT,
+ rb_setselect(client_p->localClient->F->fd, FDLIST_IDLECLIENT,
COMM_SELECT_READ, read_packet, client_p, 0);
}
}
int tl; /* current length of presently being built string in t */
for (i = 2; i < (parc - 1); i++)
{
- tl = ircsprintf(t, " %s", parv[i]);
+ tl = rb_sprintf(t, " %s", parv[i]);
t += tl;
}
- ircsprintf(t, " :%s", parv[parc - 1]);
+ rb_sprintf(t, " :%s", parv[parc - 1]);
}
if((target_p = find_client(parv[1])) != NULL)
{
ServerStats->is_rej++;
SetReject(client_p);
- comm_setselect(client_p->localClient->F->fd, FDLIST_NONE, COMM_SELECT_WRITE | COMM_SELECT_READ, NULL, NULL, 0);
+ rb_setselect(client_p->localClient->F->fd, FDLIST_NONE, COMM_SELECT_WRITE | COMM_SELECT_READ, NULL, NULL, 0);
SetClosing(client_p);
dlinkMoveNode(&client_p->localClient->tnode, &unknown_list, &delay_exit);
return 1;
{
SetExUnknown(client_p);
SetReject(client_p);
- comm_setselect(client_p->localClient->F->fd, FDLIST_NONE, COMM_SELECT_WRITE | COMM_SELECT_READ, NULL, NULL, 0);
+ rb_setselect(client_p->localClient->F->fd, FDLIST_NONE, COMM_SELECT_WRITE | COMM_SELECT_READ, NULL, NULL, 0);
SetClosing(client_p);
dlinkMoveNode(&client_p->localClient->tnode, &unknown_list, &delay_exit);
return 1;
if (res_fd <= 0) /* there isn't any such thing as fd 0, that's just a myth. */
{
- if ((res_fd = comm_socket(irc_nsaddr_list[0].ss_family, SOCK_DGRAM, 0,
+ if ((res_fd = rb_socket(irc_nsaddr_list[0].ss_family, SOCK_DGRAM, 0,
"UDP resolver socket")) == -1)
return;
/* At the moment, the resolver FD data is global .. */
- comm_setselect(res_fd, FDLIST_NONE, COMM_SELECT_READ, res_readreply, NULL, 0);
+ rb_setselect(res_fd, FDLIST_NONE, COMM_SELECT_READ, res_readreply, NULL, 0);
eventAdd("timeout_resolver", timeout_resolver, NULL, 1);
}
}
*/
void restart_resolver(void)
{
- comm_close(res_fd);
+ rb_close(res_fd);
res_fd = -1;
eventDelete(timeout_resolver, NULL); /* -ddosen */
start_resolver();
struct sockaddr_in *v4 = (struct sockaddr_in *)addr;
cp = (const unsigned char *)&v4->sin_addr.s_addr;
- ircsprintf(request->queryname, "%u.%u.%u.%u.in-addr.arpa", (unsigned int)(cp[3]),
+ rb_sprintf(request->queryname, "%u.%u.%u.%u.in-addr.arpa", (unsigned int)(cp[3]),
(unsigned int)(cp[2]), (unsigned int)(cp[1]), (unsigned int)(cp[0]));
}
#ifdef IPV6
/* Re-schedule a read *after* recvfrom, or we'll be registering
* interest where it'll instantly be ready for read :-) -- adrian
*/
- comm_setselect(fd, FDLIST_NONE, COMM_SELECT_READ, res_readreply, NULL, 0);
+ rb_setselect(fd, FDLIST_NONE, COMM_SELECT_READ, res_readreply, NULL, 0);
/* Better to cast the sizeof instead of rc */
if (rc <= (int)(sizeof(HEADER)))
return;
server_reboot(void)
{
int i;
- int maxconn = comm_get_maxconnections();
+ int maxconn = rb_get_maxconnections();
sendto_realops_snomask(SNO_GENERAL, L_ALL, "Restarting server...");
/*
* XXX we used to call flush_connections() here. But since this routine
* doesn't exist anymore, we won't be flushing. This is ok, since
- * when close handlers come into existance, comm_close() will be called
+ * when close handlers come into existance, rb_close() will be called
* below, and the data flushing will be implicit.
* -- adrian
*
* -- adrian
*/
client->localClient->allow_read = MAX_FLOOD;
- comm_setflush(client->localClient->F->fd, 1000, flood_recalc, client);
+ rb_setflush(client->localClient->F->fd, 1000, flood_recalc, client);
dlinkAddTail(client, &client->node, &global_client_list);
read_packet(client->localClient->F->fd, client);
}
{
++ServerStats->is_abad;
- comm_close(auth->fd);
+ rb_close(auth->fd);
auth->fd = -1;
ClearAuth(auth);
return 0;
family = auth->client->localClient->ip.ss_family;
- if((fd = comm_socket(family, SOCK_STREAM, 0, "ident")) == -1)
+ if((fd = rb_socket(family, SOCK_STREAM, 0, "ident")) == -1)
{
report_error("creating auth stream socket %s:%s",
get_client_name(auth->client, SHOW_IP),
/*
* TBD: this is a pointless arbitrary limit .. we either have a socket or not. -nenolod
*/
- if((comm_get_maxconnections() - 10) < fd)
+ if((rb_get_maxconnections() - 10) < fd)
{
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"Can't allocate fd for auth on %s",
get_client_name(auth->client, SHOW_IP));
- comm_close(fd);
+ rb_close(fd);
return 0;
}
auth->fd = fd;
SetAuthConnect(auth);
- comm_connect_tcp(fd, auth->client->sockhost, 113,
+ rb_connect_tcp(fd, auth->client->sockhost, 113,
(struct sockaddr *) &localaddr, GET_SS_LEN(localaddr),
auth_connect_callback, auth,
localaddr.ss_family, GlobalSetOptions.ident_timeout);
if(auth->timeout < CurrentTime)
{
if(auth->fd >= 0)
- comm_close(auth->fd);
+ rb_close(auth->fd);
if(IsDoingAuth(auth))
{
}
/*
- * auth_connect_callback() - deal with the result of comm_connect_tcp()
+ * auth_connect_callback() - deal with the result of rb_connect_tcp()
*
* If the connection failed, we simply close the auth fd and report
* a failure. If the connection suceeded send the ident server a query
auth_error(auth);
return;
}
- ircsnprintf(authbuf, sizeof(authbuf), "%u , %u\r\n",
+ rb_snprintf(authbuf, sizeof(authbuf), "%u , %u\r\n",
(unsigned int) ntohs(them.sin_port), (unsigned int) ntohs(us.sin_port));
if(write(auth->fd, authbuf, strlen(authbuf)) == -1)
if(len < 0 && ignoreErrno(errno))
{
- comm_setselect(fd, FDLIST_IDLECLIENT, COMM_SELECT_READ, read_auth_reply, auth, 0);
+ rb_setselect(fd, FDLIST_IDLECLIENT, COMM_SELECT_READ, read_auth_reply, auth, 0);
return;
}
}
}
- comm_close(auth->fd);
+ rb_close(auth->fd);
auth->fd = -1;
ClearAuth(auth);
delete_resolver_queries(&auth->dns_query);
if(auth->fd >= 0)
- comm_close(auth->fd);
+ rb_close(auth->fd);
dlinkDelete(&auth->node, &auth_poll_list);
free_auth_request(auth);
ConfigFileEntry.reject_duration = 120;
ConfigFileEntry.max_unknown_ip = 2;
- ServerInfo.max_clients = comm_get_maxconnections() - MAX_BUFFER;
+ ServerInfo.max_clients = rb_get_maxconnections() - MAX_BUFFER;
}
#undef YES
if(MyOper(client_p))
{
- ircsnprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}",
+ rb_snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}",
client_p->name, client_p->username,
client_p->host, client_p->localClient->opername);
return buffer;
}
- ircsnprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}",
+ rb_snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}",
client_p->name, client_p->username,
client_p->host, client_p->servptr->name);
return buffer;
if(type == KLINE_TYPE)
{
- ircsnprintf(buffer, sizeof(buffer),
+ rb_snprintf(buffer, sizeof(buffer),
"\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n",
user, host, reason, oper_reason, current_date,
get_oper_name(source_p), CurrentTime);
}
else if(type == DLINE_TYPE)
{
- ircsnprintf(buffer, sizeof(buffer),
+ rb_snprintf(buffer, sizeof(buffer),
"\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n", host,
reason, oper_reason, current_date, get_oper_name(source_p), CurrentTime);
}
else if(type == RESV_TYPE)
{
- ircsnprintf(buffer, sizeof(buffer), "\"%s\",\"%s\",\"%s\",%ld\n",
+ rb_snprintf(buffer, sizeof(buffer), "\"%s\",\"%s\",\"%s\",%ld\n",
host, reason, get_oper_name(source_p), CurrentTime);
}
ircvsnprintf(buf, sizeof(buf), format, args);
va_end(args);
- ircsnprintf(buf2, sizeof(buf2), "%s %s\n", smalldate(), buf);
+ rb_snprintf(buf2, sizeof(buf2), "%s %s\n", smalldate(), buf);
if(fputs(buf2, logfile) < 0)
{
lt = localtime(<ime);
- ircsnprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d",
+ rb_snprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d",
lt->tm_year + 1900, lt->tm_mon + 1,
lt->tm_mday, lt->tm_hour, lt->tm_min);
/*
* We used to only print this if serv_connect() actually
- * suceeded, but since comm_tcp_connect() can call the callback
+ * suceeded, but since rb_tcp_connect() can call the callback
* immediately if there is an error, we were getting error messages
* in the wrong order. SO, we just print out the activated line,
* and let serv_connect() / serv_connect_callback() print an
{
if(cap->cap & cap_can_send)
{
- tl = ircsprintf(t, "%s ", cap->name);
+ tl = rb_sprintf(t, "%s ", cap->name);
t += tl;
}
}
char *pp;
int count = 0;
- mlen = ircsprintf(buf, ":%s MODE %s +", me.name, chname);
+ mlen = rb_sprintf(buf, ":%s MODE %s +", me.name, chname);
cur_len = mlen;
mp = mbuf;
*mp++ = flag;
*mp = '\0';
- pp += ircsprintf(pp, "%s ", banptr->banstr);
+ pp += rb_sprintf(pp, "%s ", banptr->banstr);
cur_len += tlen;
count++;
}
int mlen;
int cur_len;
- cur_len = mlen = ircsprintf(buf, ":%s BMASK %ld %s %c :",
+ cur_len = mlen = rb_sprintf(buf, ":%s BMASK %ld %s %c :",
me.id, (long) chptr->channelts, chptr->chname, flag);
t = buf + mlen;
t = buf + mlen;
}
- ircsprintf(t, "%s ", banptr->banstr);
+ rb_sprintf(t, "%s ", banptr->banstr);
t += tlen;
cur_len += tlen;
}
if(*chptr->chname != '#')
continue;
- cur_len = mlen = ircsprintf(buf, ":%s SJOIN %ld %s %s :", me.name,
+ cur_len = mlen = rb_sprintf(buf, ":%s SJOIN %ld %s %s :", me.name,
(long) chptr->channelts, chptr->chname,
channel_modes(chptr, client_p));
t = buf + mlen;
}
- ircsprintf(t, "%s%s ", find_channel_status(msptr, 1),
+ rb_sprintf(t, "%s%s ", find_channel_status(msptr, 1),
msptr->client_p->name);
cur_len += tlen;
if(*chptr->chname != '#')
continue;
- cur_len = mlen = ircsprintf(buf, ":%s SJOIN %ld %s %s :", me.id,
+ cur_len = mlen = rb_sprintf(buf, ":%s SJOIN %ld %s %s :", me.id,
(long) chptr->channelts, chptr->chname,
channel_modes(chptr, client_p));
t = buf + mlen;
}
- ircsprintf(t, "%s%s ", find_channel_status(msptr, 1),
+ rb_sprintf(t, "%s%s ", find_channel_status(msptr, 1),
use_id(msptr->client_p));
cur_len += tlen;
int tl;
t = msgbuf;
- tl = ircsprintf(msgbuf, "TS ");
+ tl = rb_sprintf(msgbuf, "TS ");
t += tl;
if(!IsServer(target_p) || !target_p->serv->caps) /* short circuit if no caps */
{
if(cap->cap & target_p->serv->caps)
{
- tl = ircsprintf(t, "%s ", cap->name);
+ tl = rb_sprintf(t, "%s ", cap->name);
t += tl;
}
}
(me.info[0]) ? (me.info) : "IRCers United");
}
- if(!comm_set_buffers(client_p->localClient->F->fd, READBUF_SIZE))
+ if(!rb_set_buffers(client_p->localClient->F->fd, READBUF_SIZE))
report_error(SETBUF_ERROR_MSG,
get_server_name(client_p, SHOW_IP),
log_client_name(client_p, SHOW_IP), errno);
/* we won't overflow FD_DESC_SZ here, as it can hold
* client_p->name + 64
*/
- comm_note(client_p->localClient->F->fd, "slink data: %s", client_p->name);
- comm_note(client_p->localClient->ctrlfd, "slink ctrl: %s", client_p->name);
+ rb_note(client_p->localClient->F->fd, "slink data: %s", client_p->name);
+ rb_note(client_p->localClient->ctrlfd, "slink ctrl: %s", client_p->name);
}
else
- comm_note(client_p->localClient->F->fd, "Server: %s", client_p->name);
+ rb_note(client_p->localClient->F->fd, "Server: %s", client_p->name);
/*
** Old sendto_serv_but_one() call removed because we now
goto fork_error;
else if(ret == 0)
{
- int maxconn = comm_get_maxconnections();
+ int maxconn = rb_get_maxconnections();
/* set our fds as non blocking and close everything else */
for (i = 0; i < maxconn; i++)
if((i == ctrl_fds[1]) || (i == data_fds[1]) || (i == server->localClient->F->fd))
{
- comm_set_nb(i);
+ rb_set_nb(i);
}
else
{
}
}
- ircsnprintf(fd_str[0], sizeof(fd_str[0]), "%d", ctrl_fds[1]);
- ircsnprintf(fd_str[1], sizeof(fd_str[1]), "%d", data_fds[1]);
- ircsnprintf(fd_str[2], sizeof(fd_str[2]), "%d", server->localClient->F->fd);
+ rb_snprintf(fd_str[0], sizeof(fd_str[0]), "%d", ctrl_fds[1]);
+ rb_snprintf(fd_str[1], sizeof(fd_str[1]), "%d", data_fds[1]);
+ rb_snprintf(fd_str[2], sizeof(fd_str[2]), "%d", server->localClient->F->fd);
kid_argv[0] = slink;
kid_argv[1] = fd_str[0];
kid_argv[2] = fd_str[1];
}
else
{
- comm_close(server->localClient->F->fd);
+ rb_close(server->localClient->F->fd);
/* close the childs end of the pipes */
close(ctrl_fds[1]);
s_assert(server->localClient);
server->localClient->ctrlfd = ctrl_fds[0];
- server->localClient->F = comm_add_fd(data_fds[0]);
+ server->localClient->F = rb_add_fd(data_fds[0]);
- if(!comm_set_nb(server->localClient->F->fd))
+ if(!rb_set_nb(server->localClient->F->fd))
{
report_error(NONB_ERROR_MSG,
get_server_name(server, SHOW_IP),
errno);
}
- if(!comm_set_nb(server->localClient->ctrlfd))
+ if(!rb_set_nb(server->localClient->ctrlfd))
{
report_error(NONB_ERROR_MSG,
get_server_name(server, SHOW_IP),
errno);
}
- comm_open(server->localClient->ctrlfd, FD_SOCKET, NULL);
- comm_open(server->localClient->F->fd, FD_SOCKET, NULL);
+ rb_open(server->localClient->ctrlfd, FD_SOCKET, NULL);
+ rb_open(server->localClient->F->fd, FD_SOCKET, NULL);
read_ctrl_packet(server->localClient->ctrlfd, server);
read_packet(server->localClient->F->fd, server);
* This code initiates a connection to a server. It first checks to make
* sure the given server exists. If this is the case, it creates a socket,
* creates a client, saves the socket information in the client, and
- * initiates a connection to the server through comm_connect_tcp(). The
+ * initiates a connection to the server through rb_connect_tcp(). The
* completion of this goes through serv_completed_connection().
*
* We return 1 if the connection is attempted, since we don't know whether
}
/* create a socket for the server connection */
- if((fd = comm_socket(server_p->aftype, SOCK_STREAM, 0, NULL)) < 0)
+ if((fd = rb_socket(server_p->aftype, SOCK_STREAM, 0, NULL)) < 0)
{
/* Eek, failure to create the socket */
report_error("opening stream socket to %s: %s",
}
/* servernames are always guaranteed under HOSTLEN chars */
- comm_note(fd, "Server: %s", server_p->name);
+ rb_note(fd, "Server: %s", server_p->name);
/* Create a local client */
client_p = make_client(NULL);
strlcpy(client_p->name, server_p->name, sizeof(client_p->name));
strlcpy(client_p->host, server_p->host, sizeof(client_p->host));
strlcpy(client_p->sockhost, server_p->host, sizeof(client_p->sockhost));
- client_p->localClient->F = comm_add_fd(fd);
+ client_p->localClient->F = rb_add_fd(fd);
/*
* Set up the initial server evilness, ripped straight from
* -- adrian
*/
- if(!comm_set_buffers(client_p->localClient->F->fd, READBUF_SIZE))
+ if(!rb_set_buffers(client_p->localClient->F->fd, READBUF_SIZE))
{
report_error(SETBUF_ERROR_MSG,
get_server_name(client_p, SHOW_IP),
#endif
(server_p->aftype == AF_INET ? "IPv4" : "?"));
- comm_connect_tcp(client_p->localClient->F->fd, server_p->host,
+ rb_connect_tcp(client_p->localClient->F->fd, server_p->host,
server_p->port, NULL, 0, serv_connect_callback,
client_p, server_p->aftype,
ConfigFileEntry.connect_timeout);
(server_p->aftype == AF_INET ? "IPv4" : "?"), vhoststr);
- comm_connect_tcp(client_p->localClient->F->fd, server_p->host,
+ rb_connect_tcp(client_p->localClient->F->fd, server_p->host,
server_p->port, (struct sockaddr *) &myipnum,
GET_SS_LEN(myipnum), serv_connect_callback, client_p,
myipnum.ss_family, ConfigFileEntry.connect_timeout);
struct Client *client_p = data;
struct server_conf *server_p;
char *errstr;
- fde_t *F = comm_locate_fd(fd);
+ fde_t *F = rb_locate_fd(fd);
/* First, make sure its a real client! */
s_assert(client_p != NULL);
#else
client_p->host,
#endif
- comm_errstr(status));
+ rb_errstr(status));
ilog(L_SERVER, "Error connecting to %s[%s]: %s",
client_p->name, client_p->sockhost,
- comm_errstr(status));
+ rb_errstr(status));
}
else
{
- errstr = strerror(comm_get_sockerr(fd));
+ errstr = strerror(rb_get_sockerr(fd));
sendto_realops_snomask(SNO_GENERAL, is_remote_connect(client_p) ? L_NETWIDE : L_ALL,
"Error connecting to %s[%s]: %s (%s)",
client_p->name,
#else
client_p->host,
#endif
- comm_errstr(status), errstr);
+ rb_errstr(status), errstr);
ilog(L_SERVER, "Error connecting to %s[%s]: %s (%s)",
client_p->name, client_p->sockhost,
- comm_errstr(status), errstr);
+ rb_errstr(status), errstr);
}
- exit_client(client_p, client_p, &me, comm_errstr(status));
+ exit_client(client_p, client_p, &me, rb_errstr(status));
return;
}
del_from_client_hash(source_p->name, source_p);
strlcpy(source_p->name, source_p->preClient->spoofnick, NICKLEN + 1);
add_to_client_hash(source_p->name, source_p);
- comm_note(source_p->localClient->F->fd, "Nick: %s", source_p->name);
+ rb_note(source_p->localClient->F->fd, "Nick: %s", source_p->name);
}
if(!valid_hostname(source_p->host))
ServerStats->is_ref++;
sendto_one_notice(source_p, ":*** Your username is invalid. Please make sure that your username contains "
"only alphanumeric characters.");
- ircsprintf(tmpstr2, "Invalid username [%s]", source_p->username);
+ rb_sprintf(tmpstr2, "Invalid username [%s]", source_p->username);
exit_client(client_p, source_p, &me, tmpstr2);
return (CLIENT_EXITED);
}
#ifdef USE_IODEBUG_HOOKS
hook_data_int hd;
#endif
- fde_t *F = comm_locate_fd(to->localClient->F->fd);
+ fde_t *F = rb_locate_fd(to->localClient->F->fd);
if (!F)
return;
else
flags = COMM_SELECT_WRITE;
if(linebuf_len(&to->localClient->buf_sendq))
- comm_setselect(fd, FDLIST_IDLECLIENT, flags,
+ rb_setselect(fd, FDLIST_IDLECLIENT, flags,
send_queued_write, to, 0);
}
/* if we have any more data, reschedule a write */
if(to->localClient->slinkq_len)
- comm_setselect(to->localClient->ctrlfd, FDLIST_IDLECLIENT,
+ rb_setselect(to->localClient->ctrlfd, FDLIST_IDLECLIENT,
COMM_SELECT_WRITE|COMM_SELECT_RETRY, send_queued_slink_write, to, 0);
}
isupport_intptr(const void *ptr)
{
static char buf[15];
- ircsnprintf(buf, sizeof buf, "%d", *(const int *)ptr);
+ rb_snprintf(buf, sizeof buf, "%d", *(const int *)ptr);
return buf;
}
{
static char result[80];
- ircsnprintf(result, sizeof result, "%s%sbq,k,%slj,imnpst%scgzLP%s",
+ rb_snprintf(result, sizeof result, "%s%sbq,k,%slj,imnpst%scgzLP%s",
ConfigChannel.use_except ? "e" : "",
ConfigChannel.use_invex ? "I" : "",
ConfigChannel.use_forward ? "f" : "",
{
static char result[30];
- ircsnprintf(result, sizeof result, "&#:%i", ConfigChannel.max_chans_per_user);
+ rb_snprintf(result, sizeof result, "&#:%i", ConfigChannel.max_chans_per_user);
return result;
}
{
static char result[30];
- ircsnprintf(result, sizeof result, "bq%s%s:%i",
+ rb_snprintf(result, sizeof result, "bq%s%s:%i",
ConfigChannel.use_except ? "e" : "",
ConfigChannel.use_invex ? "I" : "",
ConfigChannel.max_bans);
{
static char result[200];
- ircsnprintf(result, sizeof result, "NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:%d,NOTICE:%d,ACCEPT:,MONITOR:",
+ rb_snprintf(result, sizeof result, "NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:%d,NOTICE:%d,ACCEPT:,MONITOR:",
ConfigFileEntry.max_targets,
ConfigFileEntry.max_targets);
return result;
p = get_extban_string();
if (EmptyString(p))
return NULL;
- ircsnprintf(result, sizeof result, "$,%s", p);
+ rb_snprintf(result, sizeof result, "$,%s", p);
return result;
}