1 | /* |
1 | /* |
2 | * send.C: Socket I/O. |
2 | * send.C: Socket I/O. |
3 | * Rights to this code are documented in doc/pod/license.pod. |
3 | * Rights to this code are documented in doc/pod/license.pod. |
4 | * |
4 | * |
5 | * Copyright © 2005-2007 Atheme Project (http://www.atheme.org) |
5 | * Copyright © 2005-2007 Atheme Project (http://www.atheme.org) |
6 | */ |
6 | */ |
7 | |
7 | |
8 | static char const rcsid[] = "$Id: send.C,v 1.4 2007/07/25 00:03:21 pippijn Exp $"; |
8 | static char const rcsid[] = "$Id: send.C,v 1.5 2007/08/28 17:08:12 pippijn Exp $"; |
9 | |
9 | |
10 | #include "atheme.h" |
10 | #include "atheme.h" |
11 | #include "uplink.h" |
11 | #include "uplink.h" |
12 | #include "datastream.h" |
12 | #include "datastream.h" |
13 | |
13 | |
14 | /* send a line to the server, append the \r\n */ |
14 | /* send a line to the server, append the \r\n */ |
15 | int |
15 | int |
16 | sts (char *fmt, ...) |
16 | sts (char const * const fmt, ...) |
17 | { |
17 | { |
18 | va_list ap; |
18 | va_list ap; |
19 | char buf[513]; |
19 | char buf[513]; |
20 | int len; |
20 | int len; |
21 | |
21 | |
… | |
… | |
66 | time_t delay; |
66 | time_t delay; |
67 | |
67 | |
68 | while (!(runflags & (RF_SHUTDOWN | RF_RESTART))) |
68 | while (!(runflags & (RF_SHUTDOWN | RF_RESTART))) |
69 | { |
69 | { |
70 | /* update the current time */ |
70 | /* update the current time */ |
71 | NOW = time (NULL); |
71 | NOW = time_t (now ()); |
72 | |
72 | |
73 | /* check for events */ |
73 | /* check for events */ |
74 | delay = event_next_time (); |
74 | delay = event_next_time (); |
75 | |
75 | |
76 | if (delay <= NOW) |
76 | if (delay <= NOW) |
77 | event_run (); |
77 | event_run (); |
78 | |
78 | |
79 | connection_select (25000); |
79 | connection_select (25000); |
80 | |
|
|
81 | // garbage collection |
|
|
82 | gc::cleanup (); |
|
|
83 | } |
80 | } |
84 | } |
81 | } |