Deleted Added
full compact
serf_private.h (256281) serf_private.h (262339)
1/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *

--- 9 unchanged lines hidden (view full) ---

18
19/* ### what the hell? why does the APR interface have a "size" ??
20 ### the implication is that, if we bust this limit, we'd need to
21 ### stop, rebuild a pollset, and repopulate it. what suckage. */
22#define MAX_CONN 16
23
24/* Windows does not define IOV_MAX, so we need to ensure it is defined. */
25#ifndef IOV_MAX
1/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *

--- 9 unchanged lines hidden (view full) ---

18
19/* ### what the hell? why does the APR interface have a "size" ??
20 ### the implication is that, if we bust this limit, we'd need to
21 ### stop, rebuild a pollset, and repopulate it. what suckage. */
22#define MAX_CONN 16
23
24/* Windows does not define IOV_MAX, so we need to ensure it is defined. */
25#ifndef IOV_MAX
26#define IOV_MAX 16
26/* There is no limit for iovec count on Windows, but apr_socket_sendv
27 allocates WSABUF structures on stack if vecs_count <= 50. */
28#define IOV_MAX 50
27#endif
28
29/* Older versions of APR do not have this macro. */
30#ifdef APR_SIZE_MAX
31#define REQUESTED_MAX APR_SIZE_MAX
32#else
33#define REQUESTED_MAX (~((apr_size_t)0))
34#endif

--- 53 unchanged lines hidden (view full) ---

88 serf_response_acceptor_t acceptor;
89 void *acceptor_baton;
90
91 serf_response_handler_t handler;
92 void *handler_baton;
93
94 serf_bucket_t *resp_bkt;
95
29#endif
30
31/* Older versions of APR do not have this macro. */
32#ifdef APR_SIZE_MAX
33#define REQUESTED_MAX APR_SIZE_MAX
34#else
35#define REQUESTED_MAX (~((apr_size_t)0))
36#endif

--- 53 unchanged lines hidden (view full) ---

