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

« back to all changes in this revision

Viewing changes to srclib/apr/include/arch/win32/apr_arch_networkio.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
/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
 
2
 * applicable.
 
3
 *
 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
 
5
 * you may not use this file except in compliance with the License.
 
6
 * 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
#ifndef NETWORK_IO_H
 
18
#define NETWORK_IO_H
 
19
 
 
20
#include "apr_network_io.h"
 
21
#include "apr_general.h"
 
22
#include "apr_poll.h"
 
23
 
 
24
typedef struct sock_userdata_t sock_userdata_t;
 
25
struct sock_userdata_t {
 
26
    sock_userdata_t *next;
 
27
    const char *key;
 
28
    void *data;
 
29
};
 
30
 
 
31
struct apr_socket_t {
 
32
    apr_pool_t         *pool;
 
33
    SOCKET              socketdes;
 
34
    int                 type; /* SOCK_STREAM, SOCK_DGRAM */
 
35
    int                 protocol;
 
36
    apr_sockaddr_t     *local_addr;
 
37
    apr_sockaddr_t     *remote_addr;
 
38
    int                 timeout_ms; /* MUST MATCH if timeout > 0 */
 
39
    apr_interval_time_t timeout;
 
40
    apr_int32_t         disconnected;
 
41
    int                 local_port_unknown;
 
42
    int                 local_interface_unknown;
 
43
    int                 remote_addr_unknown;
 
44
    apr_int32_t         options;
 
45
    apr_int32_t         inherit;
 
46
#if APR_HAS_SENDFILE
 
47
    /* As of 07.20.04, the overlapped structure is only used by 
 
48
     * apr_socket_sendfile and that's where it will be allocated 
 
49
     * and initialized.
 
50
     */
 
51
    OVERLAPPED         *overlapped;
 
52
#endif
 
53
    sock_userdata_t    *userdata;
 
54
 
 
55
    /* if there is a timeout set, then this pollset is used */
 
56
    apr_pollset_t *pollset;
 
57
};
 
58
 
 
59
#ifdef _WIN32_WCE
 
60
#ifndef WSABUF
 
61
typedef struct _WSABUF {
 
62
    u_long      len;     /* the length of the buffer */
 
63
    char FAR *  buf;     /* the pointer to the buffer */
 
64
} WSABUF, FAR * LPWSABUF;
 
65
#endif
 
66
#else
 
67
/* Not sure if this is the right place to define this */
 
68
#define HAVE_STRUCT_IPMREQ
 
69
#endif
 
70
 
 
71
apr_status_t status_from_res_error(int);
 
72
 
 
73
const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
 
74
int apr_inet_pton(int af, const char *src, void *dst);
 
75
void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t);
 
76
 
 
77
#define apr_is_option_set(skt, option)  \
 
78
    (((skt)->options & (option)) == (option))
 
79
 
 
80
#define apr_set_option(skt, option, on) \
 
81
    do {                                 \
 
82
        if (on)                          \
 
83
            (skt)->options |= (option);         \
 
84
        else                             \
 
85
            (skt)->options &= ~(option);        \
 
86
    } while (0)
 
87
 
 
88
#endif  /* ! NETWORK_IO_H */
 
89