DbgPrint ( line );
}
+void InitializeSocketFlags(struct socket *so)
+{
+ so->so_state |= SS_NBIO;
+ so->so_options |= SO_DONTROUTE;
+}
+
/* From uipc_syscalls.c */
int OskitTCPSocket( void *context,
int error = socreate(domain, &so, type, proto);
if( !error ) {
so->so_connection = context;
- so->so_state |= SS_NBIO;
- so->so_options |= SO_DONTROUTE;
+ InitializeSocketFlags(so);
*aso = so;
}
OSKUnlock();
&tcp_flags );
OSKUnlock();
- *OutLen = Len - uio.uio_resid;
+ if (error == 0) *OutLen = Len - uio.uio_resid;
return error;
}
error = sosend( socket, NULL, &uio, NULL, NULL, 0 );
OSKUnlock();
- *OutLen = Len - uio.uio_resid;
+ if (error == 0) *OutLen = Len - uio.uio_resid;
return error;
}
if (error)
goto out;
- so->so_state |= SS_NBIO | SS_ISCONNECTED;
+ InitializeSocketFlags(so);
+ so->so_state |= SS_ISCONNECTED;
so->so_q = so->so_q0 = NULL;
so->so_qlen = so->so_q0len = 0;
so->so_head = 0;
struct tcpcb *tp;
int offer;
{
+#ifndef __REACTOS__
register struct rtentry *rt;
struct ifnet *ifp = NULL;
- register int rtt, mss;
+ struct rmxp_tao *taop;
+ register int rtt;
+#endif
+ register int mss;
u_long bufsize;
struct inpcb *inp;
struct socket *so;
- struct rmxp_tao *taop;
int origoffer = offer;
inp = tp->t_inpcb;
- if ((rt = tcp_rtlookup(inp)) == NULL) {
+ so = inp->inp_socket;
#ifndef __REACTOS__
+ if ((rt = tcp_rtlookup(inp)) == NULL) {
tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
-#else
- if (offer < tcp_mssdflt)
- tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
- else
- tp->t_maxopd = tp->t_maxseg = min(offer, tcp_mssopt(tp));
-#endif
return;
}
-#ifndef __REACTOS__
ifp = rt->rt_ifp;
-#endif
- so = inp->inp_socket;
taop = rmx_taop(rt->rt_rmx);
/*
*/
if (offer == -1)
offer = taop->tao_mssopt;
+#endif
/*
* Offer == 0 means that there was no MSS on the SYN segment,
* in this case we use tcp_mssdflt.
* funny things may happen in tcp_output.
*/
offer = max(offer, 64);
+#ifndef __REACTOS__
taop->tao_mssopt = offer;
/*
if (!in_localaddr(inp->inp_faddr))
mss = min(mss, tcp_mssdflt);
}
+#else
+ mss = tcp_mssopt(tp);
+ mss = min(mss, tcp_mssdflt);
+#endif
mss = min(mss, offer);
/*
* maxopd stores the maximum length of data AND options
* number of mss units; if the mss is larger than
* the socket buffer, decrease the mss.
*/
-#ifdef RTV_SPIPE
+#if defined(RTV_SPIPE) && !defined(__REACTOS__)
if ((bufsize = rt->rt_rmx.rmx_sendpipe) == 0)
#endif
bufsize = so->so_snd.sb_hiwat;
}
tp->t_maxseg = mss;
-#ifdef RTV_RPIPE
+#if defined(RTV_RPIPE) && !defined(__REACTOS__)
if ((bufsize = rt->rt_rmx.rmx_recvpipe) == 0)
#endif
bufsize = so->so_rcv.sb_hiwat;
bufsize = sb_max;
(void)sbreserve(&so->so_rcv, bufsize);
}
+#ifndef __REACTOS__
/*
* Don't force slow-start on local network.
*/
if (!in_localaddr(inp->inp_faddr))
+#endif
tp->snd_cwnd = mss;
+#ifndef __REACTOS__
if (rt->rt_rmx.rmx_ssthresh) {
/*
* There's some sort of gateway or interface
tp->snd_ssthresh = max(2 * mss, rt->rt_rmx.rmx_ssthresh);
tcpstat.tcps_usedssthresh++;
}
+#endif
}
/*