-/* $OpenBSD: uipc_socket.c,v 1.296 2023/01/23 18:33:34 mvs Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.297 2023/01/23 18:34:24 mvs Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
restart:
if ((error = sblock(so, &so->so_snd, SBLOCKWAIT(flags))) != 0)
goto out;
- so->so_state |= SS_ISSENDING;
+ so->so_snd.sb_state |= SS_ISSENDING;
do {
if (so->so_snd.sb_state & SS_CANTSENDMORE)
snderr(EPIPE);
snderr(EWOULDBLOCK);
sbunlock(so, &so->so_snd);
error = sbwait(so, &so->so_snd);
- so->so_state &= ~SS_ISSENDING;
+ so->so_snd.sb_state &= ~SS_ISSENDING;
if (error)
goto out;
goto restart;
top->m_flags |= M_EOR;
}
if (resid == 0)
- so->so_state &= ~SS_ISSENDING;
+ so->so_snd.sb_state &= ~SS_ISSENDING;
if (top && so->so_options & SO_ZEROIZE)
top->m_flags |= M_ZEROIZE;
if (flags & MSG_OOB)
} while (resid);
release:
- so->so_state &= ~SS_ISSENDING;
+ so->so_snd.sb_state &= ~SS_ISSENDING;
sbunlock(so, &so->so_snd);
out:
sounlock(so);
goto release;
len = space;
}
- sosp->so_state |= SS_ISSENDING;
+ sosp->so_snd.sb_state |= SS_ISSENDING;
SBLASTRECORDCHK(&so->so_rcv, "somove 1");
SBLASTMBUFCHK(&so->so_rcv, "somove 1");
/* Append all remaining data to drain socket. */
if (so->so_rcv.sb_cc == 0 || maxreached)
- sosp->so_state &= ~SS_ISSENDING;
+ sosp->so_snd.sb_state &= ~SS_ISSENDING;
error = pru_send(sosp, m, NULL, NULL);
if (error) {
if (sosp->so_snd.sb_state & SS_CANTSENDMORE)
goto nextpkt;
release:
- sosp->so_state &= ~SS_ISSENDING;
+ sosp->so_snd.sb_state &= ~SS_ISSENDING;
if (!error && maxreached && so->so_splicemax == so->so_splicelen)
error = EFBIG;
if (error)
-/* $OpenBSD: socketvar.h,v 1.116 2023/01/22 12:05:44 mvs Exp $ */
+/* $OpenBSD: socketvar.h,v 1.117 2023/01/23 18:34:24 mvs Exp $ */
/* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */
/*-
* NOTE: The following states should be used with corresponding socket's
* buffer `sb_state' only:
*
- * SS_CANTSENDMORE with `so_snd'
+ * SS_CANTSENDMORE with `so_snd'
+ * SS_ISSENDING with `so_snd'
* SS_CANTRCVMORE with `so_rcv'
* SS_RCVATMARK with `so_rcv'
*/
/* are we sending on this socket? */
#define soissending(so) \
- ((so)->so_state & SS_ISSENDING)
+ ((so)->so_snd.sb_state & SS_ISSENDING)
/* can we read something from so? */
static inline int