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

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

?? waitheaders.c

?? 嵌入式系統(tǒng)設(shè)計與實例開發(fā)實驗教材二源碼 多線程應(yīng)用程序設(shè)計 串行端口程序設(shè)計 AD接口實驗 CAN總線通信實驗 GPS通信實驗 Linux內(nèi)核移植與編譯實驗 IC卡讀寫實驗 SD驅(qū)動使
?? 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一区二区三区免费野_久草精品视频
欧美自拍偷拍午夜视频| 欧美精品一区二区三区一线天视频| 精品少妇一区二区三区在线播放| 亚洲国产欧美在线人成| 欧美午夜宅男影院| 亚洲成精国产精品女| 日韩欧美国产一区二区在线播放| 热久久一区二区| 精品国产91久久久久久久妲己| 久久精品国产免费看久久精品| 久久夜色精品一区| 不卡一区在线观看| 亚洲一区av在线| 精品少妇一区二区三区在线视频| 国产成人亚洲综合色影视| 最新欧美精品一区二区三区| 欧美三级在线播放| 国产一区激情在线| 亚洲一区二区在线视频| 2欧美一区二区三区在线观看视频| 国产99久久久国产精品潘金网站| 亚洲精品一二三区| 久久亚洲一级片| 欧美日韩在线观看一区二区 | 亚洲成av人片www| 欧美xfplay| 欧美区在线观看| 色哟哟在线观看一区二区三区| 水蜜桃久久夜色精品一区的特点| 久久香蕉国产线看观看99| 欧美日韩一级片在线观看| 国产精品影视在线| 久久国产视频网| 石原莉奈一区二区三区在线观看 | 国产精品二区一区二区aⅴ污介绍| 欧美久久免费观看| 欧美性一二三区| 91成人在线观看喷潮| 色综合激情五月| 成人动漫一区二区在线| 国产成人精品aa毛片| 国产精品一二二区| 国产99久久久国产精品潘金| 国产在线精品一区二区不卡了| 久久精品国产网站| 国产主播一区二区三区| 久久99国产精品麻豆| 久久99久久99| 国产精品91一区二区| 国产精品资源在线观看| 成人不卡免费av| 色婷婷久久一区二区三区麻豆| 在线亚洲一区二区| 欧美性受xxxx黑人xyx| 69久久夜色精品国产69蝌蚪网| 91.com视频| 久久久久久久久久久久电影| 国产性天天综合网| 亚洲精品美国一| 日韩av成人高清| 国产99久久久久| 欧美日韩久久久| 国产午夜精品一区二区| 自拍偷拍欧美精品| 精品一区二区国语对白| 色综合一个色综合| 欧美mv日韩mv国产网站app| 国产精品色眯眯| 日本一不卡视频| 99re成人精品视频| 日韩免费观看高清完整版在线观看| 中文欧美字幕免费| 日本aⅴ免费视频一区二区三区| 99精品国产热久久91蜜凸| 欧美一区二区三区色| 亚洲人成精品久久久久| 韩国精品一区二区| 欧美一区二区视频在线观看| 日韩一区有码在线| 国产成人av网站| 精品美女一区二区| 日韩精品国产精品| 欧美在线播放高清精品| 18涩涩午夜精品.www| 国产老肥熟一区二区三区| 欧美刺激午夜性久久久久久久| 亚洲一二三区不卡| 欧日韩精品视频| 亚洲欧美一区二区三区国产精品| 国产精品一级片在线观看| 精品精品欲导航| 精品写真视频在线观看| 欧美大片在线观看一区二区| 日韩国产在线一| 制服丝袜中文字幕一区| 日本三级亚洲精品| 日韩欧美国产一区二区在线播放| 美女在线视频一区| 26uuu亚洲婷婷狠狠天堂| 久久99精品国产91久久来源| 久久影院午夜片一区| 国产成人精品aa毛片| 亚洲精品免费在线观看| 欧美精品一卡二卡| 国产一区在线视频| 亚洲日本丝袜连裤袜办公室| 欧美色图第一页| 精品在线免费观看| 亚洲欧美日韩国产成人精品影院| 色哟哟一区二区三区| 秋霞电影网一区二区| 国产女同性恋一区二区| 日本高清不卡视频| 精品在线播放午夜| 一级特黄大欧美久久久| 日韩你懂的在线观看| 91蜜桃传媒精品久久久一区二区| 国产在线精品视频| 亚洲一区二区中文在线| 99国产精品99久久久久久| 国产亚洲欧美在线| 国产老妇另类xxxxx| 日韩av一区二| 国精产品一区一区三区mba视频 | 成人理论电影网| 首页国产欧美久久| 亚洲人精品午夜| 国产精品少妇自拍| 国产日韩高清在线| 欧美一区二区视频在线观看2022 | 日韩欧美在线1卡| 欧美丰满少妇xxxxx高潮对白| 91啪九色porn原创视频在线观看| 韩国成人精品a∨在线观看| 男女视频一区二区| 三级影片在线观看欧美日韩一区二区| 亚洲裸体在线观看| 日韩理论电影院| 亚洲自拍偷拍综合| 五月天视频一区| 人人狠狠综合久久亚洲| 韩国理伦片一区二区三区在线播放| 麻豆视频一区二区| 蜜臀av性久久久久蜜臀aⅴ | 亚洲国产成人自拍| 国产日韩欧美高清| 国产视频一区在线观看| 国产精品久久久久久一区二区三区 | 91免费视频网| 欧美久久久久久久久久| 日韩视频免费直播| 久久久精品黄色| 国产精品情趣视频| 亚洲一区在线免费观看| 日本欧美加勒比视频| av在线综合网| 91精品国产日韩91久久久久久| 精品免费视频一区二区| 亚洲欧美色一区| 久久爱另类一区二区小说| 国产99久久久久久免费看农村| 欧美艳星brazzers| 国产丝袜美腿一区二区三区| 天天亚洲美女在线视频| 成人一区二区视频| 欧美卡1卡2卡| 亚洲欧美激情小说另类| 久草中文综合在线| 欧美色图在线观看| 亚洲欧美日韩小说| 成人永久免费视频| 欧美xxxx在线观看| 亚洲成av人片一区二区三区| 成人高清视频在线观看| 欧美xxx久久| 韩国成人福利片在线播放| 日韩免费成人网| 久久国产日韩欧美精品| 欧美一三区三区四区免费在线看| 亚洲成人激情自拍| 日韩欧美一区二区免费| 国产综合色在线| 一区在线中文字幕| 欧美影视一区二区三区| 天堂久久久久va久久久久| 欧美一激情一区二区三区| 激情五月婷婷综合网| 国产精品毛片久久久久久久| 91传媒视频在线播放| 国产在线视频精品一区| 亚洲美女精品一区| 欧美一二三在线| 亚洲最大色网站| 3d动漫精品啪啪一区二区竹菊| 亚洲动漫第一页| 91精品欧美综合在线观看最新| 亚洲一区二区三区不卡国产欧美| 色综合久久88色综合天天免费| 亚洲天堂av一区| 欧美日韩国产小视频在线观看|