imapc-client.c revision b09f510e3f7e3bd4a5216a60fa1406d1e83d001b
/* Copyright (c) 2011-2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "ioloop.h"
#include "safe-mkstemp.h"
#include "iostream-ssl.h"
#include "imapc-msgmap.h"
#include "imapc-connection.h"
#include "imapc-client-private.h"
#include <unistd.h>
const struct imapc_capability_name imapc_capability_names[] = {
{ "SASL-IR", IMAPC_CAPABILITY_SASL_IR },
{ "LITERAL+", IMAPC_CAPABILITY_LITERALPLUS },
{ "QRESYNC", IMAPC_CAPABILITY_QRESYNC },
{ "IDLE", IMAPC_CAPABILITY_IDLE },
{ "UIDPLUS", IMAPC_CAPABILITY_UIDPLUS },
{ "AUTH=PLAIN", IMAPC_CAPABILITY_AUTH_PLAIN },
{ "STARTTLS", IMAPC_CAPABILITY_STARTTLS },
{ "X-GM-EXT-1", IMAPC_CAPABILITY_X_GM_EXT_1 },
{ "CONDSTORE", IMAPC_CAPABILITY_CONDSTORE },
{ "IMAP4REV1", IMAPC_CAPABILITY_IMAP4REV1 },
{ NULL, 0 }
};
static void
void *context ATTR_UNUSED)
{
}
struct imapc_client *
{
struct imapc_client *client;
struct ssl_iostream_settings ssl_set;
const char *source;
i_error("imapc(%s): Couldn't initialize SSL context",
source);
}
}
return client;
}
{
}
{
return;
}
{
struct imapc_client_connection **connp;
}
}
void *context)
{
}
{
struct imapc_client_connection *const *connp;
}
}
{
struct imapc_client_connection *const *connp;
}
{
}
{
}
{
}
static struct imapc_client_connection *
{
struct imapc_client_connection *conn;
return conn;
}
static struct imapc_connection *
{
struct imapc_client_connection *const *connp;
/* FIXME: stupid algorithm */
}
struct imapc_command *
{
struct imapc_connection *conn;
}
static struct imapc_client_connection *
{
struct imapc_client_connection *const *conns;
unsigned int i, count;
for (i = 0; i < count; i++) {
return conns[i];
}
return imapc_client_add_connection(client);
}
{
struct imapc_client_connection *conn;
}
struct imapc_client_mailbox *
void *untagged_box_context)
{
struct imapc_client_mailbox *box;
struct imapc_client_connection *conn;
return box;
}
void *context)
{
}
static void
void *context)
{
/* reopen the mailbox */
} else {
}
}
{
if (reconnect) {
}
if (reconnect) {
}
}
{
struct imapc_client_connection *const *connp;
/* cancel any pending commands */
if (box->reconnecting) {
/* need to abort the reconnection so it won't try to access
the box */
}
/* set this only after unselect, which may cancel some commands that
reference this box */
break;
}
}
}
struct imapc_command *
{
struct imapc_command *cmd;
return cmd;
}
struct imapc_msgmap *
{
}
{
}
{
struct imapc_client_mailbox *selected_box;
return FALSE;
if (selected_box != box) {
if (selected_box != NULL)
i_error("imapc: Selected mailbox changed unexpectedly");
return FALSE;
}
return TRUE;
}
enum imapc_capability
{
struct imapc_client_connection *const *connp;
/* try to find a connection that is already logged in */
return imapc_connection_get_capabilities(conn);
}
/* fallback to whatever exists (there always exists one) */
return imapc_connection_get_capabilities(conn);
}
const char **path_r)
{
int fd;
i_error("imapc: temp_path_prefix not set, "
"can't create temp file");
return -1;
}
if (fd == -1) {
return -1;
}
/* we just want the fd, unlink it */
/* shouldn't happen.. */
return -1;
}
return fd;
}