decrease amount of history buffer to use for IPcomp.
the default setting of zlib allocates too much memory and of no use for network packets (which are like < 2k). From: Laine Stump <lainestump@rcn.com>
This commit is contained in:
parent
895de56d08
commit
37ecccca6b
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ipcomp_core.c,v 1.3 1999/07/03 21:30:19 thorpej Exp $ */
|
||||
/* $NetBSD: ipcomp_core.c,v 1.4 1999/11/05 14:56:26 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 WIDE Project.
|
||||
@ -66,6 +66,8 @@ static int deflate_compress __P((struct mbuf *, struct mbuf *, size_t *));
|
||||
static int deflate_decompress __P((struct mbuf *, struct mbuf *, size_t *));
|
||||
|
||||
static int deflate_policy = Z_DEFAULT_COMPRESSION;
|
||||
static int deflate_window = 12; /* 2^12 = 4Kbytes */
|
||||
static int deflate_memlevel = MAX_MEM_LEVEL;
|
||||
|
||||
#if 1
|
||||
struct ipcomp_algorithm ipcomp_algorithms[] = {
|
||||
@ -137,8 +139,10 @@ deflate_common(m, md, lenp, mode)
|
||||
zs.zalloc = deflate_alloc;
|
||||
zs.zfree = deflate_free;
|
||||
|
||||
zerror = mode ? inflateInit(&zs)
|
||||
: deflateInit(&zs, deflate_policy);
|
||||
zerror = mode ? inflateInit2(&zs, deflate_window)
|
||||
: deflateInit2(&zs, deflate_policy, Z_DEFLATED,
|
||||
deflate_window, deflate_memlevel,
|
||||
Z_DEFAULT_STRATEGY);
|
||||
if (zerror != Z_OK) {
|
||||
error = ENOBUFS;
|
||||
goto fail;
|
||||
|
Loading…
Reference in New Issue
Block a user