This allows using the new client_add_forward_field() in e.g. plugins.
#include "ostream.h"
#include "safe-memset.h"
#include "str.h"
-#include "strescape.h"
#include "imap-parser.h"
#include "imap-id.h"
#include "imap-resp-code.h"
}
} else if (strncasecmp(key, "x-forward-", 10) == 0) {
/* handle extra field */
- if (client->common.forward_fields == NULL)
- client->common.forward_fields = str_new(client->common.preproxy_pool, 32);
- else
- str_append_c(client->common.forward_fields, '\t');
- /* prefixing is done by auth process */
- str_append_tabescaped(client->common.forward_fields,
- key+10);
- str_append_c(client->common.forward_fields, '=');
- str_append_tabescaped(client->common.forward_fields, value);
+ client_add_forward_field(&client->common, key+10, value);
} else {
return FALSE;
}
#include "hook-build.h"
#include "buffer.h"
#include "str.h"
+#include "strescape.h"
#include "base64.h"
#include "str-sanitize.h"
#include "safe-memset.h"
return clients_count;
}
+void client_add_forward_field(struct client *client, const char *key,
+ const char *value)
+{
+ if (client->forward_fields == NULL)
+ client->forward_fields = str_new(client->preproxy_pool, 32);
+ else
+ str_append_c(client->forward_fields, '\t');
+ /* prefixing is done by auth process */
+ str_append_tabescaped(client->forward_fields, key);
+ str_append_c(client->forward_fields, '=');
+ str_append_tabescaped(client->forward_fields, value);
+}
+
const char *client_get_session_id(struct client *client)
{
buffer_t *buf, *base64_buf;
unsigned int clients_get_count(void) ATTR_PURE;
+void client_add_forward_field(struct client *client, const char *key,
+ const char *value);
void client_set_title(struct client *client);
void client_log(struct client *client, const char *msg);
void client_log_err(struct client *client, const char *msg);