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

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

?? waitheaders.c

?? linux和2410結合開發 用他可以生成2410所需的zImage文件
?? 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一区二区三区免费野_久草精品视频
欧美综合在线视频| 一区二区中文视频| 午夜精品一区二区三区免费视频 | 亚洲成人动漫一区| 欧洲精品一区二区三区在线观看| 欧美国产视频在线| 成人国产精品免费| 中文字幕一区二区三区在线播放 | 久久综合久久99| 国产九色精品成人porny | 日本成人在线看| 不卡视频一二三四| 老司机午夜精品99久久| 4438x亚洲最大成人网| 亚洲一区在线观看免费观看电影高清| 成人小视频在线| 亚洲日本乱码在线观看| 91女人视频在线观看| 亚洲欧美日韩在线不卡| 欧美综合色免费| 日本中文字幕一区二区视频| 8x8x8国产精品| 国产综合久久久久影院| 中文字幕免费观看一区| 国产成人a级片| 一区在线中文字幕| 欧美美女bb生活片| 日本成人在线看| 日韩一区二区三区免费观看| 国产成人免费在线观看不卡| 亚洲精品亚洲人成人网| 69堂精品视频| av不卡免费在线观看| 亚洲综合色在线| 久久免费视频色| 一本大道av一区二区在线播放| 亚洲地区一二三色| 国产女主播视频一区二区| 在线观看日韩国产| 国产精品99精品久久免费| 天天影视涩香欲综合网| 国产精品私房写真福利视频| 91精品国产91久久久久久最新毛片| 国产91综合网| 精品一区二区影视| 中文字幕色av一区二区三区| 日韩美一区二区三区| 欧美日韩综合一区| 91免费视频大全| 国产伦精一区二区三区| 麻豆一区二区99久久久久| 国产精品毛片大码女人| 欧美久久高跟鞋激| 欧美喷潮久久久xxxxx| 成人免费av网站| 成人黄色免费短视频| 免费看欧美女人艹b| 亚洲大片免费看| 天堂蜜桃一区二区三区 | 亚洲自拍偷拍麻豆| 亚洲欧美另类综合偷拍| 亚洲免费av在线| 一区二区视频免费在线观看| 亚洲手机成人高清视频| 欧美高清在线一区| 国产欧美综合在线观看第十页| 色香色香欲天天天影视综合网| 91香蕉视频污在线| 欧美日韩中文字幕一区二区| 日韩欧美另类在线| 亚洲精品一区二区三区福利| 国产亚洲欧美日韩在线一区| 中文字幕亚洲不卡| 亚洲第一综合色| 国产主播一区二区三区| av一区二区三区| 欧美人狂配大交3d怪物一区| 日韩精品资源二区在线| 精品三级在线看| 中文字幕中文在线不卡住| 亚洲一区在线电影| 婷婷中文字幕一区三区| 国产精品性做久久久久久| 91成人在线精品| 欧美大片在线观看一区| 一色桃子久久精品亚洲| 六月婷婷色综合| 色偷偷久久一区二区三区| 精品国产三级a在线观看| 1区2区3区精品视频| 久久99国产精品久久99 | 一区二区三区四区视频精品免费| 日本大胆欧美人术艺术动态| 国产精品影视在线观看| 欧美亚洲综合色| 国产色综合久久| 国产精品资源在线| 欧美不卡一区二区三区四区| 成人免费小视频| 成人性视频免费网站| 日韩一卡二卡三卡| 不卡一卡二卡三乱码免费网站| 久久先锋影音av鲁色资源| 日韩国产精品久久| 91.com在线观看| 亚洲一区在线免费观看| 色综合天天天天做夜夜夜夜做| 久久精品视频网| 日本欧美韩国一区三区| 国产精品久久久久影院色老大| 丝袜美腿亚洲色图| 欧美性生交片4| 久久久青草青青国产亚洲免观| 国产成人三级在线观看| 国产婷婷色一区二区三区四区| 亚洲男人电影天堂| 欧美性做爰猛烈叫床潮| 天堂午夜影视日韩欧美一区二区| 91精品国产一区二区| 青青草国产成人99久久| 日韩精品一区二区三区视频播放 | 欧美亚洲日本国产| 日韩av电影一区| 国产欧美一区二区三区鸳鸯浴| 9i看片成人免费高清| 一区二区三区.www| 欧美一二三在线| 成人动漫视频在线| 五月婷婷另类国产| 国产女人aaa级久久久级| 99久久久免费精品国产一区二区| 中文字幕一区二区不卡| 欧美亚洲综合在线| caoporen国产精品视频| 日韩高清国产一区在线| √…a在线天堂一区| 6080午夜不卡| 99re8在线精品视频免费播放| 久久99精品久久久久久动态图| 亚洲欧美视频在线观看视频| 国产三区在线成人av| 精品入口麻豆88视频| 欧美日韩亚洲综合一区| 成人美女在线视频| 国产一区二区三区在线观看免费| 天天综合色天天综合色h| 亚洲欧美色一区| 亚洲色图视频网| 亚洲人精品午夜| 欧美mv和日韩mv国产网站| 欧美日韩精品一区视频| 在线观看日韩国产| 日本福利一区二区| 欧美视频一区二区在线观看| 色综合色狠狠综合色| 一本到高清视频免费精品| 不卡一区二区在线| 成人福利在线看| 成人在线视频首页| 欧美在线视频你懂得| 国产精品理伦片| 亚洲精品国产一区二区三区四区在线| 日本一二三四高清不卡| 国产精品乱码一区二区三区软件| 久久亚洲综合色一区二区三区 | 99r国产精品| 在线精品视频小说1| 欧美日韩国产免费一区二区 | 欧美成人免费网站| 久久久久久免费网| 美国十次了思思久久精品导航| 麻豆国产欧美日韩综合精品二区| 国产精品996| 国产白丝精品91爽爽久久| 99麻豆久久久国产精品免费| 欧美中文字幕久久| 精品人在线二区三区| 国产精品久久久久桃色tv| 天天影视涩香欲综合网| 国产乱码精品一区二区三 | 亚洲精品高清视频在线观看| 日韩av不卡一区二区| 成人开心网精品视频| 欧美日本国产一区| 国产精品毛片久久久久久| 国产精品综合一区二区三区| 在线观看一区不卡| 久久这里只有精品首页| 日韩精品视频网站| 日本久久一区二区三区| 久久蜜桃香蕉精品一区二区三区| 亚洲一区二区四区蜜桃| 成人一区在线看| 欧美大黄免费观看| 亚洲激情综合网| 国产乱理伦片在线观看夜一区 | 激情国产一区二区| 精品剧情在线观看| 天天色图综合网| 91精品在线观看入口|