fts-parser-tika.c revision 88b90ce9dfe1056d1ec5497b95592d30a849e5f1
/* Copyright (c) 2014-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "istream.h"
#include "module-context.h"
#include "http-url.h"
#include "http-client.h"
#include "message-parser.h"
#include "mail-user.h"
#include "fts-parser.h"
#define TIKA_USER_CONTEXT(obj) \
struct fts_parser_tika_user {
};
struct tika_fts_parser {
struct fts_parser parser;
struct http_client_request *http_req;
bool failed;
};
static int
{
struct http_client_settings http_set;
/* fts_tika disabled */
return -1;
}
}
return -1;
}
if (tika_http_client == NULL) {
}
return 0;
}
static void
struct tika_fts_parser *parser)
{
case 200:
/* read response */
else {
}
break;
case 204: /* empty response */
case 415: /* Unsupported Media Type */
case 422: /* Unprocessable Entity */
i_debug("fts_tika: PUT %s failed: %u %s",
}
break;
default:
i_error("fts_tika: PUT %s failed: %u %s",
break;
}
}
static struct fts_parser *
const char *content_disposition)
{
struct tika_fts_parser *parser;
struct http_client_request *http_req;
return NULL;
}
struct message_block *block)
{
const unsigned char *data;
/* first we'll send everything to Tika */
return;
}
/* read the result from Tika */
return;
}
/* continue returning data from Tika */
return;
/* wait for more input from Tika */
} else {
}
}
if (size > 0) {
} else {
/* finished */
i_error("read(%s) failed: %s",
}
}
}
{
}
/* FIXME: kludgy, http_req should be NULL here if we don't want to
free it. requires lib-http changes. */
return ret;
}
static void fts_parser_tika_unload(void)
{
if (tika_http_client != NULL)
}
struct fts_parser_vfuncs fts_parser_tika = {
};