From 334099c3241345a698fbf2d9f3fc27448b79dd3d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 3 Jun 2020 18:38:48 +0200 Subject: [PATCH] REORG: include: move shctx to haproxy/shctx{,-t}.h Minor cleanups were applied, some includes were missing from the types file and some were incorrect in a few C files (duplicated or not using path). --- include/{types/shctx.h => haproxy/shctx-t.h} | 24 +++++++++++++++++--- include/{proto => haproxy}/shctx.h | 13 +++++------ src/cache.c | 3 +-- src/shctx.c | 2 +- src/ssl_sock.c | 2 +- 5 files changed, 30 insertions(+), 14 deletions(-) rename include/{types/shctx.h => haproxy/shctx-t.h} (64%) rename include/{proto => haproxy}/shctx.h (96%) diff --git a/include/types/shctx.h b/include/haproxy/shctx-t.h similarity index 64% rename from include/types/shctx.h rename to include/haproxy/shctx-t.h index 7d9d8c8a1..ea835af3d 100644 --- a/include/types/shctx.h +++ b/include/haproxy/shctx-t.h @@ -1,5 +1,23 @@ -#ifndef __TYPES_SHCTX -#define __TYPES_SHCTX +/* + * include/haproxy/shctx-t.h - shared context management functions for SSL + * + * Copyright (C) 2011-2012 EXCELIANCE + * + * Author: Emeric Brun - emeric@exceliance.fr + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#ifndef __HAPROXY_SHCTX_T_H +#define __HAPROXY_SHCTX_T_H + +#if !defined (USE_PRIVATE_CACHE) && defined(USE_PTHREAD_PSHARED) +#include +#endif +#include #ifndef SHSESS_BLOCK_MIN_SIZE #define SHSESS_BLOCK_MIN_SIZE 128 @@ -46,4 +64,4 @@ struct shared_context { unsigned char data[0]; }; -#endif +#endif /* __HAPROXY_SHCTX_T_H */ diff --git a/include/proto/shctx.h b/include/haproxy/shctx.h similarity index 96% rename from include/proto/shctx.h rename to include/haproxy/shctx.h index 76f498f53..b258f3ce0 100644 --- a/include/proto/shctx.h +++ b/include/haproxy/shctx.h @@ -1,5 +1,5 @@ /* - * shctx.h - shared context management functions for SSL + * include/haproxy/shctx.h - shared context management functions for SSL * * Copyright (C) 2011-2012 EXCELIANCE * @@ -11,13 +11,12 @@ * 2 of the License, or (at your option) any later version. */ -#ifndef SHCTX_H -#define SHCTX_H +#ifndef __HAPROXY_SHCTX_H +#define __HAPROXY_SHCTX_H +#include #include -#include - -#include +#include #ifndef USE_PRIVATE_CACHE #ifdef USE_PTHREAD_PSHARED @@ -215,5 +214,5 @@ static inline void shctx_block_set_avail(struct shared_context *shctx, LIST_ADDQ(&shctx->avail, &s->list); } -#endif /* SHCTX_H */ +#endif /* __HAPROXY_SHCTX_H */ diff --git a/src/cache.c b/src/cache.c index 754cb4427..02083c05c 100644 --- a/src/cache.c +++ b/src/cache.c @@ -11,6 +11,7 @@ */ #include +#include #include #include @@ -18,7 +19,6 @@ #include #include #include -#include #include #include @@ -30,7 +30,6 @@ #include #include #include -#include #include diff --git a/src/shctx.c b/src/shctx.c index 113828adb..1a38b9148 100644 --- a/src/shctx.c +++ b/src/shctx.c @@ -16,7 +16,7 @@ #include #include #include -#include "proto/shctx.h" +#include #if !defined (USE_PRIVATE_CACHE) diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 61560125e..44818d0af 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -79,7 +80,6 @@ #include #include #include -#include #include #include #include