mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 23:56:57 +02:00
CLEANUP: compression: use the build options list to report the algos
This removes 2 #ifdef, an include, an ugly construct and a wild "extern" declaration from haproxy.c. The message indicating that compression is *not* enabled is not there anymore.
This commit is contained in:
parent
c2c0b61274
commit
b97c6fb59e
@ -624,8 +624,26 @@ static int deflate_end(struct comp_ctx **comp_ctx)
|
|||||||
__attribute__((constructor))
|
__attribute__((constructor))
|
||||||
static void __comp_fetch_init(void)
|
static void __comp_fetch_init(void)
|
||||||
{
|
{
|
||||||
|
char *ptr = NULL;
|
||||||
|
int i;
|
||||||
|
|
||||||
#ifdef USE_SLZ
|
#ifdef USE_SLZ
|
||||||
slz_make_crc_table();
|
slz_make_crc_table();
|
||||||
slz_prepare_dist_table();
|
slz_prepare_dist_table();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_ZLIB
|
||||||
|
memprintf(&ptr, "Built with zlib version : " ZLIB_VERSION);
|
||||||
|
memprintf(&ptr, "%s\nRunning on zlib version : %s", ptr, zlibVersion());
|
||||||
|
#elif defined(USE_SLZ)
|
||||||
|
memprintf(&ptr, "Built with libslz for stateless compression.");
|
||||||
|
#endif
|
||||||
|
memprintf(&ptr, "%s\nCompression algorithms supported :", ptr);
|
||||||
|
|
||||||
|
for (i = 0; comp_algos[i].cfg_name; i++)
|
||||||
|
memprintf(&ptr, "%s%s %s(\"%s\")", ptr, (i == 0 ? "" : ","), comp_algos[i].cfg_name, comp_algos[i].ua_name);
|
||||||
|
|
||||||
|
if (i == 0)
|
||||||
|
memprintf(&ptr, "%s none", ptr);
|
||||||
|
|
||||||
|
hap_register_build_opts(ptr, 1);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,6 @@
|
|||||||
#include <common/version.h>
|
#include <common/version.h>
|
||||||
|
|
||||||
#include <types/capture.h>
|
#include <types/capture.h>
|
||||||
#include <types/compression.h>
|
|
||||||
#include <types/filters.h>
|
#include <types/filters.h>
|
||||||
#include <types/global.h>
|
#include <types/global.h>
|
||||||
#include <types/acl.h>
|
#include <types/acl.h>
|
||||||
@ -127,12 +126,6 @@
|
|||||||
#include <import/51d.h>
|
#include <import/51d.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********************************************************************/
|
|
||||||
|
|
||||||
extern const struct comp_algo comp_algos[];
|
|
||||||
|
|
||||||
/*********************************************************************/
|
|
||||||
|
|
||||||
/* list of config files */
|
/* list of config files */
|
||||||
static struct list cfg_cfgfiles = LIST_HEAD_INIT(cfg_cfgfiles);
|
static struct list cfg_cfgfiles = LIST_HEAD_INIT(cfg_cfgfiles);
|
||||||
int pid; /* current process id */
|
int pid; /* current process id */
|
||||||
@ -340,27 +333,6 @@ static void display_build_opts()
|
|||||||
#endif
|
#endif
|
||||||
"\n");
|
"\n");
|
||||||
|
|
||||||
#ifdef USE_ZLIB
|
|
||||||
printf("Built with zlib version : " ZLIB_VERSION "\n");
|
|
||||||
printf("Running on zlib version : %s\n", zlibVersion());
|
|
||||||
#elif defined(USE_SLZ)
|
|
||||||
printf("Built with libslz for stateless compression.\n");
|
|
||||||
#else /* USE_ZLIB */
|
|
||||||
printf("Built without compression support (neither USE_ZLIB nor USE_SLZ are set)\n");
|
|
||||||
#endif
|
|
||||||
printf("Compression algorithms supported :");
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; comp_algos[i].cfg_name; i++) {
|
|
||||||
printf("%s %s(\"%s\")", (i == 0 ? "" : ","), comp_algos[i].cfg_name, comp_algos[i].ua_name);
|
|
||||||
}
|
|
||||||
if (i == 0) {
|
|
||||||
printf("none");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
|
|
||||||
list_for_each_entry(item, &build_opts_list, list) {
|
list_for_each_entry(item, &build_opts_list, list) {
|
||||||
puts(item->str);
|
puts(item->str);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user