亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? waitheaders.c

?? 嵌入式系統設計與實驗教材二源碼linux內核移植與編譯
?? C
字號:
/*kHTTPd -- the next generationWait for headers on the accepted connections*//**************************************************************** *	This program is free software; you can redistribute it and/or modify *	it under the terms of the GNU General Public License as published by *	the Free Software Foundation; either version 2, or (at your option) *	any later version. * *	This program is distributed in the hope that it will be useful, *	but WITHOUT ANY WARRANTY; without even the implied warranty of *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *	GNU General Public License for more details. * *	You should have received a copy of the GNU General Public License *	along with this program; if not, write to the Free Software *	Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * ****************************************************************//*Purpose:WaitForHeaders polls all connections in "WaitForHeaderQueue" to see ifheaders have arived. If so, the headers are decoded and the request ismoved to either the "SendingDataQueue" or the "UserspaceQueue".Return value:	The number of requests that changed status*/#include <linux/config.h>#include <linux/kernel.h>#include <linux/skbuff.h>#include <linux/smp_lock.h>#include <linux/file.h>#include <asm/uaccess.h>#include "structure.h"#include "prototypes.h"static	char			*Buffer[CONFIG_KHTTPD_NUMCPU];static int DecodeHeader(const int CPUNR, struct http_request *Request);int WaitForHeaders(const int CPUNR){	struct http_request *CurrentRequest,**Prev;	struct sock *sk;	int count = 0;		EnterFunction("WaitForHeaders");		CurrentRequest = threadinfo[CPUNR].WaitForHeaderQueue;		Prev = &(threadinfo[CPUNR].WaitForHeaderQueue);		while (CurrentRequest!=NULL)	{				/* If the connection is lost, remove from queue */				if (CurrentRequest->sock->sk->state != TCP_ESTABLISHED		    && CurrentRequest->sock->sk->state != TCP_CLOSE_WAIT)		{			struct http_request *Next;						Next = CurrentRequest->Next;						*Prev = CurrentRequest->Next;			CurrentRequest->Next = NULL;								CleanUpRequest(CurrentRequest);			CurrentRequest = Next;			continue;		}								/* If data pending, take action */					sk = CurrentRequest->sock->sk;				if (!skb_queue_empty(&(sk->receive_queue))) /* Do we have data ? */		{			struct http_request *Next;												/* Decode header */						if (DecodeHeader(CPUNR,CurrentRequest)<0)			{				CurrentRequest = CurrentRequest->Next;				continue;			} 									/* Remove from WaitForHeaderQueue */								Next= CurrentRequest->Next;					*Prev = Next;			count++;						/* Add to either the UserspaceQueue or the DataSendingQueue */						if (CurrentRequest->IsForUserspace!=0)			{				CurrentRequest->Next = threadinfo[CPUNR].UserspaceQueue;				threadinfo[CPUNR].UserspaceQueue = CurrentRequest;				} else			{				CurrentRequest->Next = threadinfo[CPUNR].DataSendingQueue;				threadinfo[CPUNR].DataSendingQueue = CurrentRequest;				} 							CurrentRequest = Next;			continue;				}					Prev = &(CurrentRequest->Next);		CurrentRequest = CurrentRequest->Next;	}	LeaveFunction("WaitHeaders");	return count;}void StopWaitingForHeaders(const int CPUNR){	struct http_request *CurrentRequest,*Next;		EnterFunction("StopWaitingForHeaders");	CurrentRequest = threadinfo[CPUNR].WaitForHeaderQueue;	while (CurrentRequest!=NULL)	{		Next = CurrentRequest->Next;		CleanUpRequest(CurrentRequest);		CurrentRequest=Next;			}		threadinfo[CPUNR].WaitForHeaderQueue = NULL; /* The queue is empty now */		free_page((unsigned long)Buffer[CPUNR]);	Buffer[CPUNR]=NULL;		EnterFunction("StopWaitingForHeaders");}/* DecodeHeader peeks at the TCP/IP data, determines what the request is, fills the request-structure and sends the HTTP-header when apropriate.*/static int DecodeHeader(const int CPUNR, struct http_request *Request){	struct msghdr		msg;	struct iovec		iov;	int			len;	mm_segment_t		oldfs;		EnterFunction("DecodeHeader");		/* First, read the data */	msg.msg_name     = 0;	msg.msg_namelen  = 0;	msg.msg_iov	 = &iov;	msg.msg_iovlen   = 1;	msg.msg_control  = NULL;	msg.msg_controllen = 0;	msg.msg_flags    = 0;		msg.msg_iov->iov_base = &Buffer[CPUNR][0];	msg.msg_iov->iov_len  = (size_t)4095;		len = 0;	oldfs = get_fs(); set_fs(KERNEL_DS);	/* 4095 leaves a "0" to terminate the string */		len = sock_recvmsg(Request->sock,&msg,4095,MSG_PEEK);	set_fs(oldfs);	if (len<0) {		/* WONDERFUL. NO COMMENTS. --ANK */		Request->IsForUserspace = 1;		return 0;	}	if (len>=4094) /* BIG header, we cannot decode it so leave it to userspace */		{		Request->IsForUserspace = 1;		return 0;	}		/* Then, decode the header */			ParseHeader(Buffer[CPUNR],len,Request);		Request->filp = OpenFileForSecurity(Request->FileName);			Request->MimeType = ResolveMimeType(Request->FileName,&Request->MimeLength);			if (Request->MimeType==NULL) /* Unknown mime-type */	{		if (Request->filp!=NULL)		{			fput(Request->filp);			Request->filp = NULL;		}		Request->IsForUserspace = 1;				return 0;	}	if (Request->filp==NULL)	{		Request->IsForUserspace = 1;		return 0;	}	else	{		Request->FileLength = (int)Request->filp->f_dentry->d_inode->i_size;		Request->Time       = Request->filp->f_dentry->d_inode->i_mtime;		Request->IMS_Time   = mimeTime_to_UnixTime(Request->IMS);		sprintf(Request->LengthS,"%i",Request->FileLength);		time_Unix2RFC(min_t(unsigned int, Request->Time,CurrentTime_i),Request->TimeS);   	        /* The min() is required by rfc1945, section 10.10:   	           It is not allowed to send a filetime in the future */		if (Request->IMS_Time>Request->Time)		{	/* Not modified since last time */			Send304(Request->sock);			Request->FileLength=0;		}		else   /* Normal Case */		{			Request->sock->sk->tp_pinfo.af_tcp.nonagle = 2; /* this is TCP_CORK */			if (Request->HTTPVER!=9)  /* HTTP/0.9 doesn't allow a header */				SendHTTPHeader(Request);		}				}		LeaveFunction("DecodeHeader");	return 0;}int InitWaitHeaders(int ThreadCount){	int I,I2;	EnterFunction("InitWaitHeaders");	I=0;		while (I<ThreadCount)	{		Buffer[I] = (char*)get_free_page((int)GFP_KERNEL);		if (Buffer[I] == NULL) 		{			printk(KERN_CRIT "kHTTPd: Not enough memory for basic needs\n");			I2=0;			while (I2<I-1)			{				free_page( (unsigned long)Buffer[I2++]);			}			return -1;		}		I++;	}		LeaveFunction("InitWaitHeaders");		return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女视频黄久久| 丝袜a∨在线一区二区三区不卡| 成人91在线观看| 亚洲婷婷综合久久一本伊一区| 欧美日韩精品一区二区天天拍小说 | 国产成人精品亚洲777人妖| 亚洲三级电影网站| 欧美精品777| 福利一区二区在线| 日韩电影在线观看网站| 国产日韩欧美一区二区三区综合| 91玉足脚交白嫩脚丫在线播放| 久久精品国产久精国产爱| 国产精品情趣视频| 欧美麻豆精品久久久久久| 国产传媒欧美日韩成人| 亚洲最大成人网4388xx| 精品国产污污免费网站入口 | 国产精品久久久久久久久久久免费看| 91福利在线导航| 国产精品一品二品| 婷婷久久综合九色国产成人 | 久久久久高清精品| 日韩三级精品电影久久久| www.色精品| 肉丝袜脚交视频一区二区| 亚洲精品乱码久久久久久久久| 日韩精品一区二区三区在线播放| 精品黑人一区二区三区久久| 在线免费亚洲电影| 成人av在线资源网站| 激情亚洲综合在线| 午夜精品视频一区| 亚洲美女偷拍久久| 亚洲视频一区二区在线观看| 精品捆绑美女sm三区| 欧洲一区在线观看| 欧美日韩在线综合| 色乱码一区二区三区88| 高清国产一区二区三区| 国产大片一区二区| 国内久久精品视频| 五月综合激情网| 日韩国产成人精品| 午夜激情综合网| 日韩激情在线观看| 亚洲激情图片一区| 国产精品人成在线观看免费| 2023国产一二三区日本精品2022| 8v天堂国产在线一区二区| 欧美日韩中文字幕一区| av在线一区二区| 99久久久久久| 91麻豆国产自产在线观看| 在线一区二区三区四区五区| 不卡大黄网站免费看| 成人免费精品视频| 在线影视一区二区三区| 欧美影视一区在线| 欧美影视一区在线| 日韩精品一区二区三区三区免费| 日韩一级大片在线| 欧美成人午夜电影| 中文天堂在线一区| 亚洲视频一二区| 亚洲国产综合91精品麻豆| 亚洲成人免费视| 丝袜亚洲另类丝袜在线| 国精品**一区二区三区在线蜜桃| 国产一区二区三区四区五区美女| 日韩欧美一级二级三级久久久 | 欧美一区二区三区四区视频| 欧美在线一区二区三区| 欧美色图激情小说| 91精品国产欧美一区二区 | 国产精品女主播av| 亚洲视频在线一区二区| 婷婷久久综合九色综合绿巨人 | 亚洲一区二区综合| 一区二区三区欧美| 精品亚洲国产成人av制服丝袜| 久久精品99国产精品日本| 国产99一区视频免费| 99久久综合99久久综合网站| 91国产免费看| 久久久精品一品道一区| 中文字幕人成不卡一区| 一区二区日韩电影| 国产一区二区美女诱惑| 国产69精品久久久久毛片| 92国产精品观看| 日韩一级片在线播放| 欧美激情艳妇裸体舞| 亚洲欧美日韩在线| 日韩电影免费在线| 国产精品亚洲人在线观看| 欧美亚洲精品一区| 精品久久久三级丝袜| 日韩一区有码在线| 国产专区综合网| 91在线无精精品入口| 欧美不卡123| 亚洲视频每日更新| 蜜臀久久99精品久久久久宅男| eeuss鲁片一区二区三区| 欧美色视频在线| 久久久亚洲午夜电影| 日本不卡视频一二三区| 成人国产在线观看| 91麻豆国产福利在线观看| 久久久噜噜噜久噜久久综合| 亚洲免费在线看| 亚洲精品第1页| 国产成人欧美日韩在线电影| 欧美性xxxxxxxx| 亚洲色图.com| 国产乱码精品一区二区三| 欧美亚洲国产怡红院影院| 日韩理论片一区二区| 国产一区二区视频在线播放| 欧美优质美女网站| 亚洲精品乱码久久久久久久久| 在线成人av网站| 亚洲欧美另类小说| 国产精品自产自拍| 777a∨成人精品桃花网| 亚洲最新在线观看| 国产成人免费视| 日韩精品资源二区在线| 青草av.久久免费一区| 99re这里只有精品6| 91精品国产品国语在线不卡| 首页国产欧美久久| 色狠狠色噜噜噜综合网| 亚洲三级电影全部在线观看高清| 国产麻豆精品在线| 日韩三级免费观看| 久久精品久久99精品久久| 欧美性受极品xxxx喷水| 久久九九久久九九| 国产成人精品一区二区三区网站观看| 日韩一区二区免费电影| 麻豆视频一区二区| 制服丝袜在线91| 天堂va蜜桃一区二区三区漫画版| 欧美久久久久免费| 夜夜精品浪潮av一区二区三区| 日韩精品乱码免费| 欧美一区二区三区在线看| 亚洲地区一二三色| 日本韩国欧美一区二区三区| 中文字幕亚洲视频| 成人av网站在线观看| 亚洲精品视频一区| 日本高清无吗v一区| 亚洲欧美激情在线| 欧美日韩一区中文字幕| 亚洲成人黄色小说| 欧美日韩国产一级二级| 亚洲午夜在线视频| 欧美日韩一区二区三区高清| 五月天激情综合| 91精品黄色片免费大全| 亚洲午夜在线视频| 3d动漫精品啪啪1区2区免费 | 成人高清av在线| 亚洲欧洲色图综合| 一本到不卡免费一区二区| 亚洲色图.com| 一本一道久久a久久精品综合蜜臀| 亚洲在线中文字幕| 欧美丰满一区二区免费视频| 国产一区二区伦理| 国产精品一区免费在线观看| 日韩欧美在线影院| 成人黄页在线观看| 综合欧美一区二区三区| 日韩亚洲欧美成人一区| 国产一区二区毛片| 国产无人区一区二区三区| 在线观看91视频| 免费在线成人网| 中文字幕一区日韩精品欧美| 色呦呦网站一区| 亚洲国产日韩综合久久精品| 欧美精品一区二区高清在线观看| 国产老肥熟一区二区三区| 欧美激情一区在线观看| 在线精品观看国产| 美女网站在线免费欧美精品| 成人免费在线视频观看| 欧美日韩二区三区| 精品一区二区三区久久| 国产精品伦理在线| 欧美日韩一区二区三区在线| 懂色中文一区二区在线播放| 一区二区三区视频在线看| 国产欧美综合在线| 91国偷自产一区二区三区成为亚洲经典 | 26uuu亚洲综合色|