void userclient_accepted(struct ServerSocket *server, int sockfd) {
struct UserClient *client;
- struct IODescriptor *iofd = iohandler_add(sockfd, IOTYPE_CLIENT, userclient_callback);
+ struct IODescriptor *iofd = iohandler_add(sockfd, IOTYPE_CLIENT, NULL, userclient_callback);
if(!iofd) return;
iofd->state = IO_CONNECTED;
iofd->read_lines = 1;
void userclient_close(struct UserClient *client) {
if(client->flags & USERCLIENT_LOGGED_IN) {
- usersession_client_close(client->user);
+ if(client->user)
+ usersession_client_close(client->user);
} else {
struct UserLogin *login = client->user;
if(client->flags & USERCLIENT_LOGIN_PROCESSING) {