trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sji...@apache.org
Subject svn commit: r929770 - in /incubator/trafficserver/site/trunk/docs/v2/sdk: RemapAPI_Example.html ch03.html css/ydoc.css
Date Thu, 01 Apr 2010 01:40:22 GMT
Author: sjiang
Date: Thu Apr  1 01:40:22 2010
New Revision: 929770

URL: http://svn.apache.org/viewvc?rev=929770&view=rev
Log:
Fixed links and config line wrapping

Modified:
    incubator/trafficserver/site/trunk/docs/v2/sdk/RemapAPI_Example.html
    incubator/trafficserver/site/trunk/docs/v2/sdk/ch03.html
    incubator/trafficserver/site/trunk/docs/v2/sdk/css/ydoc.css

Modified: incubator/trafficserver/site/trunk/docs/v2/sdk/RemapAPI_Example.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/v2/sdk/RemapAPI_Example.html?rev=929770&r1=929769&r2=929770&view=diff
==============================================================================
--- incubator/trafficserver/site/trunk/docs/v2/sdk/RemapAPI_Example.html (original)
+++ incubator/trafficserver/site/trunk/docs/v2/sdk/RemapAPI_Example.html Thu Apr  1 01:40:22
2010
@@ -21,10 +21,9 @@
 <h3 class="title">Configuration of query_remap</h3>
 <p>The query remap plugin will allow the query parameter name to be specified, along
with the hostnames of the servers to hash across.  Sample <code class="filename">remap.config</code>
rules using <code class="code">query_remap</code> will look like: <p>
 
-<pre class="programlisting">
-map http://www.example.com/search http://srch1.example.com/search @plugin=query_remap.so
@pparam=q @pparam=srch1.example.com @pparam=srch2.example.com @pparam=srch3.example.com
-map http://www.example.com/profiles http://prof1.example.com/profiles @plugin=query_remap.so
@pparam=user_id @pparam=prof1.example.com @pparam=prof2.example.com
-</pre>
+<pre class="configline">map http://www.example.com/search http://srch1.example.com/search
@plugin=query_remap.so @pparam=q @pparam=srch1.example.com @pparam=srch2.example.com @pparam=srch3.example.com</pre>
+<pre class="configline">map http://www.example.com/profiles http://prof1.example.com/profiles
@plugin=query_remap.so @pparam=user_id @pparam=prof1.example.com @pparam=prof2.example.com</pre>
+
 
 <p>The first <code class="code">@pparam</code> specifies the query param
key for which the value will be hashed.  The remaining parameters list the hostnames of the
servers.  A request for <code class="code">http://www.example.com/search?q=apache</code>
will match the first rule.  The plugin will look for the <code class="code"><em class="replaceable">q</em></code>
parameter and hash the value '<code class="code">apache</code>' to pick from among
<code class="code">srch<em class="replaceable">[1-3]</em>.example.com</code>
to send the request.</p>
 
@@ -56,12 +55,12 @@ int tsremap_new_instance(int argc,char *
   // 1: toURL
   // 2: query param to hash
   // 3,4,... : server hostnames
-  query_remap_info *qri = (query_remap_info*) malloc(sizeof(query_remap_info));
+  query_remap_info *qri = (query_remap_info*) INKmalloc(sizeof(query_remap_info));
   
   qri->param_name = strdup(argv[2]);
   qri->param_len = strlen(qri->param_name);
   qri->num_hosts = argc - 3;
-  qri->hosts = (char**) malloc(qri->num_hosts*sizeof(char*));
+  qri->hosts = (char**) INKmalloc(qri->num_hosts*sizeof(char*));
 
   for (i=0; i < qri->num_hosts; ++i) {
     qri->hosts[i] = strdup(argv[i+3]);
@@ -95,7 +94,7 @@ int tsremap_remap(ihandle ih, rhandle rh
     char *q, *s, *key;
 
     //make a copy of the query, as it is read only
-    q = (char*) malloc(rri->request_query_size+1);
+    q = (char*) INKmalloc(rri->request_query_size+1);
     strncpy(q, rri->request_query, rri->request_query_size);
     q[rri->request_query_size] = '\0';
 
@@ -113,7 +112,7 @@ int tsremap_remap(ihandle ih, rhandle rh
       }
     }
     
-    free(q);
+    INKfree(q);
 
     if (hostidx >= 0) {
       rri->new_host_size = strlen(qri->hosts[hostidx]);

Modified: incubator/trafficserver/site/trunk/docs/v2/sdk/ch03.html
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/v2/sdk/ch03.html?rev=929770&r1=929769&r2=929770&view=diff
==============================================================================
--- incubator/trafficserver/site/trunk/docs/v2/sdk/ch03.html (original)
+++ incubator/trafficserver/site/trunk/docs/v2/sdk/ch03.html Thu Apr  1 01:40:22 2010
@@ -44,9 +44,9 @@
   <p>A remap plugin is required to implement the following functions: 
     <ul>
       
-      <li><code><b>tsremap_init</b></code> (TODO link): the
remap initialization function</li>
-      <li><code><b>tsremap_new_instance</b></code> (TODO link):
 anew instance is created for each rule associated with the plugin</li>
-      <li><code><b>tsremap_remap</b></code> (TODO link): the
main remap function</li>
+      <li><a href="ch03s02.html#tsremap_init"><code><b>tsremap_init</b></code></a>:
the remap initialization function, called once when the plugin is loaded</li>
+      <li><a href="ch03s02.html#tsremap_new_instance"><code><b>tsremap_new_instance</b></code></a>:
a new instance is created for each rule associated with the plugin.  Called each time the
plugin used in a remap rule (this function is what processes the pparam values)</li>
+      <li><a href="ch03s02.html#tsremap_remap"><code><b>tsremap_remap</b></code></a>:
the entry point used by Traffic Server to find the new URL to which it remaps; called every
time a request comes in</li>
     </ul> </p>
   
   <h3><a name="Configuration">Configuration </a></h3>

Modified: incubator/trafficserver/site/trunk/docs/v2/sdk/css/ydoc.css
URL: http://svn.apache.org/viewvc/incubator/trafficserver/site/trunk/docs/v2/sdk/css/ydoc.css?rev=929770&r1=929769&r2=929770&view=diff
==============================================================================
--- incubator/trafficserver/site/trunk/docs/v2/sdk/css/ydoc.css (original)
+++ incubator/trafficserver/site/trunk/docs/v2/sdk/css/ydoc.css Thu Apr  1 01:40:22 2010
@@ -26,7 +26,8 @@ th {font-weight: bold; }
 
 p { margin: 0.5em 0em; }
 
-pre { background: #eee; border: 1px solid gray; padding: 2px; white-space: pre; }
+pre { background: #eee; border: 1px solid gray; padding: 0.5em; }
+pre.configline { white-space: pre-wrap; padding-left: 1.5em; text-indent: -1em; }
 .cmdsynopsis p { background: #ddd; border-left: 1px solid black; padding: 2px 4px; }
 pre, code, .cmdsynopsis { font-family: courier; font-size: 100%; }
 strong.userinput, strong.userinput code, .classname { font-weight: bold; }



Mime
View raw message