Skip to content

Commit 7682710

Browse files
authored
Merge pull request #25 from Castaglia/ifdef-nits
Style nits for using the longer, more explicit `#if defined` syntax; …
2 parents ef87646 + b0088f9 commit 7682710

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

mod_proxy_protocol.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "conf.h"
2626
#include "privs.h"
2727

28-
#ifdef HAVE_SYS_UIO_H
28+
#if defined(HAVE_SYS_UIO_H)
2929
# include <sys/uio.h>
3030
#endif /* HAVE_SYS_UIO_H */
3131

@@ -147,13 +147,13 @@ static int read_sock(int sockfd, void *buf, size_t reqlen) {
147147
*/
148148
if (xerrno == ECONNRESET ||
149149
xerrno == ECONNABORTED ||
150-
#ifdef ETIMEDOUT
150+
#if defined(ETIMEDOUT)
151151
xerrno == ETIMEDOUT ||
152152
#endif /* ETIMEDOUT */
153-
#ifdef ENOTCONN
153+
#if defined(ENOTCONN)
154154
xerrno == ENOTCONN ||
155155
#endif /* ENOTCONN */
156-
#ifdef ESHUTDOWN
156+
#if defined(ESHUTDOWN)
157157
xerrno == ESHUTDOWN ||
158158
#endif /* ESHUTDOWNN */
159159
xerrno == EPIPE) {
@@ -235,13 +235,13 @@ static int readv_sock(int sockfd, const struct iovec *iov, int count) {
235235
*/
236236
if (xerrno == ECONNRESET ||
237237
xerrno == ECONNABORTED ||
238-
#ifdef ETIMEDOUT
238+
#if defined(ETIMEDOUT)
239239
xerrno == ETIMEDOUT ||
240240
#endif /* ETIMEDOUT */
241-
#ifdef ENOTCONN
241+
#if defined(ENOTCONN)
242242
xerrno == ENOTCONN ||
243243
#endif /* ENOTCONN */
244-
#ifdef ESHUTDOWN
244+
#if defined(ESHUTDOWN)
245245
xerrno == ESHUTDOWN ||
246246
#endif /* ESHUTDOWNN */
247247
xerrno == EPIPE) {
@@ -438,7 +438,7 @@ static int read_haproxy_v1(pool *p, conn_t *conn,
438438
if (strncmp(ptr, "TCP4 ", 5) == 0) {
439439
have_tcp4 = TRUE;
440440

441-
#ifdef PR_USE_IPV6
441+
#if defined(PR_USE_IPV6)
442442
} else if (strncmp(ptr, "TCP6 ", 5) == 0) {
443443
if (pr_netaddr_use_ipv6()) {
444444
have_tcp6 = TRUE;
@@ -543,7 +543,7 @@ static int read_haproxy_v1(pool *p, conn_t *conn,
543543
return -1;
544544
}
545545

546-
#ifdef PR_USE_IPV6
546+
#if defined(PR_USE_IPV6)
547547
} else {
548548
if (pr_netaddr_get_family(src_addr) != AF_INET6) {
549549
pr_log_debug(DEBUG8, MOD_PROXY_PROTOCOL_VERSION
@@ -1063,7 +1063,7 @@ static int read_haproxy_v2(pool *p, conn_t *conn,
10631063
"of TLV data", (unsigned long) tlv_len);
10641064
}
10651065

1066-
#ifdef PR_USE_IPV6
1066+
#if defined(PR_USE_IPV6)
10671067
ipv6[0].iov_base = (void *) &src_ipv6;
10681068
ipv6[0].iov_len = sizeof(src_ipv6);
10691069
ipv6[1].iov_base = (void *) &dst_ipv6;
@@ -1530,7 +1530,7 @@ static int proxy_protocol_sess_init(void) {
15301530
server_rec *proxied_server = NULL;
15311531

15321532
/* Add "mod_proxy_protocol.proxied_server_addr" session note. With, or
1533-
* without, port?
1533+
* without, port?
15341534
*/
15351535

15361536
if (pr_netaddr_cmp(session.c->local_addr, proxied_dst_addr) != 0 ||

0 commit comments

Comments
 (0)