trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r780996 - /websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/
Date Sat, 18 Dec 2010 23:43:42 GMT
Author: buildbot
Date: Sat Dec 18 23:43:42 2010
New Revision: 780996

Log:
Staging update by buildbot

Modified:
    websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/adding-hooks.en.html
    websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-alternate-selection.en.html
    websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-sessions.en.html
    websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-transactions.en.html
    websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/index.en.html
    websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/initiate-http-connection.en.html
    websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/intercepting-http-transactions.en.html

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/adding-hooks.en.html
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/adding-hooks.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/adding-hooks.en.html Sat Dec 18 23:43:42 2010
@@ -6,8 +6,8 @@
     
     <link rel="stylesheet" href="/styles/pygments_style.css" />
     
-    <title></title>
-    
+    <title>Apache Traffic Server™ Software Developers Kit</title>
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
   </head>
 
   <body>
@@ -15,11 +15,116 @@
 	    <span id="ts_logo">
 		  <a href="http://trafficserver.apache.org/"><img alt="Apache Traffic Server" src="/images/ts75.png" /></a>
 	  </span>
-	    <h1></h1>
+	    <h1>Apache Traffic Server™ Software Developers Kit</h1>
     </div>
 
   <div id="content">
-      
+      <p><a href="../http-hooks-and-transactions">Prev</a> - HTTP Hooks and Transactions</p>
+<p>HTTP Sessions - <a href="http-sessions">Next</a></p>
+<h2 id="AddingHooks">Adding Hooks</h2>
+<p>There are several ways to add hooks to your plugin.</p>
+<ul>
+<li>
+<p><strong>Global HTTP hooks</strong>
+HTTP transaction hooks are set on a global basis using the function <code>TSHttpHookAdd</code>.
+This means that the continuation specified as the parameter to <code>TSHttpHookAdd</code>
+is called for every transaction. <code>TSHttpHookAdd</code> must be used in <code>TSPluginInit</code>.</p>
+</li>
+<li>
+<p><strong>Transaction hooks</strong>
+Transaction hooks can be used to call plugins back for a specific HTTP transaction.
+You cannot add transaction hooks in <code>TSPluginInit</code>; you first need a handle
+to a transaction. See <a href="../header-based-plugin-examples/blacklist-plugin/accessing-the-transaction-being-processed">Accessing the Transaction Being Processed</a></p>
+</li>
+<li>
+<p><strong>Transformation hooks</strong>
+Transformation hooks are a special case of transaction hooks. See
+%method TSVConnCacheObjectSizeGet%
+for more information about transformation hooks. You add a transformation hook
+using <code>TSHttpTxnHookAdd</code>, as described in <a href="HTTP_Transactions.html">HTTP Transactions</a>.</p>
+</li>
+<li>
+<p><strong>Session hooks</strong>
+An HTTP session starts when a client opens a connection to Traffic Server and
+ends when the connection closes. A session can consist of several transactions.
+Session hooks enable you to hook your plugin to a particular point in every
+transaction within a specified session (see <a href="HTTPSessions.html">HTTP Sessions</a>).
+Session hooks are added in a manner similar to transaction hooks (ie, you first
+need a handle to an HTTP session).</p>
+</li>
+<li>
+<p><strong>HTTP select alternate hook</strong>
+Alternate selection hooks enable you to hook on to the alternate selection
+state. These hooks must be added globally, since Traffic Server does not have
+a handle to a transaction or session when alternate selection is taking place.
+See <a href="HTTPAlternateSelection.html">HTTP Alternate Selection</a> for information
+on the alternate selection mechanism.</p>
+</li>
+</ul>
+<p>All of the hook addition functions (<a href="HTTPFunctions.html#TSHttpHookAdd"><code>TSHttpHookAdd</code></a>,
+<a href="HTTPSessionFunctions.html#TSHttpSsnHookAdd"><code>TSHttpSsnHookAdd</code></a>, <a href="HTTPSessionFunctions.html#TSHttpSsnReenable"><code>TSHttpSsnReenable</code></a>)
+take <code>TSHttpHookID</code> (identifies the hook to add on to) and <code>TSCont</code> (the
+basic callback mechanism in Traffic Server). A single <code>TSCont</code> can be added
+to any number of hooks at a time.</p>
+<p>An HTTP hook is identified by the enumerated type <code>TSHttpHookID</code>. The values
+for <code>TSHttpHookID</code> are:</p>
+<p><strong>Values for TSHttpHookID</strong></p>
+<dl>
+<dt><code>TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK</code></dt>
+<dd>Called after the HTTP state machine has completed the cache lookup for the
+document requested in the ongoing transaction. Register this hook via <code>TSHttpTxnHookAdd</code>
+or <code>TSHttpHookAdd</code>. Corresponds to the event <code>TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE</code>.</dd>
+<dt><code>TS_HTTP_OS_DNS_HOOK</code></dt>
+<dd>Called immediately after the HTTP state machine has completed a DNS lookup
+of the origin server. The HTTP state machine will know the origin server's
+IP address at this point, which is useful for performing both authentication
+and blacklisting. Corresponds to the event <code>TS_EVENT_HTTP_OS_DNS</code>.</dd>
+<dt><code>TS_HTTP_READ_CACHE_HDR_HOOK</code></dt>
+<dd>Called immediately after the request and response header of a previously-cached
+object is read from cache. This hook is only called if the document is being
+served from cache. Corresponds to the event <code>TS_EVENT_HTTP_READ_CACHE_HDR</code>.</dd>
+<dt><code>TS_HTTP_READ_RESPONSE_HDR_HOOK</code></dt>
+<dd>Called immediately after the response header is read from the origin server
+or parent proxy. Corresponds to the event <code>TS_EVENT_HTTP_READ_RESPONSE_HDR</code>.</dd>
+<dt><code>TS_HTTP_RESPONSE_TRANSFORM_HOOK</code></dt>
+<dd>See "<a href="../http-transformation-plugin#Transformations">"Transformations"</a> for
+information about transformation hooks.</dd>
+<dt><code>TS_HTTP_READ_REQUEST_HDR_HOOK</code></dt>
+<dd>Called immediately after the request header is read from the client. Corresponds
+to the event <code>TS_EVENT_HTTP_READ_REQUEST_HDR</code>.</dd>
+<dt><code>TS_HTTP_READ_REQUEST_PRE_REMAP_HOOK</code></dt>
+<dd>Called after the request header is read from the client, before any remapping
+of the headers occurs. Corresponds to the event <code>TS_EVENT_HTTP_READ_REQUEST_PRE_REMAP</code>.</dd>
+<dt><code>TS_HTTP_REQUEST_TRANSFORM_HOOK</code></dt>
+<dd>See "<a href="../http-transformation-plugin#Transformations">"Transformations"</a> for
+information about transformation hooks.</dd>
+<dt><code>TS_HTTP_SELECT_ALT_HOOK</code></dt>
+<dd>See <a href="http-alternate-selection">"HTTP Alternate Selection"</a> for information
+about the alternate selection mechanism.</dd>
+<dt><code>TS_HTTP_SEND_RESPONSE_HDR_HOOK</code></dt>
+<dd>Called immediately before the proxy's response header is written to the client;
+this hook is usually used for modifying the response header. Corresponds to
+the event <code>TS_EVENT_HTTP_SEND_RESPONSE_HDR</code>.</dd>
+<dt><code>TS_HTTP_SEND_REQUEST_HDR_HOOK</code></dt>
+<dd>Called immediately before the proxy's request header is sent to the origin
+server or the parent proxy. This hook is not called if the document is being
+served from cache. This hook is usually used for modifying the proxy's request
+header before it is sent to the origin server or parent proxy.</dd>
+<dt><code>TS_HTTP_SSN_CLOSE_HOOK</code></dt>
+<dd>Called when an HTTP session ends. A session ends when the client connection
+is closed. You can only add this hook as a global hook</dd>
+<dt><code>TS_HTTP_SSN_START_HOOK</code></dt>
+<dd>Called when an HTTP session is started. A session starts when a client connects
+to Traffic Server. You can only add this hook as a global hook.</dd>
+<dt><code>TS_HTTP_TXN_CLOSE_HOOK</code></dt>
+<dd>Called when an HTTP transaction ends.</dd>
+<dt><code>TS_HTTP_TXN_START_HOOK</code></dt>
+<dd>Called when an HTTP transaction is started. A transaction starts when either
+a client connects to Traffic Server and data is available on the connection,
+or a previous client connection that was left open for keep alive has new data
+available.</dd>
+</dl>
+<p>The function you use to add a global HTTP hook is %method TSHttpHookAdd%.</p>
   </div>
 
   <div id="footer">

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-alternate-selection.en.html
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-alternate-selection.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-alternate-selection.en.html Sat Dec 18 23:43:42 2010
@@ -6,8 +6,8 @@
     
     <link rel="stylesheet" href="/styles/pygments_style.css" />
     