90 serf_response_acceptor_t acceptor;
91 void *acceptor_baton;
92
93 serf_response_handler_t handler;
94 void *handler_baton;
95
96 serf_bucket_t *resp_bkt;
97
96 int written;
98 int writing_started;
97 int priority;
98 /* 1 if this is a request to setup a SSL tunnel, 0 for normal requests. */
99 int ssltunnel;
100
101 /* This baton is currently only used for digest authentication, which
102 needs access to the uri of the request in the response handler.
103 If serf_request_t is replaced by a serf_http_request_t in the future,
104 which knows about uri and method and such, this baton won't be needed

--- 7 unchanged lines hidden (view full) ---

112 /* the set of connections to poll */
113 apr_pollset_t *pollset;
114} serf_pollset_t;
115
116typedef struct serf__authn_info_t {
117 const serf__authn_scheme_t *scheme;
118
119 void *baton;
99 int priority;
100 /* 1 if this is a request to setup a SSL tunnel, 0 for normal requests. */
101 int ssltunnel;
102
103 /* This baton is currently only used for digest authentication, which
104 needs access to the uri of the request in the response handler.
105 If serf_request_t is replaced by a serf_http_request_t in the future,
106 which knows about uri and method and such, this baton won't be needed

--- 7 unchanged lines hidden (view full) ---

114 /* the set of connections to poll */
115 apr_pollset_t *pollset;
116} serf_pollset_t;
117
118typedef struct serf__authn_info_t {
119 const serf__authn_scheme_t *scheme;
120
121 void *baton;
122
123 int failed_authn_types;
120} serf__authn_info_t;
121
122struct serf_context_t {
123 /* the pool used for self and for other allocations */
124 apr_pool_t *pool;
125
126 void *pollset_baton;
127 serf_socket_add_t pollset_add;

--- 133 unchanged lines hidden (view full) ---

261
262 /* Host url, path ommitted, syntax: https://svn.apache.org . */
263 const char *host_url;
264
265 /* Exploded host url, path ommitted. Only scheme, hostinfo, hostname &
266 port values are filled in. */
267 apr_uri_t host_info;
268
124} serf__authn_info_t;
125
126struct serf_context_t {
127 /* the pool used for self and for other allocations */
128 apr_pool_t *pool;
129
130 void *pollset_baton;
131 serf_socket_add_t pollset_add;

--- 133 unchanged lines hidden (view full) ---

265
266 /* Host url, path ommitted, syntax: https://svn.apache.org . */
267 const char *host_url;
268
269 /* Exploded host url, path ommitted. Only scheme, hostinfo, hostname &
270 port values are filled in. */
271 apr_uri_t host_info;
272
269 /* connection and authentication scheme specific information */
270 void *authn_baton;
271 void *proxy_authn_baton;
273 /* authentication info for this connection. */
274 serf__authn_info_t authn_info;
272
273 /* Time marker when connection begins. */
274 apr_time_t connect_time;
275
276 /* Calculated connection latency. Negative value if latency is unknown. */
277 apr_interval_time_t latency;
278
279 /* Needs to read first before we can write again. */

--- 7 unchanged lines hidden (view full) ---

287
288 This can only be used when we haven't started reading the body of the
289 response yet.
290
291 Keep internal for now, probably only useful within serf.
292 */
293apr_status_t serf_response_full_become_aggregate(serf_bucket_t *bucket);
294
275
276 /* Time marker when connection begins. */
277 apr_time_t connect_time;
278
279 /* Calculated connection latency. Negative value if latency is unknown. */
280 apr_interval_time_t latency;
281
282 /* Needs to read first before we can write again. */

--- 7 unchanged lines hidden (view full) ---

290
291 This can only be used when we haven't started reading the body of the
292 response yet.
293
294 Keep internal for now, probably only useful within serf.
295 */
296apr_status_t serf_response_full_become_aggregate(serf_bucket_t *bucket);
297
298/**
299 * Remove the header from the list, do nothing if the header wasn't added.
300 */
301void serf__bucket_headers_remove(serf_bucket_t *headers_bucket,
302 const char *header);
303
295/*** Authentication handler declarations ***/
296
297typedef enum { PROXY, HOST } peer_t;
298
299/**
300 * For each authentication scheme we need a handler function of type
301 * serf__auth_handler_func_t. This function will be called when an
302 * authentication challenge is received in a session.

--- 44 unchanged lines hidden (view full) ---

347 serf_bucket_t *hdrs_bkt);
348
349/**
350 * This function will be called when a response is received, so that the
351 * scheme handler can validate the Authentication related response headers
352 * (if needed).
353 */
354typedef apr_status_t
304/*** Authentication handler declarations ***/
305
306typedef enum { PROXY, HOST } peer_t;
307
308/**
309 * For each authentication scheme we need a handler function of type
310 * serf__auth_handler_func_t. This function will be called when an
311 * authentication challenge is received in a session.

--- 44 unchanged lines hidden (view full) ---

356 serf_bucket_t *hdrs_bkt);
357
358/**
359 * This function will be called when a response is received, so that the
360 * scheme handler can validate the Authentication related response headers
361 * (if needed).
362 */
363typedef apr_status_t
355(*serf__validate_response_func_t)(peer_t peer,
364(*serf__validate_response_func_t)(const serf__authn_scheme_t *scheme,
365 peer_t peer,
356 int code,
357 serf_connection_t *conn,
358 serf_request_t *request,
359 serf_bucket_t *response,
360 apr_pool_t *pool);
361
362/**
363 * serf__authn_scheme_t: vtable for an authn scheme provider.

--- 92 unchanged lines hidden ---
366 int code,
367 serf_connection_t *conn,
368 serf_request_t *request,
369 serf_bucket_t *response,
370 apr_pool_t *pool);
371
372/**
373 * serf__authn_scheme_t: vtable for an authn scheme provider.

--- 92 unchanged lines hidden ---