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

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

?? httpd.sgml

?? 嵌入式操作系統ECOS的網絡開發包
?? SGML
?? 第 1 頁 / 共 2 頁
字號:

<!-- =============================================================== -->
<!--                                                                 -->
<!--     httpd.sgml                                                  -->
<!--                                                                 -->
<!--     eCos HTTP Server                                            -->
<!--                                                                 -->
<!-- =============================================================== -->
<!-- ####COPYRIGHTBEGIN####                                          -->
<!--                                                                 -->
<!-- =============================================================== -->
<!-- Copyright (C) 2002 Nick Garnett                                 -->
<!-- This material may be distributed only subject to the terms      -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- or later (the latest version is presently available at          -->
<!-- http://www.opencontent.org/openpub/)                            -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- permission obtained from the copyright holder                   -->
<!-- =============================================================== -->
<!--                                                                 -->      
<!-- ####COPYRIGHTEND####                                            -->
<!-- =============================================================== -->
<!-- #####DESCRIPTIONBEGIN####                                       -->
<!--                                                                 -->
<!-- ####DESCRIPTIONEND####                                          -->
<!-- =============================================================== -->

<part id="net-httpd">
<title>Embedded HTTP Server</title>
<chapter id="net-httpd-chapter">
<title>Embedded HTTP Server</title>

<sect1 id="net-httpd-intro">
<title>Intrduction</title>
<para>
The <emphasis>eCos</emphasis> HTTPD package provides a simple HTTP
server for use with applications in eCos. This server is specifically
aimed at the remote control and monitoring requirements of embedded
applications. For this reason the emphasis is on dynamically generated
content, simple forms handling and a basic CGI interface. It is
<emphasis>not</emphasis> intended to be a general purpose server for
delivering arbitrary web content. For these purposes a port of the
GoAhead web server is available from <ulink
url="www.goahead.com">www.goahead.com</ulink>.
</para>
</sect1>

<sect1 id="net-httpd-organization">
<title>Server Organization</title>
<para>
The server consists of one or more threads running in parallel to any
application threads and which serve web pages to clients. Apart from
defining content, the application does not need to do anything to
start the HTTP server.
</para>
<para>
The HTTP server is started by a static constructor. This simply
creates an initial thread and sets it running. Since this is called
before the scheduler is started, nothing will happen until the
application calls <function>cyg_scheduler_start()</function>.
</para>
<para>
When the thread gets to run it first optionally delays for some period
of time. This is to allow the application to perform any
initialization free of any interference from the HTTP server. When the
thread does finally run it creates a socket, binds it to the HTTP
server port, and puts it into listen mode. It will then create any
additional HTTPD server threads that have been configured before
becoming a server thread itself.
</para>
<para>
Each HTTPD server thread simply waits for a connection to be made to
the server port. When the connection is made it reads the HTTP request
and extracts the filename being accessed. If the request also contains
form data, this is also preserved. The filename is then looked up in a
table.
</para>
<para>
Each table entry contains a filename pattern string, a
pointer to a handler function, and a user defined argument for the
function. Table entries are defined using the same link-time table
building mechanism used to generate device tables. This is all handled
by the <literal>CYG_HTTPD_TABLE_ENTRY()</literal> macro which has the
following format:
</para>
<programlisting width=72>

#include &lt;cyg/httpd/httpd.h&gt;

CYG_HTTPD_TABLE_ENTRY( __name, __pattern, __handler, __arg )

</programlisting>
<para>
The <parameter>__name</parameter> argument is a variable name for the
table entry since C does not allow us to define anonymous data
structures. This name should be chosen so that it is unique and does
not pollute the name space. The <parameter>__pattern</parameter>
argument is the match pattern. The <parameter>__handler</parameter>
argument is a pointer to the handler function and
<parameter>__arg</parameter> the user defined value.
</para>
<para>
The link-time table building means that several different pieces of
code can define server table entries, and so long as the patterns do
not clash they can be totally oblivious of each other. However, note
also that this mechanism does not guarantee the order in which entries
appear, this depends on the order of object files in the link, which
could vary from one build to the next. So any tricky pattern matching
that relies on this may not always work.
</para>
<para>
A request filename matches an entry in the table if either it exactly
matches the pattern string, or if the pattern ends in an asterisk, and
it matches everything up to that point. So for example the pattern
&quot;/monitor/threads.html&quot; will only match that exact filename,
but the pattern &quot;/monitor/thread-*&quot; will match
&quot;/monitor/thread-0040.html&quot;,
&quot;/monitor/thread-0100.html&quot; and any other filename starting
with &quot;/monitor/thread-&quot;.
</para>
<para>
When a pattern is matched, the hander function is called. It has the
following prototype:
</para>
<programlisting width=72>
cyg_bool cyg_httpd_handler(FILE *client,
                           char *filename,
                           char *formdata,
                           void *arg);
</programlisting>
<para>
The <parameter>client</parameter> argument is the TCP connection to
the client: anything output through this stream will be returned to
the browser. The <parameter>filename</parameter> argument is the
filename from the HTTP request and the <parameter>formdata</parameter>
argument is any form response data, or NULL if none was sent. The
<parameter>arg</parameter> argument is the user defined value from the
table entry.
</para>
<para>
The handler is entirely responsible for generating the response to the
client, both HTTP header and content. If the handler decides that it
does not want to generate a response it can return
<literal>false</literal>, in which case the table scan is resumed for
another match. If no match is found, or no handler returns true, then
a default response page is generated indicating that the requested
page cannot be found.
</para>
<para>
Finally, the server thread closes the connection to the client and
loops back to accept a new connection.
</para>
</sect1>

<!-- =============================================================== -->

<sect1 id="net-httpd-configuration">
<title>Server Configuration</title>
<para>
The HTTP server has a number of configuration options:
</para>

<sect2>
<title><literal>CYGNUM_HTTPD_SERVER_PORT</literal></title>
<para>
This option defines the TCP port that the server will listen on. It
defaults to the standard HTTP port number 80. It may be changed to a
different number if, for example, another HTTP server is using the
main HTTP port.
</para>
</sect2>

<sect2>
<title><literal>CYGDAT_HTTPD_SERVER_ID</literal></title>
<para>
This is the string that is reported to the client in the
&quot;Server:&quot; field of the HTTP header. 
</para>
</sect2>

<sect2>
<title><literal>CYGNUM_HTTPD_THREAD_COUNT</literal></title>
<para>
The HTTP server can be configured to use more than one thread to
service HTTP requests. If you expect to serve complex pages with many
images or other components that are fetched separately, or if any
pages may take a long time to send, then it may be useful to increase
the number of server threads. For most uses, however, the connection
queuing in the TCP/IP stack and the speed with which each page is
generated, means that a single thread is usually adequate.
</para>
</sect2>

<sect2>
<title><literal>CYGNUM_HTTPD_THREAD_PRIORITY</literal></title>
<para>
The HTTP server threads can be run at any priority. The exact priority
depends on the importance of the server relative to the rest of the
system. The default is to put them in the middle of the priority range
to provide reasonable response without impacting genuine high priority
threads.
</para>
</sect2>

<sect2>
<title><literal>CYGNUM_HTTPD_THREAD_STACK_SIZE</literal></title>
<para>
This is the amount of stack to be allocated for each of the HTTPD
threads. The actual stack size allocated will be this value plus the
values of <literal>CYGNUM_HAL_STACK_SIZE_MINIMUM</literal> and
<literal>CYGNUM_HTTPD_SERVER_BUFFER_SIZE</literal>.
</para>
</sect2>

<sect2>
<title><literal>CYGNUM_HTTPD_SERVER_BUFFER_SIZE</literal></title>
<para>
This defines the size of the buffer used to receive the first line of
each HTTP request. If you expect to use particularly long URLs or have
very complex forms, this should be increased.
</para>
</sect2>

<sect2>
<title><literal>CYGNUM_HTTPD_SERVER_DELAY</literal></title>
<para>
This defines the number of system clock ticks that the HTTP server
will wait before initializing itself and spawning any extra server
threads. This is to give the application a chance to initialize
properly without any interference from the HTTPD.
</para>
</sect2>

</sect1>

<!-- =============================================================== -->

<sect1 id="net-httpd-html">
<title>Support Functions and Macros</title>
<para>
The emphasis of this server is on dynamically generated content,
rather than fetching it from a filesystem. To do this the handler
functions make calls to <function>fprintf()</function> and
<function>fputs()</function>. Such handler functions would end up a
mass of print calls, with the actual structure of the HTML page hidden
in the format strings and arguments, making maintenance and debugging
very difficult. Such an approach would also result in the definition
of many, often only slightly different, format strings, leading to
unnecessary bloat.
</para>
<para>
In an effort to expose the structure of the HTML in the structure of
the C code, and to maximize the sharing of string constants, the
<filename>cyg/httpd/httpd.h</filename> header file defines a set of
helper functions and macros. Most of these are wrappers for predefined
print calls on the <parameter>client</parameter> stream passed to the
hander function. For examples of their use, see the System Monitor
example.
</para>
<note>
<para>
All arguments to macros are pointers to strings, unless otherwise
stated. In general, wherever a function or macro has an
<parameter>attr</parameter> or <parameter>__attr</parameter>
parameter, then the contents of this string will be inserted into the
tag being defined as HTML attributes. If it is a NULL or empty string

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天天影视色香欲综合网老头| 日韩精品一级二级| 日韩一区二区三区在线视频| 日韩精品一区二区三区视频播放| 欧美精品电影在线播放| 337p粉嫩大胆噜噜噜噜噜91av | 色94色欧美sute亚洲13| av一区二区三区| 欧美日韩在线一区二区| 久久日韩粉嫩一区二区三区| 中文字幕二三区不卡| 五月天欧美精品| 丁香婷婷综合网| 欧美老女人第四色| 欧美国产欧美亚州国产日韩mv天天看完整 | 亚洲chinese男男1069| 舔着乳尖日韩一区| 经典三级一区二区| 欧美日韩一区二区三区在线| 久久五月婷婷丁香社区| 亚洲地区一二三色| 97久久超碰国产精品电影| 精品乱人伦小说| 亚洲一线二线三线视频| 成人伦理片在线| 欧美一区二区视频观看视频| 亚洲图片另类小说| 福利91精品一区二区三区| 7777精品伊人久久久大香线蕉| 国产精品久久影院| 国产黑丝在线一区二区三区| 在线91免费看| 亚洲动漫第一页| 日本韩国欧美一区| 国产精品久久久久影院老司| 国产麻豆精品一区二区| 日韩午夜在线播放| 亚洲综合另类小说| 国产精品911| 久久久国产精品麻豆| 久久国内精品视频| 欧美xxxx在线观看| 麻豆精品视频在线观看视频| 欧美精品在线视频| 五月婷婷久久丁香| 在线观看91视频| 亚洲最新在线观看| 欧美日韩视频在线一区二区| 亚洲欧美日韩国产手机在线| 99久久99久久精品免费看蜜桃| 久久久青草青青国产亚洲免观| 久久av资源网| 欧美tickling挠脚心丨vk| 亚洲第一福利一区| 欧美精品电影在线播放| 日本欧美在线观看| 日韩三级在线观看| 国产最新精品免费| 国产三级精品视频| av欧美精品.com| 亚洲乱码精品一二三四区日韩在线| 不卡一区二区在线| 亚洲欧美日韩小说| 欧美日韩视频在线第一区 | 91超碰这里只有精品国产| 丝袜亚洲另类欧美| 日韩小视频在线观看专区| 蜜臀久久久久久久| 久久久精品日韩欧美| 国产成人免费9x9x人网站视频| 中文字幕乱码日本亚洲一区二区| 久久超碰97人人做人人爱| 久久影院电视剧免费观看| 国产成人啪免费观看软件| 国产精品久久久久久福利一牛影视 | 亚洲国产色一区| 日韩视频123| 成人美女在线观看| 午夜亚洲福利老司机| 欧美精品粉嫩高潮一区二区| 精品一区二区三区在线播放 | 亚洲成人动漫av| www久久久久| 色哟哟精品一区| 日本sm残虐另类| 欧美国产乱子伦| 欧美性色欧美a在线播放| 日本欧美在线看| 日本一区二区三区视频视频| 国产激情视频一区二区在线观看 | 亚洲成人动漫在线免费观看| 精品国产百合女同互慰| 97国产精品videossex| 日本成人中文字幕| 欧美激情在线看| 欧美一区二区三区影视| 波多野结衣欧美| 奇米影视一区二区三区小说| 中文文精品字幕一区二区| 欧美男同性恋视频网站| 国产丶欧美丶日本不卡视频| 亚洲国产美女搞黄色| 国产欧美一区二区精品性色| 欧美日韩成人一区| 91免费观看视频在线| 国产一区二区三区最好精华液| 欧美激情一区二区三区不卡| 91亚洲资源网| 国产精品乡下勾搭老头1| 亚洲成人免费av| 亚洲免费在线播放| 精品久久久久久久久久久久久久久| 91黄视频在线观看| 久久97超碰国产精品超碰| 一区二区三区日韩| 国产精品久久影院| 国产午夜一区二区三区| 日韩视频一区在线观看| 欧美日韩中文字幕精品| 色悠悠亚洲一区二区| 成人av小说网| 国产很黄免费观看久久| 国内精品久久久久影院一蜜桃| 亚洲成a人v欧美综合天堂下载| 亚洲人妖av一区二区| 日韩欧美一二三| 91精品福利在线一区二区三区| 91官网在线观看| 日本高清无吗v一区| 99精品欧美一区二区三区小说 | 国产一区免费电影| 同产精品九九九| 亚洲va欧美va天堂v国产综合| 亚洲欧美激情视频在线观看一区二区三区 | 91在线免费视频观看| 大尺度一区二区| 国产激情偷乱视频一区二区三区 | 蜜臀va亚洲va欧美va天堂 | 久久久久久久久久久黄色| 精品少妇一区二区三区视频免付费 | 久久先锋影音av| 中文字幕一区二区在线观看| 亚洲激情自拍视频| 免费在线看成人av| 国产91精品露脸国语对白| 在线观看视频一区| 精品电影一区二区| 亚洲欧美日韩在线不卡| 久久精品国产亚洲一区二区三区| 国产精品一区二区久久精品爱涩| 99re6这里只有精品视频在线观看| 欧美三电影在线| 欧美国产成人在线| 午夜亚洲福利老司机| 高清国产午夜精品久久久久久| 欧美体内she精高潮| 久久综合狠狠综合久久综合88 | 国产性色一区二区| 亚洲国产va精品久久久不卡综合| 国产一区二区三区精品视频| 91一区二区在线| 久久亚洲精华国产精华液| 亚洲综合999| 国产成人啪午夜精品网站男同| 欧美区在线观看| 亚洲欧美日韩中文播放| 国产曰批免费观看久久久| 欧美三级日韩三级国产三级| 国产亚洲福利社区一区| 日韩av一二三| 欧美在线高清视频| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 国产精品久久99| 麻豆91在线看| 777色狠狠一区二区三区| 亚洲欧美日韩国产另类专区 | 国产日产亚洲精品系列| 三级亚洲高清视频| 欧美性猛交xxxx乱大交退制版| 国产婷婷色一区二区三区| 另类成人小视频在线| 欧美日韩亚洲不卡| 亚洲综合色在线| 色欧美片视频在线观看| 国产精品美女久久久久高潮| 久久狠狠亚洲综合| 日韩午夜av电影| 免费成人在线影院| 欧美一区欧美二区| 香蕉久久夜色精品国产使用方法 | 国产精品99久久久久久宅男| 欧美一区二区三区在线电影| 亚洲成a天堂v人片| 欧美日韩国产另类不卡| 亚洲综合久久av| 欧美男同性恋视频网站| 丝袜亚洲另类欧美综合| 欧美老肥妇做.爰bbww| 香蕉av福利精品导航| 欧美精品国产精品|