~ps10gel/ubuntu/xenial/trafficserver/6.2.0

« back to all changes in this revision

Viewing changes to example/file-1/readme.txt

  • Committer: Bazaar Package Importer
  • Author(s): Arno Toell
  • Date: 2011-01-13 11:49:18 UTC
  • Revision ID: james.westby@ubuntu.com-20110113114918-vu422h8dknrgkj15
Tags: upstream-2.1.5-unstable
ImportĀ upstreamĀ versionĀ 2.1.5-unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
About file-plugin.c
 
2
 
 
3
This plugin simply reads a file and writes its contents to
 
4
a buffer. 
 
5
 
 
6
In a typical Traffic Server installation, this buffer is 
 
7
written to traffic.out.
 
8
 
 
9
A similar function is used in the append-transform plugin 
 
10
which reads in text from a file, and appends the text to the 
 
11
bodies of html response documents. (See the load function in
 
12
append-transform.c).
 
13
 
 
14
To use this plugin, you would need a line like this in  
 
15
plugin.config:
 
16
 
 
17
        On NT:  File.dll path/to/file.text
 
18
        On Solaris: file-1.so path/to/file.text
 
19
 
 
20
Enter either an absolute or a relative pathname for the file.  
 
21
If you use a relative pathname, the path must be specified with 
 
22
respect to the Traffic Server install directory.  (That is, the path 
 
23
contained in /etc/traffic_server.)
 
24
 
 
25
The only function defined is TSPluginInit.
 
26
 
 
27
It does the following:
 
28
 
 
29
- opens the file specified in plugin.config, using
 
30
        TSfopen
 
31
 
 
32
- reads the content of the file into a buffer using 
 
33
        TSfgets
 
34
 
 
35
- closes the file using 
 
36
        TSfclose