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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? waitheaders.c

?? 《嵌入式系統(tǒng)設(shè)計與實例開發(fā)實驗教材二源碼》Linux內(nèi)核移植與編譯實驗
?? 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;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲天堂中文字幕| 欧美久久久一区| 久久精品人人爽人人爽| 加勒比av一区二区| www日韩大片| 丁香另类激情小说| 亚洲免费观看高清| 欧美三级电影一区| 日韩电影免费一区| 久久久综合网站| 99re亚洲国产精品| 日韩精品电影在线观看| 欧美va亚洲va在线观看蝴蝶网| 老司机精品视频导航| 国产日韩亚洲欧美综合| 91小视频在线观看| 日韩精品电影在线| 久久亚洲二区三区| 色综合久久88色综合天天免费| 亚洲国产精品综合小说图片区| 日韩欧美一区二区不卡| 国产成人免费网站| 亚洲欧洲av一区二区三区久久| 91久久精品网| 美女网站在线免费欧美精品| 国产精品美女视频| 欧美日韩国产成人在线免费| 国内精品伊人久久久久av影院| 国产精品久久久久久久浪潮网站| 欧美三区在线视频| 国产精品一区二区在线播放| 亚洲综合在线电影| 久久综合九色综合欧美亚洲| 色婷婷av一区二区三区之一色屋| 老鸭窝一区二区久久精品| 国产精品网站一区| 3d成人h动漫网站入口| 成人性生交大片免费看在线播放 | 国产成人免费av在线| 亚洲精品老司机| 精品日韩欧美一区二区| 色综合天天综合狠狠| 久久精品国产免费| 亚洲精品国产视频| 久久精品综合网| 欧美猛男超大videosgay| 国产99精品国产| 日本欧美一区二区三区| 1000部国产精品成人观看| 日韩精品一区二区三区视频| 欧美制服丝袜第一页| av电影在线观看一区| 久久成人av少妇免费| 五月天久久比比资源色| 最新日韩av在线| 久久久91精品国产一区二区三区| 宅男噜噜噜66一区二区66| 91浏览器在线视频| 懂色av中文字幕一区二区三区 | 精品国产1区2区3区| 在线观看91视频| 91香蕉视频mp4| 成年人国产精品| 国产精品一线二线三线| 精品无码三级在线观看视频| 日本美女一区二区三区视频| 亚洲成人动漫在线免费观看| 亚洲色图视频免费播放| 中文字幕欧美一区| 中文字幕一区在线观看视频| 国产女人aaa级久久久级| 久久夜色精品国产欧美乱极品| 日韩免费电影网站| 日韩欧美精品在线| 日韩欧美一区二区久久婷婷| 日韩三级视频中文字幕| 日韩欧美一区二区不卡| 26uuuu精品一区二区| 久久久三级国产网站| 欧美zozo另类异族| 色综合天天综合网国产成人综合天 | 成人动漫精品一区二区| 久久精品99国产精品| 日韩一区精品视频| 亚洲一区欧美一区| 一区二区三区小说| 亚洲婷婷在线视频| 亚洲美女视频在线| 亚洲人123区| 亚洲你懂的在线视频| 国产精品伦一区二区三级视频| 久久久国产午夜精品| 国产亚洲精品bt天堂精选| 久久久亚洲综合| 欧美精品一区二区三| 精品久久久久久久人人人人传媒 | 26uuu成人网一区二区三区| 色婷婷久久综合| 日本国产一区二区| 在线观看91精品国产入口| 欧美少妇bbb| 欧美日韩一区二区电影| 91在线国产观看| 在线看国产一区| 欧美酷刑日本凌虐凌虐| 色婷婷综合久久久久中文| 欧美无乱码久久久免费午夜一区| 欧美日韩国产天堂| 777午夜精品免费视频| 欧美高清视频一二三区| 欧美一级淫片007| 精品免费日韩av| 久久久久久久电影| 国产精品久久久久久妇女6080 | 99久久99久久精品国产片果冻 | 精品久久久久一区| 久久久久久久久久久久久女国产乱| 久久久久久亚洲综合| 国产日韩精品久久久| 中文字幕一区二区三中文字幕| 亚洲免费在线观看| 亚洲chinese男男1069| 日韩电影在线免费| 国产91精品在线观看| 91久久国产综合久久| 日韩一区和二区| 中文字幕一区二区三区四区| 丝袜美腿高跟呻吟高潮一区| 国产一区不卡在线| 在线精品视频小说1| 精品剧情在线观看| 亚洲乱码国产乱码精品精的特点| 亚洲v日本v欧美v久久精品| 国产黄色91视频| 欧美日韩和欧美的一区二区| 久久亚区不卡日本| 亚洲自拍偷拍麻豆| 国产精品18久久久久| 欧美日韩一卡二卡| 亚洲美女淫视频| 国内久久婷婷综合| 精品视频1区2区| 久久97超碰国产精品超碰| 国产永久精品大片wwwapp| 欧美日韩亚州综合| 国产精品国产三级国产aⅴ入口| 2024国产精品| 国产精品99久久久久久久女警| 色一情一乱一乱一91av| 日本在线不卡一区| 国产自产高清不卡| 国产毛片精品视频| 免费成人av在线播放| 欧美精彩视频一区二区三区| 欧美日韩在线播| 午夜精品免费在线观看| 99视频有精品| 亚洲在线视频免费观看| 亚洲国产中文字幕在线视频综合 | 成熟亚洲日本毛茸茸凸凹| www.成人在线| 久久你懂得1024| 亚洲国产精品视频| 在线亚洲高清视频| 亚洲视频在线一区| 欧美一级夜夜爽| 亚洲精品亚洲人成人网| 欧美一级午夜免费电影| 亚洲精品中文字幕乱码三区| 99精品视频一区| 国产精品夜夜嗨| 亚洲精品日产精品乱码不卡| 国产精品久久久久久妇女6080| 国产丝袜美腿一区二区三区| 欧美色精品在线视频| 91色porny| 美女脱光内衣内裤视频久久影院| 成人欧美一区二区三区1314| 风间由美一区二区av101| 国产精品免费aⅴ片在线观看| 欧美精品18+| www.爱久久.com| 午夜精品一区在线观看| 亚洲国产精品激情在线观看 | 欧美在线高清视频| 亚洲成av人片在线观看无码| 日韩免费成人网| 91国产免费看| 成年人国产精品| 一区二区三区在线观看欧美| 日韩欧美亚洲另类制服综合在线| 91视频一区二区三区| 成人午夜视频福利| 亚洲一区在线观看免费 | 久久草av在线| 亚洲一区欧美一区| 一区二区三区.www| 亚洲一区二区三区四区五区黄 | 欧美性极品少妇| 亚洲欧美成人一区二区三区|