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

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

?? httpd.c

?? ADS下uIP到LPC22XX的移植(含RTL8019AS驅動)
?? C
字號:
/* * Copyright (c) 2001, Adam Dunkels. * All rights reserved.  * * Redistribution and use in source and binary forms, with or without  * modification, are permitted provided that the following conditions  * are met:  * 1. Redistributions of source code must retain the above copyright  *    notice, this list of conditions and the following disclaimer.  * 2. Redistributions in binary form must reproduce the above copyright  *    notice, this list of conditions and the following disclaimer in the  *    documentation and/or other materials provided with the distribution.  * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *      This product includes software developed by Adam Dunkels. * 4. The name of the author may not be used to endorse or promote *    products derived from this software without specific prior *    written permission.   * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   * * This file is part of the uIP TCP/IP stack. * * $Id: httpd.c,v 1.27 2002/01/15 17:22:08 adam Exp $ * */#include "uip.h"#include "httpd.h"#include "fs.h"#include "fsdata.h"#include "cgi.h"#define NULL (void *)0/* The HTTP server states: */#define HTTP_NOGET        0#define HTTP_FILE         1#define HTTP_TEXT         2#define HTTP_FUNC         3#define HTTP_END          4#ifdef DEBUG#include <stdio.h>#define PRINT(x) printf("%s", x)#define PRINTLN(x) printf("%s\n", x)#else /* DEBUG */#define PRINT(x)#define PRINTLN(x)#endif /* DEBUG */struct httpd_state *hs;extern const struct fsdata_file file_index_html;static void next_scriptline(void);static void next_scriptstate(void);#define ISO_G        0x47#define ISO_E        0x45#define ISO_T        0x54#define ISO_slash    0x2f    #define ISO_c        0x63#define ISO_g        0x67#define ISO_i        0x69#define ISO_space    0x20#define ISO_nl       0x0a#define ISO_cr       0x0d#define ISO_a        0x61#define ISO_t        0x74#define ISO_hash     0x23#define ISO_period   0x2e/*-----------------------------------------------------------------------------------*/voidhttpd_init(void){  fs_init();    /* Listen to port 80. */  uip_listen(80);}/*-----------------------------------------------------------------------------------*/voidhttpd(void){  struct fs_file fsfile;    u8_t i;    switch(uip_conn->lport) {    /* This is the web server: */  case htons(80):    /* Pick out the application state from the uip_conn structure. */    hs = (struct httpd_state *)(uip_conn->appstate);    /* We use the uip_ test functions to deduce why we were       called. If uip_connected() is non-zero, we were called       because a remote host has connected to us. If       uip_newdata() is non-zero, we were called because the       remote host has sent us new data, and if uip_acked() is       non-zero, the remote host has acknowledged the data we       previously sent to it. */    if(uip_connected()) {      /* Since we have just been connected with the remote host, we         reset the state for this connection. The ->count variable         contains the amount of data that is yet to be sent to the         remote host, and the ->state is set to HTTP_NOGET to signal         that we haven't received any HTTP GET request for this         connection yet. */      hs->state = HTTP_NOGET;      hs->count = 0;      /* Don't send any data in return; we wait for the HTTP request	 instead. */      uip_send(uip_appdata, 0);      return;    } else if(uip_poll()) {      /* If we are polled ten times, we abort the connection. This is         because we don't want connections lingering indefinately in         the system. */      if(hs->count++ >= 10) {	uip_abort();      }      return;    } else if(uip_newdata() && hs->state == HTTP_NOGET) {      /* This is the first data we receive, and it should contain a	 GET. */            /* Check for GET. */      if(uip_appdata[0] != ISO_G ||	 uip_appdata[1] != ISO_E ||	 uip_appdata[2] != ISO_T ||	 uip_appdata[3] != ISO_space) {	/* If it isn't a GET, we abort the connection. */	uip_abort();	return;      }	             /* Find the file we are looking for. */      for(i = 4; i < 40; ++i) {	if(uip_appdata[i] == ISO_space ||	   uip_appdata[i] == ISO_cr ||	   uip_appdata[i] == ISO_nl) {	  uip_appdata[i] = 0;	  break;	}      }      PRINT("request for file ");      PRINTLN(&uip_appdata[4]);            if(!fs_open((const char *)&uip_appdata[4], &fsfile)) {	PRINTLN("couldn't open file");	fs_open(file_index_html.name, &fsfile);      }       if(uip_appdata[4] == ISO_slash &&	 uip_appdata[5] == ISO_c &&	 uip_appdata[6] == ISO_g &&	 uip_appdata[7] == ISO_i &&	 uip_appdata[8] == ISO_slash) {	/* If the request is for a file that starts with "/cgi/", we           prepare for invoking a script. */		hs->script = fsfile.data;	next_scriptstate();      } else {	hs->script = NULL;	/* The web server is now no longer in the HTTP_NOGET state, but	   in the HTTP_FILE state since is has now got the GET from	   the client and will start transmitting the file. */	hs->state = HTTP_FILE;	/* Point the file pointers in the connection state to point to	   the first byte of the file. */	hs->dataptr = fsfile.data;	hs->count = fsfile.len;	      }         }        if(hs->state != HTTP_FUNC) {      /* Check if the client (remote end) has acknowledged any data that	 we've previously sent. If so, we move the file pointer further	 into the file and send back more data. If we are out of data to	 send, we close the connection. */      if(uip_acked()) {		if(hs->count >= uip_mss()) {	  hs->count -= uip_mss();	  hs->dataptr += uip_mss();	} else {	  hs->count = 0;	}		if(hs->count == 0) {	  if(hs->script != NULL) {	    next_scriptline();	    next_scriptstate();	  } else {	    uip_close();	  }	}      }             }        if(hs->state == HTTP_FUNC) {      /* Call the CGI function. */      if(cgitab[hs->script[2] - ISO_a]()) {	/* If the function returns non-zero, we jump to the next line           in the script. */	next_scriptline();	next_scriptstate();      }    }    if(hs->state != HTTP_FUNC && !uip_poll()) {      /* Send a piece of data, but not more than the MSS of the	 connection. */      uip_send(hs->dataptr,	       hs->count > uip_mss()? uip_mss(): hs->count);    }    /* Finally, return to uIP. Our outgoing packet will soon be on its       way... */    return;  default:    /* Should never happen. */    uip_abort();    break;  }  }/*-----------------------------------------------------------------------------------*//* next_scriptline(): * * Reads the script until it finds a newline. */static voidnext_scriptline(void){  /* Loop until we find a newline character. */  do {    ++(hs->script);  } while(hs->script[0] != ISO_nl);  /* Eat up the newline as well. */  ++(hs->script);}/*-----------------------------------------------------------------------------------*//* next_sciptstate: * * Reads one line of script and decides what to do next. */static voidnext_scriptstate(void){  struct fs_file fsfile;  u8_t i; again:  switch(hs->script[0]) {  case ISO_t:    /* Send a text string. */    hs->state = HTTP_TEXT;    hs->dataptr = &hs->script[2];    /* Calculate length of string. */    for(i = 0; hs->dataptr[i] != ISO_nl; ++i);    hs->count = i;        break;  case ISO_c:    /* Call a function. */    hs->state = HTTP_FUNC;    hs->dataptr = NULL;    hs->count = 0;    uip_reset_acked();    break;  case ISO_i:       /* Include a file. */    hs->state = HTTP_FILE;    if(!fs_open(&hs->script[2], &fsfile)) {      uip_abort();    }    hs->dataptr = fsfile.data;    hs->count = fsfile.len;    break;  case ISO_hash:    /* Comment line. */    next_scriptline();    goto again;    break;  case ISO_period:    /* End of script. */    hs->state = HTTP_END;    uip_close();    break;  default:    uip_abort();    break;  }}/*-----------------------------------------------------------------------------------*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区视频在线播放| 色成年激情久久综合| 国产精品影音先锋| 欧美成人性福生活免费看| 久久久www成人免费无遮挡大片| 亚洲一区二区影院| 精品福利二区三区| 在线视频一区二区三区| 亚洲第一精品在线| 男女视频一区二区| 中文字幕在线免费不卡| 亚洲第一福利一区| 欧美一二三四区在线| 色94色欧美sute亚洲线路一ni | 午夜日韩在线观看| 亚洲成人av中文| 玖玖九九国产精品| 91在线播放网址| 日韩一区二区不卡| 中文字幕日韩一区二区| 免费一级片91| 在线视频综合导航| 国产午夜精品久久久久久免费视| 亚洲少妇中出一区| 久久99热国产| 91极品视觉盛宴| 91精品国产一区二区三区香蕉 | 欧美伦理影视网| 亚洲人成人一区二区在线观看| 另类调教123区| 波波电影院一区二区三区| 91精品国产高清一区二区三区蜜臀| 国产精品你懂的在线| 久久av中文字幕片| 欧美日韩在线播放| 久久精品亚洲精品国产欧美| 日韩电影在线一区二区| 成人黄色免费短视频| 精品久久久久久久久久久久包黑料 | 国产三级久久久| 另类的小说在线视频另类成人小视频在线 | 国产欧美日产一区| 男女性色大片免费观看一区二区 | 亚洲国产一区二区三区青草影视| va亚洲va日韩不卡在线观看| 久久精品一区二区三区av| 蜜桃视频一区二区三区在线观看| 日本道色综合久久| 久久视频一区二区| 国产成人亚洲综合a∨猫咪 | 国产一区二区导航在线播放| 色婷婷av一区二区三区gif | 欧美xxxxxxxx| 老司机一区二区| 日韩一区二区三区四区五区六区| 国产精品女同一区二区三区| 激情综合网av| 久久久噜噜噜久噜久久综合| 精品一区二区国语对白| 精品国产一区二区亚洲人成毛片 | 日本欧洲一区二区| 欧美日韩精品一区视频| 亚洲国产人成综合网站| 色天使色偷偷av一区二区| 一区二区在线观看av| 99九九99九九九视频精品| 久久国产精品72免费观看| 亚洲欧美在线视频观看| 国产偷v国产偷v亚洲高清| 日韩一区二区免费电影| 精品国产乱码久久久久久1区2区 | 在线免费观看一区| 欧美日韩在线免费视频| 欧美偷拍一区二区| 欧美丰满一区二区免费视频| 欧美一区二区观看视频| 色天天综合色天天久久| 欧美一级搡bbbb搡bbbb| 国产欧美一区二区精品秋霞影院 | 99国产精品国产精品久久| 自拍偷拍欧美激情| 91久久人澡人人添人人爽欧美| 韩国成人在线视频| 日韩电影免费在线| 91精品国产综合久久蜜臀| 亚洲久本草在线中文字幕| 欧美在线一二三| 麻豆精品在线播放| 国产精品午夜免费| 91精品国产乱码久久蜜臀| 国产一区二区不卡| 有码一区二区三区| 26uuu精品一区二区| 国产一区二区精品久久99| 色狠狠色噜噜噜综合网| 一区二区三区中文在线| 日本韩国一区二区三区视频| 亚洲成在人线免费| 欧美日韩在线播放| 国产女主播一区| 国产精品一区二区不卡| 欧美一区二区视频观看视频| 亚洲超丰满肉感bbw| 欧美电影在哪看比较好| 99久久精品免费看国产免费软件| 99久久久精品免费观看国产蜜| 亚洲亚洲人成综合网络| 欧美精三区欧美精三区| 91久久精品日日躁夜夜躁欧美| 国内精品不卡在线| 婷婷综合五月天| 亚洲一区二区在线播放相泽| 亚洲私人黄色宅男| 欧美激情一区二区三区全黄| 日韩视频一区二区三区在线播放 | 日韩精品中文字幕在线不卡尤物| 欧美三级电影在线看| 91在线国产观看| 成人毛片视频在线观看| 麻豆精品在线观看| 狠狠色2019综合网| 久久电影网电视剧免费观看| 九色综合国产一区二区三区| 精品一区二区三区欧美| 精油按摩中文字幕久久| 精品一区二区在线观看| 国产一区二区在线电影| 欧美三级一区二区| 色婷婷综合久久久| 欧美极品xxx| 久久精品一区二区三区不卡| 国产日产欧产精品推荐色| 欧美激情在线一区二区| 日韩精品一区二区三区视频在线观看| 91精品国产一区二区人妖| 欧美性色aⅴ视频一区日韩精品| www.视频一区| 色又黄又爽网站www久久| 色综合天天综合狠狠| 一本一道久久a久久精品综合蜜臀| 一道本成人在线| 欧美日韩的一区二区| 日韩亚洲欧美中文三级| 久久久蜜桃精品| 亚洲精品免费电影| 午夜久久久久久| 激情综合网av| 91色在线porny| 欧美丰满一区二区免费视频 | 色综合久久久久| 7799精品视频| 久久久久97国产精华液好用吗| 国产精品福利在线播放| 国产在线视频不卡二| 国产综合成人久久大片91| 国产精品一区不卡| 欧美视频完全免费看| 精品成a人在线观看| 国产精品久久久久久久久免费丝袜| 亚洲三级久久久| 激情久久五月天| 色婷婷av久久久久久久| 亚洲精品一区二区精华| 成人免费一区二区三区视频| 日本va欧美va精品| 色综合天天综合网天天看片| 精品国产91乱码一区二区三区 | 国产在线视频不卡二| 97se狠狠狠综合亚洲狠狠| 久久精品夜色噜噜亚洲aⅴ| 爽爽淫人综合网网站| 欧美日本韩国一区二区三区视频 | 日韩欧美的一区| 欧美激情一二三区| 日韩国产一二三区| 99久久综合国产精品| 麻豆精品在线视频| 国产成人av资源| 成人av集中营| 久久综合五月天婷婷伊人| 亚洲免费av观看| 国产一区二区三区综合| 欧美一区二区三区啪啪| 国产精品美女一区二区| 国产一区二区三区av电影| 91色综合久久久久婷婷| 国产精品无人区| 国产成人精品免费看| 精品少妇一区二区三区日产乱码 | 福利91精品一区二区三区| 欧美一区二区精品久久911| 成+人+亚洲+综合天堂| 色素色在线综合| 欧美日韩在线精品一区二区三区激情 | 青青草精品视频| 国产欧美精品区一区二区三区 | 在线影视一区二区三区| 日韩欧美你懂的| 男男视频亚洲欧美| 7777精品伊人久久久大香线蕉经典版下载|