You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/06/15 23:14:56 UTC

svn commit: r1350802 - /trafficserver/site/trunk/content/docs/trunk/sdk/continuations/writing-handler-functions.en.mdtext

Author: jpeach
Date: Fri Jun 15 21:14:55 2012
New Revision: 1350802

URL: http://svn.apache.org/viewvc?rev=1350802&view=rev
Log:
Put event edata destriptions in a table

Modified:
    trafficserver/site/trunk/content/docs/trunk/sdk/continuations/writing-handler-functions.en.mdtext

Modified: trafficserver/site/trunk/content/docs/trunk/sdk/continuations/writing-handler-functions.en.mdtext
URL: http://svn.apache.org/viewvc/trafficserver/site/trunk/content/docs/trunk/sdk/continuations/writing-handler-functions.en.mdtext?rev=1350802&r1=1350801&r2=1350802&view=diff
==============================================================================
--- trafficserver/site/trunk/content/docs/trunk/sdk/continuations/writing-handler-functions.en.mdtext (original)
+++ trafficserver/site/trunk/content/docs/trunk/sdk/continuations/writing-handler-functions.en.mdtext Fri Jun 15 21:14:55 2012
@@ -17,19 +17,18 @@ Notice:    Licensed to the Apache Softwa
            under the License.
 Navigation: [*](*)
 
-
-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. 
-
-The continuation's handler function is a function of type `TSEventFunc`. 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 `TSContDataSet`). 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: 
+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.
+
+The continuation's handler function is a function of type `TSEventFunc`. 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 `TSContDataSet`). 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:
 
         ::::c
         static int some_handler (TScont contp, TSEvent event, void *edata)
@@ -50,173 +49,57 @@ handler function typically has a switch 
             return 0;
         }
 
-
 ![[Caution]](/images/docbook/caution.png)
 
-**Caution** 
+**Caution**
 
-You might notice that a continuation cannot determine if more events are "in 
-flight" toward it. Do not use `TSContDestroy` to delete a continuation before 
-you make sure that all incoming events, such as those sent because of `TSHttpTxnHookAdd`, 
+You might notice that a continuation cannot determine if more events are "in
+flight" toward it. Do not use `TSContDestroy` to delete a continuation before
+you make sure that all incoming events, such as those sent because of `TSHttpTxnHookAdd`,
 have been handled.
 
-The following table lists events and the corresponding type of `void * `data 
+The following table lists events and the corresponding type of `void * `data
 passed to handler functions:
 
