imap_urlauth_DEPENDENCIES = $(LIBDOVECOT_DEPS)
imap_urlauth_SOURCES = \
+ imap-urlauth-worker-client.c \
imap-urlauth.c \
imap-urlauth-client.c \
imap-urlauth-settings.c
imap-urlauth-common.h \
imap-urlauth-settings.h \
imap-urlauth-login-settings.h \
+ imap-urlauth-worker-common.h \
+ imap-urlauth-worker-client.h \
imap-urlauth-worker-settings.h
#include "array.h"
#include "ioloop.h"
#include "net.h"
-#include "fdpass.h"
#include "istream.h"
#include "ostream.h"
#include "str.h"
#include "master-service.h"
#include "master-interface.h"
+#include "imap-urlauth-worker-client.h"
+
#include <unistd.h>
#include <sys/wait.h>
#define IMAP_URLAUTH_PROTOCOL_MAJOR_VERSION 1
#define IMAP_URLAUTH_PROTOCOL_MINOR_VERSION 0
-#define IMAP_URLAUTH_WORKER_SOCKET "imap-urlauth-worker"
-
-/* max. length of input lines (URLs) */
-#define MAX_INBUF_SIZE 2048
-
/* Disconnect client after idling this many milliseconds */
#define CLIENT_IDLE_TIMEOUT_MSECS (10*60*1000)
struct client *imap_urlauth_clients;
unsigned int imap_urlauth_client_count;
-static int client_worker_connect(struct client *client);
-static void client_worker_disconnect(struct client *client);
-static void client_worker_input(struct client *client);
-
int client_create(const char *service, const char *username,
int fd_in, int fd_out,
const struct imap_urlauth_settings *set,
va_end(va);
}
-#include "imap-urlauth-worker-client.c"
-
void client_destroy(struct client *client, const char *reason)
{
i_assert(reason != NULL || client->disconnected);
-static int client_worker_connect(struct client *client)
+/* Copyright (c) 2023 Dovecot authors, see the included COPYING file */
+
+#include "lib.h"
+#include "array.h"
+#include "net.h"
+#include "istream.h"
+#include "ostream.h"
+#include "str.h"
+#include "strescape.h"
+#include "fdpass.h"
+#include "eacces-error.h"
+
+#include "imap-urlauth-common.h"
+#include "imap-urlauth-worker-client.h"
+
+/* max. length of input lines (URLs) */
+#define MAX_INBUF_SIZE 2048
+
+static void client_worker_input(struct client *client);
+
+int client_worker_connect(struct client *client)
{
static const char handshake[] = "VERSION\timap-urlauth-worker\t2\t0\n";
const char *socket_path;
return 0;
}
-void client_worker_input(struct client *client)
+static void client_worker_input(struct client *client)
{
struct istream *input = client->ctrl_input;
const char *line;
--- /dev/null
+#ifndef IMAP_URLAUTH_WORKER_CLIENT_H
+#define IMAP_URLAUTH_WORKER_CLIENT_H
+
+#include "imap-urlauth-worker-common.h"
+
+int client_worker_connect(struct client *client);
+void client_worker_disconnect(struct client *client);
+
+#endif
--- /dev/null
+#ifndef IMAP_URLAUTH_WORKER_COMMON_H
+#define IMAP_URLAUTH_WORKER_COMMON_H
+
+#define IMAP_URLAUTH_WORKER_SOCKET "imap-urlauth-worker"
+
+#endif