#include <stdbool.h>
#include <unistd.h>
+#include "job.h"
#include "postfix.h"
struct jpriv_t {
buffer_t obuf;
};
-task_t *postfix_create(void)
+void postfix_start(job_t *job, query_t *query)
{
- return NULL;
}
-void postfix_release(task_t **task)
-{
- if (task) {
- *task = NULL;
- }
-}
-
-void postfix_run(job_t *job, query_t *query)
-{
-}
-
-void postfix_done(job_t *job)
+void postfix_stop(job_t *job)
{
}
void postfix_process(job_t *job)
{
if (job->state & JOB_LISTEN) {
- // TODO
+ /* TODO check return code */
+ job_accept(job, JOB_READ);
}
if (job->state & JOB_WRITE) {
if (!strstr(job->jdata->ibuf.data, "\r\n\r\n"))
return;
+ job->state &= ~JOB_READ;
+
/* TODO: do the parse */
}
}
-
-task_t task_postfix = {
- postfix_create,
- postfix_release,
- postfix_run,
- postfix_done,
- NULL,
- postfix_process
-};