Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148636971
D21186.id60573.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D21186.id60573.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D21186: Convert ng_deflate to use new zlib.
Attached
Detach File
Event Timeline
Log In to Comment