imap-zlib-plugin.c revision e34d170f8f0e084bd94bfbc1a7085ece67e508df
/* Copyright (c) 2010-2012 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "str.h"
#include "istream.h"
#include "ostream.h"
#include "module-context.h"
#include "imap-commands.h"
#include "zlib-plugin.h"
#include "imap-zlib-plugin.h"
#include <stdlib.h>
#define IMAP_COMPRESS_DEFAULT_LEVEL 6
#define IMAP_ZLIB_IMAP_CONTEXT(obj) \
struct zlib_client {
union imap_module_context module_ctx;
const struct zlib_handler *handler;
};
const char *imap_zlib_plugin_version = DOVECOT_VERSION;
static struct module *imap_zlib_module;
{
const unsigned char *data;
if (data[0] == '\n')
else
i_unreached();
}
{
struct client_command_context *cmd;
}
}
}
{
const struct zlib_handler *handler;
struct ostream *old_output;
unsigned int level;
/* <mechanism> */
return FALSE;
return TRUE;
}
"NO [COMPRESSIONACTIVE] COMPRESSION=%s already enabled.",
return TRUE;
}
if (client->tls_compression) {
"NO [COMPRESSIONACTIVE] TLS compression already enabled.");
return TRUE;
}
return TRUE;
}
"imap_zlib_compress_level");
/* preserve output offset so that the bytes out counter in logout
message doesn't get reset here */
return TRUE;
}
{
struct zlib_client *zclient;
}
if (next_hook_client_created != NULL)
}
{
}
void imap_zlib_plugin_deinit(void)
{
command_unregister("COMPRESS");
}
const char imap_zlib_plugin_binary_dependency[] = "imap";