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

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

?? httpd.sgml

?? 嵌入式操作系統(tǒng)ECOS的網(wǎng)絡(luò)開發(fā)包
?? SGML
?? 第 1 頁 / 共 2 頁
字號(hào):

<!-- =============================================================== -->
<!--                                                                 -->
<!--     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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一二区| 一本色道亚洲精品aⅴ| 欧美日韩一级二级三级| 亚洲国产高清不卡| 美女任你摸久久| 色国产精品一区在线观看| 国产性色一区二区| 强制捆绑调教一区二区| 91成人在线精品| 国产精品久久久久一区| 韩国精品一区二区| 91麻豆精品91久久久久同性| 亚洲人精品午夜| 国产成人超碰人人澡人人澡| 日韩免费高清视频| 日韩av在线发布| 欧美在线观看18| 亚洲少妇30p| 成人午夜伦理影院| 久久奇米777| 久久精品国产久精国产爱| 欧美日韩的一区二区| 亚洲精品一二三| 99在线视频精品| 日韩一区日韩二区| 成人av电影在线| 国产欧美一二三区| 国产精品资源站在线| 日韩欧美国产三级| 免费黄网站欧美| 欧美一卡二卡三卡四卡| 日韩电影在线一区二区| 在线不卡的av| 日韩国产欧美视频| 91精品婷婷国产综合久久竹菊| 亚洲一区二区三区三| 在线免费观看日韩欧美| 亚洲综合激情网| 欧美日韩国产免费一区二区| 亚洲午夜久久久久久久久电影网 | 最新中文字幕一区二区三区 | 免费成人在线观看| 欧美电影在哪看比较好| 首页综合国产亚洲丝袜| 7777精品伊人久久久大香线蕉完整版| 亚洲成a人v欧美综合天堂| 欧美日韩和欧美的一区二区| 亚洲.国产.中文慕字在线| 欧美日韩综合在线免费观看| 午夜国产不卡在线观看视频| 91麻豆精品国产91久久久久久 | 亚洲福利视频导航| 欧美日韩国产综合一区二区| 午夜视频一区二区| 日韩精品电影在线观看| 91麻豆精品国产综合久久久久久| 日韩国产精品大片| 日韩美女视频在线| 国产很黄免费观看久久| 欧美国产乱子伦| 91女厕偷拍女厕偷拍高清| 一区二区三区四区国产精品| 欧美三区在线视频| 麻豆精品在线观看| 久久久不卡影院| 成人性生交大片免费看中文| 亚洲欧美激情一区二区| 欧美日韩国产一级片| 精品一区二区三区在线观看 | 欧美日韩一区视频| 久久国产精品99久久人人澡| 国产午夜精品美女毛片视频| 91在线云播放| 丝瓜av网站精品一区二区| 久久婷婷综合激情| 91在线视频免费91| 午夜精品久久久久久久99水蜜桃 | 精品日韩一区二区三区| 国产精品一区二区视频| 亚洲欧美日韩中文字幕一区二区三区 | 亚洲黄色免费网站| 日韩欧美国产三级| 99re这里只有精品首页| 午夜精品久久久久久久久久| 国产亚洲综合在线| 欧美日韩综合一区| 国产成人精品www牛牛影视| 亚洲一区二区三区视频在线播放| 欧美一级精品在线| 成人免费看的视频| 污片在线观看一区二区| 国产欧美在线观看一区| 欧美日韩国产中文| 国产福利一区二区| 五月天久久比比资源色| 国产欧美日韩精品在线| 欧美片网站yy| 成人精品视频一区二区三区| 五月天激情综合网| 中文字幕在线不卡视频| 欧美一区二区三区日韩| 99精品欧美一区二区蜜桃免费 | 亚洲成av人片www| 亚洲国产精品99久久久久久久久| 欧美日韩免费一区二区三区| 国产成人综合精品三级| 视频一区二区三区在线| 国产精品毛片高清在线完整版| 欧美一区二区三区思思人| 色哟哟一区二区在线观看| 国产原创一区二区| 亚洲va韩国va欧美va精品| 国产精品乱子久久久久| 欧美v亚洲v综合ⅴ国产v| 在线亚洲欧美专区二区| 国产精品69毛片高清亚洲| 偷窥少妇高潮呻吟av久久免费 | 51午夜精品国产| 91视频www| 国产成人在线视频免费播放| 奇米影视在线99精品| 亚洲综合激情小说| 91视频在线看| 国产99久久久国产精品免费看| 免费在线一区观看| 亚洲国产一区二区视频| 国产精品欧美综合在线| 久久久久久电影| 日韩亚洲欧美综合| 欧美日韩国产片| 色视频成人在线观看免| 春色校园综合激情亚洲| 激情综合色综合久久综合| 日韩高清在线不卡| 亚洲一区影音先锋| 亚洲欧美日韩国产一区二区三区| 久久久精品tv| 精品国产在天天线2019| 日韩精品一区二区三区蜜臀 | 欧美日韩国产首页| 色噜噜偷拍精品综合在线| 成年人午夜久久久| 风流少妇一区二区| 国产精品123区| 激情久久五月天| 精品一区中文字幕| 麻豆视频观看网址久久| 日日骚欧美日韩| 天天射综合影视| 日韩激情中文字幕| 午夜不卡av免费| 午夜av区久久| 日本免费在线视频不卡一不卡二| 亚洲成人免费电影| 日韩电影在线一区| 丝袜国产日韩另类美女| 日韩精品电影在线观看| 免播放器亚洲一区| 男女性色大片免费观看一区二区| 午夜精品一区在线观看| 五月婷婷久久综合| 日韩va欧美va亚洲va久久| 秋霞午夜av一区二区三区| 免费成人在线播放| 国产一区二区三区黄视频| 国产成人一区在线| 成人福利视频网站| 色综合色狠狠综合色| 欧美伊人精品成人久久综合97| 91官网在线观看| 欧美日韩高清一区二区三区| 欧美猛男超大videosgay| 717成人午夜免费福利电影| 欧美一区二区观看视频| 日韩欧美一级特黄在线播放| 精品捆绑美女sm三区| 久久久久久久久99精品| 中文字幕亚洲不卡| 亚洲国产精品久久久男人的天堂 | 国产精品久久久久影院色老大 | 国产精品久久久久影院色老大| 亚洲欧洲99久久| 亚洲免费在线视频| 午夜精品久久久久久久蜜桃app| 美腿丝袜一区二区三区| 国产sm精品调教视频网站| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美中文字幕不卡| 日韩女优制服丝袜电影| 欧美国产亚洲另类动漫| 亚洲精品你懂的| 日本成人在线一区| 国产高清精品在线| 欧美中文字幕亚洲一区二区va在线 | 99久久精品免费看| 3d成人动漫网站| 久久精品这里都是精品| 欧美亚洲综合网| 欧美电视剧免费全集观看| 国产精品亲子乱子伦xxxx裸|