Enable IndentPPDirectives

This commit is contained in:
Tatsuhiro Tsujikawa 2018-06-09 16:21:30 +09:00
parent bda7e079e2
commit 880f948684
107 changed files with 315 additions and 315 deletions

View File

@ -68,7 +68,7 @@ IncludeCategories:
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentPPDirectives: AfterHash
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave

View File

@ -36,10 +36,10 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif // HAVE_FCNTL_H
#include <iostream>
#include <string>

View File

@ -27,26 +27,26 @@
* intentionally made simple.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <inttypes.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif /* HAVE_FCNTL_H */
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif /* HAVE_NETDB_H */
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#include <netinet/tcp.h>
#include <poll.h>

View File

@ -23,7 +23,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* !HAVE_CONFIG_H */
#include <stdio.h>

View File

@ -23,33 +23,33 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef __sgi
#include <string.h>
#define errx(exitcode, format, args...) \
{ \
warnx(format, ##args); \
exit(exitcode); \
}
#define warnx(format, args...) fprintf(stderr, format "\n", ##args)
# include <string.h>
# define errx(exitcode, format, args...) \
{ \
warnx(format, ##args); \
exit(exitcode); \
}
# define warnx(format, args...) fprintf(stderr, format "\n", ##args)
char *strndup(const char *s, size_t size);
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#include <netinet/tcp.h>
#ifndef __sgi
#include <err.h>
# include <err.h>
#endif
#include <signal.h>
#include <string.h>

View File

@ -23,41 +23,41 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef __sgi
#define errx(exitcode, format, args...) \
{ \
warnx(format, ##args); \
exit(exitcode); \
}
#define warn(format, args...) warnx(format ": %s", ##args, strerror(errno))
#define warnx(format, args...) fprintf(stderr, format "\n", ##args)
# define errx(exitcode, format, args...) \
{ \
warnx(format, ##args); \
exit(exitcode); \
}
# define warn(format, args...) warnx(format ": %s", ##args, strerror(errno))
# define warnx(format, args...) fprintf(stderr, format "\n", ##args)
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif /* HAVE_NETDB_H */
#include <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#include <sys/stat.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif /* HAVE_FCNTL_H */
#include <ctype.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#include <netinet/tcp.h>
#ifndef __sgi
#include <err.h>
# include <err.h>
#endif
#include <string.h>
#include <errno.h>

View File

@ -28,7 +28,7 @@
/* Define WIN32 when build target is Win32 API (borrowed from
libcurl) */
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
#define WIN32
# define WIN32
#endif
#ifdef __cplusplus
@ -40,9 +40,9 @@ extern "C" {
/* MSVC < 2013 does not have inttypes.h because it is not C99
compliant. See compiler macros and version number in
https://sourceforge.net/p/predef/wiki/Compilers/ */
#include <stdint.h>
# include <stdint.h>
#else /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */
#include <inttypes.h>
# include <inttypes.h>
#endif /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */
#include <sys/types.h>
#include <stdarg.h>
@ -50,20 +50,20 @@ extern "C" {
#include <nghttp2/nghttp2ver.h>
#ifdef NGHTTP2_STATICLIB
#define NGHTTP2_EXTERN
# define NGHTTP2_EXTERN
#elif defined(WIN32)
#ifdef BUILDING_NGHTTP2
#define NGHTTP2_EXTERN __declspec(dllexport)
#else /* !BUILDING_NGHTTP2 */
#define NGHTTP2_EXTERN __declspec(dllimport)
#endif /* !BUILDING_NGHTTP2 */
#else /* !defined(WIN32) */
#ifdef BUILDING_NGHTTP2
#define NGHTTP2_EXTERN __attribute__((visibility("default")))
#else /* !BUILDING_NGHTTP2 */
#define NGHTTP2_EXTERN
#endif /* !BUILDING_NGHTTP2 */
#endif /* !defined(WIN32) */
# ifdef BUILDING_NGHTTP2
# define NGHTTP2_EXTERN __declspec(dllexport)
# else /* !BUILDING_NGHTTP2 */
# define NGHTTP2_EXTERN __declspec(dllimport)
# endif /* !BUILDING_NGHTTP2 */
#else /* !defined(WIN32) */
# ifdef BUILDING_NGHTTP2
# define NGHTTP2_EXTERN __attribute__((visibility("default")))
# else /* !BUILDING_NGHTTP2 */
# define NGHTTP2_EXTERN
# endif /* !BUILDING_NGHTTP2 */
#endif /* !defined(WIN32) */
/**
* @macro

View File

@ -26,7 +26,7 @@
#define NGHTTP2_BUF_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_CALLBACKS_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,18 +26,18 @@
#define NGHTTP2_DEBUG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>
#ifdef DEBUGBUILD
#define DEBUGF(...) nghttp2_debug_vprintf(__VA_ARGS__)
# define DEBUGF(...) nghttp2_debug_vprintf(__VA_ARGS__)
void nghttp2_debug_vprintf(const char *format, ...);
#else
#define DEBUGF(...) \
do { \
} while (0)
# define DEBUGF(...) \
do { \
} while (0)
#endif
#endif /* NGHTTP2_DEBUG_H */

View File

@ -26,7 +26,7 @@
#define NGHTTP2_FRAME_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_HD_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_HD_HUFFMAN_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_HELPER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <string.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_HTTP_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_INT_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_MAP_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_MEM_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,15 +26,15 @@
#define NGHTTP2_NET_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
# include <arpa/inet.h>
#endif /* HAVE_ARPA_INET_H */
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#include <nghttp2/nghttp2.h>
@ -44,11 +44,11 @@
define inline functions for those function so that we don't have
dependeny on that lib. */
#ifdef _MSC_VER
#define STIN static __inline
#else
#define STIN static inline
#endif
# ifdef _MSC_VER
# define STIN static __inline
# else
# define STIN static inline
# endif
STIN uint32_t htonl(uint32_t hostlong) {
uint32_t res;

View File

@ -26,7 +26,7 @@
#define NGHTTP2_NPN_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_OPTION_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_OUTBOUND_ITEM_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_PQ_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_PRIORITY_SPEC_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_QUEUE_H
#ifdef HAVE_CONFIG_H
#include "config.h"
# include "config.h"
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_RCBUF_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_SESSION_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_STREAM_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_SUBMIT_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -23,7 +23,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <nghttp2/nghttp2.h>

View File

@ -32,7 +32,7 @@
#ifdef HAVE_LIBXML2
#include <libxml/HTMLparser.h>
# include <libxml/HTMLparser.h>
#endif // HAVE_LIBXML2

View File

@ -26,23 +26,23 @@
#include <sys/stat.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif // HAVE_NETDB_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif // HAVE_FCNTL_H
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif // HAVE_NETINET_IN_H
#include <netinet/tcp.h>
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
# include <arpa/inet.h>
#endif // HAVE_ARPA_INET_H
#include <cassert>
@ -64,7 +64,7 @@
#include "template.h"
#ifndef O_BINARY
#define O_BINARY (0)
# define O_BINARY (0)
#endif // O_BINARY
namespace nghttp2 {

View File

@ -28,7 +28,7 @@
#include "nghttp2_config.h"
#ifndef _WIN32
#include <sys/uio.h>
# include <sys/uio.h>
#endif // !_WIN32
#include <cassert>

View File

@ -24,19 +24,19 @@
*/
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif // HAVE_NETDB_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif // HAVE_FCNTL_H
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif // HAVE_NETINET_IN_H
#include <netinet/tcp.h>
#include <poll.h>

View File

@ -30,7 +30,7 @@
#include <cinttypes>
#include <cstdlib>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
# include <sys/time.h>
#endif // HAVE_SYS_TIME_H
#include <poll.h>

View File

@ -26,7 +26,7 @@
#define BASE64_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace nghttp2 {

View File

@ -26,7 +26,7 @@
#define BUFFER_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace nghttp2 {

View File

@ -26,7 +26,7 @@
#define NGHTTP2_COMP_HELPER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <jansson.h>

View File

@ -23,11 +23,11 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <getopt.h>

View File

@ -27,12 +27,12 @@
#include <getopt.h>
#include <signal.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif // HAVE_NETINET_IN_H
#include <netinet/tcp.h>
#include <sys/stat.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif // HAVE_FCNTL_H
#include <cstdio>
@ -58,7 +58,7 @@
#include "template.h"
#ifndef O_BINARY
#define O_BINARY (0)
# define O_BINARY (0)
#endif // O_BINARY
using namespace nghttp2;

View File

@ -29,10 +29,10 @@
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif // HAVE_NETDB_H
#include <sys/un.h>

View File

@ -26,7 +26,7 @@
#define SHRPX_HTTP2_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace shrpx {

View File

@ -23,11 +23,11 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <getopt.h>

View File

@ -35,7 +35,7 @@ struct iovec {
size_t iov_len; /* Length of data. */
};
#else // !_WIN32
#include <sys/uio.h>
# include <sys/uio.h>
#endif // !_WIN32
#include <cassert>
@ -52,9 +52,9 @@ namespace nghttp2 {
#define DEFAULT_WR_IOVCNT 16
#if defined(IOV_MAX) && IOV_MAX < DEFAULT_WR_IOVCNT
#define MAX_WR_IOVCNT IOV_MAX
# define MAX_WR_IOVCNT IOV_MAX
#else // !defined(IOV_MAX) || IOV_MAX >= DEFAULT_WR_IOVCNT
#define MAX_WR_IOVCNT DEFAULT_WR_IOVCNT
# define MAX_WR_IOVCNT DEFAULT_WR_IOVCNT
#endif // !defined(IOV_MAX) || IOV_MAX >= DEFAULT_WR_IOVCNT
template <size_t N> struct Memchunk {

View File

@ -26,7 +26,7 @@
#define MEMCHUNK_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace nghttp2 {

View File

@ -26,23 +26,23 @@
#define NETWORK_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#ifdef _WIN32
#include <ws2tcpip.h>
# include <ws2tcpip.h>
#else // !_WIN32
#include <sys/un.h>
# include <sys/un.h>
#endif // !_WIN32
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif // HAVE_NETINET_IN_H
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
# include <arpa/inet.h>
#endif // HAVE_ARPA_INET_H
namespace nghttp2 {

View File

@ -26,13 +26,13 @@
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif // HAVE_FCNTL_H
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif // HAVE_NETINET_IN_H
#include <netinet/tcp.h>
#include <getopt.h>
@ -50,7 +50,7 @@
#include <openssl/err.h>
#ifdef HAVE_JANSSON
#include <jansson.h>
# include <jansson.h>
#endif // HAVE_JANSSON
#include "app_helper.h"
@ -62,7 +62,7 @@
#include "ssl_compat.h"
#ifndef O_BINARY
#define O_BINARY (0)
# define O_BINARY (0)
#endif // O_BINARY
namespace nghttp2 {

View File

@ -29,10 +29,10 @@
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif // HAVE_NETDB_H
#include <string>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
#endif // NGHTTP2_CONFIG_H

View File

@ -24,16 +24,16 @@
*/
#ifndef NGHTTP2_GZIP_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* HAVE_CONFIG_H */
#include <zlib.h>
# ifdef HAVE_CONFIG_H
# include <config.h>
# endif /* HAVE_CONFIG_H */
# include <zlib.h>
#include <nghttp2/nghttp2.h>
# include <nghttp2/nghttp2.h>
#ifdef __cplusplus
# ifdef __cplusplus
extern "C" {
#endif
# endif
/**
* @struct
@ -115,8 +115,8 @@ int nghttp2_gzip_inflate(nghttp2_gzip *inflater, uint8_t *out,
*/
int nghttp2_gzip_inflate_finished(nghttp2_gzip *inflater);
#ifdef __cplusplus
# ifdef __cplusplus
}
#endif
# endif
#endif /* NGHTTP2_GZIP_H */

View File

@ -26,7 +26,7 @@
#define NGHTTP2_GZIP_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#ifdef __cplusplus

View File

@ -25,11 +25,11 @@
#include "nghttp2_config.h"
#ifdef __sgi
#define daemon _daemonize
# define daemon _daemonize
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <signal.h>
#include <getopt.h>

View File

@ -23,7 +23,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
#include <stdio.h>

View File

@ -28,36 +28,36 @@
#include <sys/wait.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#include <sys/un.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif // HAVE_NETDB_H
#include <signal.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif // HAVE_NETINET_IN_H
#include <netinet/tcp.h>
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
# include <arpa/inet.h>
#endif // HAVE_ARPA_INET_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <getopt.h>
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
# include <syslog.h>
#endif // HAVE_SYSLOG_H
#ifdef HAVE_LIMITS_H
#include <limits.h>
# include <limits.h>
#endif // HAVE_LIMITS_H
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
# include <sys/time.h>
#endif // HAVE_SYS_TIME_H
#include <sys/resource.h>
#ifdef HAVE_LIBSYSTEMD
#include <systemd/sd-daemon.h>
# include <systemd/sd-daemon.h>
#endif // HAVE_LIBSYSTEMD
#include <cinttypes>
@ -131,16 +131,16 @@ constexpr auto ENV_ACCEPT_PREFIX = StringRef::from_lit("NGHTTPX_ACCEPT_");
constexpr auto ENV_ORIG_PID = StringRef::from_lit("NGHTTPX_ORIG_PID");
#ifndef _KERNEL_FASTOPEN
#define _KERNEL_FASTOPEN
# define _KERNEL_FASTOPEN
// conditional define for TCP_FASTOPEN mostly on ubuntu
#ifndef TCP_FASTOPEN
#define TCP_FASTOPEN 23
#endif
# ifndef TCP_FASTOPEN
# define TCP_FASTOPEN 23
# endif
// conditional define for SOL_TCP mostly on ubuntu
#ifndef SOL_TCP
#define SOL_TCP 6
#endif
# ifndef SOL_TCP
# define SOL_TCP 6
# endif
#endif
// This configuration is fixed at the first startup of the main
@ -1140,15 +1140,15 @@ int call_daemon() {
#ifdef __sgi
return _daemonize(0, 0, 0, 0);
#else // !__sgi
#ifdef HAVE_LIBSYSTEMD
# ifdef HAVE_LIBSYSTEMD
if (sd_booted() && (getenv("NOTIFY_SOCKET") != nullptr)) {
LOG(NOTICE) << "Daemonising disabled under systemd";
chdir("/");
return 0;
}
#endif // HAVE_LIBSYSTEMD
# endif // HAVE_LIBSYSTEMD
return daemon(0, 0);
#endif // !__sgi
#endif // !__sgi
}
} // namespace

View File

@ -26,20 +26,20 @@
#define SHRPX_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#include <cassert>
#ifndef HAVE__EXIT
#define nghttp2_Exit(status) _exit(status)
# define nghttp2_Exit(status) _exit(status)
#else // HAVE__EXIT
#define nghttp2_Exit(status) _Exit(status)
# define nghttp2_Exit(status) _Exit(status)
#endif // HAVE__EXIT
#define DIE() nghttp2_Exit(EXIT_FAILURE)

View File

@ -25,7 +25,7 @@
#include "shrpx_accept_handler.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <cerrno>

View File

@ -25,13 +25,13 @@
#include "shrpx_client_handler.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif // HAVE_NETDB_H
#include <cerrno>

View File

@ -25,21 +25,21 @@
#include "shrpx_config.h"
#ifdef HAVE_PWD_H
#include <pwd.h>
# include <pwd.h>
#endif // HAVE_PWD_H
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif // HAVE_NETDB_H
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
# include <syslog.h>
#endif // HAVE_SYSLOG_H
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif // HAVE_FCNTL_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <dirent.h>

View File

@ -29,14 +29,14 @@
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#include <sys/un.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif // HAVE_NETINET_IN_H
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
# include <arpa/inet.h>
#endif // HAVE_ARPA_INET_H
#include <cinttypes>
#include <cstdio>

View File

@ -25,7 +25,7 @@
#include "shrpx_config_test.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <cstdlib>

View File

@ -26,7 +26,7 @@
#define SHRPX_CONFIG_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace shrpx {

View File

@ -25,7 +25,7 @@
#include "shrpx_connection.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <netinet/tcp.h>
@ -817,11 +817,11 @@ int Connection::get_tcp_hint(TCPHint *hint) const {
// For TLSv1.3, AES-GCM and CHACHA20_POLY1305 overhead are now 22
// bytes (5 (header) + 1 (ContentType) + 16 (tag)).
size_t tls_overhead;
#ifdef TLS1_3_VERSION
# ifdef TLS1_3_VERSION
if (SSL_version(tls.ssl) == TLS1_3_VERSION) {
tls_overhead = 22;
} else
#endif // TLS1_3_VERSION
# endif // TLS1_3_VERSION
{
tls_overhead = 29;
}

View File

@ -25,7 +25,7 @@
#include "shrpx_connection_handler.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <sys/types.h>
#include <sys/wait.h>
@ -254,15 +254,15 @@ int ConnectionHandler::create_worker_thread(size_t num) {
cert_tree_ = tls::create_cert_lookup_tree();
auto sv_ssl_ctx = tls::setup_server_ssl_context(
all_ssl_ctx_, indexed_ssl_ctx_, cert_tree_.get()
#ifdef HAVE_NEVERBLEED
# ifdef HAVE_NEVERBLEED
,
nb_.get()
#endif // HAVE_NEVERBLEED
# endif // HAVE_NEVERBLEED
);
auto cl_ssl_ctx = tls::setup_downstream_client_ssl_context(
#ifdef HAVE_NEVERBLEED
# ifdef HAVE_NEVERBLEED
nb_.get()
#endif // HAVE_NEVERBLEED
# endif // HAVE_NEVERBLEED
);
if (cl_ssl_ctx) {
@ -284,9 +284,9 @@ int ConnectionHandler::create_worker_thread(size_t num) {
if (memcachedconf.tls) {
session_cache_ssl_ctx = tls::create_ssl_client_context(
#ifdef HAVE_NEVERBLEED
# ifdef HAVE_NEVERBLEED
nb_.get(),
#endif // HAVE_NEVERBLEED
# endif // HAVE_NEVERBLEED
tlsconf.cacert, memcachedconf.cert_file,
memcachedconf.private_key_file, nullptr);
all_ssl_ctx_.push_back(session_cache_ssl_ctx);
@ -299,11 +299,11 @@ int ConnectionHandler::create_worker_thread(size_t num) {
auto worker = make_unique<Worker>(
loop, sv_ssl_ctx, cl_ssl_ctx, session_cache_ssl_ctx, cert_tree_.get(),
ticket_keys_, this, config->conn.downstream);
#ifdef HAVE_MRUBY
# ifdef HAVE_MRUBY
if (worker->create_mruby_context() != 0) {
return -1;
}
#endif // HAVE_MRUBY
# endif // HAVE_MRUBY
workers_.push_back(std::move(worker));
worker_loops_.push_back(loop);
@ -629,19 +629,19 @@ void ConnectionHandler::handle_ocsp_complete() {
tls::verify_ocsp_response(ssl_ctx, ocsp_.resp.data(),
ocsp_.resp.size()) == 0) {
#ifndef OPENSSL_IS_BORINGSSL
#ifdef HAVE_ATOMIC_STD_SHARED_PTR
# ifdef HAVE_ATOMIC_STD_SHARED_PTR
std::atomic_store_explicit(
&tls_ctx_data->ocsp_data,
std::make_shared<std::vector<uint8_t>>(std::move(ocsp_.resp)),
std::memory_order_release);
#else // !HAVE_ATOMIC_STD_SHARED_PTR
# else // !HAVE_ATOMIC_STD_SHARED_PTR
std::lock_guard<std::mutex> g(tls_ctx_data->mu);
tls_ctx_data->ocsp_data =
std::make_shared<std::vector<uint8_t>>(std::move(ocsp_.resp));
#endif // !HAVE_ATOMIC_STD_SHARED_PTR
#else // OPENSSL_IS_BORINGSSL
# endif // !HAVE_ATOMIC_STD_SHARED_PTR
#else // OPENSSL_IS_BORINGSSL
SSL_CTX_set_ocsp_response(ssl_ctx, ocsp_.resp.data(), ocsp_.resp.size());
#endif // OPENSSL_IS_BORINGSSL
#endif // OPENSSL_IS_BORINGSSL
}
++ocsp_.next;

View File

@ -29,7 +29,7 @@
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#include <mutex>
@ -37,7 +37,7 @@
#include <vector>
#include <random>
#ifndef NOTHREADS
#include <future>
# include <future>
#endif // NOTHREADS
#include <openssl/ssl.h>
@ -45,7 +45,7 @@
#include <ev.h>
#ifdef HAVE_NEVERBLEED
#include <neverbleed.h>
# include <neverbleed.h>
#endif // HAVE_NEVERBLEED
#include "shrpx_downstream_connection_pool.h"

View File

@ -38,7 +38,7 @@
#include "shrpx_http2_session.h"
#include "shrpx_log.h"
#ifdef HAVE_MRUBY
#include "shrpx_mruby.h"
# include "shrpx_mruby.h"
#endif // HAVE_MRUBY
#include "util.h"
#include "http2.h"

View File

@ -26,7 +26,7 @@
#define SHRPX_DOWNSTREAM_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace shrpx {

View File

@ -25,7 +25,7 @@
#include "shrpx_http2_downstream_connection.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include "http-parser/http_parser.h"

View File

@ -26,7 +26,7 @@
#include <netinet/tcp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <vector>

View File

@ -39,7 +39,7 @@
#include "shrpx_http2_session.h"
#include "shrpx_log.h"
#ifdef HAVE_MRUBY
#include "shrpx_mruby.h"
# include "shrpx_mruby.h"
#endif // HAVE_MRUBY
#include "http2.h"
#include "util.h"

View File

@ -25,7 +25,7 @@
#include "shrpx_http_test.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <cstdlib>

View File

@ -26,7 +26,7 @@
#define SHRPX_HTTP_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace shrpx {

View File

@ -39,7 +39,7 @@
#include "shrpx_http2_session.h"
#include "shrpx_log.h"
#ifdef HAVE_MRUBY
#include "shrpx_mruby.h"
# include "shrpx_mruby.h"
#endif // HAVE_MRUBY
#include "http2.h"
#include "util.h"

View File

@ -25,18 +25,18 @@
#include "shrpx_log.h"
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
# include <syslog.h>
#endif // HAVE_SYSLOG_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
# include <inttypes.h>
#endif // HAVE_INTTYPES_H
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif // HAVE_FCNTL_H
#include <sys/wait.h>

View File

@ -57,14 +57,14 @@ LogConfig::LogConfig()
}
#ifndef NOTHREADS
#ifdef HAVE_THREAD_LOCAL
# ifdef HAVE_THREAD_LOCAL
namespace {
thread_local std::unique_ptr<LogConfig> config = make_unique<LogConfig>();
} // namespace
LogConfig *log_config() { return config.get(); }
void delete_log_config() {}
#else // !HAVE_THREAD_LOCAL
# else // !HAVE_THREAD_LOCAL
namespace {
pthread_key_t lckey;
pthread_once_t lckey_once = PTHREAD_ONCE_INIT;
@ -85,8 +85,8 @@ LogConfig *log_config() {
}
void delete_log_config() { delete log_config(); }
#endif // !HAVE_THREAD_LOCAL
#else // NOTHREADS
# endif // !HAVE_THREAD_LOCAL
#else // NOTHREADS
namespace {
std::unique_ptr<LogConfig> config = make_unique<LogConfig>();
} // namespace
@ -94,7 +94,7 @@ std::unique_ptr<LogConfig> config = make_unique<LogConfig>();
LogConfig *log_config() { return config.get(); }
void delete_log_config() {}
#endif // NOTHREADS
#endif // NOTHREADS
void LogConfig::update_tstamp_millis(
const std::chrono::system_clock::time_point &now) {

View File

@ -578,9 +578,9 @@ int MemcachedConnection::parse_packet() {
#define DEFAULT_WR_IOVCNT 128
#if defined(IOV_MAX) && IOV_MAX < DEFAULT_WR_IOVCNT
#define MAX_WR_IOVCNT IOV_MAX
# define MAX_WR_IOVCNT IOV_MAX
#else // !defined(IOV_MAX) || IOV_MAX >= DEFAULT_WR_IOVCNT
#define MAX_WR_IOVCNT DEFAULT_WR_IOVCNT
# define MAX_WR_IOVCNT DEFAULT_WR_IOVCNT
#endif // !defined(IOV_MAX) || IOV_MAX >= DEFAULT_WR_IOVCNT
size_t MemcachedConnection::fill_request_buffer(struct iovec *iov,

View File

@ -26,7 +26,7 @@
#define SHRPX_ROUTER_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace shrpx {

View File

@ -25,10 +25,10 @@
#include "shrpx_tls.h"
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif // HAVE_NETDB_H
#include <netinet/tcp.h>
#include <pthread.h>
@ -46,7 +46,7 @@
#include <openssl/rand.h>
#include <openssl/dh.h>
#ifndef OPENSSL_NO_OCSP
#include <openssl/ocsp.h>
# include <openssl/ocsp.h>
#endif // OPENSSL_NO_OCSP
#include <nghttp2/nghttp2.h>
@ -204,21 +204,21 @@ int servername_callback(SSL *ssl, int *al, void *arg) {
for (auto ssl_ctx : ssl_ctx_list) {
auto cert = SSL_CTX_get0_certificate(ssl_ctx);
#if OPENSSL_1_1_API
# if OPENSSL_1_1_API
auto pubkey = X509_get0_pubkey(cert);
#else // !OPENSSL_1_1_API
# else // !OPENSSL_1_1_API
auto pubkey = X509_get_pubkey(cert);
#endif // !OPENSSL_1_1_API
# endif // !OPENSSL_1_1_API
if (EVP_PKEY_base_id(pubkey) != EVP_PKEY_EC) {
continue;
}
#if OPENSSL_1_1_API
# if OPENSSL_1_1_API
auto eckey = EVP_PKEY_get0_EC_KEY(pubkey);
#else // !OPENSSL_1_1_API
# else // !OPENSSL_1_1_API
auto eckey = EVP_PKEY_get1_EC_KEY(pubkey);
#endif // !OPENSSL_1_1_API
# endif // !OPENSSL_1_1_API
if (eckey == nullptr) {
continue;
@ -227,10 +227,10 @@ int servername_callback(SSL *ssl, int *al, void *arg) {
auto ecgroup = EC_KEY_get0_group(eckey);
auto cert_curve = EC_GROUP_get_curve_name(ecgroup);
#if !OPENSSL_1_1_API
# if !OPENSSL_1_1_API
EC_KEY_free(eckey);
EVP_PKEY_free(pubkey);
#endif // !OPENSSL_1_1_API
# endif // !OPENSSL_1_1_API
if (shared_curve == cert_curve) {
SSL_set_SSL_CTX(ssl, ssl_ctx);
@ -251,13 +251,13 @@ int servername_callback(SSL *ssl, int *al, void *arg) {
namespace {
std::shared_ptr<std::vector<uint8_t>>
get_ocsp_data(TLSContextData *tls_ctx_data) {
#ifdef HAVE_ATOMIC_STD_SHARED_PTR
# ifdef HAVE_ATOMIC_STD_SHARED_PTR
return std::atomic_load_explicit(&tls_ctx_data->ocsp_data,
std::memory_order_acquire);
#else // !HAVE_ATOMIC_STD_SHARED_PTR
# else // !HAVE_ATOMIC_STD_SHARED_PTR
std::lock_guard<std::mutex> g(tls_ctx_data->mu);
return tls_ctx_data->ocsp_data;
#endif // !HAVE_ATOMIC_STD_SHARED_PTR
# endif // !HAVE_ATOMIC_STD_SHARED_PTR
}
} // namespace
@ -567,9 +567,9 @@ int alpn_select_proto_cb(SSL *ssl, const unsigned char **out,
#if !LIBRESSL_IN_USE && OPENSSL_VERSION_NUMBER >= 0x10002000L
#ifndef TLSEXT_TYPE_signed_certificate_timestamp
#define TLSEXT_TYPE_signed_certificate_timestamp 18
#endif // !TLSEXT_TYPE_signed_certificate_timestamp
# ifndef TLSEXT_TYPE_signed_certificate_timestamp
# define TLSEXT_TYPE_signed_certificate_timestamp 18
# endif // !TLSEXT_TYPE_signed_certificate_timestamp
namespace {
int sct_add_cb(SSL *ssl, unsigned int ext_type, unsigned int context,
@ -629,7 +629,7 @@ int sct_parse_cb(SSL *ssl, unsigned int ext_type, unsigned int context,
}
} // namespace
#if !OPENSSL_1_1_1_API
# if !OPENSSL_1_1_1_API
namespace {
int legacy_sct_add_cb(SSL *ssl, unsigned int ext_type,
@ -654,8 +654,8 @@ int legacy_sct_parse_cb(SSL *ssl, unsigned int ext_type,
}
} // namespace
#endif // !OPENSSL_1_1_1_API
#endif // !LIBRESSL_IN_USE && OPENSSL_VERSION_NUMBER >= 0x10002000L
# endif // !OPENSSL_1_1_1_API
#endif // !LIBRESSL_IN_USE && OPENSSL_VERSION_NUMBER >= 0x10002000L
#ifndef OPENSSL_NO_PSK
namespace {
@ -794,18 +794,18 @@ SSL_CTX *create_ssl_context(const char *private_key_file, const char *cert_file,
}
#ifndef OPENSSL_NO_EC
#if !LIBRESSL_LEGACY_API && OPENSSL_VERSION_NUMBER >= 0x10002000L
# if !LIBRESSL_LEGACY_API && OPENSSL_VERSION_NUMBER >= 0x10002000L
if (SSL_CTX_set1_curves_list(ssl_ctx, tlsconf.ecdh_curves.c_str()) != 1) {
LOG(FATAL) << "SSL_CTX_set1_curves_list " << tlsconf.ecdh_curves
<< " failed";
DIE();
}
#if !defined(OPENSSL_IS_BORINGSSL) && !OPENSSL_1_1_API
# if !defined(OPENSSL_IS_BORINGSSL) && !OPENSSL_1_1_API
// It looks like we need this function call for OpenSSL 1.0.2. This
// function was deprecated in OpenSSL 1.1.0 and BoringSSL.
SSL_CTX_set_ecdh_auto(ssl_ctx, 1);
#endif // !defined(OPENSSL_IS_BORINGSSL) && !OPENSSL_1_1_API
#else // LIBRESSL_LEGACY_API || OPENSSL_VERSION_NUBMER < 0x10002000L
# endif // !defined(OPENSSL_IS_BORINGSSL) && !OPENSSL_1_1_API
# else // LIBRESSL_LEGACY_API || OPENSSL_VERSION_NUBMER < 0x10002000L
// Use P-256, which is sufficiently secure at the time of this
// writing.
auto ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
@ -816,8 +816,8 @@ SSL_CTX *create_ssl_context(const char *private_key_file, const char *cert_file,
}
SSL_CTX_set_tmp_ecdh(ssl_ctx, ecdh);
EC_KEY_free(ecdh);
#endif // LIBRESSL_LEGACY_API || OPENSSL_VERSION_NUBMER < 0x10002000L
#endif // OPENSSL_NO_EC
# endif // LIBRESSL_LEGACY_API || OPENSSL_VERSION_NUBMER < 0x10002000L
#endif // OPENSSL_NO_EC
if (!tlsconf.dh_param_file.empty()) {
// Read DH parameters from file
@ -939,7 +939,7 @@ SSL_CTX *create_ssl_context(const char *private_key_file, const char *cert_file,
// OpenSSL handles signed_certificate_timestamp extension specially,
// and it lets custom handler to process the extension.
if (!sct_data.empty()) {
#if OPENSSL_1_1_1_API
# if OPENSSL_1_1_1_API
// It is not entirely clear to me that SSL_EXT_CLIENT_HELLO is
// required here. sct_parse_cb is called without
// SSL_EXT_CLIENT_HELLO being set. But the passed context value
@ -953,7 +953,7 @@ SSL_CTX *create_ssl_context(const char *private_key_file, const char *cert_file,
<< ERR_error_string(ERR_get_error(), nullptr);
DIE();
}
#else // !OPENSSL_1_1_1_API
# else // !OPENSSL_1_1_1_API
if (SSL_CTX_add_server_custom_ext(
ssl_ctx, TLSEXT_TYPE_signed_certificate_timestamp,
legacy_sct_add_cb, legacy_sct_free_cb, nullptr, legacy_sct_parse_cb,
@ -962,7 +962,7 @@ SSL_CTX *create_ssl_context(const char *private_key_file, const char *cert_file,
<< ERR_error_string(ERR_get_error(), nullptr);
DIE();
}
#endif // !OPENSSL_1_1_1_API
# endif // !OPENSSL_1_1_1_API
}
#endif // !LIBRESSL_IN_USE && OPENSSL_VERSION_NUMBER >= 0x10002000L
@ -1893,11 +1893,11 @@ int verify_ocsp_response(SSL_CTX *ssl_ctx, const uint8_t *ocsp_resp,
return -1;
}
#if OPENSSL_1_1_API
# if OPENSSL_1_1_API
auto certid = OCSP_SINGLERESP_get0_id(sresp);
#else // !OPENSSL_1_1_API
# else // !OPENSSL_1_1_API
auto certid = sresp->certId;
#endif // !OPENSSL_1_1_API
# endif // !OPENSSL_1_1_API
assert(certid != nullptr);
ASN1_INTEGER *serial;
@ -1971,10 +1971,10 @@ StringRef get_x509_issuer_name(BlockAllocator &balloc, X509 *x) {
}
#ifdef WORDS_BIGENDIAN
#define bswap64(N) (N)
# define bswap64(N) (N)
#else /* !WORDS_BIGENDIAN */
#define bswap64(N) \
((uint64_t)(ntohl((uint32_t)(N))) << 32 | ntohl((uint32_t)((N) >> 32)))
# define bswap64(N) \
((uint64_t)(ntohl((uint32_t)(N))) << 32 | ntohl((uint32_t)((N) >> 32)))
#endif /* !WORDS_BIGENDIAN */
StringRef get_x509_serial(BlockAllocator &balloc, X509 *x) {

View File

@ -36,7 +36,7 @@
#include <ev.h>
#ifdef HAVE_NEVERBLEED
#include <neverbleed.h>
# include <neverbleed.h>
#endif // HAVE_NEVERBLEED
#include "network.h"

View File

@ -26,7 +26,7 @@
#define SHRPX_TLS_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace shrpx {

View File

@ -25,7 +25,7 @@
#include "shrpx_worker.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <memory>
@ -37,7 +37,7 @@
#include "shrpx_log_config.h"
#include "shrpx_memcached_dispatcher.h"
#ifdef HAVE_MRUBY
#include "shrpx_mruby.h"
# include "shrpx_mruby.h"
#endif // HAVE_MRUBY
#include "util.h"
#include "template.h"

View File

@ -34,7 +34,7 @@
#include <deque>
#include <thread>
#ifndef NOTHREADS
#include <future>
# include <future>
#endif // NOTHREADS
#include <openssl/ssl.h>

View File

@ -26,7 +26,7 @@
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <sys/resource.h>
#include <sys/wait.h>

View File

@ -25,7 +25,7 @@
#include "shrpx_worker_test.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <cstdlib>

View File

@ -26,7 +26,7 @@
#define SHRPX_WORKER_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace shrpx {

View File

@ -24,20 +24,20 @@
*/
#ifndef OPENSSL_COMPAT_H
#include <openssl/opensslv.h>
# include <openssl/opensslv.h>
#if defined(LIBRESSL_VERSION_NUMBER)
#define OPENSSL_1_1_API 0
#define OPENSSL_1_1_1_API 0
#define LIBRESSL_IN_USE 1
#define LIBRESSL_LEGACY_API (LIBRESSL_VERSION_NUMBER < 0x20700000L)
#define LIBRESSL_2_7_API (LIBRESSL_VERSION_NUMBER >= 0x20700000L)
#else // !defined(LIBRESSL_VERSION_NUMBER)
#define OPENSSL_1_1_API (OPENSSL_VERSION_NUMBER >= 0x1010000fL)
#define OPENSSL_1_1_1_API (OPENSSL_VERSION_NUMBER >= 0x10101000L)
#define LIBRESSL_IN_USE 0
#define LIBRESSL_LEGACY_API 0
#define LIBRESSL_2_7_API 0
#endif // !defined(LIBRESSL_VERSION_NUMBER)
# if defined(LIBRESSL_VERSION_NUMBER)
# define OPENSSL_1_1_API 0
# define OPENSSL_1_1_1_API 0
# define LIBRESSL_IN_USE 1
# define LIBRESSL_LEGACY_API (LIBRESSL_VERSION_NUMBER < 0x20700000L)
# define LIBRESSL_2_7_API (LIBRESSL_VERSION_NUMBER >= 0x20700000L)
# else // !defined(LIBRESSL_VERSION_NUMBER)
# define OPENSSL_1_1_API (OPENSSL_VERSION_NUMBER >= 0x1010000fL)
# define OPENSSL_1_1_1_API (OPENSSL_VERSION_NUMBER >= 0x10101000L)
# define LIBRESSL_IN_USE 0
# define LIBRESSL_LEGACY_API 0
# define LIBRESSL_2_7_API 0
# endif // !defined(LIBRESSL_VERSION_NUMBER)
#endif // OPENSSL_COMPAT_H

View File

@ -26,7 +26,7 @@
#define TEMPLATE_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace nghttp2 {

View File

@ -26,7 +26,7 @@
#define TIMEGM_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#ifdef __cplusplus
@ -34,7 +34,7 @@ extern "C" {
#endif /* __cplusplus */
#ifdef HAVE_TIME_H
#include <time.h>
# include <time.h>
#endif // HAVE_TIME_H
time_t nghttp2_timegm(struct tm *tm);

View File

@ -25,30 +25,30 @@
#include "util.h"
#ifdef HAVE_TIME_H
#include <time.h>
# include <time.h>
#endif // HAVE_TIME_H
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
# include <sys/socket.h>
#endif // HAVE_SYS_SOCKET_H
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif // HAVE_NETDB_H
#include <sys/stat.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
# include <fcntl.h>
#endif // HAVE_FCNTL_H
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
# include <netinet/in.h>
#endif // HAVE_NETINET_IN_H
#ifdef _WIN32
#include <ws2tcpip.h>
#include <boost/date_time/posix_time/posix_time.hpp>
# include <ws2tcpip.h>
# include <boost/date_time/posix_time/posix_time.hpp>
#else // !_WIN32
#include <netinet/tcp.h>
# include <netinet/tcp.h>
#endif // !_WIN32
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
# include <arpa/inet.h>
#endif // HAVE_ARPA_INET_H
#include <cmath>
@ -80,9 +80,9 @@ int nghttp2_inet_pton(int af, const char *src, void *dst) {
namespace {
// inet_pton-wrapper for Windows
int nghttp2_inet_pton(int af, const char *src, void *dst) {
#if _WIN32_WINNT >= 0x0600
# if _WIN32_WINNT >= 0x0600
return InetPtonA(af, src, dst);
#else
# else
// the function takes a 'char*', so we need to make a copy
char addr[INET6_ADDRSTRLEN + 1];
strncpy(addr, src, sizeof(addr));
@ -93,7 +93,7 @@ int nghttp2_inet_pton(int af, const char *src, void *dst) {
if (WSAStringToAddress(addr, af, NULL, (LPSOCKADDR)dst, &size) == 0)
return 1;
return 0;
#endif
# endif
}
} // namespace
#endif // _WIN32

View File

@ -28,11 +28,11 @@
#include "nghttp2_config.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif // HAVE_UNISTD_H
#include <getopt.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
# include <netdb.h>
#endif // HAVE_NETDB_H
#include <cmath>

View File

@ -26,7 +26,7 @@
#define UTIL_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif // HAVE_CONFIG_H
namespace shrpx {

View File

@ -26,11 +26,11 @@
/* Make sure that we get XSI-compliant version of strerror_r */
#ifdef _POSIX_C_SOURCE
#undef _POSIX_C_SOURCE
# undef _POSIX_C_SOURCE
#endif /* _POSIX_C_SOURCE */
#ifdef _GNU_SOURCE
#undef _GNU_SOURCE
# undef _GNU_SOURCE
#endif /* _GNU_SOURCE */
#include <string.h>

View File

@ -26,7 +26,7 @@
#define XSI_STRERROR_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <stddef.h>

View File

@ -23,7 +23,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <stdio.h>

View File

@ -26,7 +26,7 @@
#define FAILMALLOC_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
void test_nghttp2_session_send(void);

View File

@ -23,7 +23,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <stdio.h>

View File

@ -26,7 +26,7 @@
#define MALLOC_WRAPPER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <stdlib.h>

View File

@ -26,7 +26,7 @@
#define NGHTTP2_BUF_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
void test_nghttp2_bufs_add(void);

View File

@ -26,7 +26,7 @@
#define NGHTTP2_FRAME_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
void test_nghttp2_frame_pack_headers(void);

View File

@ -26,7 +26,7 @@
#define NGHTTP2_HD_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
void test_nghttp2_hd_deflate(void);

View File

@ -26,7 +26,7 @@
#define NGHTTP2_HELPER_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif /* HAVE_CONFIG_H */
void test_nghttp2_adjust_local_window_size(void);

Some files were not shown because too many files have changed in this diff Show More