~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/third_party/serf/src/test/server/test_server.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2011 Justin Erenkrantz and Greg Stein
2
 
 *
3
 
 * Licensed under the Apache License, Version 2.0 (the "License");
4
 
 * you may not use this file except in compliance with the License.
5
 
 * You may obtain a copy of the License at
6
 
 *
7
 
 *     http://www.apache.org/licenses/LICENSE-2.0
8
 
 *
9
 
 * Unless required by applicable law or agreed to in writing, software
10
 
 * distributed under the License is distributed on an "AS IS" BASIS,
11
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 
 * See the License for the specific language governing permissions and
13
 
 * limitations under the License.
14
 
 */
15
 
 
16
 
#ifndef TEST_SERVER_H
17
 
#define TEST_SERVER_H
18
 
 
19
 
typedef struct serv_ctx_t serv_ctx_t;
20
 
 
21
 
#define TEST_SERVER_DUMP 1
22
 
 
23
 
/* Default port for our test server. */
24
 
#define SERV_PORT 12345
25
 
#define SERV_PORT_STR "12345"
26
 
 
27
 
#define PROXY_PORT 23456
28
 
 
29
 
typedef struct
30
 
{
31
 
    enum {
32
 
        SERVER_RECV,
33
 
        SERVER_SEND,
34
 
        SERVER_RESPOND,
35
 
        SERVER_IGNORE_AND_KILL_CONNECTION,
36
 
        SERVER_KILL_CONNECTION
37
 
    } kind;
38
 
 
39
 
    const char *text;
40
 
} test_server_action_t;
41
 
 
42
 
typedef struct
43
 
{
44
 
    const char *text;
45
 
} test_server_message_t;
46
 
 
47
 
apr_status_t test_start_server(serv_ctx_t **servctx_p,
48
 
                               apr_sockaddr_t *address,
49
 
                               test_server_message_t *message_list,
50
 
                               apr_size_t message_count,
51
 
                               test_server_action_t *action_list,
52
 
                               apr_size_t action_count,
53
 
                               apr_int32_t options,
54
 
                               apr_pool_t *pool);
55
 
 
56
 
apr_status_t test_server_run(serv_ctx_t *servctx,
57
 
                             apr_short_interval_time_t duration,
58
 
                             apr_pool_t *pool);
59
 
 
60
 
apr_status_t test_server_destroy(serv_ctx_t *servctx, apr_pool_t *pool);
61
 
 
62
 
#ifndef APR_VERSION_AT_LEAST /* Introduced in APR 1.3.0 */
63
 
#define APR_VERSION_AT_LEAST(major,minor,patch)                  \
64
 
(((major) < APR_MAJOR_VERSION)                                       \
65
 
 || ((major) == APR_MAJOR_VERSION && (minor) < APR_MINOR_VERSION)    \
66
 
 || ((major) == APR_MAJOR_VERSION && (minor) == APR_MINOR_VERSION && \
67
 
     (patch) <= APR_PATCH_VERSION))
68
 
#endif /* APR_VERSION_AT_LEAST */
69
 
 
70
 
#endif /* TEST_SERVER_H */