}
struct ClientSocket* create_socket(char *host, int port, char *bindto, char *pass, char *nick, char *ident, char *realname) {
+ if(!sockets)
+ init_sockets();
struct ClientSocket *client = malloc(sizeof(*client));
if (!client) {
return NULL;
static IOHANDLER_CALLBACK(socket_callback) {
struct ClientSocket *client = event->iofd->data;
+ #ifdef HAVE_THREADS
unsigned int tid;
+ #endif
switch(event->type) {
case IOEVENT_CONNECTED:
client->flags |= SOCKET_FLAG_CONNECTED;
tid = (unsigned int) pthread_self_tid();
clientsocket_start_of_recv(tid);
#endif
+ client->traffic_in += strlen(event->data.recv_str);
parse_line(client, event->data.recv_str);
#ifdef HAVE_THREADS
clientsocket_end_of_recv(tid);