You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bu...@apache.org on 2012/06/15 23:15:07 UTC
svn commit: r821932 - in /websites/staging/trafficserver/trunk/content: ./
docs/trunk/sdk/continuations/writing-handler-functions.en.html
Author: buildbot
Date: Fri Jun 15 21:15:06 2012
New Revision: 821932
Log:
Staging update by buildbot for tserver
Modified:
websites/staging/trafficserver/trunk/content/ (props changed)
websites/staging/trafficserver/trunk/content/docs/trunk/sdk/continuations/writing-handler-functions.en.html
Propchange: websites/staging/trafficserver/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Jun 15 21:15:06 2012
@@ -1 +1 @@
-1350801
+1350802
Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/continuations/writing-handler-functions.en.html
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/continuations/writing-handler-functions.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/continuations/writing-handler-functions.en.html Fri Jun 15 21:15:06 2012
@@ -58,17 +58,17 @@
<div class="row content">
<div class="eightcol">
<div id="content">
- <p>The handler function is the key component of a continuation. It is supposed
-to examine the event and event data, and then do something appropriate. The
-probable action might be to schedule another event for the continuation to
-received, to open up a connection to a server, or simply to destroy itself. </p>
-<p>The continuation's handler function is a function of type <code>TSEventFunc</code>. Its
-arguments are a continuation, an event, and a pointer to some data (this data
-is passed to the continuation by the caller - do not confuse this data with
-the continuation's own data, associated by <code>TSContDataSet</code>). When the continuation
-is called back, the continuation and an event are passed to the handler function.
-The continuation is a handle to the same continuation that is invoked. The
-handler function typically has a switch statement to handle the events it receives: </p>
+ <p>The handler function is the key component of a continuation. It is supposed
+to examine the event and event data, and then do something appropriate. The
+probable action might be to schedule another event for the continuation to
+received, to open up a connection to a server, or simply to destroy itself.</p>
+<p>The continuation's handler function is a function of type <code>TSEventFunc</code>. Its
+arguments are a continuation, an event, and a pointer to some data (this data
+is passed to the continuation by the caller - do not confuse this data with
+the continuation's own data, associated by <code>TSContDataSet</code>). When the continuation
+is called back, the continuation and an event are passed to the handler function.
+The continuation is a handle to the same continuation that is invoked. The
+handler function typically has a switch statement to handle the events it receives:</p>
<div class="codehilite"><pre> <span class="k">static</span> <span class="kt">int</span> <span class="nf">some_handler</span> <span class="p">(</span><span class="n">TScont</span> <span class="n">contp</span><span class="p">,</span> <span class="n">TSEvent</span> <span class="n">event</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">edata</span><span class="p">)</span>
<span class="p">{</span>
<span class="p">.....</span>
@@ -90,185 +90,51 @@ handler function typically has a switch
<p><img alt="[Caution]" src="/images/docbook/caution.png" /></p>
-<p><strong>Caution</strong> </p>
-<p>You might notice that a continuation cannot determine if more events are "in
-flight" toward it. Do not use <code>TSContDestroy</code> to delete a continuation before
-you make sure that all incoming events, such as those sent because of <code>TSHttpTxnHookAdd</code>,
+<p><strong>Caution</strong></p>
+<p>You might notice that a continuation cannot determine if more events are "in
+flight" toward it. Do not use <code>TSContDestroy</code> to delete a continuation before
+you make sure that all incoming events, such as those sent because of <code>TSHttpTxnHookAdd</code>,
have been handled.</p>
-<p>The following table lists events and the corresponding type of <code>void *</code>data
+<p>The following table lists events and the corresponding type of <code>void *</code>data
passed to handler functions:</p>
-<dl>
-<dt><code>TS_EVENT_HTTP_READ_REQUEST_HDR</code></dt>
-<dd><code>TS_HTTP_READ_REQUEST_HDR_HOOK</code></dd>
-<dd><code>TSHttpTxn</code></dd>
-<dt><code>TS_EVENT_HTTP_OS_DNS</code></dt>
-<dd><code>TS_HTTP_OS_DNS_HOOK</code></dd>
-<dd><code>TSHttpTxn</code></dd>
-<dt><code>TS_EVENT_HTTP_SEND_REQUEST_HDR</code></dt>
-<dd><code>TS_HTTP_SEND_REQUEST_HDR_HOOK</code></dd>
-<dd><code>TSHttpTxn</code></dd>
-<dt><code>TS_EVENT_HTTP_READ_CACHE_HDR</code></dt>
-<dd><code>TS_HTTP_READ_CACHE_HDR_HOOK</code></dd>
-<dd><code>TSHttpTxn</code></dd>
-<dt><code>TS_EVENT_HTTP_READ_RESPONSE_HDR</code></dt>
-<dd><code>TS_HTTP_READ_RESPONSE_HDR_HOOK</code></dd>
-<dd><code>TSHttpTxn</code></dd>
-<dt><code>TS_EVENT_HTTP_SEND_RESPONSE_HDR</code></dt>
-<dd><code>TS_HTTP_SEND_RESPONSE_HDR_HOOK</code></dd>
-<dd><code>TSHttpTxn</code></dd>
-<dt><code>TS_EVENT_HTTP_SELECT_ALT</code></dt>
-<dd><code>TS_HTTP_SELECT_ALT_HOOK</code></dd>
-<dd><code>TSHttpTxn</code></dd>
-<dt><code>TS_EVENT_HTTP_TXN_START</code></dt>
-<dd><code>TS_HTTP_TXN_START_HOOK</code></dd>
-<dd><code>TSHttpTxn</code></dd>
-<dt><code>TS_EVENT_HTTP_TXN_CLOSE</code></dt>
-<dd><code>TS_HTTP_TXN_CLOSE_HOOK</code></dd>
-<dd><code>TSHttpTxn</code></dd>
-<dt><code>TS_EVENT_HTTP_SSN_START</code></dt>
-<dd><code>TS_HTTP_SSN_START_HOOK</code></dd>
-<dd><code>TSHttpSsn</code></dd>
-<dt><code>TS_EVENT_HTTP_SSN_CLOSE</code></dt>
-<dd><code>TS_HTTP_SSN_CLOSE_HOOK</code></dd>
-<dd><code>TSHttpSsn</code></dd>
-<dt><code>TS_EVENT_NONE</code></dt>
-<dd><code></code></dd>
-<dd><code></code></dd>
-<dt><code>TS_EVENT_CACHE_LOOKUP_COMPLETE</code></dt>
-<dd><code>TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK</code></dd>
-<dd><code>TSHttpTxn</code></dd>
-<dt><code>TS_EVENT_IMMEDIATE</code></dt>
-<dd><code>TSVConnClose, TSVIOReenable, TSContSchedule</code></dd>
-<dd><code></code></dd>
-<dt><code>TS_EVENT_IMMEDIATE</code></dt>
-<dd><code>TS_HTTP_REQUEST_TRANSFORM_HOOK</code></dd>
-<dd><code></code></dd>
-<dt><code>TS_EVENT_IMMEDIATE</code></dt>
-<dd><code>TS_HTTP_RESPONSE_TRANSFORM_HOOK</code></dd>
-<dd><code></code></dd>
-<dt><code>TS_EVENT_CACHE_OPEN_READ</code></dt>
-<dd><code>TSCacheRead</code></dd>
-<dd>Cache VC</dd>
-<dt><code>TS_EVENT_CACHE_OPEN_READ_FAILED</code></dt>
-<dd><code>TSCacheRead</code></dd>
-<dd>Error code, see <code>TS_CACHE_ERROR_XXX</code></dd>
-<dt><code>TS_EVENT_CACHE_OPEN_WRITE</code></dt>
-<dd><code>TSCacheWrite</code></dd>
-<dd>Cache VC</dd>
-<dt><code>TS_EVENT_CACHE_OPEN_WRITE_FAILED</code></dt>
-<dd><code>TSCacheWrite</code></dd>
-<dd>Error code, see <code>TS_CACHE_ERROR_XXX</code></dd>
-<dt><code>TS_EVENT_CACHE_REMOVE</code></dt>
-<dd><code>TSCacheRemove</code></dd>
-<dd>Nothing</dd>
-<dt><code>TS_EVENT_CACHE_REMOVE_FAILED</code></dt>
-<dd><code>TSCacheRemove</code></dd>
-<dd>Error code, see <code>TS_CACHE_ERROR_XXX</code></dd>
-<dt><code>TS_EVENT_NET_ACCEPT</code></dt>
-<dd>
-<p>TSNetAccept, TSHttpTxnServerIntercept,
- TSHttpTxnIntercept: Net VConnection</p>
-</dd>
-<dt><code>TS_EVENT_NET_ACCEPT_FAILED</code></dt>
-<dd>
-<div class="codehilite"><pre><span class="n">TSNetAccept</span><span class="p">,</span> <span class="n">TSHttpTxnServerIntercept</span><span class="p">,</span>
- <span class="n">TSHttpTxnIntercept:</span> <span class="n">Nothing</span>
-</pre></div>
-
-
-</dd>
-<dt><code>TS_EVENT_HOST_LOOKUP</code></dt>
-<dd>
-<p><code>TSHostLookup</code></p>
-</dd>
-<dd>
-<p>Null pointer - error Non null pointer - <code>TSHostLookupResult</code></p>
-</dd>
-<dt><code>TS_EVENT_TIMEOUT</code></dt>
-<dd>
-<p><code>TSContSchedule</code></p>
-</dd>
-<dd>
-<p><code></code></p>
-</dd>
-<dt><code>TS_EVENT_ERROR</code></dt>
-<dd>
-<p><code></code></p>
-</dd>
-<dd>
-<p><code></code></p>
-</dd>
-<dt><code>TS_EVENT_VCONN_READ_READY</code></dt>
-<dd>
-<p><code>TSVConnRead</code></p>
-</dd>
-<dd>
-<p><code>TSVConn</code></p>
-</dd>
-<dt><code>TS_EVENT_VCONN_WRITE_READY</code></dt>
-<dd>
-<p><code>TSVConnWrite</code></p>
-</dd>
-<dd>
-<p><code>TSVConn</code></p>
-</dd>
-<dt><code>TS_EVENT_VCONN_READ_COMPLETE</code></dt>
-<dd>
-<p><code>TSVConnRead</code></p>
-</dd>
-<dd>
-<p><code>TSVConn</code></p>
-</dd>
-<dt><code>TS_EVENT_VCONN_WRITE_COMPLETE</code></dt>
-<dd>
-<p><code>TSVConnWrite</code></p>
-</dd>
-<dd>
-<p><code>TSVConn</code></p>
-</dd>
-<dt><code>TS_EVENT_VCONN_EOS</code></dt>
-<dd>
-<p><code>TSVConnRead</code></p>
-</dd>
-<dd>
-<p><code>TSVConn</code></p>
-</dd>
-<dt><code>TS_EVENT_NET_CONNECT</code></dt>
-<dd>
-<p><code>TSNetConnect</code></p>
-</dd>
-<dd>
-<p><code>TSVConn</code></p>
-</dd>
-<dt><code>TS_EVENT_NET_CONNECT_FAILED</code></dt>
-<dd>
-<p><code>TSNetConnect</code></p>
-</dd>
-<dd>
-<p><code>TSVConn</code></p>
-</dd>
-<dt><code>TS_EVENT_HTTP_CONTINUE</code></dt>
-<dd>
-<p><code></code></p>
-</dd>
-<dd>
-<p><code></code></p>
-</dd>
-<dt><code>TS_EVENT_HTTP_ERROR</code></dt>
-<dd>
-<p><code></code></p>
-</dd>
-<dd>
-<p><code></code></p>
-</dd>
-<dt><code>TS_EVENT_MGMT_UPDATE</code></dt>
-<dd>
-<p><code>TSMgmtUpdateRegister</code></p>
-</dd>
-<dd>
-<p><code>NULL</code></p>
-</dd>
-</dl>
+<h2 id="event-hook-or-api-function-that-sends-the-event-event-data-type">| Event | Hook or API Function That Sends the Event | Event Data Type |</h2>
+<p>| <code>TS_EVENT_HTTP_READ_REQUEST_HDR</code> | <code>TS_HTTP_READ_REQUEST_HDR_HOOK</code> | <code>TSHttpTxn</code> |
+| <code>TS_EVENT_HTTP_OS_DNS</code> | <code>TS_HTTP_OS_DNS_HOOK</code> | <code>TSHttpTxn</code> |
+| <code>TS_EVENT_HTTP_SEND_REQUEST_HDR</code> | <code>TS_HTTP_SEND_REQUEST_HDR_HOOK</code> | <code>TSHttpTxn</code> |
+| <code>TS_EVENT_HTTP_READ_CACHE_HDR</code> | <code>TS_HTTP_READ_CACHE_HDR_HOOK</code> | <code>TSHttpTxn</code> |
+| <code>TS_EVENT_HTTP_READ_RESPONSE_HDR</code> | <code>TS_HTTP_READ_RESPONSE_HDR_HOOK</code> | <code>TSHttpTxn</code> |
+| <code>TS_EVENT_HTTP_SEND_RESPONSE_HDR</code> | <code>TS_HTTP_SEND_RESPONSE_HDR_HOOK</code> | <code>TSHttpTxn</code> |
+| <code>TS_EVENT_HTTP_SELECT_ALT</code> | <code>TS_HTTP_SELECT_ALT_HOOK</code> | <code>TSHttpTxn</code> |
+| <code>TS_EVENT_HTTP_TXN_START</code> | <code>TS_HTTP_TXN_START_HOOK</code> | <code>TSHttpTxn</code> |
+| <code>TS_EVENT_HTTP_TXN_CLOSE</code> | <code>TS_HTTP_TXN_CLOSE_HOOK</code> | <code>TSHttpTxn</code> |
+| <code>TS_EVENT_HTTP_SSN_START</code> | <code>TS_HTTP_SSN_START_HOOK</code> | <code>TSHttpSsn</code> |
+| <code>TS_EVENT_HTTP_SSN_CLOSE</code> | <code>TS_HTTP_SSN_CLOSE_HOOK</code> | <code>TSHttpSsn</code> |
+| <code>TS_EVENT_NONE</code> | <code></code> | <code></code> |
+| <code>TS_EVENT_CACHE_LOOKUP_COMPLETE</code> | <code>TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK</code> | <code>TSHttpTxn</code> |
+| <code>TS_EVENT_IMMEDIATE</code> | <code>TSVConnClose, TSVIOReenable, TSContSchedule</code> | <code></code> |
+| <code>TS_EVENT_IMMEDIATE</code> | <code>TS_HTTP_REQUEST_TRANSFORM_HOOK</code> | <code></code> |
+| <code>TS_EVENT_IMMEDIATE</code> | <code>TS_HTTP_RESPONSE_TRANSFORM_HOOK</code> | <code></code> |
+| <code>TS_EVENT_CACHE_OPEN_READ</code> | <code>TSCacheRead</code> | Cache VC |
+| <code>TS_EVENT_CACHE_OPEN_READ_FAILED</code> | <code>TSCacheRead</code> | Error code, see <code>TS_CACHE_ERROR_XXX</code> |
+| <code>TS_EVENT_CACHE_OPEN_WRITE</code> | <code>TSCacheWrite</code> | Cache VC |
+| <code>TS_EVENT_CACHE_OPEN_WRITE_FAILED</code> | <code>TSCacheWrite</code> | Error code, see <code>TS_CACHE_ERROR_XXX</code> |
+| <code>TS_EVENT_CACHE_REMOVE</code> | <code>TSCacheRemove</code> | Nothing |
+| <code>TS_EVENT_CACHE_REMOVE_FAILED</code> | <code>TSCacheRemove</code> | Error code, see <code>TS_CACHE_ERROR_XXX</code> |
+| <code>TS_EVENT_NET_ACCEPT</code> | TSNetAccept, TSHttpTxnServerIntercept, TSHttpTxnIntercept| Net VConnection |
+| <code>TS_EVENT_NET_ACCEPT_FAILED</code> | TSNetAccept, TSHttpTxnServerIntercept, TSHttpTxnIntercept| Nothing |
+| <code>TS_EVENT_HOST_LOOKUP</code> | <code>TSHostLookup</code> | Null pointer - error Non null pointer - <code>TSHostLookupResult</code> |
+| <code>TS_EVENT_TIMEOUT</code> | <code>TSContSchedule</code> | <code></code> |
+| <code>TS_EVENT_ERROR</code> | <code></code> | <code></code> |
+| <code>TS_EVENT_VCONN_READ_READY</code> | <code>TSVConnRead</code> | <code>TSVConn</code> |
+| <code>TS_EVENT_VCONN_WRITE_READY</code> | <code>TSVConnWrite</code> | <code>TSVConn</code> |
+| <code>TS_EVENT_VCONN_READ_COMPLETE</code> | <code>TSVConnRead</code> | <code>TSVConn</code> |
+| <code>TS_EVENT_VCONN_WRITE_COMPLETE</code> | <code>TSVConnWrite</code> | <code>TSVConn</code> |
+| <code>TS_EVENT_VCONN_EOS</code> | <code>TSVConnRead</code> | <code>TSVConn</code> |
+| <code>TS_EVENT_NET_CONNECT</code> | <code>TSNetConnect</code> | <code>TSVConn</code> |
+| <code>TS_EVENT_NET_CONNECT_FAILED</code> | <code>TSNetConnect</code> | <code>TSVConn</code> |
+| <code>TS_EVENT_HTTP_CONTINUE</code> | <code></code> | <code></code> |
+| <code>TS_EVENT_HTTP_ERROR</code> | <code></code> | <code></code> |
+| <code>TS_EVENT_MGMT_UPDATE</code> | <code>TSMgmtUpdateRegister</code> | <code>NULL</code> |</p>
<p>The continuation functions are listed below:</p>
<ul>
<li>