-    <title></title>
-    
+    <title>Apache Traffic Server™ Software Developers Kit</title>
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
   </head>
 
   <body>
@@ -15,11 +15,183 @@
 	    <span id="ts_logo">
 		  <a href="http://trafficserver.apache.org/"><img alt="Apache Traffic Server" src="/images/ts75.png" /></a>
 	  </span>
-	    <h1></h1>
+	    <h1>Apache Traffic Server™ Software Developers Kit</h1>
     </div>
 
   <div id="content">
-      
+      <p><a href="initiate-http-connection">Prev</a> - Initiate HTTP Connection</p>
+<p>Miscellaneous Interface Guide - <a href="../misc-interface-guide">Next</a></p>
+<h2 id="HTTPAlternateSelection">HTTP Alternate Selection</h2>
+<p>The HTTP alternate selection functions provide a mechanism for hooking into
+Traffic Server's alternate selection mechanism and augmenting it with additional
+information. <strong>HTTP alternate selection</strong> refers to the process of choosing
+between several alternate versions of a document for a specific URL. Alternates
+arise because the HTTP 1.1 specification allows different documents to be sent
+back for the same URL (depending on the clients request). For example, a server
+might send back a GIF image to a client that only accepts GIF images, and might
+send back a JPEG image to a client that only accepts JPEG images.</p>
+<p>The alternate selection mechanism is invoked when Traffic Server looks up a
+URL in its cache. For each URL, Traffic Server stores a vector of alternates.
+For each alternate in this vector, Traffic Server computes a quality value
+between 0 and 1 that represents how "good" the alternate is. A quality value
+of 0 means that the alternate is unacceptable; a value of 1 means that the
+alternate is a perfect match.</p>
+<p>If a plugin hooks onto the <code>TS_HTTP_SELECT_ALT_HOOK</code>, then it will be called
+back when Traffic Server performs alternate selection. You cannot register
+locally to the hook <code>TS_HTTP_SELECT_ALT_HOOK</code> by using <code>TSHttpTxnHookAdd</code>
+- you can only do so by using only <code>TSHttpHookAdd</code>. Since Traffic Server does
+not actually have an HTTP transaction or an HTTP session on hand when alternate
+selection is performed, it is only valid to hook onto the global list of <code>TS_HTTP_SELECT_ALT_HOOK</code>.
+Traffic Server calls each of the select alternate hooks with the <code>TS_EVENT_HTTP_SELECT_ALT</code>
+event. The <code>void *edata</code> argument that is passed to the continuation is a pointer
+to an <code>TSHttpAltInfo</code> structure. It can be used later to call the HTTP alternate
+selection functions listed at the end of this section. Unlike other hooks,
+this alternate selection callout is non-blocking; the expectation is that the
+quality value for the alternate will be changed by a call to <code>TSHttpAltInfoQualitySet</code>.</p>
+<p><img alt="[Note]" src="/images/docbook/note.png" />
+<strong>Note</strong></p>
+<p>HTTP SM does not have to be reenabled using <code>TSHttpTxnReenable</code> or any other
+APIs; just return from the function.</p>
+<p>The sample code below shows how to call the alternate APIs.</p>
+<div class="codehilite"><pre><span class="k">static</span> <span class="kt">void</span> <span class="nf">handle_select_alt</span><span class="p">(</span><span class="n">TSHttpAltInfo</span> <span class="n">infop</span><span class="p">)</span>
+<span class="p">{</span>
+    <span class="n">TSMBuffer</span> <span class="n">client_req_buf</span><span class="p">,</span> <span class="n">cache_resp_buf</span><span class="p">;</span>
+    <span class="n">TSMLoc</span> <span class="n">client_req_hdr</span><span class="p">,</span> <span class="n">cache_resp_hdr</span><span class="p">;</span>
+
+    <span class="n">TSMLoc</span> <span class="n">accept_transform_field</span><span class="p">;</span>
+    <span class="n">TSMLoc</span> <span class="n">content_transform_field</span><span class="p">;</span>
+
+    <span class="kt">int</span> <span class="n">accept_transform_len</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">content_transform_len</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+    <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">accept_transform_value</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+    <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">content_transform_value</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+    <span class="kt">int</span> <span class="n">content_plugin</span><span class="p">,</span> <span class="n">accept_plugin</span><span class="p">;</span>
+
+    <span class="kt">float</span> <span class="n">quality</span><span class="p">;</span>
+
+    <span class="cm">/* get client request, cached request and cached response */</span>
+    <span class="n">TSHttpAltInfoClientReqGet</span> <span class="p">(</span><span class="n">infop</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">client_req_buf</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">client_req_hdr</span><span class="p">);</span>
+    <span class="n">TSHttpAltInfoCachedRespGet</span><span class="p">(</span><span class="n">infop</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">cache_resp_buf</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">cache_resp_hdr</span><span class="p">);</span>
+
+    <span class="cm">/* get the Accept-Transform field value from the client request */</span>
+    <span class="n">accept_transform_field</span> <span class="o">=</span> <span class="n">TSMimeHdrFieldFind</span><span class="p">(</span><span class="n">client_req_buf</span><span class="p">,</span>
+            <span class="n">client_req_hdr</span><span class="p">,</span> <span class="s">&quot;Accept-Transform&quot;</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">accept_transform_field</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">TSMimeHdrFieldValueStringGet</span><span class="p">(</span><span class="n">client_req_buf</span><span class="p">,</span> <span class="n">client_req_hdr</span><span class="p">,</span>
+                <span class="n">accept_transform_field</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">accept_transform_value</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">accept_transform_len</span><span class="p">);</span>
+        <span class="n">TSDebug</span><span class="p">(</span><span class="n">DBG_TAG</span><span class="p">,</span> <span class="s">&quot;Accept-Transform = |%s|&quot;</span><span class="p">,</span>
+                <span class="n">accept_transform_value</span><span class="p">);</span>
+    <span class="p">}</span>
+
+    <span class="cm">/* get the Content-Transform field value from cached server response */</span>
+    <span class="n">content_transform_field</span> <span class="o">=</span> <span class="n">TSMimeHdrFieldFind</span><span class="p">(</span><span class="n">cache_resp_buf</span><span class="p">,</span>
+            <span class="n">cache_resp_hdr</span><span class="p">,</span> <span class="s">&quot;Content-Transform&quot;</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">content_transform_field</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">TSMimeHdrFieldValueStringGet</span><span class="p">(</span><span class="n">cache_resp_buf</span><span class="p">,</span> <span class="n">cache_resp_hdr</span><span class="p">,</span>
+                <span class="n">content_transform_field</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">content_transform_value</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">content_transform_len</span><span class="p">);</span>
+        <span class="n">TSDebug</span><span class="p">(</span><span class="n">DBG_TAG</span><span class="p">,</span> <span class="s">&quot;Content-Transform = |%s|&quot;</span><span class="p">,</span>
+                <span class="n">content_transform_value</span><span class="p">);</span>
+    <span class="p">}</span>
+
+    <span class="cm">/* compute quality */</span>
+    <span class="n">accept_plugin</span> <span class="o">=</span> <span class="p">(</span><span class="n">accept_transform_value</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="n">accept_transform_len</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&amp;&amp;</span>
+            <span class="p">(</span><span class="n">strncmp</span><span class="p">(</span><span class="n">accept_transform_value</span><span class="p">,</span> <span class="s">&quot;plugin&quot;</span><span class="p">,</span>
+                 <span class="n">accept_transform_len</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">));</span>
+
+    <span class="n">content_plugin</span> <span class="o">=</span> <span class="p">(</span><span class="n">content_transform_value</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="n">content_transform_len</span> <span class="o">&gt;</span><span class="mi">0</span><span class="p">)</span> <span class="o">&amp;&amp;</span>
+            <span class="p">(</span><span class="n">strncmp</span><span class="p">(</span><span class="n">content_transform_value</span><span class="p">,</span> <span class="s">&quot;plugin&quot;</span><span class="p">,</span>
+                 <span class="n">content_transform_len</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">));</span>
+
+    <span class="k">if</span> <span class="p">(</span><span class="n">accept_plugin</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">quality</span> <span class="o">=</span> <span class="n">content_plugin</span> <span class="o">?</span> <span class="mf">1.0</span> <span class="o">:</span> <span class="mf">0.0</span><span class="p">;</span>
+    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+        <span class="n">quality</span> <span class="o">=</span> <span class="n">content_plugin</span> <span class="o">?</span> <span class="mf">0.0</span> <span class="o">:</span> <span class="mf">0.5</span><span class="p">;</span>
+    <span class="p">}</span>
+
+    <span class="n">TSDebug</span><span class="p">(</span><span class="n">DBG_TAG</span><span class="p">,</span> <span class="s">&quot;Setting quality to %3.1f&quot;</span><span class="p">,</span> <span class="n">quality</span><span class="p">);</span>
+
+    <span class="cm">/* set quality for this alternate */</span>
+    <span class="n">TSHttpAltInfoQualitySet</span><span class="p">(</span><span class="n">infop</span><span class="p">,</span> <span class="n">quality</span><span class="p">);</span>
+
+    <span class="cm">/* cleanup */</span>
+    <span class="k">if</span> <span class="p">(</span><span class="n">accept_transform_field</span><span class="p">)</span>
+        <span class="n">TSHandleMLocRelease</span><span class="p">(</span><span class="n">client_req_buf</span><span class="p">,</span> <span class="n">client_req_hdr</span><span class="p">,</span>
+                <span class="n">accept_transform_field</span><span class="p">);</span>
+    <span class="n">TSHandleMLocRelease</span><span class="p">(</span><span class="n">client_req_buf</span><span class="p">,</span> <span class="n">TS_NULL_MLOC</span><span class="p">,</span> <span class="n">client_req_hdr</span><span class="p">);</span>
+
+    <span class="k">if</span> <span class="p">(</span><span class="n">content_transform_field</span><span class="p">)</span>
+        <span class="n">TSHandleMLocRelease</span><span class="p">(</span><span class="n">cache_resp_buf</span><span class="p">,</span> <span class="n">cache_resp_hdr</span><span class="p">,</span>
+                <span class="n">content_transform_field</span><span class="p">);</span>
+    <span class="n">TSHandleMLocRelease</span><span class="p">(</span><span class="n">cache_resp_buf</span><span class="p">,</span> <span class="n">TS_NULL_MLOC</span><span class="p">,</span> <span class="n">cache_resp_hdr</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">alt_plugin</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="n">TSHttpAltInfo</span> <span class="n">infop</span><span class="p">;</span>
+
+    <span class="k">switch</span> <span class="p">(</span><span class="n">event</span><span class="p">)</span> <span class="p">{</span>
+        <span class="k">case</span> <span class="n">TS_EVENT_HTTP_SELECT_ALT</span>:
+            <span class="n">infop</span> <span class="o">=</span> <span class="p">(</span><span class="n">TSHttpAltInfo</span><span class="p">)</span><span class="n">edata</span><span class="p">;</span>
+            <span class="n">handle_select_alt</span><span class="p">(</span><span class="n">infop</span><span class="p">);</span>
+            <span class="k">break</span><span class="p">;</span>
+
+        <span class="nl">default:</span>
+            <span class="k">break</span><span class="p">;</span>
+    <span class="p">}</span>
+
+    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="kt">void</span> <span class="nf">TSPluginInit</span> <span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span>
+<span class="p">{</span>
+    <span class="n">TSHttpHookAdd</span><span class="p">(</span><span class="n">TS_HTTP_SELECT_ALT_HOOK</span><span class="p">,</span> <span class="n">TSContCreate</span> <span class="p">(</span><span class="n">alt_plugin</span><span class="p">,</span>
+                <span class="nb">NULL</span><span class="p">));</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Traffic Server augments the alternate selection through these callouts using
+the following algorithm:</p>
+<ol>
+<li>
+<p>Traffic Server computes its own quality value for the alternate, taking into
+account the quality of the accept match, the encoding match, and the language
+match.</p>
+</li>
+<li>
+<p>Traffic Server then calls out each of the continuations on the global
+<code>TS_HTTP_SELECT_ALT_HOOK</code>'s list.</p>
+</li>
+<li>
+<p>It multiplies its quality value with the value returned by each callout. Since
+all of the values are clamped to be between 0 and 1, the final value will be
+between 0 and 1 as well.</p>
+</li>
+<li>
+<p>This algorithm also ensures that a single callout can block the usage of a
+given alternate by specifying a quality value of 0.</p>
+</li>
+</ol>
+<p>A common usage for the alternate selection mechanism is when a plugin transforms
+a document for some clients and not for others, but wants to store both the
+transformed and unchanged document. The client's request will specify whether
+it accepted the transformed document. The plugin will then determine if the
+alternate matches this specification and then set the appropriate quality level
+for the alternate.</p>
+<p>The HTTP alternate selection functions are:</p>
+<ul>
+<li>
+<p>%method TSHttpAltInfoCachedReqGet%</p>
+</li>
+<li>
+<p>%method TSHttpAltInfoCachedRespGet%</p>
+</li>
+<li>
+<p>%method TSHttpAltInfoClientReqGet%</p>
+</li>
+<li>
+<p>%method TSHttpAltInfoQualitySet%</p>
+</li>
+</ul>
   </div>
 
   <div id="footer">

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-sessions.en.html
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-sessions.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-sessions.en.html Sat Dec 18 23:43:42 2010
@@ -6,8 +6,8 @@
     
     <link rel="stylesheet" href="/styles/pygments_style.css" />
     
-    <title></title>
-    
+    <title>Apache Traffic Server™ Software Developers Kit</title>
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
   </head>
 
   <body>
@@ -15,11 +15,44 @@
 	    <span id="ts_logo">
 		  <a href="http://trafficserver.apache.org/"><img alt="Apache Traffic Server" src="/images/ts75.png" /></a>
 	  </span>
-	    <h1></h1>
+	    <h1>Apache Traffic Server™ Software Developers Kit</h1>
     </div>
 
   <div id="content">
-      
+      <p><a href="adding-hooks">Prev</a> - Adding Hooks</p>
+<p>HTTP Transactions - <a href="http-transactions">Next</a></p>
+<h2 id="HTTPSessions">HTTP Sessions</h2>
+<p>An <strong>HTTP session</strong> is an object that is defined for the lifetime of a client's
+TCP session. The Traffic Server API enables you to add a global hook to the
+start or end of an HTTP session, as well as add session hooks that call back
+your plugin for every transaction within a given session. When a client connects
+to Traffic Server, it opens up a TCP connection and sends one or more HTTP
+requests. An individual request and its response comprise the HTTP transaction.
+The <strong>HTTP session</strong> begins when the client opens the connection and ends when
+the connection closes.</p>
+<p>The HTTP session hooks are:</p>
+<ul>
+<li>
+<p><code>TS_HTTP_SSN_START_HOOK</code>
+    Called when an HTTP session is started (a session starts when a client connects
+to Traffic Server). This hook must be added as a global hook.</p>
+</li>
+<li>
+<p><code>TS_HTTP_SSN_CLOSE_HOOK</code>
+    Called when an HTTP session ends (a session ends when the client connection
+is closed). This hook must be added as a global hook.</p>
+</li>
+</ul>
+<p>Use the session hooks to get a handle to a session (an <code>TSHttpSsn</code> object).
+If you want your plugin to be called back for each transaction within the session,
+then use <code>TSHttpSsnHookAdd</code>.</p>
+<p><strong>Note:</strong> you must reenable the session with <code>TSHttpSsnReenable</code> after processing
+a session hook.</p>
+<p>The session hook functions are listed below:</p>
+<ul>
+<li>%method TSHttpSsnHookAdd%</li>
+<li>%method TSHttpSsnReenable%</li>
+</ul>
   </div>
 
   <div id="footer">

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-transactions.en.html
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-transactions.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/http-transactions.en.html Sat Dec 18 23:43:42 2010
@@ -6,8 +6,8 @@
     
     <link rel="stylesheet" href="/styles/pygments_style.css" />
     
-    <title></title>
-    
+    <title>Apache Traffic Server™ Software Developers Kit</title>
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
   </head>
 
   <body>
@@ -15,11 +15,208 @@
 	    <span id="ts_logo">
 		  <a href="http://trafficserver.apache.org/"><img alt="Apache Traffic Server" src="/images/ts75.png" /></a>
 	  </span>
-	    <h1></h1>
+	    <h1>Apache Traffic Server™ Software Developers Kit</h1>
     </div>
 
   <div id="content">
-      
+      <p><a href="http-sessions.html">Prev</a> - HTTP Sessions</p>
+<p>Intercepting HTTP Transactions - <a href="intercepting-http-transactions">Next</a></p>
+<h2 id="HTTPTransactions">HTTP Transactions</h2>
+<p>The HTTP transaction functions enable you to set up plugin callbacks to HTTP
+transactions and obtain/modify information about particular HTTP transactions.</p>
+<p>As described in the section on HTTP sessions, an <strong>HTTP transaction</strong> is an
+object defined for the lifetime of a single request from a client and the corresponding
+response from Traffic Server. The <strong><code>TSHttpTxn</code></strong> structure is the main handle
+given to a plugin for manipulating a transaction's internal state. Additionally,
+an HTTP transaction has a reference back to the HTTP session that created it.</p>
+<p>The sample code below illustrates how to register locally to a transaction
+and associate data to the transaction.</p>
+<div class="codehilite"><pre><span class="cm">/*</span>
+<span class="cm">* Simple plugin that illustrates:</span>
+<span class="cm">* - how to register locally to a transaction</span>
+<span class="cm">* - how to deal with data that&#39;s associated with a tranaction</span>
+<span class="cm">*</span>
+<span class="cm">* Note: for readability, error checking is omitted</span>
+<span class="cm">*/</span>
+
+<span class="cp">#include &lt;ts/ts.h&gt;</span>
+
+<span class="cp">#define DBG_TAG &quot;txn&quot;</span>
+
+<span class="cm">/* Structure to be associated to txns */</span>
+<span class="k">typedef</span> <span class="k">struct</span> <span class="p">{</span>
+   <span class="kt">int</span> <span class="n">i</span><span class="p">;</span>
+   <span class="kt">float</span> <span class="n">f</span><span class="p">;</span>
+   <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">;</span>
+<span class="p">}</span> <span class="n">TxnData</span><span class="p">;</span>
+
+<span class="cm">/* Allocate memory and init a TxnData structure */</span>
+<span class="n">TxnData</span> <span class="o">*</span>
+<span class="nf">txn_data_alloc</span><span class="p">()</span>
+<span class="p">{</span>
+   <span class="n">TxnData</span> <span class="o">*</span><span class="n">data</span><span class="p">;</span>
+   <span class="n">data</span> <span class="o">=</span> <span class="n">TSmalloc</span><span class="p">(</span><span class="k">sizeof</span><span class="p">(</span><span class="n">TxnData</span><span class="p">));</span>
+
+   <span class="n">data</span><span class="o">-&gt;</span><span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
+   <span class="n">data</span><span class="o">-&gt;</span><span class="n">f</span> <span class="o">=</span> <span class="mf">0.5</span><span class="p">;</span>
+   <span class="n">data</span><span class="o">-&gt;</span><span class="n">s</span> <span class="o">=</span> <span class="s">&quot;Constant String&quot;</span><span class="p">;</span>
+   <span class="k">return</span> <span class="n">data</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="cm">/* Free up a TxnData structure */</span>
+<span class="kt">void</span>
+<span class="nf">txn_data_free</span><span class="p">(</span><span class="n">TxnData</span> <span class="o">*</span><span class="n">data</span><span class="p">)</span>
+<span class="p">{</span>
+   <span class="n">TSfree</span><span class="p">(</span><span class="n">data</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="cm">/* Handler for event READ_REQUEST and TXN_CLOSE */</span>
+<span class="k">static</span> <span class="kt">int</span>
+<span class="nf">local_hook_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="n">TSHttpTxn</span> <span class="n">txnp</span> <span class="o">=</span> <span class="p">(</span><span class="n">TSHttpTxn</span><span class="p">)</span> <span class="n">edata</span><span class="p">;</span>
+   <span class="n">TxnData</span> <span class="o">*</span><span class="n">txn_data</span> <span class="o">=</span> <span class="n">TSContDataGet</span><span class="p">(</span><span class="n">contp</span><span class="p">);</span>
+   <span class="k">switch</span> <span class="p">(</span><span class="n">event</span><span class="p">)</span> <span class="p">{</span>
+   <span class="k">case</span> <span class="n">TS_EVENT_HTTP_READ_REQUEST_HDR</span>:
+      <span class="cm">/* Modify values of txn data */</span>
+      <span class="n">txn_data</span><span class="o">-&gt;</span><span class="n">i</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span>
+      <span class="n">txn_data</span><span class="o">-&gt;</span><span class="n">f</span> <span class="o">=</span> <span class="mf">3.5</span><span class="p">;</span>
+      <span class="n">txn_data</span><span class="o">-&gt;</span><span class="n">s</span> <span class="o">=</span> <span class="s">&quot;Constant String 2&quot;</span><span class="p">;</span>
+      <span class="k">break</span><span class="p">;</span>
+
+   <span class="k">case</span> <span class="n">TS_EVENT_HTTP_TXN_CLOSE</span>:
+      <span class="cm">/* Print txn data values */</span>
+      <span class="n">TSDebug</span><span class="p">(</span><span class="n">DBG_TAG</span><span class="p">,</span> <span class="s">&quot;Txn data i=%d f=%f s=%s&quot;</span><span class="p">,</span> <span class="n">txn_data</span><span class="o">-&gt;</span><span class="n">i</span><span class="p">,</span> <span class="n">txn_data</span><span class="o">-&gt;</span><span class="n">f</span><span class="p">,</span> <span class="n">txn_data</span><span class="o">-&gt;</span><span class="n">s</span><span class="p">);</span>
+
+      <span class="cm">/* Then destroy the txn cont and its data */</span>
+      <span class="n">txn_data_free</span><span class="p">(</span><span class="n">txn_data</span><span class="p">);</span>
+      <span class="n">TSContDestroy</span><span class="p">(</span><span class="n">contp</span><span class="p">);</span>
+      <span class="k">break</span><span class="p">;</span>
+
+   <span class="nl">default:</span>
+       <span class="n">TSAssert</span><span class="p">(</span><span class="o">!</span><span class="s">&quot;Unexpected event&quot;</span><span class="p">);</span>
+       <span class="k">break</span><span class="p">;</span>
+   <span class="p">}</span>
+
+   <span class="n">TSHttpTxnReenable</span><span class="p">(</span><span class="n">txnp</span><span class="p">,</span> <span class="n">TS_EVENT_HTTP_CONTINUE</span><span class="p">);</span>
+   <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="cm">/* Handler for event TXN_START */</span>
+<span class="k">static</span> <span class="kt">int</span>
+<span class="nf">global_hook_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="n">TSHttpTxn</span> <span class="n">txnp</span> <span class="o">=</span> <span class="p">(</span><span class="n">TSHttpTxn</span><span class="p">)</span> <span class="n">edata</span><span class="p">;</span>
+   <span class="n">TSCont</span> <span class="n">txn_contp</span><span class="p">;</span>
+   <span class="n">TxnData</span> <span class="o">*</span><span class="n">txn_data</span><span class="p">;</span>
+
+   <span class="k">switch</span> <span class="p">(</span><span class="n">event</span><span class="p">)</span> <span class="p">{</span>
+   <span class="k">case</span> <span class="n">TS_EVENT_HTTP_TXN_START</span>:
+      <span class="cm">/* Create a new continuation for this txn and associate data to it */</span>
+      <span class="n">txn_contp</span> <span class="o">=</span> <span class="n">TSContCreate</span><span class="p">(</span><span class="n">local_hook_handler</span><span class="p">,</span> <span class="n">TSMutexCreate</span><span class="p">());</span>
+      <span class="n">txn_data</span> <span class="o">=</span> <span class="n">txn_data_alloc</span><span class="p">();</span>
+      <span class="n">TSContDataSet</span><span class="p">(</span><span class="n">txn_contp</span><span class="p">,</span> <span class="n">txn_data</span><span class="p">);</span>
+
+      <span class="cm">/* Registers locally to hook READ_REQUEST and TXN_CLOSE */</span>
+      <span class="n">TSHttpTxnHookAdd</span><span class="p">(</span><span class="n">txnp</span><span class="p">,</span> <span class="n">TS_HTTP_READ_REQUEST_HDR_HOOK</span><span class="p">,</span> <span class="n">txn_contp</span><span class="p">);</span>
+      <span class="n">TSHttpTxnHookAdd</span><span class="p">(</span><span class="n">txnp</span><span class="p">,</span> <span class="n">TS_HTTP_TXN_CLOSE_HOOK</span><span class="p">,</span> <span class="n">txn_contp</span><span class="p">);</span>
+      <span class="k">break</span><span class="p">;</span>
+
+   <span class="nl">default:</span>
+      <span class="n">TSAssert</span><span class="p">(</span><span class="o">!</span><span class="s">&quot;Unexpected event&quot;</span><span class="p">);</span>
+      <span class="k">break</span><span class="p">;</span>
+   <span class="p">}</span>
+
+   <span class="n">TSHttpTxnReenable</span><span class="p">(</span><span class="n">txnp</span><span class="p">,</span> <span class="n">TS_EVENT_HTTP_CONTINUE</span><span class="p">);</span>
+   <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="kt">void</span>
+<span class="nf">TSPluginInit</span> <span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span>
+<span class="p">{</span>
+   <span class="n">TSCont</span> <span class="n">contp</span><span class="p">;</span>
+
+   <span class="cm">/* Note that we do not need a mutex for this txn since it registers globally</span>
+<span class="cm">      and doesn&#39;t have any data associated with it */</span>
+   <span class="n">contp</span> <span class="o">=</span> <span class="n">TSContCreate</span><span class="p">(</span><span class="n">global_hook_handler</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
+
+   <span class="cm">/* Register gloabally */</span>
+   <span class="n">TSHttpHookAdd</span><span class="p">(</span><span class="n">TS_HTTP_TXN_START_HOOK</span><span class="p">,</span> <span class="n">contp</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>See <a href="adding-hooks">Adding Hooks</a> for background about HTTP transactions
+and HTTP hooks, as well as <a href="../http-hooks-and-transactions">HTTP Hooks and Transactions</a>
+Also see the [HTTP Transaction State Diagram ](HTTPHooksAndTransactions.html(../http-hooks-and-transactions#HHTTPTxStateDiag)
+for an illustration of the steps involved in a typical HTTP transaction.</p>
+<p>The HTTP transaction functions are:</p>
+<ul>
+<li>
+<p>%method TSHttpTxnCacheLookupStatusGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnCachedReqGet% - Note that it is an error to modify cached headers.</p>
+</li>
+<li>
+<p>%method TSHttpTxnCachedRespGet% - Note that it is an error to modify cached headers.</p>
+</li>
+<li>
+<p>%method TSHttpTxnClientIncomingPortGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnClientIPGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnClientRemotePortGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnClientReqGet% - Plugins that must read client request headers
+use this call to retrieve the HTTP header.</p>
+</li>
+<li>
+<p>%method TSHttpTxnClientRespGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnErrorBodySet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnHookAdd%</p>
+</li>
+<li>
+<p>%method TSHttpTxnNextHopIPGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnNextHopIPGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnParentProxySet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnReenable%</p>
+</li>
+<li>
+<p>%method TSHttpTxnServerIPGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnServerReqGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnServerRespGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnSsnGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnTransformedRespCache%</p>
+</li>
+<li>
+<p>%method TSHttpTxnTransformRespGet%</p>
+</li>
+<li>
+<p>%method TSHttpTxnUntransformedRespCache%</p>
+</li>
+</ul>
   </div>
 
   <div id="footer">

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/index.en.html
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/index.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/index.en.html Sat Dec 18 23:43:42 2010
@@ -6,8 +6,8 @@
     
     <link rel="stylesheet" href="/styles/pygments_style.css" />
     
-    <title></title>
-    
+    <title>Apache Traffic Server™ Software Developers Kit</title>
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
   </head>
 
   <body>
@@ -15,11 +15,51 @@
 	    <span id="ts_logo">
 		  <a href="http://trafficserver.apache.org/"><img alt="Apache Traffic Server" src="/images/ts75.png" /></a>
 	  </span>
-	    <h1></h1>
+	    <h1>Apache Traffic Server™ Software Developers Kit</h1>
     </div>
 
   <div id="content">
-      
+      <p><a href="../cache-plugin/cache-events">Prev</a> - Cache Events</p>
+<p>Adding Hooks - <a href="adding-hooks.en">Next</a></p>
+<h2 id="HTTPHooksTransactions">HTTP Hooks and Transactions</h2>
+<p>Hooks are points in Traffic Server transaction processing where plugins can
+step in and do some work. Registering a plugin function for callback amounts
+to "adding" the function to a hook. You can register your plugin to be called
+back for every single transaction or only for specific transactions.</p>
+<p>This chapter contains the following sections:</p>
+<ul>
+<li><a href="adding-hooks">Adding Hooks</a></li>
+<li><a href="http-sessions">HTTP Sessions</a></li>
+<li><a href="http-transactions">HTTP Transactions</a></li>
+<li><a href="intercepting-http-transactions">Intercepting HTTP Transaction Functions</a></li>
+<li><a href="initiate-http-connection">Initiate HTTP Connection</a></li>
+<li><a href="http-alternate-selection">HTTP Alternate Selection</a></li>
+</ul>
+<h2 id="SetofHooks">The Set of Hooks</h2>
+<p>To understand hooks and transactions, you should be familiar with the following
+terminology:</p>
+<p><strong><em>HTTP Transaction</em></strong></p>
+<p>A <strong>transaction</strong> consists of a single HTTP request from a client and the response
+Traffic Server sends to that client. Thus, a transaction begins when Traffic
+Server receives a request and ends when Traffic Server sends the response.</p>
+<p>Traffic Server uses <strong>HTTP state machines</strong> to process transactions. The state
+machines follow a complex set of states involved in sophisticated caching and
+document retrieval (taking into account, for example, alternate selection,
+freshness criteria, and hierarchical caching). The Traffic Server API provides
+hooks to a subset of these states, as illustrated in the
+<a href="#HHTTPTxStateDiag">HTTP Transaction State Diagram</a> below.</p>
+<p><strong><em>Transform hooks</em></strong></p>
+<p>The two <strong>transform hooks</strong>, <code>TS_HTTP_REQUEST_TRANSFORM_HOOK</code> and <code>TS_HTTP_RESPONSE_TRANSFORM_HOOK</code>,
+are called in the course of an HTTP transform. To see where in the HTTP transaction
+they are called, look for the "set up transform" ovals in the
+<a href="#HHTTPTxStateDiag">HTTP Transaction State Diagram</a> below.</p>
+<p><strong><em>HTTP session</em></strong></p>
+<p>A <strong>session</strong> consists of a single client connection to Traffic Server; it
+may consist of a single transaction or several transactions in succession.
+The session starts when the client connection opens and ends when the connection
+closes.</p>
+<p id="HHTTPTxStateDiag"><strong>HTTP Transaction State Diagram (<em>not yet updated</em>)</strong></p>
+<p><img alt="HTTP Transaction State Diagram" src="/images/sdk/http_state2.jpg" /></p>
   </div>
 
   <div id="footer">

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/initiate-http-connection.en.html
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/initiate-http-connection.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/initiate-http-connection.en.html Sat Dec 18 23:43:42 2010
@@ -7,7 +7,7 @@
     <link rel="stylesheet" href="/styles/pygments_style.css" />
     
     <title></title>
-    
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
   </head>
 
   <body>
@@ -19,7 +19,15 @@
     </div>
 
   <div id="content">
-      
+      <p>Title: Apache Traffic Server™ Software Developers Kit</p>
+<p><a href="intercepting-http-transactions">Prev</a> - Intercepting HTTP Transactions</p>
+<p>HTTP Alternate Selection - <a href="http-alternate-selection">Next</a></p>
+<h2 id="InitiateHTTPConnection">Initiate HTTP Connection</h2>
+<p>This function enables plugins to initiate HTTP transactions. The initiate HTTP
+connection function is:</p>
+<ul>
+<li>%method TSHttpConnect%</li>
+</ul>
   </div>
 
   <div id="footer">

Modified: websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/intercepting-http-transactions.en.html
==============================================================================
--- websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/intercepting-http-transactions.en.html (original)
+++ websites/staging/trafficserver/trunk/content/docs/trunk/sdk/http-hooks-and-transactions/intercepting-http-transactions.en.html Sat Dec 18 23:43:42 2010
@@ -6,8 +6,8 @@
     
     <link rel="stylesheet" href="/styles/pygments_style.css" />
     
-    <title></title>
-    
+    <title>Apache Traffic Server™ Software Developers Kit</title>
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
   </head>
 
   <body>
@@ -15,11 +15,22 @@
 	    <span id="ts_logo">
 		  <a href="http://trafficserver.apache.org/"><img alt="Apache Traffic Server" src="/images/ts75.png" /></a>
 	  </span>
-	    <h1></h1>
+	    <h1>Apache Traffic Server™ Software Developers Kit</h1>
     </div>
 
   <div id="content">
-      
+      <p><a href="http-transactions.html">Prev</a> - HTTP Transactions</p>
+<p>Initiate HTTP Connection - <a href="initiate-http-connection">Next</a></p>
+<h2 id="InterceptingHTTPTransactions">Intercepting HTTP Transactions</h2>
+<p>The intercepting HTTP transaction functions enable plugins to intercept transactions
+either after the request is received or upon contact with the origin server.
+The plugin then acts as the origin server using the <code>TSVConn</code> interface. The
+intercepting HTTP transaction function allow for reading <code>POST</code> bodies in plugins
+as well as using alternative transports to the origin server.The intercepting
+HTTP transaction functions are:</p>
+<ul>
+<li>%method TSHttpTxnIntercept%</li>
+</ul>
   </div>
 
   <div id="footer">



Mime
View raw message