Page MenuHomeFreeBSD

D21186.id60573.diff
No OneTemporary

D21186.id60573.diff

Index: sys/netgraph/ng_deflate.c
===================================================================
--- sys/netgraph/ng_deflate.c
+++ sys/netgraph/ng_deflate.c
@@ -41,7 +41,7 @@
#include <sys/endian.h>
#include <sys/errno.h>
#include <sys/syslog.h>
-#include <sys/zlib.h>
+#include <contrib/zlib/zlib.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
@@ -82,8 +82,6 @@
static ng_disconnect_t ng_deflate_disconnect;
/* Helper functions */
-static void *z_alloc(void *, u_int items, u_int size);
-static void z_free(void *, void *ptr);
static int ng_deflate_compress(node_p node,
struct mbuf *m, struct mbuf **resultp);
static int ng_deflate_decompress(node_p node,
@@ -255,8 +253,6 @@
if (priv->cfg.enable) {
priv->cx.next_in = NULL;
- priv->cx.zalloc = z_alloc;
- priv->cx.zfree = z_free;
int res;
if (priv->compress) {
if ((res = deflateInit2(&priv->cx,
@@ -419,24 +415,6 @@
HELPER STUFF
************************************************************************/
-/*
- * Space allocation and freeing routines for use by zlib routines.
- */
-
-static void *
-z_alloc(void *notused, u_int items, u_int size)
-{
-
- return (malloc(items * size, M_NETGRAPH_DEFLATE, M_NOWAIT));
-}
-
-static void
-z_free(void *notused, void *ptr)
-{
-
- free(ptr, M_NETGRAPH_DEFLATE);
-}
-
/*
* Compress/encrypt a packet and put the result in a new mbuf at *resultp.
* The original mbuf is not free'd.
@@ -486,7 +464,7 @@
priv->cx.avail_out = outlen - 2 - DEFLATE_HDRLEN;
/* Compress. */
- rtn = deflate(&priv->cx, Z_PACKET_FLUSH);
+ rtn = deflate(&priv->cx, Z_SYNC_FLUSH);
/* Check return value. */
if (rtn != Z_OK) {
@@ -604,7 +582,7 @@
priv->cx.avail_out = outlen - 1;
/* Decompress. */
- rtn = inflate(&priv->cx, Z_PACKET_FLUSH);
+ rtn = inflate(&priv->cx, Z_SYNC_FLUSH);
/* Check return value. */
if (rtn != Z_OK && rtn != Z_STREAM_END) {
@@ -658,12 +636,12 @@
priv->cx.avail_in = inlen;
}
- rtn = inflateIncomp(&priv->cx);
+ rtn = inflateInit(&priv->cx);
/* Check return value */
if (rtn != Z_OK) {
priv->stats.Errors++;
- log(LOG_NOTICE, "%s: inflateIncomp error: %d (%s)\n",
+ log(LOG_NOTICE, "%s: inflateInit error: %d (%s)\n",
__func__, rtn, priv->cx.msg);
NG_FREE_M(m);
priv->seqnum = 0;

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 20, 7:11 AM (1 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30006120
Default Alt Text
D21186.id60573.diff (2 KB)

Event Timeline