8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / sendmail / libmilter / handler.c
blob2c34f1f05dba5b3f95353f07fa95172ba64e250b
1 /*
2 * Copyright (c) 1999-2003, 2006 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
9 */
11 #include <sm/gen.h>
12 SM_RCSID("@(#)$Id: handler.c,v 8.39 2008/11/25 01:14:16 ca Exp $")
14 #include "libmilter.h"
16 #if !_FFR_WORKERS_POOL
18 ** HANDLE_SESSION -- Handle a connected session in its own context
20 ** Parameters:
21 ** ctx -- context structure
23 ** Returns:
24 ** MI_SUCCESS/MI_FAILURE
27 int
28 mi_handle_session(ctx)
29 SMFICTX_PTR ctx;
31 int ret;
33 if (ctx == NULL)
34 return MI_FAILURE;
35 ctx->ctx_id = (sthread_t) sthread_get_id();
38 ** Detach so resources are free when the thread returns.
39 ** If we ever "wait" for threads, this call must be removed.
42 if (pthread_detach(ctx->ctx_id) != 0)
43 ret = MI_FAILURE;
44 else
45 ret = mi_engine(ctx);
46 mi_clr_ctx(ctx);
47 ctx = NULL;
48 return ret;
50 #endif /* !_FFR_WORKERS_POOL */