#endif
}
// Add to list of sockets
- struct client_data *cl = allocClient();
+ client_data *cl = new client_data();
cl->fd = fd;
cl->cctx = cctx;
cl->type = addr.ss_family == AF_INET6 ? 6 : 4;
FILE *f = fopen(getdatafile("init.txt"), "rbe");
if (f) {
- struct client_data *fake = allocClient();
+ client_data *fake = new client_data();
fake->fd = -1;
fake->umode |= UMODE_OPER | UMODE_SECURE;
fake->hostname = mystrdup("localhost");
#include "irc.h"
#include "ircfmt.h"
#include "job.h"
-
-struct client_data *allocClient(void)
-{
- return (struct client_data *)calloc(1, sizeof(struct client_data));
-}
-
void update_poll_reg(struct client_data *cl)
{
if (cl->fd == -1)
free(cl->saslusername);
free(cl->webircpeername);
free(cl->webirchostname);
- free(cl);
+ delete cl;
}
void recvProc(struct client_data *cl) {
void sendbuf(struct client_data *client);
void sendbuf_visible(struct client_data *client);
-struct client_data *allocClient(void);
void update_poll_reg(struct client_data *cl);
void log_client(struct client_data *cl, const char *format, ...);
void killConnection(struct client_data *client, int byChoice);