Skip to content

Commit 65ea3e0

Browse files
committed
Make #include directives more consistent throughout the code.
Standard and system headers go first, dependency next, then our public headers and finally our private headers. Make the use of #include <header> vs. #include "header" semantically correct and consistent, too. Also: * serf_private.h: Include serf.h because of all the typedefs. * auth/auth.h: Remove unused include of auth_spnego.h and include the needed serf_private.h. * auth/auth_spnego.c: Remove headers that are alread included in auth_spnego.h. * buckets/allocator.c, buckets/brotli_buckets.c, buckets/limit_buckets.c, buckets/socket_buckets.c: Don't include serf_private.h. * protocols/fcgi_buckets.h, protocols/fcgi_protocol.h, protocols/http2_buckets.h: Do include serf_private.h. * protocols/fcgi_protocol.c: Don't include serf_bucket_util.h. * src/context.c, src/deprecated.c, src/outgoing.c, src/pump.c: Don't include serf_bucket_util.h. * src/inet_pton.c, src/init_once.c, src/syntax.c: Don't include serf.h. * test/test_internal.c: Don't include serf_bucket_util.h. git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1931208 13f79535-47bb-0310-9956-ffa450edef68
1 parent de43a56 commit 65ea3e0

42 files changed

Lines changed: 74 additions & 83 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

auth/auth.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#ifndef AUTH_H
2222
#define AUTH_H
2323

24-
#include "auth_spnego.h"
24+
#include "serf_private.h"
2525

2626
#ifdef __cplusplus
2727
extern "C" {

auth/auth_basic.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
/*** Basic authentication ***/
2222

23-
#include <serf.h>
24-
#include <serf_private.h>
25-
#include <auth/auth.h>
26-
2723
#include <apr.h>
2824
#include <apr_base64.h>
2925
#include <apr_strings.h>
3026

27+
#include "serf.h"
28+
#include "serf_private.h"
29+
#include "auth.h"
30+
3131
/* Stores the context information related to Basic authentication.
3232
This information is stored in the per server cache in the serf context. */
3333
typedef struct basic_authn_info_t {

auth/auth_digest.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020

2121
/*** Digest authentication ***/
2222

23-
#include <serf.h>
24-
#include <serf_private.h>
25-
#include <auth/auth.h>
26-
2723
#include <apr.h>
2824
#include <apr_base64.h>
2925
#include <apr_strings.h>
3026
#include <apr_uuid.h>
3127
#include <apr_md5.h>
3228

29+
#include "serf.h"
30+
#include "serf_private.h"
31+
#include "auth.h"
32+
3333
/** Digest authentication, implements RFC 2617. **/
3434

3535
/* TODO: add support for the domain attribute. This defines the protection

auth/auth_spnego.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,20 @@
1818
* ====================================================================
1919
*/
2020

21-
2221
#include "auth_spnego.h"
2322

2423
#ifdef SERF_HAVE_SPNEGO
2524

25+
#include <apr_base64.h>
26+
#include <apr_strings.h>
27+
28+
#include "auth.h"
29+
2630
/** These functions implement SPNEGO-based Kerberos and NTLM authentication,
2731
* using either GSS-API (RFC 2743) or SSPI on Windows.
2832
* The HTTP message exchange is documented in RFC 4559.
2933
**/
3034

31-
#include <serf.h>
32-
#include <serf_private.h>
33-
#include <auth/auth.h>
34-
35-
#include <apr.h>
36-
#include <apr_base64.h>
37-
#include <apr_strings.h>
38-
3935
/** TODO:
4036
** - send session key directly on new connections where we already know
4137
** the server requires Kerberos authn.

auth/auth_spnego.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <apr.h>
2525
#include <apr_pools.h>
26+
2627
#include "serf.h"
2728
#include "serf_private.h"
2829

auth/auth_spnego_sspi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
* ====================================================================
1919
*/
2020

21-
#include "auth.h"
22-
#include "auth_spnego.h"
2321
#include "serf.h"
2422
#include "serf_private.h"
23+
#include "auth.h"
24+
#include "auth_spnego.h"
2525

2626
#ifdef SERF_USE_SSPI
2727
#include <apr.h>

auth/auth_user_defined.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
* ====================================================================
1919
*/
2020

21-
#include <serf.h>
22-
#include <serf_private.h>
21+
#include <apr_errno.h>
2322

24-
#include "apr_errno.h"
23+
#include "serf.h"
24+
#include "serf_private.h"
2525
#include "auth.h"
2626

2727

buckets/allocator.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "serf.h"
3030
#include "serf_bucket_util.h"
3131

32-
#include "serf_private.h"
3332

3433
/* Define SERF__DEBUG_UNFREED_MEMORY if you're interested in tracking
3534
* unfreed blocks on pool cleanup. */
@@ -535,4 +534,3 @@ void serf_debug__bucket_alloc_check(
535534
}
536535
#endif
537536
}
538-

buckets/brotli_buckets.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "serf.h"
2222
#include "serf_bucket_util.h"
23-
#include "serf_private.h"
23+
2424

2525
#ifdef SERF_HAVE_BROTLI
2626

buckets/buckets.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222

2323
#define APR_WANT_MEMFUNC
2424
#include <apr_want.h>
25-
2625
#include <apr_pools.h>
2726

2827
#include "serf.h"
2928
#include "serf_bucket_util.h"
3029
#include "serf_private.h"
3130

31+
3232
serf_bucket_t *serf_bucket_create(
3333
const serf_bucket_type_t *type,
3434
serf_bucket_alloc_t *allocator,

0 commit comments

Comments
 (0)