diff options
author | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
commit | d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch) | |
tree | 9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/transport/plugin_transport_http_common.h | |
parent | a0fce305c565c0937d917a92712f15e9c5736260 (diff) | |
download | gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.tar.gz gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.zip |
uncrustify as demanded.
Diffstat (limited to 'src/transport/plugin_transport_http_common.h')
-rw-r--r-- | src/transport/plugin_transport_http_common.h | 91 |
1 files changed, 44 insertions, 47 deletions
diff --git a/src/transport/plugin_transport_http_common.h b/src/transport/plugin_transport_http_common.h index 0410be8e9..6aaf663a1 100644 --- a/src/transport/plugin_transport_http_common.h +++ b/src/transport/plugin_transport_http_common.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file transport/plugin_transport_http_common.c | 21 | * @file transport/plugin_transport_http_common.c |
22 | * @brief functionality shared by http client and server transport service plugin | 22 | * @brief functionality shared by http client and server transport service plugin |
@@ -33,10 +33,10 @@ | |||
33 | #define TESTING GNUNET_NO | 33 | #define TESTING GNUNET_NO |
34 | 34 | ||
35 | #if TESTING | 35 | #if TESTING |
36 | #define HTTP_SERVER_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3) | 36 | #define HTTP_SERVER_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 3) |
37 | #define HTTP_CLIENT_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3) | 37 | #define HTTP_CLIENT_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 3) |
38 | #define HTTP_CLIENT_SESSION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 7) | 38 | #define HTTP_CLIENT_SESSION_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 7) |
39 | #define SERVER_SESSION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 7) | 39 | #define SERVER_SESSION_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 7) |
40 | #define TIMEOUT_LOG GNUNET_ERROR_TYPE_DEBUG | 40 | #define TIMEOUT_LOG GNUNET_ERROR_TYPE_DEBUG |
41 | 41 | ||
42 | #else | 42 | #else |
@@ -47,8 +47,8 @@ | |||
47 | #define PROTOCOL "http" | 47 | #define PROTOCOL "http" |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | #define HTTP_SERVER_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) | 50 | #define HTTP_SERVER_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 15) |
51 | #define HTTP_CLIENT_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) | 51 | #define HTTP_CLIENT_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 15) |
52 | #define HTTP_CLIENT_SESSION_TIMEOUT GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT | 52 | #define HTTP_CLIENT_SESSION_TIMEOUT GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT |
53 | #define HTTP_SERVER_SESSION_TIMEOUT GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT | 53 | #define HTTP_SERVER_SESSION_TIMEOUT GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT |
54 | #define TIMEOUT_LOG GNUNET_ERROR_TYPE_DEBUG | 54 | #define TIMEOUT_LOG GNUNET_ERROR_TYPE_DEBUG |
@@ -61,8 +61,7 @@ | |||
61 | /** | 61 | /** |
62 | * Bits in the `options` field of HTTP addresses. | 62 | * Bits in the `options` field of HTTP addresses. |
63 | */ | 63 | */ |
64 | enum HttpAddressOptions | 64 | enum HttpAddressOptions { |
65 | { | ||
66 | /** | 65 | /** |
67 | * No bits set. | 66 | * No bits set. |
68 | */ | 67 | */ |
@@ -87,8 +86,7 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
87 | /** | 86 | /** |
88 | * HttpAddress | 87 | * HttpAddress |
89 | */ | 88 | */ |
90 | struct HttpAddress | 89 | struct HttpAddress { |
91 | { | ||
92 | /** | 90 | /** |
93 | * Address options | 91 | * Address options |
94 | * see `enum HttpAddressOptions` | 92 | * see `enum HttpAddressOptions` |
@@ -106,8 +104,7 @@ GNUNET_NETWORK_STRUCT_END | |||
106 | /** | 104 | /** |
107 | * Representation of HTTP URL split into its components. | 105 | * Representation of HTTP URL split into its components. |
108 | */ | 106 | */ |
109 | struct SplittedHTTPAddress | 107 | struct SplittedHTTPAddress { |
110 | { | ||
111 | char *protocol; | 108 | char *protocol; |
112 | char *host; | 109 | char *host; |
113 | char *path; | 110 | char *path; |
@@ -120,7 +117,7 @@ struct SplittedHTTPAddress | |||
120 | * and path components. | 117 | * and path components. |
121 | */ | 118 | */ |
122 | struct SplittedHTTPAddress * | 119 | struct SplittedHTTPAddress * |
123 | http_split_address (const char *addr); | 120 | http_split_address(const char *addr); |
124 | 121 | ||
125 | 122 | ||
126 | /** | 123 | /** |
@@ -138,14 +135,14 @@ http_split_address (const char *addr); | |||
138 | * @param asc_cls closure for @a asc | 135 | * @param asc_cls closure for @a asc |
139 | */ | 136 | */ |
140 | void | 137 | void |
141 | http_common_plugin_address_pretty_printer (void *cls, | 138 | http_common_plugin_address_pretty_printer(void *cls, |
142 | const char *type, | 139 | const char *type, |
143 | const void *addr, | 140 | const void *addr, |
144 | size_t addrlen, | 141 | size_t addrlen, |
145 | int numeric, | 142 | int numeric, |
146 | struct GNUNET_TIME_Relative timeout, | 143 | struct GNUNET_TIME_Relative timeout, |
147 | GNUNET_TRANSPORT_AddressStringCallback asc, | 144 | GNUNET_TRANSPORT_AddressStringCallback asc, |
148 | void *asc_cls); | 145 | void *asc_cls); |
149 | 146 | ||
150 | 147 | ||
151 | /** | 148 | /** |
@@ -160,9 +157,9 @@ http_common_plugin_address_pretty_printer (void *cls, | |||
160 | * @return string representing the same address | 157 | * @return string representing the same address |
161 | */ | 158 | */ |
162 | const char * | 159 | const char * |
163 | http_common_plugin_address_to_string (const char *plugin, | 160 | http_common_plugin_address_to_string(const char *plugin, |
164 | const void *addr, | 161 | const void *addr, |
165 | size_t addrlen); | 162 | size_t addrlen); |
166 | 163 | ||
167 | 164 | ||
168 | /** | 165 | /** |
@@ -178,11 +175,11 @@ http_common_plugin_address_to_string (const char *plugin, | |||
178 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 175 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
179 | */ | 176 | */ |
180 | int | 177 | int |
181 | http_common_plugin_string_to_address (void *cls, | 178 | http_common_plugin_string_to_address(void *cls, |
182 | const char *addr, | 179 | const char *addr, |
183 | uint16_t addrlen, | 180 | uint16_t addrlen, |
184 | void **buf, | 181 | void **buf, |
185 | size_t *added); | 182 | size_t *added); |
186 | 183 | ||
187 | 184 | ||
188 | /** | 185 | /** |
@@ -194,9 +191,9 @@ http_common_plugin_string_to_address (void *cls, | |||
194 | * @return the string | 191 | * @return the string |
195 | */ | 192 | */ |
196 | struct HttpAddress * | 193 | struct HttpAddress * |
197 | http_common_address_from_socket (const char *protocol, | 194 | http_common_address_from_socket(const char *protocol, |
198 | const struct sockaddr *addr, | 195 | const struct sockaddr *addr, |
199 | socklen_t addrlen); | 196 | socklen_t addrlen); |
200 | 197 | ||
201 | 198 | ||
202 | /** | 199 | /** |
@@ -211,15 +208,15 @@ http_common_address_from_socket (const char *protocol, | |||
211 | * @return the string | 208 | * @return the string |
212 | */ | 209 | */ |
213 | struct sockaddr * | 210 | struct sockaddr * |
214 | http_common_socket_from_address (const void *addr, | 211 | http_common_socket_from_address(const void *addr, |
215 | size_t addrlen, | 212 | size_t addrlen, |
216 | int *res); | 213 | int *res); |
217 | 214 | ||
218 | 215 | ||
219 | const char * | 216 | const char * |
220 | http_common_plugin_address_to_url (void *cls, | 217 | http_common_plugin_address_to_url(void *cls, |
221 | const void *addr, | 218 | const void *addr, |
222 | size_t addrlen); | 219 | size_t addrlen); |
223 | 220 | ||
224 | 221 | ||
225 | /** | 222 | /** |
@@ -229,7 +226,7 @@ http_common_plugin_address_to_url (void *cls, | |||
229 | * @return the size | 226 | * @return the size |
230 | */ | 227 | */ |
231 | size_t | 228 | size_t |
232 | http_common_address_get_size (const struct HttpAddress * addr); | 229 | http_common_address_get_size(const struct HttpAddress * addr); |
233 | 230 | ||
234 | 231 | ||
235 | /** | 232 | /** |
@@ -242,10 +239,10 @@ http_common_address_get_size (const struct HttpAddress * addr); | |||
242 | * @return #GNUNET_YES if equal, #GNUNET_NO else | 239 | * @return #GNUNET_YES if equal, #GNUNET_NO else |
243 | */ | 240 | */ |
244 | size_t | 241 | size_t |
245 | http_common_cmp_addresses (const void *addr1, | 242 | http_common_cmp_addresses(const void *addr1, |
246 | size_t addrlen1, | 243 | size_t addrlen1, |
247 | const void *addr2, | 244 | const void *addr2, |
248 | size_t addrlen2); | 245 | size_t addrlen2); |
249 | 246 | ||
250 | 247 | ||
251 | /** | 248 | /** |
@@ -256,8 +253,8 @@ http_common_cmp_addresses (const void *addr1, | |||
256 | * @return the network type | 253 | * @return the network type |
257 | */ | 254 | */ |
258 | enum GNUNET_NetworkType | 255 | enum GNUNET_NetworkType |
259 | http_common_get_network_for_address (struct GNUNET_TRANSPORT_PluginEnvironment *env, | 256 | http_common_get_network_for_address(struct GNUNET_TRANSPORT_PluginEnvironment *env, |
260 | const struct GNUNET_HELLO_Address *address); | 257 | const struct GNUNET_HELLO_Address *address); |
261 | 258 | ||
262 | 259 | ||
263 | /* end of plugin_transport_http_common.h */ | 260 | /* end of plugin_transport_http_common.h */ |