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

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

?? waitheaders.c

?? Linux內核源代碼 為壓縮文件 是<<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(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一区二区三区免费野_久草精品视频
亚洲精品欧美综合四区| 26uuu国产在线精品一区二区| 欧美色综合网站| 欧美v亚洲v综合ⅴ国产v| 国产精品美女久久久久久久网站| 亚洲永久免费av| 狠狠色丁香九九婷婷综合五月 | 久久精品国产成人一区二区三区 | 一区二区三区国产| 麻豆精品一二三| 99re亚洲国产精品| 日韩午夜av一区| 精品国产凹凸成av人导航| 亚洲免费毛片网站| 日韩电影免费在线观看网站| 国产福利精品导航| 91.成人天堂一区| 国产网站一区二区| 又紧又大又爽精品一区二区| 国产一区二区三区黄视频| 91黄视频在线观看| 国产欧美日韩中文久久| 日韩黄色一级片| 一道本成人在线| 国产亚洲精久久久久久| 午夜精品一区在线观看| av电影在线观看一区| 久久综合色播五月| 亚洲6080在线| 91蝌蚪porny成人天涯| 久久久精品蜜桃| 日本系列欧美系列| 欧美性色黄大片| 最新日韩av在线| 成人精品国产免费网站| 久久午夜羞羞影院免费观看| 性久久久久久久久久久久| 97久久精品人人做人人爽50路| 欧美精品一区二区不卡| 免费成人在线影院| 欧美另类videos死尸| 亚洲最大色网站| 色综合欧美在线视频区| 亚洲日韩欧美一区二区在线| 成人永久免费视频| 国产日产欧美精品一区二区三区| 紧缚捆绑精品一区二区| 欧美成人三级电影在线| 日本一道高清亚洲日美韩| 在线播放视频一区| 男人的天堂久久精品| 7777精品伊人久久久大香线蕉经典版下载 | 欧美bbbbb| 欧美中文字幕久久 | 日本精品裸体写真集在线观看 | 国产不卡高清在线观看视频| 欧美一级黄色录像| 亚洲精品中文字幕在线观看| gogo大胆日本视频一区| 中文乱码免费一区二区| 国产高清精品网站| 久久先锋影音av| 国产成人午夜99999| 国产日韩高清在线| 国产69精品久久久久毛片| 久久久91精品国产一区二区精品 | 成人免费在线视频观看| av不卡一区二区三区| 亚洲精品乱码久久久久久| 欧美日韩在线播放三区| 亚洲日本va午夜在线影院| 欧美日韩国产精品成人| 九九久久精品视频| 中文字幕第一区第二区| 91福利视频网站| 蜜臀久久99精品久久久画质超高清| 欧美成人性战久久| 不卡的电视剧免费网站有什么| 一区二区三区在线看| 欧美一级高清片在线观看| 国产一区二区调教| 最好看的中文字幕久久| 在线综合+亚洲+欧美中文字幕| 久久精品99久久久| 国产精品高潮久久久久无| 欧美日韩一区二区三区免费看 | 精品一区二区三区久久久| 国产亚洲精品中文字幕| 欧美视频自拍偷拍| 国产一区二区视频在线| 国产精品美女久久久久久久久久久 | 日本人妖一区二区| 中文字幕精品在线不卡| 欧美嫩在线观看| 成人国产在线观看| 天使萌一区二区三区免费观看| 欧美精品一区二| 欧美天堂一区二区三区| 国产老女人精品毛片久久| 一区二区三区小说| 国产亚洲精品超碰| 欧美一区二区播放| 91亚洲永久精品| 国产成人精品亚洲午夜麻豆| 午夜精品久久久久久久久| 欧美极品另类videosde| 日韩免费福利电影在线观看| 欧美午夜一区二区| 国产成人亚洲精品狼色在线 | 91视频一区二区三区| 久久99国产精品麻豆| 天堂影院一区二区| 有码一区二区三区| 成人欧美一区二区三区1314| 国产午夜精品一区二区三区视频 | 亚洲成精国产精品女| 久久久久久久久伊人| 欧美一级黄色片| 在线观看91av| 韩国精品免费视频| 一区二区三区高清| 国产天堂亚洲国产碰碰| 国产欧美综合在线| 国产精品一区二区久久精品爱涩 | 91美女片黄在线观看| 一区二区三区欧美亚洲| 中文字幕一区二区三区av| ...xxx性欧美| 亚洲色图一区二区三区| 国产精品国产三级国产普通话99 | 日日欢夜夜爽一区| 亚洲一区二区三区影院| 亚洲色大成网站www久久九九| 欧美mv日韩mv亚洲| 欧美一级久久久| 欧美成人性福生活免费看| 欧美日韩在线观看一区二区| 在线一区二区三区四区五区 | 日韩欧美亚洲国产另类| 91精品国产综合久久福利软件 | 国产91丝袜在线观看| 国产高清精品久久久久| av激情成人网| 在线日韩国产精品| 欧美日韩国产首页| 日韩欧美一级在线播放| 久久久久久久久久久久久夜| 2024国产精品| 国产精品精品国产色婷婷| 亚洲综合在线五月| 日韩激情视频在线观看| 国产乱码精品一区二区三区av | 久久久噜噜噜久久中文字幕色伊伊| 欧美精品一区二区三区一线天视频 | 91国产视频在线观看| 欧美精品免费视频| 2021国产精品久久精品| 国产精品蜜臀av| 亚洲国产日韩一级| 另类欧美日韩国产在线| 成人性色生活片| 欧美色涩在线第一页| 欧美精品一区男女天堂| 亚洲欧洲在线观看av| 亚洲成a人v欧美综合天堂| 韩国av一区二区三区| 色狠狠色噜噜噜综合网| 欧美成人精品福利| 综合在线观看色| 久久成人久久爱| 国产成人无遮挡在线视频| 91国偷自产一区二区三区观看| 精品美女一区二区| 亚洲精品亚洲人成人网在线播放| 日本亚洲最大的色成网站www| 99天天综合性| 精品乱码亚洲一区二区不卡| 亚洲黄色小说网站| 日韩中文字幕麻豆| 99久久精品国产导航| 欧美成人伊人久久综合网| 日韩伦理电影网| 秋霞午夜av一区二区三区| 激情久久五月天| 91久久精品国产91性色tv| 欧美高清视频www夜色资源网| 久久九九久久九九| 欧美a一区二区| 欧美日韩国产精选| 亚洲精品成人在线| 成人免费高清在线| 久久精品视频网| 日本视频在线一区| 欧美三级中文字幕| 亚洲人成小说网站色在线 | 亚洲一二三四在线| 国产成人小视频| 国产人妖乱国产精品人妖| 国产精品一色哟哟哟| 国产清纯在线一区二区www|