temporary fix to prevent 64K writes from crashing us.
SCCS-vsn: sys/kern/uipc_socket.c 6.2
-/* uipc_socket.c 6.2 83/09/28 */
+/* uipc_socket.c 6.2 83/09/29 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
register struct mbuf *m, **mp = ⊤
register int space;
int len, error = 0, s, dontroute;
register struct mbuf *m, **mp = ⊤
register int space;
int len, error = 0, s, dontroute;
+ struct sockbuf sendtempbuf;
if (sosendallatonce(so) && uio->uio_resid > so->so_snd.sb_hiwat)
return (EMSGSIZE);
if (sosendallatonce(so) && uio->uio_resid > so->so_snd.sb_hiwat)
return (EMSGSIZE);
+ /*
+ * Temporary kludge-- don't want to update so_snd in this loop
+ * (will be done when sent), but need to recalculate
+ * space on each iteration. For now, copy so_snd into a tmp.
+ */
+ sendtempbuf = so->so_snd;
while (uio->uio_resid > 0 && space > 0) {
register struct iovec *iov = uio->uio_iov;
while (uio->uio_resid > 0 && space > 0) {
register struct iovec *iov = uio->uio_iov;
mp = &m->m_next;
if (flags & MSG_OOB)
space -= len;
mp = &m->m_next;
if (flags & MSG_OOB)
space -= len;
- else
- space = sbspace(&so->so_snd);
+ else {
+ sballoc(&sendtempbuf, m);
+ space = sbspace(&sendtempbuf);
+ }