login-connection.c revision 66251e6ab31e5cc153fe5cae608e416dacafe9cd
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "network.h"
#include "iobuffer.h"
#include "login-connection.h"
#include <stdlib.h>
#include <syslog.h>
#define MAX_INBUF_SIZE \
(sizeof(AuthContinuedRequestData) + AUTH_MAX_REQUEST_DATA_SIZE)
#define MAX_OUTBUF_SIZE \
struct _LoginConnection {
int fd;
};
static AuthInitData auth_init_data;
static LoginConnection *connections;
void *user_data)
{
}
}
{
unsigned char *data;
unsigned int size;
case 0:
return;
case -1:
/* disconnected */
return;
case -2:
/* buffer full */
i_error("BUG: imap-login sent us more than %d bytes of data",
(int)MAX_INBUF_SIZE);
return;
}
if (size < sizeof(AuthRequestType))
return;
/* note that we can't directly cast the received data pointer into
structures, as it may not be aligned properly. */
/* get the request type */
}
return;
/* we have a full init request */
return;
return;
/* we have a full continued request */
} else {
/* unknown request */
i_error("BUG: imap-login sent us unknown request %u",
}
}
{
connections = conn;
sizeof(auth_init_data)) < 0) {
}
return conn;
}
{
break;
}
}
}
void login_connections_init(void)
{
const char *env;
i_fatal("AUTH_PROCESS environment is unset");
connections = NULL;
}
void login_connections_deinit(void)
{
while (connections != NULL) {
connections = next;
}
}