Add SB_NOCOALESCE flag to disable socket buffer update in place

This commit is contained in:
Kip Macy 2007-12-17 10:02:01 +00:00
parent 3db8241bb4
commit 5e0f5cfaed
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=174711
2 changed files with 2 additions and 0 deletions

View File

@ -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) {

View File

@ -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);