亚洲欧美第一页_禁久久精品乱码_粉嫩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(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一区二区三区免费野_久草精品视频
国产亚洲精品bt天堂精选| 日本一区中文字幕| 在线免费不卡视频| 久久久精品免费免费| 国产成人亚洲综合a∨猫咪| 欧美在线视频你懂得| 国产精品国产自产拍高清av | 国产成人精品一区二| 国产夜色精品一区二区av| 欧美一区二区三区人| 日韩一区二区三区视频在线观看| 在线观看日韩av先锋影音电影院| 欧美在线视频你懂得| 欧美浪妇xxxx高跟鞋交| 91精品国产91综合久久蜜臀| 亚洲黄色在线视频| 26uuu国产在线精品一区二区| 91玉足脚交白嫩脚丫在线播放| 91麻豆精品91久久久久久清纯| 91精品在线观看入口| 亚洲mv大片欧洲mv大片精品| 国产精品网站在线观看| 水蜜桃久久夜色精品一区的特点| 久久综合av免费| 久久久久一区二区三区四区| 国产盗摄一区二区| 日韩色视频在线观看| 国产精品美女久久福利网站| 国产精品污www在线观看| 成人一级片在线观看| 亚洲三级免费电影| 欧美色区777第一页| 性感美女极品91精品| 视频在线在亚洲| 欧美最新大片在线看 | 91精品国产高清一区二区三区 | 91精品国产免费| 国产无人区一区二区三区| 日本三级亚洲精品| 欧美剧情片在线观看| 欧美丰满嫩嫩电影| 欧美视频在线一区二区三区| 欧美三级资源在线| 久久久国产精品麻豆| 国产日产欧美一区| 国产精品毛片高清在线完整版 | 欧美日韩中文字幕一区二区| 久久久国产综合精品女国产盗摄| 国v精品久久久网| 久久免费精品国产久精品久久久久| 国产精品成人网| 国产精品久久精品日日| 久久这里都是精品| 日韩av电影免费观看高清完整版在线观看| 国产综合色视频| 欧美美女黄视频| 国产麻豆精品一区二区| 麻豆国产欧美一区二区三区| 国产精品夜夜嗨| 色视频成人在线观看免| 精品视频在线免费| 欧美日韩国产小视频| 久久综合九色综合欧美98| 久久亚区不卡日本| 成人妖精视频yjsp地址| 亚洲成人精品在线观看| 高清国产一区二区| 欧美一区二区三区在线电影| 亚洲精品视频在线观看免费| 成人黄色电影在线| 欧美精品少妇一区二区三区| 国产精品亚洲成人| 欧美酷刑日本凌虐凌虐| 欧美精选在线播放| 久久99热狠狠色一区二区| 日日噜噜夜夜狠狠视频欧美人 | 欧美videos大乳护士334| 欧美日韩精品电影| 国产乱理伦片在线观看夜一区| 久久精品夜色噜噜亚洲a∨| 欧美高清你懂得| 蜜臀av一区二区| 青青国产91久久久久久 | 2020国产精品自拍| 国产精品九色蝌蚪自拍| 国产成人精品网址| 色久优优欧美色久优优| 欧美亚洲一区二区在线| 精品国产乱码91久久久久久网站| 日韩免费观看2025年上映的电影| 亚洲一区二区三区免费视频| 欧美大尺度电影在线| 亚洲bdsm女犯bdsm网站| 日韩欧美国产午夜精品| 韩国av一区二区三区四区| 日韩精品五月天| 56国语精品自产拍在线观看| 男男视频亚洲欧美| 亚洲成人自拍网| 日本一区二区视频在线| 亚洲一区二区综合| 91麻豆精品国产91久久久久久久久 | 国产精品美日韩| 亚洲嫩草精品久久| 日韩精品乱码av一区二区| 中文字幕五月欧美| 欧美日韩在线免费视频| 在线区一区二视频| 欧美一区二区在线播放| 国产精品影视天天线| 一区二区中文视频| 久久一日本道色综合| 视频一区国产视频| 亚洲国产日韩a在线播放| 欧美大片一区二区三区| 麻豆精品视频在线观看免费| 成人av在线观| 久久在线免费观看| 色狠狠色噜噜噜综合网| 国产丝袜美腿一区二区三区| 日本一区二区三区免费乱视频 | 欧美三区在线观看| 欧美日韩一区二区在线观看| 97精品超碰一区二区三区| 亚洲国产精品久久不卡毛片| 五月天激情小说综合| 自拍偷在线精品自拍偷无码专区 | 国产区在线观看成人精品| 亚洲成人自拍偷拍| 亚洲一区二区成人在线观看| 99精品久久只有精品| 亚洲男帅同性gay1069| 亚洲黄色尤物视频| 欧美伊人久久久久久午夜久久久久| 久久综合色一综合色88| 精品国产人成亚洲区| 99国产精品一区| 久久新电视剧免费观看| 麻豆一区二区三| 国产亲近乱来精品视频| 亚洲精品免费视频| 亚洲欧美日韩国产中文在线| 亚洲国产精品自拍| 国产精品资源在线| 亚洲精品一区二区三区在线观看| 中文字幕一区av| 亚洲国产精品成人久久综合一区| 国产麻豆9l精品三级站| 亚洲婷婷综合色高清在线| 日韩成人免费电影| 中文字幕一区二区在线观看| 精品国产精品网麻豆系列| 亚洲在线一区二区三区| 久久爱www久久做| 精品国产露脸精彩对白| xnxx国产精品| 成人av午夜影院| 一色桃子久久精品亚洲| 国产在线视视频有精品| 尤物在线观看一区| 欧美日韩免费高清一区色橹橹| 日韩精品一二三| 亚洲一二三级电影| 精品欧美久久久| 精品剧情v国产在线观看在线| 在线观看三级视频欧美| 在线观看不卡视频| 欧美三级日韩在线| 日韩精品一区二区三区在线| wwwwww.欧美系列| 亚洲丝袜另类动漫二区| 亚洲最大的成人av| 免费观看91视频大全| 韩国av一区二区三区在线观看| 成人免费av在线| 一本一道久久a久久精品 | 欧美日韩一区二区三区在线看| 欧美图片一区二区三区| 欧美一区二区三区在线观看视频| 久久亚洲二区三区| 亚洲婷婷综合色高清在线| 日韩精品亚洲一区二区三区免费| 久久99精品久久久久婷婷| 99国产精品视频免费观看| 欧美日韩一区三区| 欧美高清在线精品一区| 一区二区三区在线高清| 国产一区激情在线| 色视频一区二区| 欧美精品一区二区三区久久久| 一区二区中文视频| 美国一区二区三区在线播放| 成人h版在线观看| 欧美一区2区视频在线观看| 国产精品网友自拍| 亚洲国产va精品久久久不卡综合| 国产乱子伦视频一区二区三区| 日本久久一区二区三区| 久久精品视频免费观看| 日本中文一区二区三区|