master-auth.c revision 7cb128dc4cae2a03a742f63ba7afee23c78e3af0
/* Copyright (c) 2005-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "fdpass.h"
#include "buffer.h"
#include "hash.h"
#include "master-service-private.h"
#include "master-auth.h"
#include <stdlib.h>
#include <unistd.h>
#define SOCKET_CONNECT_RETRY_MSECS 500
struct master_auth_connection {
struct master_auth *auth;
unsigned int tag;
int fd;
char buf[sizeof(struct master_auth_reply)];
unsigned int buf_pos;
void *context;
};
struct master_auth {
struct master_service *service;
const char *path;
unsigned int tag_counter;
};
struct master_auth *
{
struct master_auth *auth;
return auth;
}
static void
{
}
}
{
struct hash_iterate_context *iter;
void *key;
struct master_auth_connection *conn;
}
}
{
const struct master_auth_reply *reply;
int ret;
if (ret <= 0) {
i_error("read(%s) failed: Remote closed connection "
"(service's process_limit reached?)",
} else {
return;
}
return;
}
return;
/* reply is now read */
i_error("master(%s): Received reply with unknown tag %u",
/* request aborted */
} else {
}
}
{
i_error("master(%s): Auth request timed out (received %u/%u bytes)",
}
const struct master_auth_request *request,
const unsigned char *data,
{
struct master_auth_connection *conn;
struct master_auth_request req;
i_fatal("fstat(auth dest fd) failed: %m");
i_error("net_connect_unix(%s) failed: %m%s",
return;
}
if (ret < 0)
i_error("fd_send(%s) sent only %d of %d bytes",
ret = -1;
}
if (ret < 0) {
return;
}
}
{
struct master_auth_connection *conn;
}