trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrew...@apache.org
Subject svn commit: r831152 [16/37] - in /incubator/trafficserver/site/trunk/docs: ./ admin/ admin/images/ sdk/ sdk/css/ sdk/images/ sdk/images/docbook/ sdk/js/
Date Thu, 29 Oct 2009 23:23:36 GMT
Added: incubator/trafficserver/site/trunk/docs/sdk/HTTPSessionFunctions.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/HTTPSessionFunctions.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/HTTPSessionFunctions.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/HTTPSessionFunctions.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,171 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Session Functions</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="HTTPFunctions.html" title="HTTP Functions">
+<link rel="prev" href="HTTPFunctions.html" title="HTTP Functions">
+<link rel="next" href="HTTPTransactionFunctions.html" title="HTTP Transaction Functions">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<link rel="subsection" href="HTTPSessionFunctions.html#INKHttpSsnHookAdd" title="INKHttpSsnHookAdd">
+<link rel="subsection" href="HTTPSessionFunctions.html#INKHttpSsnReenable" title="INKHttpSsnReenable">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="HTTPFunctions.html">Prev</a> — HTTP Functions</div>
+<div class="navnext">HTTP Transaction Functions — <a accesskey="n" href="HTTPTransactionFunctions.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="HTTPSessionFunctions"></a>Session Functions</h3></div></div></div>
+<p></p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpSsnHookAdd"></a>INKHttpSsnHookAdd</h4></div></div></div>
+<p>Adds an HTTP session hook.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKHttpSsnHookAdd (INKHttpSsn
+                <em class="replaceable"><code>ssnp</code></em>, INKHttpHookID
+                <em class="replaceable"><code>id</code></em>, INKCont
+                <em class="replaceable"><code>contp</code></em>)</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd><p>Adds <code class="code"><em class="replaceable"><code>contp</code></em></code> to
+                the end of the list of HTTP transaction hooks specified by
+                <code class="code"><em class="replaceable"><code>id</code></em></code>. This means that
+                <code class="code"><em class="replaceable"><code>contp</code></em></code> is called back
+                for every transaction within the session, at the point
+                specified by the hook ID. Since
+                <code class="code"><em class="replaceable"><code>contp</code></em></code> is added to a
+                session, it is not possible to call
+                <code class="function">INKHttpSsnHookAdd</code> from the plugin
+                initialization routine; the plugin needs a handle to an HTTP
+                session. See the following example.</p></dd>
+<dt><span class="term"><a name="INKEvent_1"></a>Example</span></dt>
+<dd><pre class="programlisting">#include InkAPI.h
+
+static void txn_handler (INKHttpTxn txnp, INKCont contp)
+{
+     //handle transaction
+}
+
+static void handle_session (INKHttpSsn ssnp, INKCont contp)
+{
+     INKHttpSsnHookAdd (ssnp, INK_HTTP_TXN_START_HOOK, contp);
+}
+
+static int ssn_handler (INKCont contp, INKEvent event, void *edata)
+{
+    INKHttpSsn ssnp;
+    INKHttpTxn txnp;
+
+    switch (event){
+    case INK_EVENT_HTTP_SSN_START: 
+       ssnp = (INKHttpSsn) edata;
+       handle_session (ssnp, contp);
+       INKHttpSsnReenable (ssnp, INK_EVENT_HTTP_CONTINUE); 
+       return 0;
+
+    case INK_EVENT_HTTP_TXN_START:
+       txnp = (INKHttpTxn) edata;
+       txn_handler (txnp, contp);
+       INKHttpTxnReenable (txnp, INK_EVENT_HTTP_CONTINUE);
+       return 0;
+ 
+    default:
+         break;	
+    }
+    return 0;
+}
+
+void INKPluginInit (int argc, const char *argv[])
+{
+    INKCont contp;
+    contp = INKContCreate (ssn_handler, NULL);
+    INKHttpHookAdd (INK_HTTP_SSN_START_HOOK, contp);
+}</pre></dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the hook is successfully
+                added.</p>
+<p><code class="code">INK_ERROR</code> if the hook is not added.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpSsnReenable"></a>INKHttpSsnReenable</h4></div></div></div>
+<p>Re-enables an HTTP session.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKHttpSsnReenable (INKHttpSsn
+                <em class="replaceable"><code>ssnp</code></em>, INKEvent
+                <em class="replaceable"><code>event</code></em>)</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd><p>Notifies the HTTP session
+                <code class="code"><em class="replaceable"><code>ssnp</code></em></code> that the plugin
+                is done processing the current hook. If
+                <code class="code">INK_EVENT_HTTP_CONTINUE</code> is specified for
+                <code class="code"><em class="replaceable"><code>event</code></em></code>, then the plugin
+                wants the session to continue. If
+                <code class="code">INK_EVENT_HTTP_ERROR</code> is specified for
+                <code class="code"><em class="replaceable"><code>event</code></em></code>, then the plugin
+                wants the session to be terminated and for an error to be sent
+                back to the client if no response has already been
+                sent.</p></dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the session is successfully
+                re-enabled.</p>
+<p><code class="code">INK_ERROR</code> if the hook is not added.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.5</p></dd>
+</dl></div>
+</div>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/HTTPSessionFunctions.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/trafficserver/site/trunk/docs/sdk/HTTPSessions.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/HTTPSessions.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/HTTPSessions.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/HTTPSessions.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,97 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>HTTP Sessions</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="prev" href="AddingHooks.html" title="Adding Hooks">
+<link rel="next" href="HTTP_Transactions.html" title="HTTP Transactions">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="AddingHooks.html">Prev</a> — Adding Hooks</div>
+<div class="navnext">HTTP Transactions — <a accesskey="n" href="HTTP_Transactions.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="HTTPSessions"></a>HTTP Sessions</h2></div></div></div>
+<p>An HTTP session is an object that is defined for the lifetime of a
+      client’s TCP session. The Traffic Server API allows you to add a global
+      hook to the start or end of an HTTP session, and you can add session
+      hooks that call back your plugin for every transaction within a given
+      session.</p>
+<p>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 make up an HTTP transaction. The <a class="indexterm" name="id378839"></a>HTTP session<a class="indexterm" name="id378848"></a> begins when the client opens the connection, and ends
+      when the connection closes.</p>
+<p>The HTTP session hooks are:</p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<p><code class="code">INK_HTTP_SSN_START_HOOK<a class="indexterm" name="id378868"></a></code></p>
+<p>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 class="code">INK_HTTP_SSN_CLOSE_HOOK<a class="indexterm" name="id378886"></a></code></p>
+<p>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></div>
+<p>You use the session hooks to get a handle to a session (an
+      <code class="code">INKHttpSsn</code> object) and then if you want your plugin to be
+      called back for each transaction within the session, you use
+      <code class="code">INKHttpSsnHookAdd</code>.</p>
+<p>Note that you must reenable the session with
+      <code class="code">INKHttpSsnReenable</code> after processing a session hook.</p>
+<p>The session hook functions are:</p>
+<div class="itemizedlist"><ul type="disc">
+<li><p><a href="HTTPSessionFunctions.html#INKHttpSsnHookAdd" title="INKHttpSsnHookAdd">“INKHttpSsnHookAdd”</a></p></li>
+<li><p><a href="HTTPSessionFunctions.html#INKHttpSsnReenable" title="INKHttpSsnReenable">“INKHttpSsnReenable”</a></p></li>
+</ul></div>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/HTTPSessions.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/trafficserver/site/trunk/docs/sdk/HTTPTransactionFunctions.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/HTTPTransactionFunctions.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/HTTPTransactionFunctions.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/HTTPTransactionFunctions.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,925 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>HTTP Transaction Functions</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="HTTPFunctions.html" title="HTTP Functions">
+<link rel="prev" href="HTTPSessionFunctions.html" title="Session Functions">
+<link rel="next" href="InitiateConnectionFunctions.html" title="Initiate Connection">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnCacheLookupStatusGet" title="INKHttpTxnCacheLookupStatusGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnCachedReqGet" title="INKHttpTxnCachedReqGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnCachedRespGet" title="INKHttpTxnCachedRespGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnClientIncomingPortGet" title="INKHttpTxnClientIncomingPortGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnClientIPGet" title="INKHttpTxnClientIPGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnClientRemotePortGet" title="INKHttpTxnClientRemotePortGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnClientReqGet" title="INKHttpTxnClientReqGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnClientRespGet" title="INKHttpTxnClientRespGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnErrorBodySet" title="INKHttpTxnErrorBodySet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnHookAdd" title="INKHttpTxnHookAdd">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnNextHopIPGet" title="INKHttpTxnNextHopIPGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnParentProxyGet" title="INKHttpTxnParentProxyGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnParentProxySet" title="INKHttpTxnParentProxySet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnReenable" title="INKHttpTxnReenable">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnServerIPGet" title="INKHttpTxnServerIPGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnServerReqGet" title="INKHttpTxnServerReqGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnServerRespGet" title="INKHttpTxnServerRespGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnSsnGet" title="INKHttpTxnSsnGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnTransformedRespCache" title="INKHttpTxnTransformedRespCache">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnTransformRespGet" title="INKHttpTxnTransformRespGet">
+<link rel="subsection" href="HTTPTransactionFunctions.html#INKHttpTxnUntransformedRespCache" title="INKHttpTxnUntransformedRespCache">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="HTTPSessionFunctions.html">Prev</a> — Session Functions</div>
+<div class="navnext">Initiate Connection — <a accesskey="n" href="InitiateConnectionFunctions.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="HTTPTransactionFunctions"></a>HTTP Transaction Functions</h3></div></div></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnCacheLookupStatusGet"></a>INKHttpTxnCacheLookupStatusGet</h4></div></div></div>
+<p>Stores the current cache lookup status for the ongoing
+          transaction. Also stores the number of cache lookup operations
+          already performed.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKHttpTxnCacheLookupStatusGet
+                (INKHttpTxn <em class="replaceable"><code>txnp</code></em>, int
+                *<em class="replaceable"><code>lookup_status</code></em>)</code></p></dd>
+<dt><span class="term">Arguments</span></dt>
+<dd>
+<p>INKHttpTxn txnp is the ongoing transaction.</p>
+<p>int *lookup_status is set to the lookup status.</p>
+</dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Obtains the status of the current cache lookup for the
+                ongoing transaction
+                <code class="code"><em class="replaceable"><code>txnp</code></em></code> in the
+                <code class="code"><em class="replaceable"><code>lookup_status</code></em></code>
+                variable.</p>
+<p>This function should only be called from
+                <code class="code">INK_HTTP_CACHE_LOOKUP_COMPLETE_HOOK</code>.</p>
+<p>The possible status values returned in
+                <code class="code"><em class="replaceable"><code>lookup_status</code></em></code>
+                are:</p>
+<p><code class="code">INK_CACHE_LOOKUP_MISS</code> - Document was not in
+                the cache. It will be fetched from the OS.</p>
+<p><code class="code">INK_CACHE_LOOKUP_HIT_STALE</code> - Document was
+                present in the cache but stale. A fresher version will be
+                fetched from the OS (IMS request).</p>
+<p><code class="code">INK_CACHE_LOOKUP_HIT_FRESH</code> - Document was
+                present in the cache and is fresh. Document will be served
+                from the cache.</p>
+<p><code class="code">INK_CACHE_LOOKUP_SKIPPED</code> - Traffic Server
+                didn't perform a cache lookup as the request was not cacheable
+                (url looks dynamic or request marked as noncacheable).</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the API is called
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs while calling
+                the API or if an argument is invalid.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 5.2</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnCachedReqGet"></a>INKHttpTxnCachedReqGet</h4></div></div></div>
+<p>Gets the cached request header for a specified HTTP
+          transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKHttpTxnCachedReqGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, INKMBuffer
+                *<em class="replaceable"><code>bufp</code></em>, INKMLoc
+                *<em class="replaceable"><code>hdr_loc</code></em>) </code></p></dd>
+<dt><span class="term">Arguments</span></dt>
+<dd>
+<p><code class="code">INKHttpTxn</code>
+                <code class="code"><em class="replaceable"><code>txnp</code></em></code> is the ongoing
+                transaction.</p>
+<p><code class="code">int *</code><code class="code">lookup_status</code> is set to
+                the lookup status.</p>
+</dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Obtains the status of the current cache lookup for the
+                ongoing transaction
+                <code class="code"><em class="replaceable"><code>txnp</code></em></code> in the
+                <code class="code">lookup_status</code> variable.</p>
+<p>This function should only be called from
+                <code class="code">INK_HTTP_CACHE_LOOKUP_COMPLETE_HOOK</code>.</p>
+<p>The possible status values returned in
+                <code class="code">lookup_status</code> are:</p>
+<p><code class="code">INK_CACHE_LOOKUP_MISS</code> - Document was not in
+                the cache. It will be fetched from the OS.</p>
+<p><code class="code">INK_CACHE_LOOKUP_HIT_STALE</code> - Document was
+                present in the cache but stale. A fresher version will be
+                fetched from the OS (IMS request).</p>
+<p><code class="code">INK_CACHE_LOOKUP_HIT_FRESH</code> - Document was
+                present in the cache and is fresh. Document will be served
+                from the cache.</p>
+<p><code class="code">INK_CACHE_LOOKUP_SKIPPED</code> - Traffic Server
+                didn't perform a cache lookup as the request was not cacheable
+                (url looks dynamic or request marked as noncacheable).</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the API is called
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs while calling
+                the API or if an argument is invalid.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 5.2</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnCachedRespGet"></a>INKHttpTxnCachedRespGet</h4></div></div></div>
+<p>Gets the cached response header for a specified HTTP
+          transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">int INKHttpTxnCachedRespGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, INKMBuffer
+                *<em class="replaceable"><code>bufp</code></em>, INKMLoc
+                *<em class="replaceable"><code>hdr_loc</code></em>) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Retrieves the cached response header from the HTTP
+                transaction <code class="code"><em class="replaceable"><code>txnp</code></em></code> and
+                stores the cached response header in bufp, at location
+                <code class="code"><em class="replaceable"><code>hdr_loc</code></em></code>.</p>
+<p>Call after <code class="code">SEND_RESPONSE_HDR_HOOK</code>.</p>
+<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Caution">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="images/docbook/caution.png"></td>
+<th align="left">Caution</th>
+</tr>
+<tr><td align="left" valign="top"><p>Do not modify any cached response headers returned by
+                  <code class="function">INKHttpTxnCachedRespGet</code>. The underlying
+                  data structure is read-only. Release the returned
+                  <code class="code"><em class="replaceable"><code>hdr_loc</code></em></code> with a call
+                  to <code class="function">INKHandleMLocRelease</code>.</p></td></tr>
+</table></div>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>If the cached response header does not exist, then
+                <code class="function">INKHttpTxnCachedRespGet</code> returns 0.</p>
+<p>Otherwise returns 1.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnClientIncomingPortGet"></a>INKHttpTxnClientIncomingPortGet</h4></div></div></div>
+<p>Gets the port on which the incoming request is
+          received.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">int INKHttpTxnClientIncomingPortGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Returns the port on which the HTTP transaction
+                <code class="code"><em class="replaceable"><code>txnp</code></em></code> was received.
+                This is not the destination port in the URL. It is the proxy
+                port to which the client browser is pointed.</p>
+<p>Call after <code class="code">TXN_START_HOOK</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>The port number in host byte order.</p>
+<p>Returns -1 if an error occurred.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.5</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnClientIPGet"></a>INKHttpTxnClientIPGet</h4></div></div></div>
+<p>Gets the client IP address for a specified HTTP
+          transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">unsigned int INKHttpTxnClientIPGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Returns the IP address of the client for the HTTP
+                transaction
+                <code class="code"><em class="replaceable"><code>txnp</code></em></code>.</p>
+<p><code class="function">INKHttpTxnClientIPGet</code> returns the
+                IP address in network byte order.</p>
+<p>Call after <code class="code">TXN_START_HOOK</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>The client IP address.</p>
+<p>Returns 0 if an error occurred.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnClientRemotePortGet"></a>INKHttpTxnClientRemotePortGet</h4></div></div></div>
+<p>Gets the remote host’s port number for a specified HTTP
+          transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode
+                INKHttpTxnClientRemotePortGet(INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, int
+                *<em class="replaceable"><code>port</code></em>)</code></p></dd>
+<dt><span class="term">Arguments</span></dt>
+<dd>
+<p><code class="code">INKHttpTxn</code>
+                <code class="code"><code class="code"><em class="replaceable"><code>txnp</code></em></code></code> is
+                an HTTP transaction.</p>
+<p><code class="code">int
+                *</code><code class="code"><em class="replaceable"><code>port</code></em></code> is set to
+                the client’s remote port value (port number used by the client
+                when creating a socket connection with the proxy for the
+                transaction <code class="code"><em class="replaceable"><code>txnp</code></em></code>) in
+                network byte order.</p>
+</dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Obtains the port number of the remote host for the
+                specified HTTP transaction. The port number is returned in
+                network byte order.</p>
+<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/docbook/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>This is an exception to the rule that port numbers are
+                  retrieved in host byte order.</p></td></tr>
+</table></div>
+<p>The proxy port on which the connection was accepted can
+                be retrieved using
+                <code class="function">INKHttpTxnClientIncomingPortGet</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the API is called
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs while calling
+                the API or if an argument is invalid.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 5.2</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnClientReqGet"></a>INKHttpTxnClientReqGet</h4></div></div></div>
+<p>Gets the client request header for a specified HTTP
+          transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">int INKHttpTxnClientReqGet (INKHttpTxn txnp,
+                INKMBuffer *bufp, INKMLoc *hdr_loc) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Retrieves the client request header from the HTTP
+                transaction <code class="code"><em class="replaceable"><code>txnp</code></em></code>.
+                <code class="function">INKHttpTxnClientReqGet</code> stores the client
+                request header in
+                <code class="code"><em class="replaceable"><code>bufp</code></em></code>, at location
+                <code class="code"><em class="replaceable"><code>hdr_loc</code></em></code>.</p>
+<p>Call after <code class="code">READ_REQUEST_HDR_HOOK</code>.</p>
+<p>Release the returned
+                <code class="code"><em class="replaceable"><code>hdr_loc</code></em></code> with a call to
+                <code class="function">INKHandleMLocRelease</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>If the client request header does not exist or in case
+                of an error, then <code class="function">INKHttpTxnClientReqGet</code>
+                returns 0.</p>
+<p>Otherwise returns 1.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnClientRespGet"></a>INKHttpTxnClientRespGet</h4></div></div></div>
+<p>Gets the client response header for a specified HTTP
+          transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">int INKHttpTxnClientRespGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, INKMBuffer
+                *<em class="replaceable"><code>bufp</code></em>, INKMLoc
+                *<em class="replaceable"><code>hdr_loc</code></em>) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Retrieves the client response header from the HTTP
+                transaction <code class="code"><em class="replaceable"><code>txnp</code></em></code>.
+                <code class="function">INKHttpTxnClientRespGet</code> stores the client
+                response header in
+                <code class="code"><em class="replaceable"><code>bufp</code></em></code>, at location
+                <code class="code"><em class="replaceable"><code>hdr_loc</code></em></code>.</p>
+<p>Call after <code class="code">SEND_RESPONSE_HOOK</code>.</p>
+<p>Release the returned
+                <code class="code"><em class="replaceable"><code>hdr_loc</code></em></code> with a call to
+                <code class="function">INKHandleMLocRelease</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>If the client response header does not exist or in the
+                case of an error, then
+                <code class="function">INKHttpTxnClientRespGet</code> returns 0.</p>
+<p>Otherwise returns 1.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnErrorBodySet"></a>INKHttpTxnErrorBodySet</h4></div></div></div>
+<p>Sets the format and content of the error body (or response
+          data) that Traffic Server sends to clients.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKHttpTxnErrorBodySet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, char
+                *<em class="replaceable"><code>buf</code></em>, int
+                <em class="replaceable"><code>buflength</code></em>, char
+                *<em class="replaceable"><code>mimetype</code></em>)</code></p></dd>
+<dt><span class="term">Arguments</span></dt>
+<dd>
+<p><code class="code"><em class="replaceable"><code>txnp</code></em></code> is the HTTP
+                transaction to act upon.</p>
+<p><code class="code"><em class="replaceable"><code>buf</code></em></code> contains the
+                error (or response) body. The error body can be text, an HTML
+                document, image, or another format. Before you call
+                <code class="function">INKHttpTxnErrorBodySet</code>, be sure to
+                allocate <code class="code"><em class="replaceable"><code>buf</code></em></code> using
+                <code class="function">INKmalloc</code>.</p>
+<p><code class="code"><em class="replaceable"><code>buflength</code></em></code> is the
+                length of the error body.</p>
+<p><code class="code"><em class="replaceable"><code>mimetype</code></em></code>
+                contains the format of the error body. If you want to set the
+                <code class="code"><em class="replaceable"><code>mimetype</code></em></code> to a value
+                other than <code class="code">NULL</code>, you must allocate
+                <code class="code"><em class="replaceable"><code>mimetype</code></em></code> using
+                <code class="function">INKmalloc</code> before you call
+                <code class="function">INKHttpTxnErrorBodySet</code>.</p>
+</dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Sets the format of the error body that Traffic Server
+                sends back when sending an error or response to a client. The
+                error body data is stored in the buffer
+                <code class="code"><em class="replaceable"><code>buf</code></em></code>. If the error body
+                is just plain text, setting mimetype to <code class="code">NULL</code>
+                works fine. If the error body is HTML then
+                <code class="code"><em class="replaceable"><code>mimetype</code></em></code> should be
+                "<code class="code">text/html</code>". If the error body is a JPEG image
+                then <code class="code"><em class="replaceable"><code>mimetype</code></em></code> should
+                be “image/jpeg".</p>
+<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/docbook/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>Traffic Server automatically calls
+                  <code class="function">INKfree</code> to free buf when
+                  <code class="code"><em class="replaceable"><code>buf</code></em></code> is no longer
+                  needed; make sure that the buffer
+                  <code class="code"><em class="replaceable"><code>buf</code></em></code> is allocated by
+                  a call to <code class="function">INKmalloc</code>. Similarly, if you
+                  want to set <code class="code"><em class="replaceable"><code>mimetype</code></em></code>
+                  to something other than <code class="code">NULL</code>, make sure that
+                  you allocate
+                  <code class="code"><em class="replaceable"><code>mimetype</code></em></code> with a call
+                  to <code class="function">INKmalloc</code>. Traffic Server
+                  automatically calls <code class="function">INKfree</code> to free
+                  <code class="code"><em class="replaceable"><code>mimetype</code></em></code>.</p></td></tr>
+</table></div>
+<p>Call after <code class="code">SEND_RESPONSE_HDR_HOOK</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnHookAdd"></a>INKHttpTxnHookAdd</h4></div></div></div>
+<p>Adds a continuation to the list of HTTP transaction hooks for
+          a specified HTTP transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKHttpTxnHookAdd (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, INKHttpHookID
+                <em class="replaceable"><code>id</code></em>, INKCont
+                <em class="replaceable"><code>contp</code></em>) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Adds <code class="code"><em class="replaceable"><code>contp</code></em></code> to
+                the end of the list of HTTP transaction hooks specified by
+                <code class="code"><em class="replaceable"><code>id</code></em></code>. Since
+                <code class="code"><em class="replaceable"><code>contp</code></em></code> is added to a
+                transaction, it is not possible to call
+                <code class="function">INKHttpTxnHookAdd</code> from the plugin
+                initialization routine but only when the plugin has a handle
+                to an HTTP transaction.</p>
+<p>Call after <code class="code">HTTP_TXN_START_HOOK</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnNextHopIPGet"></a>INKHttpTxnNextHopIPGet</h4></div></div></div>
+<p>Gets the IP address of the next server from which Traffic
+          Server tries to retrieve requested HTTP content.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">unsigned int INKHttpTxnNextHopIPGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Returns the IP address of the next server from which
+                Traffic Server attempts to retrieve the requested document, in
+                network byte order. This IP address could be the origin server
+                IP address or it could be the parent proxy’s IP
+                address.</p>
+<p>Call after <code class="code">SEND_REQUEST_HDR_HOOK</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>Returns the IP address of the next server from which
+                Traffic Server attempts to retrieve the request, in network
+                byte order.</p>
+<p>Returns 0 if an error occurred.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnParentProxyGet"></a>INKHttpTxnParentProxyGet</h4></div></div></div>
+<p>Gets the parent proxy name and port, if parent proxying is
+          enabled.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKHttpTxnParentProxyGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, char
+                **<em class="replaceable"><code>hostname</code></em>, int
+                *<em class="replaceable"><code>port</code></em>)</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Retrieves the value set previously by
+                <code class="function">INKHttpParentProxySet</code>. Does not return
+                values set in <code class="filename">records.config</code> parameter
+                <em class="parameter"><code>proxy.config.http.parent_proxies</code></em> or in
+                <code class="filename">parent.config</code> file.</p>
+<p>This function can be called from within any
+                <code class="code">txn</code> hook.</p>
+<p>The <code class="code">hostname</code> string returned must not be
+                deallocated.</p>
+<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/docbook/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>If parent proxying is not enabled,
+                  <code class="function">INKHttpTxnParentProxyGet</code> returns
+                  <code class="code">NULL</code> in hostname and -1 in port.</p></td></tr>
+</table></div>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnParentProxySet"></a>INKHttpTxnParentProxySet</h4></div></div></div>
+<p>Sets the parent proxy name and port.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKHttpTxnParentProxySet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, char
+                *<em class="replaceable"><code>hostname</code></em>, int
+                <em class="replaceable"><code>port</code></em>)</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>This can be used to overwrite the value set in
+                <code class="filename">records.config</code> parameter
+                <em class="parameter"><code>proxy.config.http.parent_proxies</code></em> or in
+                <code class="filename">parent.config</code> file.</p>
+<p>Call before or within
+                <code class="code">CACHE_LOOKUP_COMPLETE</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnReenable"></a>INKHttpTxnReenable</h4></div></div></div>
+<p>Tells a transaction whether or not the processing of a
+          particular hook has completed.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKHttpTxnReenable (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, INKEvent
+                <em class="replaceable"><code>event</code></em>) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Notifies the HTTP transaction txnp that the plugin is
+                done processing the current hook. If
+                <code class="code">INK_EVENT_HTTP_CONTINUE</code> is specified for
+                <code class="code"><em class="replaceable"><code>event</code></em></code>, then the plugin
+                wants the transaction to continue. If
+                <code class="code">INK_EVENT_HTTP_ERROR</code> is specified for
+                <code class="code"><em class="replaceable"><code>event</code></em></code>, then the plugin
+                wants the transaction to be terminated and for an error to be
+                sent back to the client if no response has already been
+                sent.</p>
+<p>You must always re-enable the HTTP transaction after the
+                processing of each transaction event. However, never re-enable
+                twice. Re-enabling twice is a serious error.</p>
+<p>When event is set to <code class="code">INK_EVENT_HTTP_ERROR</code>,
+                Traffic Server performs different processing depending on the
+                type of hook involved.</p>
+<p><code class="code">INK_HTTP_TXN_START_HOOK</code>: The transaction is
+                stopped right away, the connection to the client is closed,
+                and no response is sent back to the origin server.</p>
+<p><code class="code">INK_HTTP_READ_REQUEST_HDR_HOOK</code>: Traffic
+                Server does not send any request to the origin server, it
+                directly sends a 500 to the client.</p>
+<p><code class="code">INK_HTTP_SEND_REQUEST_HDR_HOOK</code>: Traffic
+                Server opens a connection to the origin server, sends an empty
+                request to the origin server, and sends back 500 to the
+                client. Then the connection to the origin server is
+                closed.</p>
+<p><code class="code">INK_HTTP_READ_RESPONSE_HDR_HOOK</code>,
+                <code class="code">INK_HTTP_SEND_RESPONSE_HOOK</code>,
+                <code class="code">INK_HTTP_OS_DNS_HOOK</code>,
+                <code class="code">INK_HTTP_READ_CACHE_HDR_HOOK</code>, and
+                <code class="code">INK_HTTP_CACHE_LOOKUP_COMPLETE_HOOK</code>: Traffic
+                Server receives all the headers of the response from the
+                origin server, then closes the connection to the origin server
+                and sends a 500 to the client. TS does not receive the
+                response body.</p>
+<p><code class="code">INK_HTTP_TXN_CLOSE_HOOK</code>: The client
+                receives whatever answer was sent by the origin server because
+                with this hook, the response has already been sent to the
+                client.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnServerIPGet"></a>INKHttpTxnServerIPGet</h4></div></div></div>
+<p>Gets the origin server IP address for a specified HTTP
+          transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">unsigned int INKHttpTxnServerIPGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Returns the IP address of the origin server specified by
+                the client request in network byte order.
+                <code class="function">INKHttpTxnServerIPGet</code> returns 0 if it is
+                called before <code class="code">INK_HTTP_OS_DNS_HOOK</code> in a
+                transaction.</p>
+<p>Call after <code class="code">INK_HTTP_OS_DNS_HOOK</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>Returns the origin server IP address in network byte
+                order.</p>
+<p>Returns 0 if an error occurred.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnServerReqGet"></a>INKHttpTxnServerReqGet</h4></div></div></div>
+<p>Gets the server request header from a specified HTTP
+          transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">int INKHttpTxnServerReqGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, INKMBuffer
+                *<em class="replaceable"><code>bufp</code></em>, INKMLoc
+                *<em class="replaceable"><code>hdr_loc</code></em>)</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Retrieves the server request header from the HTTP
+                transaction <code class="code"><em class="replaceable"><code>txnp</code></em></code>.
+                <code class="function">INKHttpTxnServerReqGet</code> stores the server
+                request header in
+                <code class="code"><em class="replaceable"><code>bufp</code></em></code>, at location
+                <code class="code"><em class="replaceable"><code>hdr_loc</code></em></code>.</p>
+<p>Call after <code class="code">SEND_REQUEST_HDR_HOOK</code>.</p>
+<p>Release the returned
+                <code class="code"><em class="replaceable"><code>hdr_loc</code></em></code> with a call to
+                <code class="function">INKHandleMLocRelease</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>If the server request header does not exist or in the
+                case of an error, then
+                <code class="function">INKHttpTxnServerReqGet</code> returns 0.</p>
+<p>Otherwise returns 1.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnServerRespGet"></a>INKHttpTxnServerRespGet</h4></div></div></div>
+<p>Gets the server response header from a specified HTTP
+          transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">int INKHttpTxnServerRespGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, INKMBuffer
+                *<em class="replaceable"><code>bufp</code></em>, INKMLoc
+                *<em class="replaceable"><code>hdr_loc</code></em>) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Retrieves the server response header from the HTTP
+                transaction <code class="code"><em class="replaceable"><code>txnp</code></em></code>.
+                <code class="function">INKHttpTxnServerRespGet</code> stores the server
+                response header in
+                <code class="code"><em class="replaceable"><code>bufp</code></em></code>, at location
+                <code class="code"><em class="replaceable"><code>hdr_loc</code></em></code>.</p>
+<p>Call after <code class="code">READ_RESPONSE_HDR_HOOK</code>.</p>
+<p>Release the returned
+                <code class="code"><em class="replaceable"><code>hdr_loc</code></em></code> with a call to
+                <code class="function">INKHandleMLocRelease</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>If the server response header does not exist or in the
+                case of an error, then
+                <code class="function">INKHttpTxnServerRespGet</code> returns 0.</p>
+<p>Otherwise returns 1.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnSsnGet"></a>INKHttpTxnSsnGet</h4></div></div></div>
+<p>Returns the session handle associated to a specified HTTP
+          transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKHttpSsn INKHttpTxnSsnGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Retrieves the <code class="function">INKHttpSsn</code> handle
+                associated with the HTTP transaction
+                <code class="code"><em class="replaceable"><code>txnp</code></em></code>.</p>
+<p>Call after <code class="code">TXN_START_HOOK</code>.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>The session handle associated with the specified HTTP
+                transaction.</p>
+<p><code class="code">INK_ERROR_PTR</code> if error.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnTransformedRespCache"></a>INKHttpTxnTransformedRespCache</h4></div></div></div>
+<p>Indicates whether or not Traffic Server writes transformed
+          documents to the cache.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKHttpTxnTransformedRespCache
+                (INKHttpTxn <em class="replaceable"><code>txnp</code></em>, int
+                <em class="replaceable"><code>on</code></em>)</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Specifies whether the transformed document should be
+                written to the cache or not. If a transformation is occurring
+                the default is for the transformed copy to be written to the
+                cache. The default maintains a rule that only a single version
+                of a document will be written to the cache for a single
+                transaction. It is valid for that rule to be broken by
+                specifying that both the transformed and the un-transformed
+                documents be written to the cache. Calls need to be made prior
+                to the actual transformation, (i.e. at the time of creating
+                the transformation) rather than in the transformation.</p>
+<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/docbook/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>This function does not overwrite HTTP directives, like
+                  <code class="code">Cache-Control</code> or <code class="code">Expire</code>, that
+                  determine whether or not a document may be cached. If the
+                  document can be cached, this function determines whether or
+                  not to cache the transformed version. Untransformed and
+                  transformed documents are cached as HTTP alternates.</p></td></tr>
+</table></div>
+<p>Call from within or after hook
+                <code class="code">TXN_START_HOOK</code>.</p>
+<p>If called after hook <code class="code">SEND_RESPONSE_HDR</code>,
+                this function will not be taken into account by TS.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnTransformRespGet"></a>INKHttpTxnTransformRespGet</h4></div></div></div>
+<p>Gets the transform response header from a specified HTTP
+          transaction.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">int INKHttpTxnTransformRespGet (INKHttpTxn
+                <em class="replaceable"><code>txnp</code></em>, INKMBuffer
+                *<em class="replaceable"><code>bufp</code></em>, INKMLoc
+                *<em class="replaceable"><code>offset</code></em>) </code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Retrieves the transform response header from the HTTP
+                transaction <code class="code"><em class="replaceable"><code>txnp</code></em></code> and
+                stores the transform response header in
+                <code class="code"><em class="replaceable"><code>bufp</code></em></code>, at location
+                <code class="code"><em class="replaceable"><code>offset</code></em></code>.</p>
+<p>Call from within your transformation, before transform
+                data is written to the downstream vconnection.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p>If the transform response header does not exist, then
+                <code class="function">INKHttpTxnTransformRespGet</code> returns
+                0.</p>
+<p>Otherwise returns 1.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="INKHttpTxnUntransformedRespCache"></a>INKHttpTxnUntransformedRespCache</h4></div></div></div>
+<p>Indicates whether or not Traffic Server writes un-transformed
+          documents to the cache.</p>
+<div class="variablelist"><dl>
+<dt><span class="term">Prototype</span></dt>
+<dd><p><code class="code">INKReturnCode INKHttpTxnUntransformedRespCache
+                (INKHttpTxn <em class="replaceable"><code>txnp</code></em>, int
+                <em class="replaceable"><code>on</code></em>)</code></p></dd>
+<dt><span class="term">Description</span></dt>
+<dd>
+<p>Specifies whether the un-transformed document should be
+                written to the cache or not. If there is no transformation
+                occurring then the default is for the un-transformed copy to
+                be written to the cache. If a transformation is occurring the
+                default is for the un-transformed copy to not be written to
+                the cache. The defaults maintain a rule that only a single
+                version of a document will be written to the cache for a
+                single transaction. It is valid for that rule to be broken by
+                specifying that both the transformed and un-transformed
+                document be written to the cache. Calls need to be made prior
+                to the actual transformation, (i.e. at the time of creating
+                the transformation) rather than in the transformation.</p>
+<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/docbook/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>This function does not overwrite HTTP directives, like
+                  Cache-Control or Expire, that determine whether or not a
+                  document can be cached. If the document can be cached, this
+                  function determines whether or not to cache the
+                  untransformed version. Untransformed and transformed
+                  documents are cached as HTTP alternates.</p></td></tr>
+</table></div>
+<p>Call from within or after hook
+                <code class="code">TXN_START_HOOK</code>.</p>
+<p>If called after hook <code class="code">SEND_RESPONSE_HDR</code>,
+                this function will not be taken into account by TS.</p>
+</dd>
+<dt><span class="term">Returns</span></dt>
+<dd>
+<p><code class="code">INK_SUCCESS</code> if the operation completes
+                successfully.</p>
+<p><code class="code">INK_ERROR</code> if an error occurs.</p>
+</dd>
+<dt><span class="term">First release</span></dt>
+<dd><p>Traffic Server 3.0</p></dd>
+</dl></div>
+</div>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/HTTPTransactionFunctions.html
------------------------------------------------------------------------------
    svn:keywords = Id

