19 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
20 |
|
* USA |
21 |
|
* |
22 |
< |
* $Id: send.c,v 7.307 2005/10/02 12:45:07 adx Exp $ |
22 |
> |
* $Id$ |
23 |
|
*/ |
24 |
|
|
25 |
|
#include "stdinc.h" |
91 |
|
} |
92 |
|
|
93 |
|
/* |
94 |
+ |
* iosend_default - append a packet to the client's sendq. |
95 |
+ |
*/ |
96 |
+ |
void * |
97 |
+ |
iosend_default(va_list args) |
98 |
+ |
{ |
99 |
+ |
struct Client *to = va_arg(args, struct Client *); |
100 |
+ |
int length = va_arg(args, int); |
101 |
+ |
char *buf = va_arg(args, char *); |
102 |
+ |
|
103 |
+ |
dbuf_put(&to->localClient->buf_sendq, buf, length); |
104 |
+ |
return NULL; |
105 |
+ |
} |
106 |
+ |
|
107 |
+ |
/* |
108 |
|
** send_message |
109 |
|
** Internal utility which appends given buffer to the sockets |
110 |
|
** sendq. |
135 |
|
return; |
136 |
|
} |
137 |
|
|
138 |
< |
dbuf_put(&to->localClient->buf_sendq, buf, len); |
138 |
> |
execute_callback(iosend_cb, to, len, buf); |
139 |
|
|
140 |
|
/* |
141 |
|
** Update statistics. The following is slightly incorrect |
312 |
|
break; |
313 |
|
} |
314 |
|
|
301 |
– |
execute_callback(iosend_cb, to, retlen, first->data); |
315 |
|
dbuf_delete(&to->localClient->buf_sendq, retlen); |
316 |
|
|
317 |
|
/* We have some data written .. update counters */ |
798 |
|
len = send_format(buffer, IRCD_BUFSIZE, pattern, args); |
799 |
|
va_end(args); |
800 |
|
|
801 |
+ |
++current_serial; |
802 |
+ |
|
803 |
|
DLINK_FOREACH(ptr, chptr->members.head) |
804 |
|
{ |
805 |
|
ms = ptr->data; |
816 |
|
((target_p->from->localClient->caps & caps) != caps) || |
817 |
|
((target_p->from->localClient->caps & nocaps) != 0)) |
818 |
|
continue; |
819 |
< |
|
820 |
< |
send_message(target_p, buffer, len); |
819 |
> |
if (target_p->from->serial != current_serial) |
820 |
> |
{ |
821 |
> |
send_message(target_p, buffer, len); |
822 |
> |
target_p->from->serial = current_serial; |
823 |
> |
} |
824 |
|
} |
825 |
|
} |
826 |
|
|