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

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

?? waitheaders.c

?? ARM 嵌入式 系統(tǒng) 設(shè)計(jì)與實(shí)例開發(fā) 實(shí)驗(yàn)教材 二源碼
?? C
字號(hào):
/*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
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美福利视频一区| 99视频一区二区| 国产精品久久久久久久岛一牛影视| av电影一区二区| 久久99精品国产.久久久久久| 国产精品伦一区| 欧美电影免费观看高清完整版在 | 大胆亚洲人体视频| 日韩精品亚洲专区| 亚洲日本va在线观看| 日本一区二区动态图| 日韩精品一区国产麻豆| 97久久精品人人澡人人爽| 极品美女销魂一区二区三区| 日韩精品成人一区二区在线| 综合色天天鬼久久鬼色| 中文字幕巨乱亚洲| 亚洲精品一区二区在线观看| 欧美一二三四区在线| 欧美无砖专区一中文字| 99国产麻豆精品| 69堂国产成人免费视频| 色999日韩国产欧美一区二区| 9人人澡人人爽人人精品| 国产成人鲁色资源国产91色综| 国产一区二区三区四区在线观看| 喷水一区二区三区| 黑人巨大精品欧美黑白配亚洲| 日本不卡在线视频| 免费在线观看精品| 精品一区二区三区视频在线观看| 美国欧美日韩国产在线播放| 美美哒免费高清在线观看视频一区二区 | 久久久久久久国产精品影院| 久久精品人人做人人综合 | 中文字幕二三区不卡| 亚洲视频小说图片| 亚洲国产精品自拍| 麻豆国产91在线播放| 国产**成人网毛片九色| 色诱亚洲精品久久久久久| 欧美日韩黄色一区二区| 欧美a级理论片| 一区二区三区成人| 麻豆成人综合网| 成人黄色免费短视频| 欧美日韩一区二区在线观看| 精品国精品自拍自在线| 亚洲综合色网站| 国产a久久麻豆| 中文字幕中文字幕一区| 午夜久久久影院| 国产成人午夜精品影院观看视频| 在线观看亚洲精品| 国产视频不卡一区| 性感美女极品91精品| 91美女在线视频| 久久精品亚洲精品国产欧美kt∨ | 成人一级片网址| 欧美一区二区三区电影| 亚洲素人一区二区| 国产精品一二三四五| 欧美久久久久久蜜桃| 亚洲三级电影网站| 国产精品系列在线播放| 在线成人小视频| 天天操天天综合网| 欧美亚一区二区| 亚洲精品va在线观看| 色综合久久久久综合体| 免费成人在线观看视频| 欧美日韩三级视频| 亚洲国产色一区| 欧美亚洲综合一区| 日韩成人伦理电影在线观看| 欧美日韩另类一区| 日韩中文字幕不卡| 777午夜精品免费视频| 午夜欧美大尺度福利影院在线看| 欧美在线视频不卡| 午夜精品在线看| 4438成人网| 久久精品国产精品亚洲红杏| 精品久久国产老人久久综合| 国产一区二区在线观看视频| 国产欧美一区二区在线| 不卡一区二区在线| 午夜a成v人精品| 2021国产精品久久精品| 成人动漫av在线| 亚洲国产日产av| 日韩区在线观看| av动漫一区二区| 青青草伊人久久| 久久精品视频一区二区三区| 91久久精品一区二区| 毛片av中文字幕一区二区| 国产精品三级在线观看| 欧美日韩一区在线观看| 国产一区二区伦理片| 亚洲综合色网站| 国产欧美日韩三区| 欧美日韩国产成人在线免费| 国产盗摄女厕一区二区三区| 亚洲第一福利一区| 国产日韩欧美不卡| 日韩免费观看高清完整版| 99精品视频在线免费观看| 麻豆精品国产91久久久久久| 亚洲色图视频网| 国产欧美日韩久久| 欧美一区二区三区在线电影| 色综合久久久久综合99| 国产69精品久久99不卡| 狠狠色2019综合网| 日本欧美大码aⅴ在线播放| 亚洲一区在线看| 亚洲欧美日韩国产综合| 国产精品福利电影一区二区三区四区 | 色偷偷一区二区三区| 国产精品亚洲а∨天堂免在线| 日韩精品电影一区亚洲| 91网页版在线| 成人黄色免费短视频| 国产河南妇女毛片精品久久久| 精品系列免费在线观看| 日韩不卡手机在线v区| 五月开心婷婷久久| 日韩1区2区3区| 久久aⅴ国产欧美74aaa| 精品一区二区免费| 国产一区二区三区四区五区美女| 国产资源精品在线观看| 国产乱码精品一品二品| 国产高清成人在线| 波波电影院一区二区三区| 91香蕉视频污在线| 欧美日韩黄色一区二区| 欧美精品一区二区三区高清aⅴ | 久久久蜜桃精品| 国产精品女主播在线观看| 亚洲国产中文字幕| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产在线播放一区二区三区| 91网站黄www| 精品国产精品一区二区夜夜嗨| 国产精品传媒视频| 午夜欧美在线一二页| 国产一区二区三区| 91丝袜美女网| 成人激情图片网| 91成人免费网站| 精品卡一卡二卡三卡四在线| 中文在线一区二区| 日日骚欧美日韩| 91在线无精精品入口| 一本到不卡免费一区二区| 日韩精品一区在线| 一区二区在线观看视频在线观看| 日韩有码一区二区三区| 91色视频在线| 精品人在线二区三区| 一区二区三区不卡在线观看 | 亚洲www啪成人一区二区麻豆| 精油按摩中文字幕久久| 一本大道综合伊人精品热热| 2024国产精品| 日本成人在线电影网| 91小视频在线| 国产亚洲欧美色| 亚洲第一av色| 91美女蜜桃在线| 国产精品青草久久| 成人午夜碰碰视频| 国产精品你懂的| 国产精品一区二区在线看| 91精品国产综合久久久久久| 国产精品电影院| 9i在线看片成人免费| 国产日本一区二区| proumb性欧美在线观看| 久久综合狠狠综合久久综合88 | 亚洲天堂av老司机| 成人国产免费视频| 最近日韩中文字幕| 色综合久久久久| 亚洲愉拍自拍另类高清精品| 欧美综合色免费| 亚洲一二三专区| 91福利国产精品| 亚洲愉拍自拍另类高清精品| 欧美日韩国产小视频| 精品一区二区三区的国产在线播放| 欧美成人综合网站| 蜜桃久久久久久| 欧美电影免费观看完整版| 波多野结衣在线aⅴ中文字幕不卡| 国产精品无人区| 色妞www精品视频| 久久精品国产久精国产爱|