~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to server/mpm/worker/fdqueue.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Licensed to the Apache Software Foundation (ASF) under one or more
 
2
 * contributor license agreements.  See the NOTICE file distributed with
 
3
 * this work for additional information regarding copyright ownership.
 
4
 * The ASF licenses this file to You under the Apache License, Version 2.0
 
5
 * (the "License"); you may not use this file except in compliance with
 
6
 * the License.  You may obtain a copy of the License at
 
7
 *
 
8
 *     http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 * Unless required by applicable law or agreed to in writing, software
 
11
 * distributed under the License is distributed on an "AS IS" BASIS,
 
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
 
15
 */
 
16
 
 
17
/**
 
18
 * @file  worker/fdqueue.h
 
19
 * @brief fd queue declarations
 
20
 *
 
21
 * @addtogroup APACHE_MPM_WORKER
 
22
 * @{
 
23
 */
 
24
 
 
25
#ifndef FDQUEUE_H
 
26
#define FDQUEUE_H
 
27
#include "httpd.h"
 
28
#include <stdlib.h>
 
29
#if APR_HAVE_UNISTD_H
 
30
#include <unistd.h>
 
31
#endif
 
32
#include <apr_thread_mutex.h>
 
33
#include <apr_thread_cond.h>
 
34
#include <sys/types.h>
 
35
#if APR_HAVE_SYS_SOCKET_H
 
36
#include <sys/socket.h>
 
37
#endif
 
38
#include <apr_errno.h>
 
39
 
 
40
typedef struct fd_queue_info_t fd_queue_info_t;
 
41
 
 
42
apr_status_t ap_queue_info_create(fd_queue_info_t **queue_info,
 
43
                                  apr_pool_t *pool, int max_idlers);
 
44
apr_status_t ap_queue_info_set_idle(fd_queue_info_t *queue_info,
 
45
                                    apr_pool_t *pool_to_recycle);
 
46
apr_status_t ap_queue_info_wait_for_idler(fd_queue_info_t *queue_info,
 
47
                                          apr_pool_t **recycled_pool);
 
48
apr_status_t ap_queue_info_term(fd_queue_info_t *queue_info);
 
49
 
 
50
struct fd_queue_elem_t {
 
51
    apr_socket_t      *sd;
 
52
    apr_pool_t        *p;
 
53
};
 
54
typedef struct fd_queue_elem_t fd_queue_elem_t;
 
55
 
 
56
struct fd_queue_t {
 
57
    fd_queue_elem_t    *data;
 
58
    int                 nelts;
 
59
    int                 bounds;
 
60
    apr_thread_mutex_t *one_big_mutex;
 
61
    apr_thread_cond_t  *not_empty;
 
62
    int                 terminated;
 
63
};
 
64
typedef struct fd_queue_t fd_queue_t;
 
65
 
 
66
apr_status_t ap_queue_init(fd_queue_t *queue, int queue_capacity, apr_pool_t *a);
 
67
apr_status_t ap_queue_push(fd_queue_t *queue, apr_socket_t *sd, apr_pool_t *p);
 
68
apr_status_t ap_queue_pop(fd_queue_t *queue, apr_socket_t **sd, apr_pool_t **p);
 
69
apr_status_t ap_queue_interrupt_all(fd_queue_t *queue);
 
70
apr_status_t ap_queue_term(fd_queue_t *queue);
 
71
 
 
72
#endif /* FDQUEUE_H */
 
73
/** @} */