Whitespace cleanup.
Checked with: cvs diff -b
This commit is contained in:
parent
3ff4e1770d
commit
06a509ffdc
@ -222,7 +222,7 @@ ng_deflate_rcvmsg(node_p node, item_p item, hook_p lasthook)
|
|||||||
|
|
||||||
if (msg->header.typecookie != NGM_DEFLATE_COOKIE)
|
if (msg->header.typecookie != NGM_DEFLATE_COOKIE)
|
||||||
ERROUT(EINVAL);
|
ERROUT(EINVAL);
|
||||||
|
|
||||||
switch (msg->header.cmd) {
|
switch (msg->header.cmd) {
|
||||||
case NGM_DEFLATE_CONFIG:
|
case NGM_DEFLATE_CONFIG:
|
||||||
{
|
{
|
||||||
@ -246,7 +246,7 @@ ng_deflate_rcvmsg(node_p node, item_p item, hook_p lasthook)
|
|||||||
inflateEnd(&priv->cx);
|
inflateEnd(&priv->cx);
|
||||||
priv->cfg.enable = 0;
|
priv->cfg.enable = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Configuration is OK, reset to it. */
|
/* Configuration is OK, reset to it. */
|
||||||
priv->cfg = *cfg;
|
priv->cfg = *cfg;
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ ng_deflate_rcvmsg(node_p node, item_p item, hook_p lasthook)
|
|||||||
if (resp == NULL)
|
if (resp == NULL)
|
||||||
ERROUT(ENOMEM);
|
ERROUT(ENOMEM);
|
||||||
bcopy(&priv->stats, resp->data,
|
bcopy(&priv->stats, resp->data,
|
||||||
sizeof(struct ng_deflate_stats));
|
sizeof(struct ng_deflate_stats));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear stats if requested. */
|
/* Clear stats if requested. */
|
||||||
@ -334,7 +334,7 @@ ng_deflate_rcvdata(hook_p hook, item_p item)
|
|||||||
NG_FREE_ITEM(item);
|
NG_FREE_ITEM(item);
|
||||||
return (ENXIO);
|
return (ENXIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
NGI_GET_M(item, m);
|
NGI_GET_M(item, m);
|
||||||
/* Compress */
|
/* Compress */
|
||||||
if (priv->compress) {
|
if (priv->compress) {
|
||||||
@ -458,7 +458,7 @@ ng_deflate_compress(node_p node, struct mbuf *m, struct mbuf **resultp)
|
|||||||
NG_FREE_M(m);
|
NG_FREE_M(m);
|
||||||
return (ENOMEM);
|
return (ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Work with contiguous regions of memory. */
|
/* Work with contiguous regions of memory. */
|
||||||
m_copydata(m, 0, inlen, (caddr_t)priv->inbuf);
|
m_copydata(m, 0, inlen, (caddr_t)priv->inbuf);
|
||||||
outlen = DEFLATE_BUF_SIZE;
|
outlen = DEFLATE_BUF_SIZE;
|
||||||
@ -538,7 +538,7 @@ ng_deflate_decompress(node_p node, struct mbuf *m, struct mbuf **resultp)
|
|||||||
*resultp = NULL;
|
*resultp = NULL;
|
||||||
|
|
||||||
inlen = m->m_pkthdr.len;
|
inlen = m->m_pkthdr.len;
|
||||||
|
|
||||||
if (inlen > DEFLATE_BUF_SIZE) {
|
if (inlen > DEFLATE_BUF_SIZE) {
|
||||||
priv->stats.Errors++;
|
priv->stats.Errors++;
|
||||||
NG_FREE_M(m);
|
NG_FREE_M(m);
|
||||||
@ -563,7 +563,7 @@ ng_deflate_decompress(node_p node, struct mbuf *m, struct mbuf **resultp)
|
|||||||
/* Packet is compressed, so decompress. */
|
/* Packet is compressed, so decompress. */
|
||||||
if (proto == PROT_COMPD) {
|
if (proto == PROT_COMPD) {
|
||||||
priv->stats.FramesComp++;
|
priv->stats.FramesComp++;
|
||||||
|
|
||||||
/* Check sequence number. */
|
/* Check sequence number. */
|
||||||
rseqnum = ntohs(((uint16_t *)(priv->inbuf + offset))[0]);
|
rseqnum = ntohs(((uint16_t *)(priv->inbuf + offset))[0]);
|
||||||
offset += 2;
|
offset += 2;
|
||||||
|
@ -235,7 +235,7 @@ ng_pred1_rcvmsg(node_p node, item_p item, hook_p lasthook)
|
|||||||
|
|
||||||
if (msg->header.typecookie != NGM_PRED1_COOKIE)
|
if (msg->header.typecookie != NGM_PRED1_COOKIE)
|
||||||
ERROUT(EINVAL);
|
ERROUT(EINVAL);
|
||||||
|
|
||||||
switch (msg->header.cmd) {
|
switch (msg->header.cmd) {
|
||||||
case NGM_PRED1_CONFIG:
|
case NGM_PRED1_CONFIG:
|
||||||
{
|
{
|
||||||
@ -272,7 +272,7 @@ ng_pred1_rcvmsg(node_p node, item_p item, hook_p lasthook)
|
|||||||
if (resp == NULL)
|
if (resp == NULL)
|
||||||
ERROUT(ENOMEM);
|
ERROUT(ENOMEM);
|
||||||
bcopy(&priv->stats, resp->data,
|
bcopy(&priv->stats, resp->data,
|
||||||
sizeof(struct ng_pred1_stats));
|
sizeof(struct ng_pred1_stats));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg->header.cmd != NGM_PRED1_GET_STATS)
|
if (msg->header.cmd != NGM_PRED1_GET_STATS)
|
||||||
@ -305,7 +305,7 @@ ng_pred1_rcvdata(hook_p hook, item_p item)
|
|||||||
NG_FREE_ITEM(item);
|
NG_FREE_ITEM(item);
|
||||||
return (ENXIO);
|
return (ENXIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
NGI_GET_M(item, m);
|
NGI_GET_M(item, m);
|
||||||
/* Compress. */
|
/* Compress. */
|
||||||
if (priv->compress) {
|
if (priv->compress) {
|
||||||
@ -399,7 +399,7 @@ ng_pred1_compress(node_p node, struct mbuf *m, struct mbuf **resultp)
|
|||||||
NG_FREE_M(m);
|
NG_FREE_M(m);
|
||||||
return (ENOMEM);
|
return (ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Work with contiguous regions of memory. */
|
/* Work with contiguous regions of memory. */
|
||||||
m_copydata(m, 0, inlen, (caddr_t)(priv->inbuf + 2));
|
m_copydata(m, 0, inlen, (caddr_t)(priv->inbuf + 2));
|
||||||
|
|
||||||
@ -464,7 +464,7 @@ ng_pred1_decompress(node_p node, struct mbuf *m, struct mbuf **resultp)
|
|||||||
*resultp = NULL;
|
*resultp = NULL;
|
||||||
|
|
||||||
inlen = m->m_pkthdr.len;
|
inlen = m->m_pkthdr.len;
|
||||||
|
|
||||||
if (inlen > PRED1_BUF_SIZE) {
|
if (inlen > PRED1_BUF_SIZE) {
|
||||||
priv->stats.Errors++;
|
priv->stats.Errors++;
|
||||||
NG_FREE_M(m);
|
NG_FREE_M(m);
|
||||||
@ -475,7 +475,7 @@ ng_pred1_decompress(node_p node, struct mbuf *m, struct mbuf **resultp)
|
|||||||
m_copydata(m, 0, inlen, (caddr_t)priv->inbuf);
|
m_copydata(m, 0, inlen, (caddr_t)priv->inbuf);
|
||||||
|
|
||||||
priv->stats.InOctets += inlen;
|
priv->stats.InOctets += inlen;
|
||||||
|
|
||||||
/* Get initial length value. */
|
/* Get initial length value. */
|
||||||
len = priv->inbuf[0] << 8;
|
len = priv->inbuf[0] << 8;
|
||||||
len += priv->inbuf[1];
|
len += priv->inbuf[1];
|
||||||
@ -486,7 +486,7 @@ ng_pred1_decompress(node_p node, struct mbuf *m, struct mbuf **resultp)
|
|||||||
/* Is data compressed or not really? */
|
/* Is data compressed or not really? */
|
||||||
if (cf) {
|
if (cf) {
|
||||||
NG_FREE_M(m);
|
NG_FREE_M(m);
|
||||||
|
|
||||||
priv->stats.FramesComp++;
|
priv->stats.FramesComp++;
|
||||||
len1 = Pred1Decompress(node, priv->inbuf + 2, priv->outbuf,
|
len1 = Pred1Decompress(node, priv->inbuf + 2, priv->outbuf,
|
||||||
inlen - 4, PRED1_BUF_SIZE);
|
inlen - 4, PRED1_BUF_SIZE);
|
||||||
|
Loading…
Reference in New Issue
Block a user