From 5e0f5cfaed4e1694038fec66cf9ab631eda20f33 Mon Sep 17 00:00:00 2001 From: Kip Macy Date: Mon, 17 Dec 2007 10:02:01 +0000 Subject: [PATCH] Add SB_NOCOALESCE flag to disable socket buffer update in place --- sys/kern/uipc_sockbuf.c | 1 + sys/sys/socketvar.h | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index aa1d5ce8b9f..d8c0cab6c4c 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -761,6 +761,7 @@ sbcompress(struct sockbuf *sb, struct mbuf *m, struct mbuf *n) } if (n && (n->m_flags & M_EOR) == 0 && M_WRITABLE(n) && + ((sb->sb_flags & SB_NOCOALESCE) == 0) && m->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */ m->m_len <= M_TRAILINGSPACE(n) && n->m_type == m->m_type) { diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index bc8df7b9fb8..a8163f3dba3 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -130,6 +130,7 @@ struct socket { #define SB_NOINTR 0x40 /* operations not interruptible */ #define SB_AIO 0x80 /* AIO operations queued */ #define SB_KNOTE 0x100 /* kernel note attached */ +#define SB_NOCOALESCE 0x200 /* don't coalesce new data into existing mbufs */ #define SB_AUTOSIZE 0x800 /* automatically size socket buffer */ void (*so_upcall)(struct socket *, void *, int);