Remove construction of some TS5 linebufs.

This commit is contained in:
Jilles Tjoelker 2008-06-14 02:30:30 +02:00
parent 982ef94983
commit ba301effe1

View file

@ -467,7 +467,6 @@ sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
static char buf[BUFSIZE]; static char buf[BUFSIZE];
va_list args; va_list args;
buf_head_t rb_linebuf_local; buf_head_t rb_linebuf_local;
buf_head_t rb_linebuf_name;
buf_head_t rb_linebuf_id; buf_head_t rb_linebuf_id;
struct Client *target_p; struct Client *target_p;
struct membership *msptr; struct membership *msptr;
@ -475,7 +474,6 @@ sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
rb_dlink_node *next_ptr; rb_dlink_node *next_ptr;
rb_linebuf_newbuf(&rb_linebuf_local); rb_linebuf_newbuf(&rb_linebuf_local);
rb_linebuf_newbuf(&rb_linebuf_name);
rb_linebuf_newbuf(&rb_linebuf_id); rb_linebuf_newbuf(&rb_linebuf_id);
current_serial++; current_serial++;
@ -493,7 +491,6 @@ sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
source_p->name, source_p->username, source_p->name, source_p->username,
source_p->host, buf); source_p->host, buf);
rb_linebuf_putmsg(&rb_linebuf_name, NULL, NULL, ":%s %s", source_p->name, buf);
rb_linebuf_putmsg(&rb_linebuf_id, NULL, NULL, ":%s %s", use_id(source_p), buf); rb_linebuf_putmsg(&rb_linebuf_id, NULL, NULL, ":%s %s", use_id(source_p), buf);
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->members.head) RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->members.head)
@ -520,11 +517,7 @@ sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
if(target_p->from->serial != current_serial) if(target_p->from->serial != current_serial)
{ {
if(has_id(target_p->from)) send_linebuf_remote(target_p, source_p, &rb_linebuf_id);
send_linebuf_remote(target_p, source_p, &rb_linebuf_id);
else
send_linebuf_remote(target_p, source_p, &rb_linebuf_name);
target_p->from->serial = current_serial; target_p->from->serial = current_serial;
} }
} }
@ -533,7 +526,6 @@ sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
} }
rb_linebuf_donebuf(&rb_linebuf_local); rb_linebuf_donebuf(&rb_linebuf_local);
rb_linebuf_donebuf(&rb_linebuf_name);
rb_linebuf_donebuf(&rb_linebuf_id); rb_linebuf_donebuf(&rb_linebuf_id);
} }
@ -749,11 +741,9 @@ sendto_match_butone(struct Client *one, struct Client *source_p,
rb_dlink_node *ptr; rb_dlink_node *ptr;
rb_dlink_node *next_ptr; rb_dlink_node *next_ptr;
buf_head_t rb_linebuf_local; buf_head_t rb_linebuf_local;
buf_head_t rb_linebuf_name;
buf_head_t rb_linebuf_id; buf_head_t rb_linebuf_id;
rb_linebuf_newbuf(&rb_linebuf_local); rb_linebuf_newbuf(&rb_linebuf_local);
rb_linebuf_newbuf(&rb_linebuf_name);
rb_linebuf_newbuf(&rb_linebuf_id); rb_linebuf_newbuf(&rb_linebuf_id);
va_start(args, pattern); va_start(args, pattern);
@ -769,7 +759,6 @@ sendto_match_butone(struct Client *one, struct Client *source_p,
source_p->name, source_p->username, source_p->name, source_p->username,
source_p->host, buf); source_p->host, buf);
rb_linebuf_putmsg(&rb_linebuf_name, NULL, NULL, ":%s %s", source_p->name, buf);
rb_linebuf_putmsg(&rb_linebuf_id, NULL, NULL, ":%s %s", use_id(source_p), buf); rb_linebuf_putmsg(&rb_linebuf_id, NULL, NULL, ":%s %s", use_id(source_p), buf);
if(what == MATCH_HOST) if(what == MATCH_HOST)
@ -799,15 +788,11 @@ sendto_match_butone(struct Client *one, struct Client *source_p,
if(target_p == one) if(target_p == one)
continue; continue;
if(has_id(target_p)) send_linebuf_remote(target_p, source_p, &rb_linebuf_id);
send_linebuf_remote(target_p, source_p, &rb_linebuf_id);
else
send_linebuf_remote(target_p, source_p, &rb_linebuf_name);
} }
rb_linebuf_donebuf(&rb_linebuf_local); rb_linebuf_donebuf(&rb_linebuf_local);
rb_linebuf_donebuf(&rb_linebuf_id); rb_linebuf_donebuf(&rb_linebuf_id);
rb_linebuf_donebuf(&rb_linebuf_name);
} }
/* sendto_match_servs() /* sendto_match_servs()
@ -825,13 +810,11 @@ sendto_match_servs(struct Client *source_p, const char *mask, int cap,
rb_dlink_node *ptr; rb_dlink_node *ptr;
struct Client *target_p; struct Client *target_p;
buf_head_t rb_linebuf_id; buf_head_t rb_linebuf_id;
buf_head_t rb_linebuf_name;
if(EmptyString(mask)) if(EmptyString(mask))
return; return;
rb_linebuf_newbuf(&rb_linebuf_id); rb_linebuf_newbuf(&rb_linebuf_id);
rb_linebuf_newbuf(&rb_linebuf_name);
va_start(args, pattern); va_start(args, pattern);
rb_vsnprintf(buf, sizeof(buf), pattern, args); rb_vsnprintf(buf, sizeof(buf), pattern, args);
@ -839,8 +822,6 @@ sendto_match_servs(struct Client *source_p, const char *mask, int cap,
rb_linebuf_putmsg(&rb_linebuf_id, NULL, NULL, rb_linebuf_putmsg(&rb_linebuf_id, NULL, NULL,
":%s %s", use_id(source_p), buf); ":%s %s", use_id(source_p), buf);
rb_linebuf_putmsg(&rb_linebuf_name, NULL, NULL,
":%s %s", source_p->name, buf);
current_serial++; current_serial++;
@ -868,15 +849,11 @@ sendto_match_servs(struct Client *source_p, const char *mask, int cap,
if(nocap && !NotCapable(target_p->from, nocap)) if(nocap && !NotCapable(target_p->from, nocap))
continue; continue;
if(has_id(target_p->from)) _send_linebuf(target_p->from, &rb_linebuf_id);
_send_linebuf(target_p->from, &rb_linebuf_id);
else
_send_linebuf(target_p->from, &rb_linebuf_name);
} }
} }
rb_linebuf_donebuf(&rb_linebuf_id); rb_linebuf_donebuf(&rb_linebuf_id);
rb_linebuf_donebuf(&rb_linebuf_name);
} }
/* sendto_monitor() /* sendto_monitor()
@ -1145,17 +1122,13 @@ kill_client_serv_butone(struct Client *one, struct Client *target_p, const char
rb_dlink_node *ptr; rb_dlink_node *ptr;
rb_dlink_node *next_ptr; rb_dlink_node *next_ptr;
buf_head_t rb_linebuf_id; buf_head_t rb_linebuf_id;
buf_head_t rb_linebuf_name;
rb_linebuf_newbuf(&rb_linebuf_name);
rb_linebuf_newbuf(&rb_linebuf_id); rb_linebuf_newbuf(&rb_linebuf_id);
va_start(args, pattern); va_start(args, pattern);
rb_vsnprintf(buf, sizeof(buf), pattern, args); rb_vsnprintf(buf, sizeof(buf), pattern, args);
va_end(args); va_end(args);
rb_linebuf_putmsg(&rb_linebuf_name, NULL, NULL, ":%s KILL %s :%s",
me.name, target_p->name, buf);
rb_linebuf_putmsg(&rb_linebuf_id, NULL, NULL, ":%s KILL %s :%s", rb_linebuf_putmsg(&rb_linebuf_id, NULL, NULL, ":%s KILL %s :%s",
use_id(&me), use_id(target_p), buf); use_id(&me), use_id(target_p), buf);
@ -1170,12 +1143,8 @@ kill_client_serv_butone(struct Client *one, struct Client *target_p, const char
(!has_id(client_p) || !has_id(target_p))) (!has_id(client_p) || !has_id(target_p)))
continue; continue;
if(has_id(client_p)) _send_linebuf(client_p, &rb_linebuf_id);
_send_linebuf(client_p, &rb_linebuf_id);
else
_send_linebuf(client_p, &rb_linebuf_name);
} }
rb_linebuf_donebuf(&rb_linebuf_id); rb_linebuf_donebuf(&rb_linebuf_id);
rb_linebuf_donebuf(&rb_linebuf_name);
} }