Added: incubator/trafficserver/site/trunk/docs/sdk/HTTPTransformationPlugins.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/sdk/HTTPTransformationPlugins.html?rev=831152&view=auto
==============================================================================
--- incubator/trafficserver/site/trunk/docs/sdk/HTTPTransformationPlugins.html (added)
+++ incubator/trafficserver/site/trunk/docs/sdk/HTTPTransformationPlugins.html Thu Oct 29 23:23:25 2009
@@ -0,0 +1,204 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Chapter 5. HTTP Transformation Plugins</title>
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/reset/reset-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/fonts/fonts-min.css" type="text/css">
+<link rel="stylesheet" href="http://yui.yahooapis.com/2.2.2/build/treeview/assets/tree.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc.css" type="text/css">
+<link rel="stylesheet" href="css/ydoc-chunk.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="up" href="index.html" title="Traffic Server Software Developers Kit">
+<link rel="prev" href="SetTransactionHook.html" title="Setting a Transaction Hook">
+<link rel="next" href="SampleNullTransformPlugin.html" title="The Sample Null Transform Plugin">
+<link rel="preface" href="Preface.html" title="Preface">
+<link rel="chapter" href="GetingStarted.html" title="Chapter 1. Getting Started">
+<link rel="chapter" href="CreatingTSPlugins.html" title="Chapter 2. How to Create Traffic Server Plugins">
+<link rel="index" href="CreatingTSPlugins.html#id372630" title="Index">
+<link rel="chapter" href="ch03.html" title="Chapter 3. Remap Plugin">
+<link rel="chapter" href="HeaderBasedPluginEx.html" title="Chapter 4. Header-Based Plugin Examples">
+<link rel="chapter" href="HTTPTransformationPlugins.html" title="Chapter 5. HTTP Transformation Plugins">
+<link rel="chapter" href="NewProtocolPlugins.html" title="Chapter 6. New Protocol Plugins">
+<link rel="chapter" href="ch07.html" title="Chapter 7. Cache Plugin">
+<link rel="chapter" href="HTTPHooksAndTransactions.html" title="Chapter 8. HTTP Hooks and Transactions">
+<link rel="chapter" href="MiscellaneousInterfaceGuide.html" title="Chapter 9. Miscellaneous Interface Guide">
+<link rel="chapter" href="HTTPHeaders.html" title="Chapter 10. HTTP Headers">
+<link rel="chapter" href="MutexGuide.html" title="Chapter 11. Mutex Guide">
+<link rel="chapter" href="Continuations.html" title="Chapter 12. Continuations">
+<link rel="chapter" href="PluginConfigurations.html" title="Chapter 13. Plugin Configurations">
+<link rel="chapter" href="ActionsGuide.html" title="Chapter 14. Actions Guide">
+<link rel="chapter" href="IOGuide.html" title="Chapter 15. IO Guide">
+<link rel="chapter" href="PluginManagement.html" title="Chapter 16. Plugin Management">
+<link rel="chapter" href="AddingStatistics.html" title="Chapter 17. Adding Statistics">
+<link rel="chapter" href="FunctionReference.html" title="Chapter 18. Function Reference">
+<link rel="appendix" href="App_SampleSourceCode.html" title="Appendix A. Sample Source Code">
+<link rel="appendix" href="App_DeprecatedFunctions.html" title="Appendix B. Deprecated Functions">
+<link rel="appendix" href="App_Troubleshooting.html" title="Appendix C. Troubleshooting Tips">
+<link rel="appendix" href="FunctionIndex.html" title="Appendix D. Function Index">
+<link rel="appendix" href="TypeIndex.html" title="Appendix E. Type Index">
+<link rel="index" href="ConceptIndex.html" title="Index">
+<link rel="section" href="HTTPTransformationPlugins.html#WritingContentTransformPlugins" title="Writing Content Transform Plugins">
+<link rel="section" href="SampleNullTransformPlugin.html" title="The Sample Null Transform Plugin">
+<link rel="section" href="AppendTransformPlugin.html" title="The Append-Transform Plugin">
+<link rel="section" href="SampleBufferedNullTransformPlugin.html" title="The Sample Buffered Null Transform Plugin">
+<script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/yahoo/yahoo-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/event/event-min.js"></script><script type="text/javascript" src="http://yui.yahooapis.com/2.2.2/build/treeview/treeview-min.js"></script><script type="text/javascript" src="js/tocnodes.js"></script><script type="text/javascript" src="js/toc.js"></script><script type="text/javascript">
+    document.write("<style> div.toc {display: none} </style>"); 
+  </script>
+</head>
+<body>
+<div class="doctitle">
+<a href="index.html">Home</a>
+<img src="images/docbook/ts75.png"><h1 class="doctitle">Traffic Server Software Developers Kit</h1>
+</div>
+<div class="navheader">
+<div class="navprev">
+<a accesskey="p" href="SetTransactionHook.html">Prev</a> — Setting a Transaction Hook</div>
+<div class="navnext">The Sample Null Transform Plugin — <a accesskey="n" href="SampleNullTransformPlugin.html">Next</a>
+</div>
+</div>
+<div id="toc"></div>
+<div class="chapter" lang="en">
+<div class="titlepage"><div><div><h2 class="title">
+<a name="HTTPTransformationPlugins"></a>Chapter 5. HTTP Transformation Plugins</h2></div></div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"><a href="HTTPTransformationPlugins.html#WritingContentTransformPlugins">Writing Content Transform Plugins</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="HTTPTransformationPlugins.html#Transformations">Transformations</a></span></dt>
+<dt><span class="section"><a href="HTTPTransformationPlugins.html#VIOs">VIOs</a></span></dt>
+<dt><span class="section"><a href="HTTPTransformationPlugins.html#IOBuffers">IO Buffers</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="SampleNullTransformPlugin.html">The Sample Null Transform Plugin</a></span></dt>
+<dt><span class="section"><a href="AppendTransformPlugin.html">The Append-Transform Plugin</a></span></dt>
+<dt><span class="section"><a href="SampleBufferedNullTransformPlugin.html">The Sample Buffered Null Transform Plugin</a></span></dt>
+</dl>
+</div>
+<p>Transform plugins examine or transform HTTP message body content.
+    For example, transform plugins can</p>
+<div class="itemizedlist"><ul type="disc">
+<li><p>Append text to HTML documents</p></li>
+<li><p>Compress images</p></li>
+<li><p>Do virus checking (on client POST data or server response
+        data)</p></li>
+<li><p>Do content-based filtering (filter out HTML documents that
+        contain certain terms or expressions)</p></li>
+</ul></div>
+<p>In this chapter you can learn how to write transform plugins. The
+    following examples are discussed in detail:</p>
+<div class="itemizedlist"><ul type="disc">
+<li><p><a href="SampleNullTransformPlugin.html" title="The Sample Null Transform Plugin">“The Sample Null Transform Plugin”</a></p></li>
+<li><p><a href="AppendTransformPlugin.html" title="The Append-Transform Plugin">“The Append-Transform Plugin”</a></p></li>
+<li><p><a href="SampleBufferedNullTransformPlugin.html" title="The Sample Buffered Null Transform Plugin">“The Sample Buffered Null Transform Plugin”</a></p></li>
+</ul></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="WritingContentTransformPlugins"></a>Writing Content Transform Plugins<a class="indexterm" name="id374305"></a></h2></div></div></div>
+<p>Content transformation plugins transform HTTP response content
+      (such as images or HTML documents), and HTTP request content such as
+      client POST data. Because the data stream to be transformed is of
+      variable length, these plugins must use a mechanism that passes data
+      from buffer to buffer and checks to see if the end of the data stream is
+      reached.</p>
+<p>This mechanism is provided by virtual connections (vconnections)
+      and virtual IO descriptors (VIOs).</p>
+<p>A <span class="emphasis"><em>vconnection</em></span> is an abstraction for a data
+      pipe that allows its users to perform asynchronous reads and writes
+      without knowing the underlying implementation. A transformation is a
+      specific type of vconnection. A
+      <span class="emphasis"><em>transformation</em></span><a class="indexterm" name="id374327"></a> connects an input data source and an output data sink;
+      this feature enables it to view and modify all the data passing through
+      it.</p>
+<p>Transformations can be chained together, one after the other, so
+      that multiple transformations can be performed on the same content. The
+      vconnection type, <code class="code">INKVConn</code>, is actually a subclass of
+      INKCont, which means that vconnections (and transformations) are
+      continuations. Vconnections and transformations can thus exchange
+      events, informing one another (for example) that data is available for
+      reading or writing, or that the end of a data stream is reached.</p>
+<p>A VIO<a class="indexterm" name="id374345"></a> is a description of an in-progress IO operation. Every
+      vconnection has an associated input VIO and an associated output VIO.
+      When vconnections are transferring data to one another, one
+      vconnection’s input VIO is another vconnection’s output VIO. A
+      vconnection’s input VIO is also called its write VIO<a class="indexterm" name="id374354"></a> because the input VIO refers to a write operation
+      performed on the vconnection itself. Similarly, the outpt VIO is also
+      called the read VIO<a class="indexterm" name="id374362"></a>. For transformations, which are designed to pass data in
+      one direction, you can picture the relationship between the
+      transformation vconnection and its VIOs as follows:</p>
+<div class="figure">
+<a name="Fig_TransformationAndVIOs"></a><p class="title"><b>Figure 5.1. A Transformation and its VIOs</b></p>
+<div class="mediaobject"><img src="images/vconnection.jpg" alt="A Transformation and its VIOs"></div>
+</div>
+<p>Because the Traffic Server API places transformations directly in
+      the response or request data stream, the transformation vconnection is
+      responsible only for reading the data from the input buffer,
+      transforming it, and writing it to the output buffer. The upstream
+      vconnection writes the incoming data to the transformation’s input
+      buffer. In <a href="HTTPTransformationPlugins.html#Fig_TransformationAndVIOs" title="Figure 5.1. A Transformation and its VIOs">Figure 5.1, “A Transformation and its VIOs”</a>, the input VIO
+      describes the progress of the upstream vconnection’s write operation on
+      the transformation, and the output VIO describes the progress of the
+      transformation’s write operation on the output (downstream) vconnection.
+      The nbytes value in the VIO is the total number of bytes to be written.
+      The ndone value is the current progress, the number of bytes
+      written.</p>
+<p>When writing a transformation plugin, you need to understand both
+      implementing and using vconnections. The implementor’s side refers to
+      how to implement a vconnection that others can use. At minimum, a
+      transform plugin creates a transformation that sits in the data stream
+      and must be able to handle the events that the upstream and downstream
+      vconnections send it. The user’s side refers to how to use a vconnection
+      to read or write data. Transformations output (write) data, at the very
+      least.</p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="Transformations"></a>Transformations</h3></div></div></div>
+<p></p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="VIOs"></a>VIOs</h3></div></div></div>
+<p>A VIO or virtual IO is a description of an in progress IO
+        operation. The VIO data structure is used by vconnection users to
+        determine how much progress has been made on a particular IO operation
+        and to re-enable an IO operation when it stalls due to buffer space.
+        VIOs are used by vconnection implementors to determine the buffer for
+        an IO operation, to determine how much work to do on the IO operation
+        and to determine which continuation to call back when progress on the
+        IO operation is made.</p>
+<p>The <code class="code">INKVIO<a class="indexterm" name="id374498"></a></code> data structure itself is opaque, but it might
+        have been defined as follow</p>
+<pre class="programlisting">typedef struct {
+     INKCont continuation;
+     INKVConn vconnection;
+     INKIOBufferReader reader;
+     INKMutex mutex;
+     int nbytes;
+     int ndone;
+} *INKVIO;</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="IOBuffers"></a>IO Buffers</h3></div></div></div>
+<p>The IO buffer data structure is the building block of the
+        vconnection abstraction. An IO buffer is composed of a list of buffer
+        blocks which in turn point to buffer data. Both the buffer block
+        (<code class="code">INKIOBufferBlock</code>) and buffer data
+        (<code class="code">INKIOBufferData</code>) data structures are reference counted
+        so that they can reside in multiple buffers at the same time. This
+        makes it extremely efficient to copy data from one IO buffer to
+        another using <code class="code">INKIOBufferCopy</code> since Traffic Server only
+        needs to copy pointers and adjust reference counts appropriately and
+        not actually copy any data.</p>
+<p>The IO buffer abstraction provides for a single writer and
+        multiple readers. In order for the readers to have no knowledge of
+        each other, they manipulate IO buffers through
+        the<code class="code">INKIOBufferReader</code> data structure. Since only a single
+        writer is allowed, there is no corresponding
+        <code class="code">INKIOBufferWriter</code> data structure. The writer simply
+        modifies the IO buffer directly.</p>
+</div>
+</div>
+</div>
+</body>
+</html>

Propchange: incubator/trafficserver/site/trunk/docs/sdk/HTTPTransformationPlugins.html
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message