Logo address

Pegasus 2.3

目次

Last Update: 2006/12/18

Bug fix and new features.
The source is in http://plan9.aichi-u.ac.jp/netlib/

This page describes only the new feature. Basic features are unchanged. Look Pegasus 2.2 documents for more detail.

More directories in $web

What was a problem?

Let's $web be httpd root for Pegasus.
We had restriction that only three directories "bin", "etc" and "doc" can be added in $web. Now the restriction has been removed.

Pegasus 2.3 internally executes (in rc notation)
bind -a $web /usr/web

Therefore, remove empty directory "/usr/web/doc"

Example

Now we can locate a private files such as users information for a web service as following
	$web/users
then the file "users" is outside of document root, and therefore only accessible via CGI.

CGI timeout for each CGI

What was a problem?

Some CGIs take much time to complete the task. The time is CGI dependent.
Therefore I enabled dynamical resetting of CGI timeout for each CGI.

A environment variable "hpid" is introduced for this purpose.
The "pid" is that of Pegasus in service.

Example 1

In starting service, execute
	echo -n timeout 180 > /proc/$hpid/note
which will reset CGI timeout to 180 seconds.

Example 2

The example below written in Python is extracted from a script on my server.
def settimeout(n):
        note="/proc/%d/note"%hpid
        f=open(note, "w")
        if f==None:
                print "unable to open %s"%note
                print "timeout is not set"
                return
        f.write("timeout %d"%n)
        f.close()
e=os.environ
hpid=0
if e.has_key("hpid"):
	hpid=int(e["hpid"])
if hpid:
	settimeout(180)
# continues heavy loaded tasks

New option for hfmt

New option "-x" is added to a CGI tool "hfmt" so that non-ascii runes in path name can be converted to %HH format.

What was a problem?

Microsoft IE sometimes fails to handle UTF-8 encoded path name in href value.

Example

The following code in rit scrit will produce local references to all files in the current directory.
<pre>${ ls | hfmt -x '<a href="%U">%H</a>' 1 1}</pre>