-`TS_EVENT_HTTP_READ_REQUEST_HDR`
-:   `TS_HTTP_READ_REQUEST_HDR_HOOK`
-:   `TSHttpTxn`
-
-`TS_EVENT_HTTP_OS_DNS`
-:   `TS_HTTP_OS_DNS_HOOK`
-:   `TSHttpTxn`
-
-`TS_EVENT_HTTP_SEND_REQUEST_HDR`
-:   `TS_HTTP_SEND_REQUEST_HDR_HOOK`
-:   `TSHttpTxn`
-
-`TS_EVENT_HTTP_READ_CACHE_HDR`
-:   `TS_HTTP_READ_CACHE_HDR_HOOK`
-:   `TSHttpTxn`
-
-`TS_EVENT_HTTP_READ_RESPONSE_HDR`
-:   `TS_HTTP_READ_RESPONSE_HDR_HOOK`
-:   `TSHttpTxn`
-
-`TS_EVENT_HTTP_SEND_RESPONSE_HDR`
-:   `TS_HTTP_SEND_RESPONSE_HDR_HOOK`
-:   `TSHttpTxn`
-
-`TS_EVENT_HTTP_SELECT_ALT`
-:   `TS_HTTP_SELECT_ALT_HOOK`
-:   `TSHttpTxn`
-
-`TS_EVENT_HTTP_TXN_START`
-:   `TS_HTTP_TXN_START_HOOK`
-:   `TSHttpTxn`
-
-`TS_EVENT_HTTP_TXN_CLOSE`
-:   `TS_HTTP_TXN_CLOSE_HOOK`
-:   `TSHttpTxn`
-
-`TS_EVENT_HTTP_SSN_START`
-:   `TS_HTTP_SSN_START_HOOK`
-:   `TSHttpSsn`
-
-`TS_EVENT_HTTP_SSN_CLOSE`
-:   `TS_HTTP_SSN_CLOSE_HOOK`
-:   `TSHttpSsn`
-
-
-`TS_EVENT_NONE`
-:   ` `
-:   ` `
-
-
-`TS_EVENT_CACHE_LOOKUP_COMPLETE`
-:   `TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK`
-:   `TSHttpTxn`
-
-`TS_EVENT_IMMEDIATE`
-:   `TSVConnClose, TSVIOReenable, TSContSchedule`
-:   ` `
-
-`TS_EVENT_IMMEDIATE`
-:   `TS_HTTP_REQUEST_TRANSFORM_HOOK`
-:   ` `
-
-`TS_EVENT_IMMEDIATE`
-:   `TS_HTTP_RESPONSE_TRANSFORM_HOOK`
-:   ` `
-
-`TS_EVENT_CACHE_OPEN_READ`
-:   `TSCacheRead`
-:   Cache VC
-
-`TS_EVENT_CACHE_OPEN_READ_FAILED`
-:   `TSCacheRead`
-:   Error code, see `TS_CACHE_ERROR_XXX`
-
-`TS_EVENT_CACHE_OPEN_WRITE`
-:   `TSCacheWrite`
-:   Cache VC
-
-`TS_EVENT_CACHE_OPEN_WRITE_FAILED`
-:   `TSCacheWrite`
-:   Error code, see `TS_CACHE_ERROR_XXX`
-
-`TS_EVENT_CACHE_REMOVE`
-:   `TSCacheRemove`
-:   Nothing
-
-`TS_EVENT_CACHE_REMOVE_FAILED`
-:   `TSCacheRemove`
-:   Error code, see `TS_CACHE_ERROR_XXX`
-
-`TS_EVENT_NET_ACCEPT`
-:       TSNetAccept, TSHttpTxnServerIntercept,
-                      TSHttpTxnIntercept:   Net VConnection
-
-`TS_EVENT_NET_ACCEPT_FAILED`
-:       TSNetAccept, TSHttpTxnServerIntercept,
-                      TSHttpTxnIntercept:   Nothing
-
-`TS_EVENT_HOST_LOOKUP`
-:   `TSHostLookup`
-:   Null pointer - error Non null pointer - `TSHostLookupResult`
-
-`TS_EVENT_TIMEOUT`
-:   `TSContSchedule`
-:   ` `
-
-`TS_EVENT_ERROR`
-:   ` `
-:   ` `
-
-
-
-`TS_EVENT_VCONN_READ_READY`
-:   `TSVConnRead`
-:   `TSVConn`
-
-`TS_EVENT_VCONN_WRITE_READY`
-:   `TSVConnWrite`
-:   `TSVConn`
-
-`TS_EVENT_VCONN_READ_COMPLETE`
-:   `TSVConnRead`
-:   `TSVConn`
-
-`TS_EVENT_VCONN_WRITE_COMPLETE`
-:   `TSVConnWrite`
-:   `TSVConn`
-
-`TS_EVENT_VCONN_EOS`
-:   `TSVConnRead`
-:   `TSVConn`
-
-`TS_EVENT_NET_CONNECT`
-:   `TSNetConnect`
-:   `TSVConn`
-
-`TS_EVENT_NET_CONNECT_FAILED`
-:   `TSNetConnect`
-:   `TSVConn`
-
-
-
-`TS_EVENT_HTTP_CONTINUE`
-:   ` `
-:   ` `
-
-`TS_EVENT_HTTP_ERROR`
-:   ` `
-:   ` `
-
-`TS_EVENT_MGMT_UPDATE`
-:   `TSMgmtUpdateRegister`
-:   `NULL`
-
+| Event | Hook or API Function That Sends the Event | Event Data Type |
+-----------------------------------------------------------------------
+| `TS_EVENT_HTTP_READ_REQUEST_HDR` |   `TS_HTTP_READ_REQUEST_HDR_HOOK` |   `TSHttpTxn` |
+| `TS_EVENT_HTTP_OS_DNS` |   `TS_HTTP_OS_DNS_HOOK` |   `TSHttpTxn` |
+| `TS_EVENT_HTTP_SEND_REQUEST_HDR` |   `TS_HTTP_SEND_REQUEST_HDR_HOOK` |   `TSHttpTxn` |
+| `TS_EVENT_HTTP_READ_CACHE_HDR` |   `TS_HTTP_READ_CACHE_HDR_HOOK` |   `TSHttpTxn` |
+| `TS_EVENT_HTTP_READ_RESPONSE_HDR` |   `TS_HTTP_READ_RESPONSE_HDR_HOOK` |   `TSHttpTxn` |
+| `TS_EVENT_HTTP_SEND_RESPONSE_HDR` |   `TS_HTTP_SEND_RESPONSE_HDR_HOOK` |   `TSHttpTxn` |
+| `TS_EVENT_HTTP_SELECT_ALT` |   `TS_HTTP_SELECT_ALT_HOOK` |   `TSHttpTxn` |
+| `TS_EVENT_HTTP_TXN_START` |   `TS_HTTP_TXN_START_HOOK` |   `TSHttpTxn` |
+| `TS_EVENT_HTTP_TXN_CLOSE` |   `TS_HTTP_TXN_CLOSE_HOOK` |   `TSHttpTxn` |
+| `TS_EVENT_HTTP_SSN_START` |   `TS_HTTP_SSN_START_HOOK` |   `TSHttpSsn` |
+| `TS_EVENT_HTTP_SSN_CLOSE` |   `TS_HTTP_SSN_CLOSE_HOOK` |   `TSHttpSsn` |
+| `TS_EVENT_NONE` |   ` ` |   ` ` |
+| `TS_EVENT_CACHE_LOOKUP_COMPLETE` |   `TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK` |   `TSHttpTxn` |
+| `TS_EVENT_IMMEDIATE` |   `TSVConnClose, TSVIOReenable, TSContSchedule` |   ` ` |
+| `TS_EVENT_IMMEDIATE` |   `TS_HTTP_REQUEST_TRANSFORM_HOOK` |   ` ` |
+| `TS_EVENT_IMMEDIATE` |   `TS_HTTP_RESPONSE_TRANSFORM_HOOK` |   ` ` |
+| `TS_EVENT_CACHE_OPEN_READ` |   `TSCacheRead` |   Cache VC |
+| `TS_EVENT_CACHE_OPEN_READ_FAILED` |   `TSCacheRead` |   Error code, see `TS_CACHE_ERROR_XXX` |
+| `TS_EVENT_CACHE_OPEN_WRITE` |   `TSCacheWrite` |   Cache VC |
+| `TS_EVENT_CACHE_OPEN_WRITE_FAILED` |   `TSCacheWrite` |   Error code, see `TS_CACHE_ERROR_XXX` |
+| `TS_EVENT_CACHE_REMOVE` |   `TSCacheRemove` |   Nothing |
+| `TS_EVENT_CACHE_REMOVE_FAILED` |   `TSCacheRemove` |   Error code, see `TS_CACHE_ERROR_XXX` |
+| `TS_EVENT_NET_ACCEPT` |       TSNetAccept, TSHttpTxnServerIntercept, TSHttpTxnIntercept|   Net VConnection |
+| `TS_EVENT_NET_ACCEPT_FAILED` |       TSNetAccept, TSHttpTxnServerIntercept, TSHttpTxnIntercept|   Nothing |
+| `TS_EVENT_HOST_LOOKUP` |   `TSHostLookup` |   Null pointer - error Non null pointer - `TSHostLookupResult` |
+| `TS_EVENT_TIMEOUT` |   `TSContSchedule` |   ` ` |
+| `TS_EVENT_ERROR` |   ` ` |   ` ` |
+| `TS_EVENT_VCONN_READ_READY` |   `TSVConnRead` |   `TSVConn` |
+| `TS_EVENT_VCONN_WRITE_READY` |   `TSVConnWrite` |   `TSVConn` |
+| `TS_EVENT_VCONN_READ_COMPLETE` |   `TSVConnRead` |   `TSVConn` |
+| `TS_EVENT_VCONN_WRITE_COMPLETE` |   `TSVConnWrite` |   `TSVConn` |
+| `TS_EVENT_VCONN_EOS` |   `TSVConnRead` |   `TSVConn` |
+| `TS_EVENT_NET_CONNECT` |   `TSNetConnect` |   `TSVConn` |
+| `TS_EVENT_NET_CONNECT_FAILED` |   `TSNetConnect` |   `TSVConn` |
+| `TS_EVENT_HTTP_CONTINUE` |   ` ` |   ` ` |
+| `TS_EVENT_HTTP_ERROR` |   ` ` |   ` ` |
+| `TS_EVENT_MGMT_UPDATE` |   `TSMgmtUpdateRegister` |   `NULL` |
 
 The continuation functions are listed below:
 
@@ -233,5 +116,3 @@ The continuation functions are listed be
 * `TSContMutexGet`
 
 * `TSContSchedule`
-
-