bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / native / common / jk_ajp13_worker.c
1 /*
2  *  Licensed to the Apache Software Foundation (ASF) under one or more
3  *  contributor license agreements.  See the NOTICE file distributed with
4  *  this work for additional information regarding copyright ownership.
5  *  The ASF licenses this file to You under the Apache License, Version 2.0
6  *  (the "License"); you may not use this file except in compliance with
7  *  the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  */
17
18 /***************************************************************************
19  * Description: Bi-directional protocol.                                   *
20  * Author:      Costin <costin@costin.dnt.ro>                              *
21  * Author:      Gal Shachor <shachor@il.ibm.com>                           *
22  * Author:      Henri Gomez <hgomez@apache.org>                            *
23  * Version:     $Revision: 611589 $                                          *
24  ***************************************************************************/
25
26 #include "jk_ajp13_worker.h"
27
28
29 /* -------------------- Method -------------------- */
30 static int JK_METHOD validate(jk_worker_t *pThis,
31                               jk_map_t *props,
32                               jk_worker_env_t *we, jk_logger_t *l)
33 {
34     int rc;
35     JK_TRACE_ENTER(l);
36     rc = ajp_validate(pThis, props, we, l, AJP13_PROTO);
37     JK_TRACE_EXIT(l);
38     return rc;
39 }
40
41
42 static int JK_METHOD init(jk_worker_t *pThis,
43                           jk_map_t *props,
44                           jk_worker_env_t *we, jk_logger_t *l)
45 {
46     int rc;
47     JK_TRACE_ENTER(l);
48
49     rc = ajp_init(pThis, props, we, l, AJP13_PROTO);
50     JK_TRACE_EXIT(l);
51     return rc;
52 }
53
54
55 static int JK_METHOD destroy(jk_worker_t **pThis, jk_logger_t *l)
56 {
57     int rc;
58     JK_TRACE_ENTER(l);
59     rc = ajp_destroy(pThis, l, AJP13_PROTO);
60     JK_TRACE_EXIT(l);
61     return rc;
62 }
63
64
65 static int JK_METHOD get_endpoint(jk_worker_t *pThis,
66                                   jk_endpoint_t **pend, jk_logger_t *l)
67 {
68     int rc;
69     JK_TRACE_ENTER(l);
70     rc = ajp_get_endpoint(pThis, pend, l, AJP13_PROTO);
71     JK_TRACE_EXIT(l);
72     return rc;
73 }
74
75 int JK_METHOD ajp13_worker_factory(jk_worker_t **w,
76                                    const char *name, jk_logger_t *l)
77 {
78     ajp_worker_t *aw;
79
80     JK_TRACE_ENTER(l);
81     if (ajp_worker_factory(w, name, l) == JK_FALSE)
82         return 0;
83
84     aw = (*w)->worker_private;
85     aw->proto = AJP13_PROTO;
86
87     aw->worker.validate = validate;
88     aw->worker.init = init;
89     aw->worker.get_endpoint = get_endpoint;
90     aw->worker.destroy = destroy;
91
92     JK_TRACE_EXIT(l);
93     return JK_AJP13_WORKER_TYPE;
94 }