tcpdodat.c,v

来自「TCP-IP红宝书源代码」· C,V 代码 · 共 90 行

C,V
90
字号
head	1.2;
access;
symbols;
locks
	dls:1.2; strict;
comment	@ * @;


1.2
date	97.09.21.19.29.52;	author dls;	state Dist;
branches;
next	1.1;

1.1
date	94.01.14.03.51.20;	author dls;	state v2e1;
branches;
next	;


desc
@@


1.2
log
@pre-3e code
@
text
@/* tcpdodat.c - tcpdodat */

#include <conf.h>
#include <kernel.h>
#include <network.h>

/*------------------------------------------------------------------------
 *  tcpdodat -  do input data processing
 *------------------------------------------------------------------------
 */
int tcpdodat(ptcb, ptcp, first, datalen)
struct	tcb	*ptcb;
struct	tcp	*ptcp;
tcpseq		first;
int		datalen;
{
	int	wakeup = 0;

	if (ptcb->tcb_rnext == first) {
		if (datalen > 0) {
			tfcoalesce(ptcb, datalen, ptcp);
			ptcb->tcb_flags |= TCBF_NEEDOUT;
			wakeup++;
		}
		if (ptcp->tcp_code & TCPF_FIN) {
			ptcb->tcb_flags |= TCBF_RDONE|TCBF_NEEDOUT;
			ptcb->tcb_rnext++;
			wakeup++;
		}
		if (ptcp->tcp_code & (TCPF_PSH | TCPF_URG)) {
			ptcb->tcb_flags |= TCBF_PUSH;
			wakeup++;
		}
		if (wakeup)
			tcpwakeup(READERS, ptcb);
	} else {
		/* process delayed controls */
		if (ptcp->tcp_code & TCPF_FIN)
			ptcb->tcb_finseq = ptcp->tcp_seq + datalen;
		if (ptcp->tcp_code & (TCPF_PSH | TCPF_URG))
			ptcb->tcb_pushseq = ptcp->tcp_seq + datalen;
		ptcp->tcp_code &= ~(TCPF_FIN|TCPF_PSH);
		tfinsert(ptcb, first, datalen);
	}
	return OK;
}
@


1.1
log
@Initial revision
@
text
@d30 1
a30 1
		if (ptcp->tcp_code & TCPF_PSH) {
d40 1
a40 1
		if (ptcp->tcp_code & TCPF_PSH)
@

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?