Wed, 15 Mar 2023 19:46:02 +0100
minimal support for ldap groups
1 | 1 | /* |
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | |
3 | * | |
4 | * Copyright 2008 Sun Microsystems, Inc. All rights reserved. | |
5 | * | |
6 | * THE BSD LICENSE | |
7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions are met: | |
10 | * | |
11 | * Redistributions of source code must retain the above copyright notice, this | |
12 | * list of conditions and the following disclaimer. | |
13 | * Redistributions in binary form must reproduce the above copyright notice, | |
14 | * this list of conditions and the following disclaimer in the documentation | |
15 | * and/or other materials provided with the distribution. | |
16 | * | |
17 | * Neither the name of the nor the names of its contributors may be | |
18 | * used to endorse or promote products derived from this software without | |
19 | * specific prior written permission. | |
20 | * | |
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER | |
25 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
27 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
28 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
30 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
31 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
32 | */ | |
33 | ||
34 | /* | |
35 | * pblock.c: Handles Parameter Blocks | |
36 | * | |
37 | * See pblock.h for public documentation. | |
38 | * | |
39 | * Rob McCool | |
40 | * | |
41 | * This code uses property lists to implement pblocks. | |
42 | */ | |
43 | ||
44 | ||
45 | #include "pblock.h" | |
46 | #include "plist_pvt.h" | |
47 | #include "plist.h" | |
48 | #include "util.h" /* util_itoa */ | |
49 | #include "pool.h" | |
50 | #include "systhr.h" | |
51 | ||
52 | #define MALLOC_POOL_HANDLE (thread_malloc_key != -1 ? (pool_handle_t *)systhread_getdata(thread_malloc_key) : getThreadMallocPool()) | |
53 | ||
54 | static int thread_malloc_key = -1; | |
55 | static int _pblock_str2pblock(const char* str, pblock* pb, PRBool lowerCase); | |
56 | ||
57 | static pool_handle_t *getThreadMallocPool() | |
58 | { | |
59 | pool_handle_t *thread_malloc_pool = 0; | |
60 | ||
61 | thread_malloc_key = getThreadMallocKey(); | |
62 | if (thread_malloc_key != -1) { | |
63 | thread_malloc_pool = (pool_handle_t *)systhread_getdata(thread_malloc_key); | |
64 | } | |
65 | ||
66 | return thread_malloc_pool; | |
67 | } | |
68 | ||
69 | /* ---------------------- pb_key static initializers ---------------------- */ | |
70 | ||
71 | /* | |
72 | * pb_key | |
73 | * | |
74 | * Contains a precomputed hash value for a specific pblock variable name. | |
75 | */ | |
76 | typedef struct pb_key pb_key; | |
77 | struct pb_key { | |
78 | const char *name; | |
79 | int namelen; | |
80 | unsigned int hashval; | |
81 | int sizendx; | |
82 | int hashndx; | |
83 | }; | |
84 | ||
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
85 | #define PB_KEY_LIST_BUCKET_COUNT 0x7f // has to be (2^n - 1) |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
86 | |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
87 | struct pb_key_list_bucket { |
365
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
88 | pb_key **elements; |
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
89 | unsigned size; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
90 | }; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
91 | |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
92 | struct pb_key_list { |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
93 | struct pb_key_list_bucket buckets[PB_KEY_LIST_BUCKET_COUNT + 1]; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
94 | }; |
1 | 95 | |
365
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
96 | static void _pb_key_list_insert(struct pb_key_list *hashList, unsigned int hashval, pb_key* element) { |
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
97 | struct pb_key_list_bucket *bucket = &hashList->buckets[hashval & PB_KEY_LIST_BUCKET_COUNT]; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
98 | size_t idx = bucket->size; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
99 | bucket->size++; |
365
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
100 | bucket->elements = realloc(bucket->elements, sizeof(pb_key*) * bucket->size); |
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
101 | if (bucket->elements == NULL) abort(); |
365
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
102 | bucket->elements[idx] = element; |
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
103 | } |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
104 | |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
105 | static struct pb_key_list _pbKeys; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
106 | |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
107 | static const pb_key *_create_key(const char *name) |
1 | 108 | { |
365
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
109 | /* Create a new pb_key */ |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
110 | pb_key *key = malloc(sizeof(pb_key)); |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
111 | if (key == NULL) abort(); |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
112 | key->name = STRDUP(name); |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
113 | key->namelen = strlen(name); |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
114 | key->hashval = PListHash(name); |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
115 | key->sizendx = 0; |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
116 | key->hashndx = key->hashval % PLSIZENDX(0); |
1 | 117 | |
118 | /* Group pb_keys by hashval for later retrieval */ | |
365
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
119 | _pb_key_list_insert(&_pbKeys, key->hashval, key); |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
120 | |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
121 | return key; |
1 | 122 | } |
123 | ||
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
124 | const pb_key *pb_key_accept; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
125 | const pb_key *pb_key_accept_charset; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
126 | const pb_key *pb_key_accept_encoding; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
127 | const pb_key *pb_key_accept_language; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
128 | const pb_key *pb_key_accept_ranges; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
129 | const pb_key *pb_key_actual_route; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
130 | const pb_key *pb_key_age; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
131 | const pb_key *pb_key_always_allow_chunked; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
132 | const pb_key *pb_key_always_use_keep_alive; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
133 | const pb_key *pb_key_auth_cert; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
134 | const pb_key *pb_key_auth_expiring; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
135 | const pb_key *pb_key_auth_group; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
136 | const pb_key *pb_key_auth_type; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
137 | const pb_key *pb_key_auth_user; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
138 | const pb_key *pb_key_authorization; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
139 | const pb_key *pb_key_browser; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
140 | const pb_key *pb_key_c2p_cl; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
141 | const pb_key *pb_key_c2p_hl; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
142 | const pb_key *pb_key_cache_info; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
143 | const pb_key *pb_key_charset; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
144 | const pb_key *pb_key_check_http_server; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
145 | const pb_key *pb_key_ChunkedRequestBufferSize; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
146 | const pb_key *pb_key_ChunkedRequestTimeout; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
147 | const pb_key *pb_key_cipher; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
148 | const pb_key *pb_key_clf_request; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
149 | const pb_key *pb_key_cli_status; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
150 | const pb_key *pb_key_client_cert_nickname; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
151 | const pb_key *pb_key_client_ip; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
152 | const pb_key *pb_key_close; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
153 | const pb_key *pb_key_connect_timeout; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
154 | const pb_key *pb_key_connection; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
155 | const pb_key *pb_key_cont; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
156 | const pb_key *pb_key_content_encoding; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
157 | const pb_key *pb_key_content_language; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
158 | const pb_key *pb_key_content_length; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
159 | const pb_key *pb_key_content_location; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
160 | const pb_key *pb_key_content_md5; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
161 | const pb_key *pb_key_content_range; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
162 | const pb_key *pb_key_content_type; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
163 | const pb_key *pb_key_cookie; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
164 | const pb_key *pb_key_date; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
165 | const pb_key *pb_key_DATE_GMT; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
166 | const pb_key *pb_key_DATE_LOCAL; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
167 | const pb_key *pb_key_dir; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
168 | const pb_key *pb_key_Directive; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
169 | const pb_key *pb_key_dns; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
170 | const pb_key *pb_key_DOCUMENT_NAME; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
171 | const pb_key *pb_key_DOCUMENT_URI; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
172 | const pb_key *pb_key_domain; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
173 | const pb_key *pb_key_enc; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
174 | const pb_key *pb_key_engine; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
175 | const pb_key *pb_key_error_action; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
176 | const pb_key *pb_key_error_desc; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
177 | const pb_key *pb_key_error_fn; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
178 | const pb_key *pb_key_escape; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
179 | const pb_key *pb_key_escaped; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
180 | const pb_key *pb_key_etag; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
181 | const pb_key *pb_key_expect; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
182 | const pb_key *pb_key_expires; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
183 | const pb_key *pb_key_expr; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
184 | const pb_key *pb_key_filter; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
185 | const pb_key *pb_key_find_pathinfo_forward; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
186 | const pb_key *pb_key_flushTimer; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
187 | const pb_key *pb_key_fn; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
188 | const pb_key *pb_key_from; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
189 | const pb_key *pb_key_full_headers; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
190 | const pb_key *pb_key_hdr; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
191 | const pb_key *pb_key_host; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
192 | const pb_key *pb_key_hostname; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
193 | const pb_key *pb_key_if_match; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
194 | const pb_key *pb_key_if_modified_since; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
195 | const pb_key *pb_key_if_none_match; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
196 | const pb_key *pb_key_if_range; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
197 | const pb_key *pb_key_if_unmodified_since; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
198 | const pb_key *pb_key_ip; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
199 | const pb_key *pb_key_iponly; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
200 | const pb_key *pb_key_issuer_dn; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
201 | const pb_key *pb_key_jroute; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
202 | const pb_key *pb_key_keep_alive; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
203 | const pb_key *pb_key_keep_alive_timeout; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
204 | const pb_key *pb_key_keysize; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
205 | const pb_key *pb_key_lang; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
206 | const pb_key *pb_key_last_modified; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
207 | const pb_key *pb_key_level; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
208 | const pb_key *pb_key_location; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
209 | const pb_key *pb_key_lock_owner; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
210 | const pb_key *pb_key_magnus_charset; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
211 | const pb_key *pb_key_magnus_internal; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
212 | const pb_key *pb_key_magnus_internal_dav_src; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
213 | const pb_key *pb_key_magnus_internal_default_acls_only; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
214 | const pb_key *pb_key_magnus_internal_error_j2ee; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
215 | const pb_key *pb_key_magnus_internal_j2ee_nsapi; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
216 | const pb_key *pb_key_magnus_internal_preserve_srvhdrs; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
217 | const pb_key *pb_key_magnus_internal_set_request_status; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
218 | const pb_key *pb_key_magnus_internal_set_response_status; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
219 | const pb_key *pb_key_magnus_internal_webapp_errordesc; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
220 | const pb_key *pb_key_matched_browser; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
221 | const pb_key *pb_key_max_age; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
222 | const pb_key *pb_key_max_forwards; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
223 | const pb_key *pb_key_message; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
224 | const pb_key *pb_key_method; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
225 | const pb_key *pb_key_name; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
226 | const pb_key *pb_key_nocache; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
227 | const pb_key *pb_key_nostat; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
228 | const pb_key *pb_key_ntrans_base; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
229 | const pb_key *pb_key_offline_origin_addr; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
230 | const pb_key *pb_key_offline_proxy_addr; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
231 | const pb_key *pb_key_origin_addr; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
232 | const pb_key *pb_key_p2c_cl; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
233 | const pb_key *pb_key_p2c_hl; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
234 | const pb_key *pb_key_p2r_cl; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
235 | const pb_key *pb_key_p2r_hl; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
236 | const pb_key *pb_key_parse_timeout; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
237 | const pb_key *pb_key_password; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
238 | const pb_key *pb_key_path; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
239 | const pb_key *pb_key_PATH_INFO; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
240 | const pb_key *pb_key_path_info; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
241 | const pb_key *pb_key_pblock; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
242 | const pb_key *pb_key_poll_interval; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
243 | const pb_key *pb_key_pool; // new |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
244 | const pb_key *pb_key_port; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
245 | const pb_key *pb_key_ppath; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
246 | const pb_key *pb_key_pragma; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
247 | const pb_key *pb_key_process_request_body; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
248 | const pb_key *pb_key_process_response_body; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
249 | const pb_key *pb_key_protocol; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
250 | const pb_key *pb_key_proxy_addr; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
251 | const pb_key *pb_key_proxy_agent; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
252 | const pb_key *pb_key_proxy_auth_cert; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
253 | const pb_key *pb_key_proxy_authorization; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
254 | const pb_key *pb_key_proxy_cipher; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
255 | const pb_key *pb_key_proxy_issuer_dn; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
256 | const pb_key *pb_key_proxy_jroute; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
257 | const pb_key *pb_key_proxy_keysize; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
258 | const pb_key *pb_key_proxy_ping; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
259 | const pb_key *pb_key_proxy_request; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
260 | const pb_key *pb_key_proxy_secret_keysize; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
261 | const pb_key *pb_key_proxy_ssl_id; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
262 | const pb_key *pb_key_proxy_user_dn; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
263 | const pb_key *pb_key_query; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
264 | const pb_key *pb_key_QUERY_STRING; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
265 | const pb_key *pb_key_QUERY_STRING_UNESCAPED; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
266 | const pb_key *pb_key_r2p_cl; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
267 | const pb_key *pb_key_r2p_hl; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
268 | const pb_key *pb_key_range; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
269 | const pb_key *pb_key_referer; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
270 | const pb_key *pb_key_reformat_request_headers; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
271 | const pb_key *pb_key_remote_status; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
272 | const pb_key *pb_key_request_jroute; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
273 | const pb_key *pb_key_required_rights; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
274 | const pb_key *pb_key_retries; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
275 | const pb_key *pb_key_rewrite_content_location; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
276 | const pb_key *pb_key_rewrite_host; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
277 | const pb_key *pb_key_rewrite_location; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
278 | const pb_key *pb_key_rewrite_set_cookie; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
279 | const pb_key *pb_key_root; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
280 | const pb_key *pb_key_route; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
281 | const pb_key *pb_key_route_cookie; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
282 | const pb_key *pb_key_route_hdr; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
283 | const pb_key *pb_key_route_offline; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
284 | const pb_key *pb_key_script_name; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
285 | const pb_key *pb_key_secret_keysize; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
286 | const pb_key *pb_key_secure; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
287 | const pb_key *pb_key_server; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
288 | const pb_key *pb_key_set_cookie; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
289 | const pb_key *pb_key_socks_addr; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
290 | const pb_key *pb_key_ssl_id; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
291 | const pb_key *pb_key_ssl_unclean_shutdown; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
292 | const pb_key *pb_key_status; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
293 | const pb_key *pb_key_sticky_cookie; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
294 | const pb_key *pb_key_sticky_param; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
295 | const pb_key *pb_key_suppress_request_headers; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
296 | const pb_key *pb_key_svr_status; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
297 | const pb_key *pb_key_timeout; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
298 | const pb_key *pb_key_to; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
299 | const pb_key *pb_key_transfer_encoding; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
300 | const pb_key *pb_key_transmit_timeout; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
301 | const pb_key *pb_key_tunnel_non_http_response; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
302 | const pb_key *pb_key_type; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
303 | const pb_key *pb_key_upstream_jroute; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
304 | const pb_key *pb_key_uri; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
305 | const pb_key *pb_key_url; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
306 | const pb_key *pb_key_url_prefix; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
307 | const pb_key *pb_key_UseOutputStreamSize; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
308 | const pb_key *pb_key_user; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
309 | const pb_key *pb_key_user_agent; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
310 | const pb_key *pb_key_user_dn; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
311 | const pb_key *pb_key_validate_server_cert; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
312 | const pb_key *pb_key_value; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
313 | const pb_key *pb_key_vary; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
314 | const pb_key *pb_key_via; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
315 | const pb_key *pb_key_warning; |
386 | 316 | const pb_key *pb_key_depth; |
317 | const pb_key *pb_key_if; | |
318 | const pb_key *pb_key_vfs; | |
319 | const pb_key *pb_key_dav; | |
320 | const pb_key *pb_key_vfsclass; | |
321 | const pb_key *pb_key_davclass; | |
1 | 322 | |
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
323 | NSAPI_PUBLIC void pblock_init_default_keys(void) { |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
324 | pb_key_accept = _create_key("accept"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
325 | pb_key_accept_charset = _create_key("accept-charset"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
326 | pb_key_accept_encoding = _create_key("accept-encoding"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
327 | pb_key_accept_language = _create_key("accept-language"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
328 | pb_key_accept_ranges = _create_key("accept-ranges"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
329 | pb_key_actual_route = _create_key("actual-route"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
330 | pb_key_age = _create_key("age"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
331 | pb_key_always_allow_chunked = _create_key("always-allow-chunked"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
332 | pb_key_always_use_keep_alive = _create_key("always-use-keep-alive"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
333 | pb_key_auth_cert = _create_key("auth-cert"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
334 | pb_key_auth_expiring = _create_key("auth-expiring"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
335 | pb_key_auth_group = _create_key("auth-group"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
336 | pb_key_auth_type = _create_key("auth-type"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
337 | pb_key_auth_user = _create_key("auth-user"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
338 | pb_key_authorization = _create_key("authorization"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
339 | pb_key_browser = _create_key("browser"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
340 | pb_key_c2p_cl = _create_key("c2p-cl"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
341 | pb_key_c2p_hl = _create_key("c2p-hl"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
342 | pb_key_cache_info = _create_key("cache-info"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
343 | pb_key_charset = _create_key("charset"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
344 | pb_key_check_http_server = _create_key("check-http-server"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
345 | pb_key_ChunkedRequestBufferSize = _create_key("ChunkedRequestBufferSize"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
346 | pb_key_ChunkedRequestTimeout = _create_key("ChunkedRequestTimeout"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
347 | pb_key_cipher = _create_key("cipher"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
348 | pb_key_clf_request = _create_key("clf-request"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
349 | pb_key_cli_status = _create_key("cli-status"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
350 | pb_key_client_cert_nickname = _create_key("client-cert-nickname"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
351 | pb_key_client_ip = _create_key("client-ip"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
352 | pb_key_close = _create_key("close"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
353 | pb_key_connect_timeout = _create_key("connect-timeout"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
354 | pb_key_connection = _create_key("connection"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
355 | pb_key_cont = _create_key("cont"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
356 | pb_key_content_encoding = _create_key("content-encoding"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
357 | pb_key_content_language = _create_key("content-language"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
358 | pb_key_content_length = _create_key("content-length"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
359 | pb_key_content_location = _create_key("content-location"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
360 | pb_key_content_md5 = _create_key("content-md5"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
361 | pb_key_content_range = _create_key("content-range"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
362 | pb_key_content_type = _create_key("content-type"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
363 | pb_key_cookie = _create_key("cookie"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
364 | pb_key_date = _create_key("date"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
365 | pb_key_DATE_GMT = _create_key("DATE_GMT"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
366 | pb_key_DATE_LOCAL = _create_key("DATE_LOCAL"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
367 | pb_key_dir = _create_key("dir"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
368 | pb_key_Directive = _create_key("Directive"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
369 | pb_key_dns = _create_key("dns"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
370 | pb_key_DOCUMENT_NAME = _create_key("DOCUMENT_NAME"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
371 | pb_key_DOCUMENT_URI = _create_key("DOCUMENT_URI"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
372 | pb_key_domain = _create_key("domain"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
373 | pb_key_enc = _create_key("enc"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
374 | pb_key_engine = _create_key("engine"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
375 | pb_key_error_action = _create_key("error-action"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
376 | pb_key_error_desc = _create_key("error-desc"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
377 | pb_key_error_fn = _create_key("error-fn"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
378 | pb_key_escape = _create_key("escape"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
379 | pb_key_escaped = _create_key("escaped"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
380 | pb_key_etag = _create_key("etag"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
381 | pb_key_expect = _create_key("expect"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
382 | pb_key_expires = _create_key("expires"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
383 | pb_key_expr = _create_key("expr"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
384 | pb_key_filter = _create_key("filter"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
385 | pb_key_find_pathinfo_forward = _create_key("find-pathinfo-forward"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
386 | pb_key_flushTimer = _create_key("flushTimer"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
387 | pb_key_fn = _create_key("fn"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
388 | pb_key_from = _create_key("from"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
389 | pb_key_full_headers = _create_key("full-headers"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
390 | pb_key_hdr = _create_key("hdr"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
391 | pb_key_host = _create_key("host"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
392 | pb_key_hostname = _create_key("hostname"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
393 | pb_key_if_match = _create_key("if-match"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
394 | pb_key_if_modified_since = _create_key("if-modified-since"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
395 | pb_key_if_none_match = _create_key("if-none-match"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
396 | pb_key_if_range = _create_key("if-range"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
397 | pb_key_if_unmodified_since = _create_key("if-unmodified-since"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
398 | pb_key_ip = _create_key("ip"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
399 | pb_key_iponly = _create_key("iponly"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
400 | pb_key_issuer_dn = _create_key("issuer_dn"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
401 | pb_key_jroute = _create_key("jroute"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
402 | pb_key_keep_alive = _create_key("keep-alive"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
403 | pb_key_keep_alive_timeout = _create_key("keep-alive-timeout"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
404 | pb_key_keysize = _create_key("keysize"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
405 | pb_key_lang = _create_key("lang"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
406 | pb_key_last_modified = _create_key("last-modified"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
407 | pb_key_level = _create_key("level"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
408 | pb_key_location = _create_key("location"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
409 | pb_key_lock_owner = _create_key("lock-owner"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
410 | pb_key_magnus_charset = _create_key("magnus-charset"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
411 | pb_key_magnus_internal = _create_key("magnus-internal"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
412 | pb_key_magnus_internal_dav_src = _create_key("magnus-internal/dav-src"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
413 | pb_key_magnus_internal_default_acls_only = _create_key("magnus-internal/default-acls-only"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
414 | pb_key_magnus_internal_error_j2ee = _create_key("magnus-internal/error-j2ee"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
415 | pb_key_magnus_internal_j2ee_nsapi = _create_key("magnus-internal/j2ee-nsapi"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
416 | pb_key_magnus_internal_preserve_srvhdrs = _create_key("magnus-internal/preserve-srvhdrs-after-req-restart"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
417 | pb_key_magnus_internal_set_request_status = _create_key("magnus-internal/set-request-status"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
418 | pb_key_magnus_internal_set_response_status = _create_key("magnus-internal/set-response-status"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
419 | pb_key_magnus_internal_webapp_errordesc = _create_key("magnus-internal/webapp-errordesc"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
420 | pb_key_matched_browser = _create_key("matched-browser"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
421 | pb_key_max_age = _create_key("max-age"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
422 | pb_key_max_forwards = _create_key("max-forwards"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
423 | pb_key_message = _create_key("message"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
424 | pb_key_method = _create_key("method"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
425 | pb_key_name = _create_key("name"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
426 | pb_key_nocache = _create_key("nocache"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
427 | pb_key_nostat = _create_key("nostat"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
428 | pb_key_ntrans_base = _create_key("ntrans-base"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
429 | pb_key_offline_origin_addr = _create_key("offline-origin-addr"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
430 | pb_key_offline_proxy_addr = _create_key("offline-proxy-addr"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
431 | pb_key_origin_addr = _create_key("origin-addr"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
432 | pb_key_p2c_cl = _create_key("p2c-cl"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
433 | pb_key_p2c_hl = _create_key("p2c-hl"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
434 | pb_key_p2r_cl = _create_key("p2r-cl"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
435 | pb_key_p2r_hl = _create_key("p2r-hl"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
436 | pb_key_parse_timeout = _create_key("parse-timeout"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
437 | pb_key_password = _create_key("password"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
438 | pb_key_path = _create_key("path"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
439 | pb_key_PATH_INFO = _create_key("PATH_INFO"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
440 | pb_key_path_info = _create_key("path-info"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
441 | pb_key_pblock = _create_key("pblock"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
442 | pb_key_poll_interval = _create_key("poll-interval"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
443 | pb_key_pool = _create_key("pool"); // new |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
444 | pb_key_port = _create_key("port"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
445 | pb_key_ppath = _create_key("ppath"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
446 | pb_key_pragma = _create_key("pragma"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
447 | pb_key_process_request_body = _create_key("process-request-body"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
448 | pb_key_process_response_body = _create_key("process-response-body"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
449 | pb_key_protocol = _create_key("protocol"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
450 | pb_key_proxy_addr = _create_key("proxy-addr"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
451 | pb_key_proxy_agent = _create_key("proxy-agent"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
452 | pb_key_proxy_auth_cert = _create_key("proxy-auth-cert"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
453 | pb_key_proxy_authorization = _create_key("proxy-authorization"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
454 | pb_key_proxy_cipher = _create_key("proxy-cipher"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
455 | pb_key_proxy_issuer_dn = _create_key("proxy-issuer-dn"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
456 | pb_key_proxy_jroute = _create_key("proxy-jroute"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
457 | pb_key_proxy_keysize = _create_key("proxy-keysize"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
458 | pb_key_proxy_ping = _create_key("proxy-ping"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
459 | pb_key_proxy_request = _create_key("proxy-request"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
460 | pb_key_proxy_secret_keysize = _create_key("proxy-secret-keysize"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
461 | pb_key_proxy_ssl_id = _create_key("proxy-ssl-id"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
462 | pb_key_proxy_user_dn = _create_key("proxy-user-dn"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
463 | pb_key_query = _create_key("query"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
464 | pb_key_QUERY_STRING = _create_key("QUERY_STRING"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
465 | pb_key_QUERY_STRING_UNESCAPED = _create_key("QUERY_STRING_UNESCAPED"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
466 | pb_key_r2p_cl = _create_key("r2p-cl"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
467 | pb_key_r2p_hl = _create_key("r2p-hl"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
468 | pb_key_range = _create_key("range"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
469 | pb_key_referer = _create_key("referer"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
470 | pb_key_reformat_request_headers = _create_key("reformat-request-headers"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
471 | pb_key_remote_status = _create_key("remote-status"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
472 | pb_key_request_jroute = _create_key("request-jroute"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
473 | pb_key_required_rights = _create_key("required-rights"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
474 | pb_key_retries = _create_key("retries"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
475 | pb_key_rewrite_content_location = _create_key("rewrite-content-location"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
476 | pb_key_rewrite_host = _create_key("rewrite-host"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
477 | pb_key_rewrite_location = _create_key("rewrite-location"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
478 | pb_key_rewrite_set_cookie = _create_key("rewrite-set-cookie"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
479 | pb_key_root = _create_key("root"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
480 | pb_key_route = _create_key("route"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
481 | pb_key_route_cookie = _create_key("route-cookie"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
482 | pb_key_route_hdr = _create_key("route-hdr"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
483 | pb_key_route_offline = _create_key("route-offline"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
484 | pb_key_script_name = _create_key("script-name"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
485 | pb_key_secret_keysize = _create_key("secret-keysize"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
486 | pb_key_secure = _create_key("secure"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
487 | pb_key_server = _create_key("server"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
488 | pb_key_set_cookie = _create_key("set-cookie"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
489 | pb_key_socks_addr = _create_key("socks_addr"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
490 | pb_key_ssl_id = _create_key("ssl-id"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
491 | pb_key_ssl_unclean_shutdown = _create_key("ssl-unclean-shutdown"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
492 | pb_key_status = _create_key("status"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
493 | pb_key_sticky_cookie = _create_key("sticky-cookie"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
494 | pb_key_sticky_param = _create_key("sticky-param"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
495 | pb_key_suppress_request_headers = _create_key("suppress-request-headers"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
496 | pb_key_svr_status = _create_key("svr-status"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
497 | pb_key_timeout = _create_key("timeout"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
498 | pb_key_to = _create_key("to"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
499 | pb_key_transfer_encoding = _create_key("transfer-encoding"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
500 | pb_key_transmit_timeout = _create_key("transmit-timeout"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
501 | pb_key_tunnel_non_http_response = _create_key("tunnel-non-http-response"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
502 | pb_key_type = _create_key("type"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
503 | pb_key_upstream_jroute = _create_key("upstream-jroute"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
504 | pb_key_uri = _create_key("uri"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
505 | pb_key_url = _create_key("url"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
506 | pb_key_url_prefix = _create_key("url-prefix"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
507 | pb_key_UseOutputStreamSize = _create_key("UseOutputStreamSize"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
508 | pb_key_user = _create_key("user"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
509 | pb_key_user_agent = _create_key("user-agent"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
510 | pb_key_user_dn = _create_key("user_dn"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
511 | pb_key_validate_server_cert = _create_key("validate-server-cert"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
512 | pb_key_value = _create_key("value"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
513 | pb_key_vary = _create_key("vary"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
514 | pb_key_via = _create_key("via"); |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
515 | pb_key_warning = _create_key("warning"); |
386 | 516 | pb_key_depth = _create_key("depth"); |
517 | pb_key_if = _create_key("if"); | |
518 | pb_key_vfs = _create_key("vfs"); | |
519 | pb_key_dav = _create_key("dav"); | |
520 | pb_key_vfsclass = _create_key("vfsclass"); | |
521 | pb_key_davclass = _create_key("davclass"); | |
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
522 | } |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
523 | |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
524 | NSAPI_PUBLIC void pblock_free_default_keys(void) { |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
525 | for (unsigned i = 0 ; i < PB_KEY_LIST_BUCKET_COUNT ; i++) { |
365
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
526 | unsigned count = _pbKeys.buckets[i].size; |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
527 | if (count > 0) { |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
528 | pb_key **keys = _pbKeys.buckets[i].elements; |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
529 | for (unsigned j = 0 ; j < count ; j++) { |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
530 | free(keys[j]); |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
531 | } |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
532 | free(keys); |
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
533 | } |
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
534 | } |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
535 | } |
1 | 536 | |
537 | /* ------------------------------ _find_key ------------------------------- */ | |
538 | ||
539 | static inline const pb_key *_find_key(const char *name, unsigned int hashval) | |
540 | { | |
541 | /* Check to see if name corresponds to a pb_key */ | |
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
542 | struct pb_key_list_bucket *bucket = &_pbKeys.buckets[hashval & PB_KEY_LIST_BUCKET_COUNT]; |
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
543 | for (unsigned i = 0 ; i < bucket->size ; i++) { |
365
2ea1ed291e9f
revert optimization that does not harmonize with realloc()
Mike Becker <universe@uap-core.de>
parents:
363
diff
changeset
|
544 | pb_key *key = bucket->elements[i]; |
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
545 | if (key->hashval == hashval && !strcmp(key->name, name)) { |
1 | 546 | return key; |
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
547 | } |
1 | 548 | } |
549 | return NULL; | |
550 | } | |
551 | ||
552 | ||
553 | /* --------------------------- _get_hash_index ---------------------------- */ | |
554 | ||
555 | static inline int _get_hash_index(const PListStruct_t *pl, const pb_key *key) | |
556 | { | |
557 | /* Get the hash index from the key. Requires a symbol table. */ | |
558 | int i; | |
559 | if (key->sizendx == pl->pl_symtab->pt_sizendx) | |
560 | i = key->hashndx; | |
561 | else | |
562 | i = key->hashval % PLSIZENDX(pl->pl_symtab->pt_sizendx); | |
563 | return i; | |
564 | } | |
565 | ||
566 | ||
567 | /* ---------------------------- _param_create ----------------------------- */ | |
568 | ||
569 | static inline pb_param *_param_create(pool_handle_t *pool_handle, const char *name, int namelen, const char *value, int valuelen) | |
570 | { | |
571 | PLValueStruct_t *ret; | |
572 | ||
573 | ret = (PLValueStruct_t *)pool_malloc(pool_handle, sizeof(PLValueStruct_t)); | |
574 | ||
575 | ret->pv_pbentry.param = &ret->pv_pbparam; | |
576 | ret->pv_pbentry.next = 0; | |
577 | ret->pv_next = 0; | |
578 | ret->pv_type = 0; | |
579 | ret->pv_mempool = pool_handle; | |
580 | ||
581 | if (name || namelen) { | |
582 | ret->pv_name = (char*)pool_malloc(pool_handle, namelen + 1); | |
583 | if (name) { | |
584 | memcpy(ret->pv_name, name, namelen); | |
585 | ret->pv_name[namelen] = '\0'; | |
586 | } else { | |
587 | ret->pv_name[0] = '\0'; | |
588 | } | |
589 | } else { | |
590 | ret->pv_name = 0; | |
591 | } | |
592 | ||
593 | if (value || valuelen) { | |
594 | ret->pv_value = (char*)pool_malloc(pool_handle, valuelen + 1); | |
595 | if (value) { | |
596 | memcpy(ret->pv_value, value, valuelen); | |
597 | ret->pv_value[valuelen] = '\0'; | |
598 | } else { | |
599 | ret->pv_value[0] = '\0'; | |
600 | } | |
601 | } else { | |
602 | ret->pv_value = 0; | |
603 | } | |
604 | ||
605 | return &ret->pv_pbparam; | |
606 | } | |
607 | ||
608 | ||
609 | /* ----------------------- pblock_key_param_create ----------------------- */ | |
610 | ||
611 | NSAPI_PUBLIC pb_param *pblock_key_param_create(pblock *pb, const pb_key *key, const char *value, int valuelen) | |
612 | { | |
613 | /* | |
614 | * Allocate a PLValueStruct_t from the property list's memory pool. | |
615 | */ | |
616 | PListStruct_t *pl = PBTOPL(pb); | |
617 | return _param_create(pl->pl_mempool, key->name, key->namelen, value, valuelen); | |
618 | } | |
619 | ||
620 | ||
621 | /* ------------------------- pblock_param_create -------------------------- */ | |
622 | ||
623 | NSAPI_PUBLIC pb_param *pblock_param_create(pblock *pb, const char *name, const char *value) | |
624 | { | |
625 | /* | |
626 | * Allocate a PLValueStruct_t from the property list's memory pool. | |
627 | */ | |
628 | PListStruct_t *pl = PBTOPL(pb); | |
629 | return _param_create(pl->pl_mempool, name, name ? strlen(name) : 0, value, value ? strlen(value) : 0); | |
630 | } | |
631 | ||
632 | ||
633 | /* ----------------------------- param_create ----------------------------- */ | |
634 | ||
635 | NSAPI_PUBLIC pb_param *param_create(const char *name, const char *value) | |
636 | { | |
637 | /* | |
638 | * Allocate a PLValueStruct_t containing the pb_param that will | |
639 | * be returned. Normally PLValueStruct_ts are allocated from the | |
640 | * memory pool associated with a property list, but we don't have | |
641 | * that here, so we just use the thread's pool and indicate we were | |
642 | * allocated from a specific pool. | |
643 | */ | |
644 | return _param_create(system_pool(), name, name ? strlen(name) : 0, value, value ? strlen(value) : 0); | |
645 | } | |
646 | ||
647 | ||
648 | /* ------------------------------ param_free ------------------------------ */ | |
649 | ||
650 | NSAPI_PUBLIC int param_free(pb_param *pp) | |
651 | { | |
652 | if (pp) { | |
653 | PLValueStruct_t *pv = PATOPV(pp); | |
654 | ||
655 | /* Don't bother if the pblock was allocated from a pool */ | |
656 | if (!pv->pv_mempool) { | |
657 | pool_free(pv->pv_mempool, pv->pv_name); | |
658 | pool_free(pv->pv_mempool, pv->pv_value); | |
659 | pool_free(pv->pv_mempool, pv); | |
660 | } | |
661 | ||
662 | return 1; | |
663 | } | |
664 | ||
665 | return 0; | |
666 | } | |
667 | ||
668 | ||
669 | /* -------------------------- pblock_create_pool -------------------------- */ | |
670 | ||
671 | NSAPI_PUBLIC pblock *pblock_create_pool(pool_handle_t *pool_handle, int n) | |
672 | { | |
673 | /* Create a property list with n property indices */ | |
674 | PListStruct_t *plist = (PListStruct_t *)PListCreate(pool_handle, n, 0, 0); | |
675 | if (!plist) | |
676 | return NULL; | |
677 | ||
678 | plist->pl_resvpi = 0; | |
679 | ||
680 | return &plist->pl_pb; | |
681 | } | |
682 | ||
683 | ||
684 | /* ----------------------------- pblock_pool ------------------------------ */ | |
685 | ||
686 | NSAPI_PUBLIC pool_handle_t *pblock_pool(pblock *pb) | |
687 | { | |
688 | PListStruct_t *pl = PBTOPL(pb); | |
689 | return pl->pl_mempool; | |
690 | } | |
691 | ||
692 | ||
693 | /* ---------------------------- pblock_create ----------------------------- */ | |
694 | ||
695 | NSAPI_PUBLIC pblock *pblock_create(int n) | |
696 | { | |
697 | return pblock_create_pool(MALLOC_POOL_HANDLE, n); | |
698 | } | |
699 | ||
700 | ||
701 | /* ----------------------------- pblock_free ------------------------------ */ | |
702 | ||
703 | NSAPI_PUBLIC void pblock_free(pblock *pb) | |
704 | { | |
705 | PListStruct_t *pl = PBTOPL(pb); | |
706 | PLValueStruct_t **ppval; | |
707 | PLValueStruct_t *pv; | |
708 | int i; | |
709 | ||
710 | if (!pb) { | |
711 | return; | |
712 | } | |
713 | ||
714 | /* If the pools are enabled, this routine has no effect anyway, so | |
715 | * just return. | |
716 | */ | |
717 | if (pl->pl_mempool || pool_enabled()) { | |
718 | return; | |
719 | } | |
720 | ||
721 | /* Free the property name symbol table if any */ | |
722 | if (pl->pl_symtab) { | |
723 | pool_free(pl->pl_mempool, (void *)(pl->pl_symtab)); | |
724 | } | |
725 | ||
726 | ppval = (PLValueStruct_t **)(pl->pl_ppval); | |
727 | ||
728 | /* Loop over the initialized property indices */ | |
729 | for (i = 0; i < pl->pl_initpi; ++i) { | |
730 | ||
731 | /* Got a property here? */ | |
732 | pv = ppval[i]; | |
733 | if (pv) { | |
734 | ||
735 | param_free(&pv->pv_pbparam); | |
736 | } | |
737 | } | |
738 | ||
739 | /* Free the array of pointers to property values */ | |
740 | pool_free(pl->pl_mempool, (void *)ppval); | |
741 | ||
742 | /* Free the property list head */ | |
743 | pool_free(pl->pl_mempool, (void *)pl); | |
744 | } | |
745 | ||
746 | ||
747 | /* ------------------------------ pblock_key ------------------------------ */ | |
748 | ||
749 | NSAPI_PUBLIC const pb_key *pblock_key(const char *name) | |
750 | { | |
751 | if (!name) | |
752 | return NULL; | |
753 | ||
754 | return _find_key(name, PListHash(name)); | |
755 | } | |
756 | ||
757 | ||
758 | /* --------------------------- pblock_kpinsert ---------------------------- */ | |
759 | ||
760 | NSAPI_PUBLIC void pblock_kpinsert(const pb_key *key, pb_param *pp, pblock *pb) | |
761 | { | |
762 | PListStruct_t *pl = PBTOPL(pb); | |
763 | PLValueStruct_t *pv = PATOPV(pp); | |
764 | ||
24
1a7853a4257e
removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
14
diff
changeset
|
765 | //PR_ASSERT(pv->pv_mempool == pl->pl_mempool); // TODO |
1 | 766 | |
767 | /* Check to see if the name corresponds to a pb_key */ | |
768 | unsigned int hashval; | |
769 | if (!key) { | |
770 | hashval = PListHash(pv->pv_name); | |
771 | key = _find_key(pv->pv_name, hashval); | |
772 | } | |
773 | ||
774 | /* Find property index */ | |
775 | int pindex = PListGetFreeIndex(pl); | |
776 | if (pindex < 1) { | |
777 | /* Error - invalid property index */ | |
3
137197831306
minimal request handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
1
diff
changeset
|
778 | printf("Error - invalid property index\n"); |
1 | 779 | return; |
780 | } | |
781 | ||
782 | /* Allocate/grow the symbol table as needed */ | |
783 | PLSymbolTable_t *pt = PListSymbolTable(pl); | |
784 | if (!pt) { | |
3
137197831306
minimal request handling
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
1
diff
changeset
|
785 | printf("!pt\n"); |
1 | 786 | return; |
787 | } | |
788 | ||
789 | /* Add PLValueStruct_t to the property list */ | |
790 | PLValueStruct_t **ppval = (PLValueStruct_t **)(pl->pl_ppval); | |
791 | pv->pv_pbkey = key; | |
792 | pv->pv_pi = pindex; | |
793 | ppval[pv->pv_pi - 1] = pv; | |
794 | ||
795 | /* Add name to symbol table */ | |
796 | int i = key ? _get_hash_index(pl, key) : (hashval % PLSIZENDX(pt->pt_sizendx)); | |
797 | pv->pv_next = pt->pt_hash[i]; | |
798 | pt->pt_hash[i] = pv; | |
799 | pt->pt_nsyms++; | |
800 | ||
24
1a7853a4257e
removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
14
diff
changeset
|
801 | //PR_ASSERT(param_key(pp) == key); // TODO |
1 | 802 | } |
803 | ||
804 | ||
805 | /* ---------------------------- pblock_pinsert ---------------------------- */ | |
806 | ||
807 | NSAPI_PUBLIC void pblock_pinsert(pb_param *pp, pblock *pb) | |
808 | { | |
809 | pblock_kpinsert(NULL, pp, pb); | |
810 | } | |
811 | ||
812 | ||
813 | /* --------------------------- pblock_nvinsert ---------------------------- */ | |
814 | ||
815 | NSAPI_PUBLIC pb_param *pblock_nvinsert(const char *name, const char *value, pblock *pb) | |
816 | { | |
817 | pb_param *pp = pblock_param_create(pb, name, value); | |
818 | if (pp) | |
819 | pblock_kpinsert(NULL, pp, pb); | |
820 | return pp; | |
821 | } | |
822 | ||
823 | ||
824 | /* --------------------------- pblock_kvinsert ---------------------------- */ | |
825 | ||
826 | NSAPI_PUBLIC pb_param *pblock_kvinsert(const pb_key *key, const char *value, int valuelen, pblock *pb) | |
827 | { | |
828 | pb_param *pp = pblock_key_param_create(pb, key, value, valuelen); | |
829 | if (pp) | |
830 | pblock_kpinsert(key, pp, pb); | |
831 | return pp; | |
832 | } | |
833 | ||
834 | ||
835 | /* --------------------------- pblock_nninsert ---------------------------- */ | |
836 | ||
837 | NSAPI_PUBLIC pb_param *pblock_nninsert(const char *name, int value, pblock *pb) | |
838 | { | |
839 | char num[UTIL_ITOA_SIZE]; | |
840 | ||
841 | util_itoa(value, num); | |
842 | return pblock_nvinsert(name, num, pb); | |
843 | } | |
844 | ||
845 | ||
846 | /* --------------------------- pblock_kninsert ---------------------------- */ | |
847 | ||
848 | NSAPI_PUBLIC pb_param *pblock_kninsert(const pb_key *key, int value, pblock *pb) | |
849 | { | |
850 | pb_param *pp = pblock_key_param_create(pb, key, NULL, UTIL_ITOA_SIZE); | |
851 | if (pp) { | |
852 | util_itoa(value, pp->value); | |
853 | pblock_kpinsert(key, pp, pb); | |
854 | } | |
855 | return pp; | |
856 | } | |
857 | ||
858 | ||
859 | /* --------------------------- pblock_kllinsert --------------------------- */ | |
860 | ||
24
1a7853a4257e
removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
14
diff
changeset
|
861 | NSAPI_PUBLIC pb_param *pblock_kllinsert(const pb_key *key, int64_t value, pblock *pb) |
1 | 862 | { |
863 | pb_param *pp = pblock_key_param_create(pb, key, NULL, UTIL_I64TOA_SIZE); | |
864 | if (pp) { | |
865 | util_i64toa(value, pp->value); | |
866 | pblock_kpinsert(key, pp, pb); | |
867 | } | |
868 | return pp; | |
869 | } | |
870 | ||
871 | ||
5
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
872 | /* ---------------------------pblock_nvlinsert ---------------------------- */ |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
873 | |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
874 | NSAPI_PUBLIC pb_param *pblock_nvlinsert(const char *name, int namelen, const char *value, int valuelen, pblock *pb) |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
875 | { |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
876 | PListStruct_t *pl = PBTOPL(pb); |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
877 | |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
878 | pb_param *pp = _param_create(pl->pl_mempool, name, namelen, value, valuelen); |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
879 | |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
880 | if(pp) { |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
881 | pblock_kpinsert(NULL, pp, pb); |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
882 | } |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
883 | |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
884 | return pp; |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
885 | } |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
886 | |
dbc01588686e
Added parser for obj.conf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
3
diff
changeset
|
887 | |
1 | 888 | /* ---------------------------- pblock_findkey ---------------------------- */ |
889 | ||
890 | NSAPI_PUBLIC pb_param *pblock_findkey(const pb_key *key, const pblock *pb) | |
891 | { | |
892 | PListStruct_t *pl = PBTOPL(pb); | |
893 | ||
894 | /* Lookup key by examining symbol table */ | |
895 | if (pl->pl_symtab) { | |
896 | int i = _get_hash_index(pl, key); | |
897 | PLValueStruct_t *pv; | |
898 | ||
899 | /* Search hash collision list for matching name */ | |
900 | for (pv = pl->pl_symtab->pt_hash[i]; pv; pv = pv->pv_next) { | |
901 | if (pv->pv_pbkey == key) | |
902 | return &pv->pv_pbparam; | |
903 | } | |
904 | } | |
905 | ||
906 | return NULL; | |
907 | } | |
908 | ||
909 | ||
910 | /* -------------------------- pblock_findkeyval --------------------------- */ | |
911 | ||
912 | NSAPI_PUBLIC char *pblock_findkeyval(const pb_key *key, const pblock *pb) | |
913 | { | |
914 | pb_param *pp = pblock_findkey(key, pb); | |
915 | return pp ? pp->value : NULL; | |
916 | } | |
917 | ||
918 | ||
919 | /* ---------------------------- pblock_findval ---------------------------- */ | |
920 | ||
921 | NSAPI_PUBLIC char *pblock_findval(const char *name, const pblock *pb) | |
922 | { | |
923 | void *pvalue = 0; | |
924 | ||
925 | (void)PListFindValue((PList_t)(PBTOPL(pb)), name, &pvalue, 0); | |
926 | ||
927 | return (char *)pvalue; | |
928 | } | |
929 | ||
930 | ||
931 | /* ------------------------------ pblock_fr ------------------------------ */ | |
932 | ||
933 | NSAPI_PUBLIC pb_param *pblock_fr(const char *name, pblock *pb, int remove) | |
934 | { | |
935 | PListStruct_t *pl = PBTOPL(pb); | |
936 | PLValueStruct_t **ppval; | |
937 | PLValueStruct_t **pvp; | |
938 | PLValueStruct_t *pv = NULL; | |
939 | int pindex; | |
940 | int i; | |
941 | ||
942 | if (pl->pl_symtab) { | |
943 | ||
944 | /* Compute hash index of specified property name */ | |
945 | i = PListHashName(pl->pl_symtab, name); | |
946 | ||
947 | /* Search hash collision list for matching name */ | |
948 | for (pvp = &pl->pl_symtab->pt_hash[i]; | |
949 | (pv = *pvp); pvp = &(*pvp)->pv_next) { | |
950 | ||
951 | if (!strcmp(name, pv->pv_name)) { | |
952 | ||
953 | if (remove) { | |
954 | /* Remove PLValueStruct_t from symbol table */ | |
955 | *pvp = pv->pv_next; | |
956 | pl->pl_symtab->pt_nsyms--; | |
957 | ||
958 | /* Remove it from pl_ppval too */ | |
959 | ppval = (PLValueStruct_t **)(pl->pl_ppval); | |
960 | pindex = pv->pv_pi; | |
961 | ppval[pindex - 1] = 0; | |
962 | } | |
963 | break; | |
964 | } | |
965 | } | |
966 | } | |
967 | ||
968 | return (pv) ? &pv->pv_pbparam : NULL; | |
969 | } | |
970 | ||
971 | ||
972 | /* --------------------------- pblock_removekey --------------------------- */ | |
973 | ||
974 | NSAPI_PUBLIC pb_param *pblock_removekey(const pb_key *key, pblock *pb) | |
975 | { | |
976 | PListStruct_t *pl = PBTOPL(pb); | |
977 | PLValueStruct_t **ppval; | |
978 | PLValueStruct_t **pvp; | |
979 | PLValueStruct_t *pv = NULL; | |
980 | int pindex; | |
981 | int i; | |
982 | ||
983 | if (pl->pl_symtab) { | |
984 | /* Lookup hash index for specified property key */ | |
985 | i = _get_hash_index(pl, key); | |
986 | ||
987 | /* Search hash collision list for matching key */ | |
988 | for (pvp = &pl->pl_symtab->pt_hash[i]; (pv = *pvp); pvp = &pv->pv_next) { | |
989 | /* If this value has the requested key... */ | |
990 | if (pv->pv_pbkey == key) { | |
991 | /* Remove PLValueStruct_t from symbol table */ | |
992 | *pvp = pv->pv_next; | |
993 | pl->pl_symtab->pt_nsyms--; | |
994 | ||
995 | /* Remove it from pl_ppval too */ | |
996 | ppval = (PLValueStruct_t **)(pl->pl_ppval); | |
997 | pindex = pv->pv_pi; | |
998 | ppval[pindex - 1] = 0; | |
999 | ||
1000 | break; | |
1001 | } | |
1002 | } | |
1003 | } | |
1004 | ||
1005 | return (pv) ? &pv->pv_pbparam : NULL; | |
1006 | } | |
1007 | ||
1008 | ||
1009 | /* -------------------------- pblock_removeone --------------------------- */ | |
1010 | ||
1011 | NSAPI_PUBLIC pb_param *pblock_removeone(pblock *pb) | |
1012 | { | |
1013 | PListStruct_t *pl = PBTOPL(pb); | |
1014 | ||
1015 | if (pl && pl->pl_symtab) { | |
1016 | /* Search hash buckets */ | |
1017 | for (int i = 0; i < PLSIZENDX(pl->pl_symtab->pt_sizendx); i++) { | |
1018 | /* Search hash collision list */ | |
1019 | PLValueStruct_t *pv = pl->pl_symtab->pt_hash[i]; | |
1020 | if (pv) { | |
1021 | /* Remove PLValueStruct_t from symbol table */ | |
1022 | pl->pl_symtab->pt_hash[i] = pv->pv_next; | |
1023 | pl->pl_symtab->pt_nsyms--; | |
1024 | ||
1025 | /* Remove it from pl_ppval too */ | |
1026 | PLValueStruct_t **ppval = (PLValueStruct_t**)pl->pl_ppval; | |
1027 | ppval[pv->pv_pi - 1] = 0; | |
1028 | ||
1029 | return &pv->pv_pbparam; | |
1030 | } | |
1031 | } | |
1032 | } | |
1033 | ||
1034 | return NULL; | |
1035 | } | |
1036 | ||
1037 | ||
1038 | /* -------------------------- pblock_str2pblock --------------------------- */ | |
1039 | ||
1040 | ||
1041 | int _verify_pbstr(const char *str) | |
1042 | { | |
1043 | const char *cp; | |
1044 | const char *scp; | |
1045 | int np; | |
1046 | int state; | |
1047 | int quote; | |
1048 | ||
1049 | for(cp = str, np = 0, state = 0; *cp; ) { | |
1050 | switch (state) { | |
1051 | case 0: /* skipping leading spaces */ | |
1052 | ||
1053 | while (*cp && isspace(*cp)) ++cp; | |
1054 | if (*cp == '=') { | |
1055 | return -1; | |
1056 | } | |
1057 | if (*cp) state = 1; | |
1058 | break; | |
1059 | ||
1060 | case 1: /* scanning parameter name */ | |
1061 | ||
1062 | scp = cp; | |
1063 | while (*cp && (*cp != '=') && !isspace(*cp)) ++cp; | |
1064 | if (*cp == '=') ++cp; | |
1065 | else cp = scp; | |
1066 | state = 2; | |
1067 | break; | |
1068 | ||
1069 | case 2: /* scanning parameter value */ | |
1070 | quote = 0; | |
1071 | if (*cp == '\"') { | |
1072 | quote = 1; | |
1073 | ++cp; | |
1074 | } | |
1075 | for (;;) { | |
1076 | if (*cp == '\\') { | |
1077 | ++cp; | |
1078 | if (*cp == 0) { | |
1079 | return -1; | |
1080 | } | |
1081 | } | |
1082 | else if (*cp == '\"') { | |
1083 | if (!quote) { | |
1084 | return -1; | |
1085 | } | |
1086 | ++np; | |
1087 | ++cp; | |
1088 | quote = 0; | |
1089 | state = 0; | |
1090 | break; | |
1091 | } | |
1092 | else if (!quote && (!*cp || isspace(*cp))) { | |
1093 | ++np; | |
1094 | if (*cp) ++cp; | |
1095 | state = 0; | |
1096 | break; | |
1097 | } | |
1098 | else if (*cp == 0) { | |
1099 | return -1; | |
1100 | } | |
1101 | ++cp; | |
1102 | } | |
1103 | if (quote) { | |
1104 | return -1; | |
1105 | } | |
1106 | break; | |
1107 | } | |
1108 | } | |
1109 | ||
1110 | return (state == 0) ? np : -1; | |
1111 | } | |
1112 | ||
1113 | NSAPI_PUBLIC int | |
1114 | INTpblock_str2pblock_lowercasename(const char *str, pblock *pb) | |
1115 | { | |
1116 | return _pblock_str2pblock(str, pb, PR_TRUE); | |
1117 | } | |
1118 | ||
1119 | NSAPI_PUBLIC int pblock_str2pblock(const char *str, pblock *pb) | |
1120 | { | |
1121 | return _pblock_str2pblock(str, pb, PR_FALSE); | |
1122 | } | |
1123 | ||
1124 | int | |
1125 | _pblock_str2pblock(const char* str, pblock* pb, PRBool lowerCase) | |
1126 | { | |
1127 | char *cpy; | |
1128 | char *cp; | |
1129 | char *dp; | |
1130 | char *pname; | |
1131 | char *pvalue; | |
1132 | int np; | |
1133 | int quote; | |
1134 | int state; | |
1135 | char numbuf[UTIL_ITOA_SIZE]; | |
1136 | ||
1137 | if((np = _verify_pbstr(str)) < 1) | |
1138 | return -1; | |
1139 | ||
1140 | while (*str && isspace(*str)) ++str; | |
1141 | ||
1142 | cpy = STRDUP(str); | |
1143 | ||
1144 | for (np = 0, cp = cpy, state = 0; *cp; ) { | |
1145 | switch (state) { | |
1146 | ||
1147 | case 0: /* skipping leading spaces */ | |
1148 | ||
1149 | while (*cp && isspace(*cp)) ++cp; | |
1150 | if (*cp) state = 1; | |
1151 | break; | |
1152 | ||
1153 | case 1: /* scanning parameter name */ | |
1154 | ||
1155 | pname = cp; | |
1156 | while (*cp && (*cp != '=') && !isspace(*cp)) ++cp; | |
1157 | if (*cp == '=') { | |
1158 | *cp++ = 0; | |
1159 | } | |
1160 | else { | |
1161 | cp = pname; | |
1162 | pname = numbuf; | |
1163 | util_itoa(np+1, numbuf); | |
1164 | } | |
1165 | state = 2; | |
1166 | break; | |
1167 | ||
1168 | case 2: /* scanning parameter value */ | |
1169 | quote = 0; | |
1170 | if (*cp == '\"') { | |
1171 | quote = 1; | |
1172 | ++cp; | |
1173 | } | |
1174 | for (pvalue = cp, dp = cp; ; ++cp, ++dp) { | |
1175 | if (*cp == '\\') { | |
1176 | ++cp; | |
1177 | } | |
1178 | else if (*cp == '\"') { | |
1179 | ++np; | |
1180 | ++cp; | |
1181 | *dp = 0; | |
1182 | quote = 0; | |
1183 | state = 0; | |
1184 | break; | |
1185 | } | |
1186 | else if (!quote && ((*cp == 0) || isspace(*cp))) { | |
1187 | ++np; | |
1188 | if (*cp != 0) { | |
1189 | ++cp; | |
1190 | } | |
1191 | *dp = 0; | |
1192 | state = 0; | |
1193 | break; | |
1194 | } | |
1195 | if (cp != dp) *dp = *cp; | |
1196 | } | |
1197 | if (lowerCase == PR_TRUE) { | |
1198 | for (char* p = pname; *p; p++) { | |
1199 | *p = tolower(*p); | |
1200 | } | |
1201 | } | |
1202 | pblock_nvinsert(pname, pvalue, pb); | |
1203 | break; | |
1204 | } | |
1205 | } | |
1206 | ||
1207 | FREE(cpy); | |
1208 | ||
1209 | return np; | |
1210 | } | |
1211 | ||
1212 | ||
1213 | /* -------------------------- pblock_pblock2str --------------------------- */ | |
1214 | ||
1215 | ||
1216 | NSAPI_PUBLIC char *pblock_pblock2str(const pblock *pb, char *str) | |
1217 | { | |
363
7f0f5c03666a
port pblock.cpp to pblock.c
Mike Becker <universe@uap-core.de>
parents:
77
diff
changeset
|
1218 | char *s = str, *t, *u; |
1 | 1219 | PListStruct_t *pl = PBTOPL(pb); |
1220 | PLValueStruct_t **ppval; | |
1221 | PLValueStruct_t *pv; | |
1222 | int i; | |
1223 | int sl; | |
1224 | int xlen; | |
1225 | ||
1226 | ppval = (PLValueStruct_t **)(pl->pl_ppval); | |
1227 | ||
1228 | /* Loop over the initialized property indices */ | |
1229 | for (i = 0, xlen = 0; i < pl->pl_initpi; ++i) { | |
1230 | ||
1231 | /* Got a property here? */ | |
1232 | pv = ppval[i]; | |
1233 | if (pv && pv->pv_name) { | |
1234 | ||
1235 | int ln = strlen(pv->pv_name); | |
1236 | int lv = strlen((char *)(pv->pv_value)); | |
1237 | ||
1238 | /* Check for " or \ because we'll have to escape them */ | |
1239 | for (t = (char *)(pv->pv_value); *t; ++t) { | |
1240 | if ((*t == '\"') || (*t == '\\')) ++lv; | |
1241 | } | |
1242 | ||
1243 | /* 4: two quotes, =, and a null */ | |
1244 | xlen += (ln + lv + 4); | |
1245 | } | |
1246 | } | |
1247 | ||
1248 | /* Allocate string to hold parameter settings, or increase size */ | |
1249 | if (!s) { | |
1250 | s = (char *)MALLOC(xlen); | |
1251 | s[0] = '\0'; | |
1252 | t = &s[0]; | |
1253 | sl = xlen; | |
1254 | } | |
1255 | else { | |
1256 | sl = strlen(s); | |
1257 | t = &s[sl]; | |
1258 | sl += xlen; | |
1259 | s = (char *)REALLOC(s, sl); | |
1260 | } | |
1261 | ||
1262 | /* Loop over the initialized property indices */ | |
1263 | for (i = 0; i < pl->pl_initpi; ++i) { | |
1264 | ||
1265 | /* Got a property here? */ | |
1266 | pv = ppval[i]; | |
1267 | if (pv && pv->pv_name) { | |
1268 | ||
1269 | if (t != s) *t++ = ' '; | |
1270 | ||
1271 | for (u = pv->pv_name; *u; ) *t++ = *u++; | |
1272 | ||
1273 | *t++ = '='; | |
1274 | *t++ = '\"'; | |
1275 | ||
1276 | for (u = (char *)(pv->pv_value); *u; ) { | |
1277 | if ((*u == '\\') || (*u == '\"')) *t++ = '\\'; | |
1278 | *t++ = *u++; | |
1279 | } | |
1280 | ||
1281 | *t++ = '\"'; | |
1282 | *t = '\0'; | |
1283 | } | |
1284 | } | |
1285 | ||
1286 | return s; | |
1287 | } | |
1288 | ||
1289 | ||
1290 | /* ----------------------------- pblock_copy ------------------------------ */ | |
1291 | ||
1292 | ||
1293 | NSAPI_PUBLIC int pblock_copy(const pblock *src, pblock *dst) | |
1294 | { | |
1295 | PListStruct_t *pl = PBTOPL(src); | |
1296 | PLValueStruct_t **ppval; | |
1297 | PLValueStruct_t *pv; | |
1298 | int rv = 0; | |
1299 | int i; | |
1300 | ||
1301 | ppval = (PLValueStruct_t **)(pl->pl_ppval); | |
1302 | ||
1303 | for (i = 0; i < pl->pl_initpi; ++i) { | |
1304 | pv = ppval[i]; | |
1305 | if (pv) { | |
1306 | if (pv->pv_pbkey) { | |
1307 | if (pv->pv_pbkey != pb_key_magnus_internal) { | |
1308 | if (!pblock_kvinsert(pv->pv_pbkey, (char *)(pv->pv_value), strlen(pv->pv_value), dst)) | |
1309 | rv = -1; | |
1310 | } | |
1311 | } else { | |
1312 | if (!pblock_nvinsert(pv->pv_name, (char *)(pv->pv_value), dst)) | |
1313 | rv = -1; | |
1314 | } | |
1315 | } | |
1316 | } | |
1317 | ||
1318 | return rv; | |
1319 | } | |
1320 | ||
1321 | /* ---------------------------- pblock_dup -------------------------------- */ | |
1322 | ||
1323 | NSAPI_PUBLIC pblock *pblock_dup(const pblock *src) | |
1324 | { | |
1325 | pblock *dst; | |
1326 | ||
1327 | if (!src) | |
1328 | return NULL; | |
1329 | ||
1330 | if ( (dst = pblock_create(src->hsize)) ) | |
1331 | pblock_copy(src, dst); | |
1332 | ||
1333 | return dst; | |
1334 | } | |
1335 | ||
1336 | ||
1337 | /* ---------------------------- pblock_pb2env ----------------------------- */ | |
1338 | ||
71 | 1339 | |
1 | 1340 | NSAPI_PUBLIC char **pblock_pb2env(const pblock *pb, char **env) |
1341 | { | |
1342 | PListStruct_t *pl = PBTOPL(pb); | |
1343 | PLValueStruct_t **ppval; | |
1344 | PLValueStruct_t *pv; | |
1345 | int i; | |
1346 | int nval; | |
1347 | int pos; | |
1348 | ||
1349 | /* Find out how many there are. */ | |
71 | 1350 | |
1 | 1351 | ppval = (PLValueStruct_t **)(pl->pl_ppval); |
1352 | ||
1353 | for (i = 0, nval = 0; i < pl->pl_initpi; ++i) { | |
1354 | if (ppval[i]) ++nval; | |
1355 | } | |
71 | 1356 | |
1 | 1357 | env = util_env_create(env, nval, &pos); |
1358 | ||
1359 | for (i = 0; i < pl->pl_initpi; ++i) { | |
1360 | pv = ppval[i]; | |
1361 | if (pv) { | |
1362 | env[pos++] = util_env_str(pv->pv_name, (char *)(pv->pv_value)); | |
1363 | } | |
1364 | } | |
1365 | env[pos] = NULL; | |
1366 | ||
1367 | return env; | |
1368 | } | |
71 | 1369 | |
1 | 1370 | |
1371 | /* ---------------------------- pblock_replace ---------------------------- */ | |
1372 | ||
1373 | NSAPI_PUBLIC char * pblock_replace(const char *name, | |
1374 | char * new_value, pblock *pb) | |
1375 | { | |
1376 | PListStruct_t *pl = PBTOPL(pb); | |
1377 | ||
1378 | /* Replace an existing value */ | |
1379 | pb_param *pp = pblock_find(name, pb); | |
1380 | if (!pp) | |
1381 | return NULL; | |
1382 | pool_free(pl->pl_mempool, pp->value); | |
1383 | pp->value = new_value; | |
1384 | ||
1385 | return new_value; | |
1386 | } | |
1387 | ||
1388 | ||
1389 | /* --------------------------- pblock_nvreplace --------------------------- */ | |
1390 | ||
1391 | NSAPI_PUBLIC void pblock_nvreplace (const char *name, const char *value, pblock *pb) | |
1392 | { | |
1393 | PListStruct_t *pl = PBTOPL(pb); | |
1394 | ||
1395 | /* Replace an existing value or insert a new value */ | |
1396 | pb_param *pp = pblock_find(name, pb); | |
1397 | if (pp) { | |
1398 | pool_free(pl->pl_mempool, pp->value); | |
1399 | pp->value = pool_strdup(pl->pl_mempool, value); | |
1400 | } else { | |
1401 | pblock_nvinsert(name, value, pb); | |
1402 | } | |
1403 | } | |
1404 | ||
1405 | ||
1406 | /* --------------------------- pblock_kvreplace --------------------------- */ | |
1407 | ||
1408 | NSAPI_PUBLIC void pblock_kvreplace(const pb_key *key, const char *value, int valuelen, pblock *pb) | |
1409 | { | |
1410 | PListStruct_t *pl = PBTOPL(pb); | |
1411 | ||
1412 | /* Replace an existing value or insert a new value */ | |
1413 | pb_param *pp = pblock_findkey(key, pb); | |
1414 | if (pp) { | |
1415 | pool_free(pl->pl_mempool, pp->value); | |
1416 | pp->value = (char*)pool_malloc(pl->pl_mempool, valuelen + 1); | |
1417 | memcpy(pp->value, value, valuelen + 1); | |
1418 | } else { | |
1419 | pblock_kvinsert(key, value, valuelen, pb); | |
1420 | } | |
1421 | } |