<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<section id="domain" xmlns:xi="http://www.w3.org/2001/XInclude">
    <sectioninfo>
	<authorgroup>
	    <author>
		<firstname>Juha</firstname>
		<surname>Heinanen</surname>
		<email>jh@song.fi</email>
	    </author>
	</authorgroup>
	<copyright>
	    <year>2002</year>
	    <year>2003</year>
	    <holder>Juha Heinanen</holder>
	</copyright>
	<revhistory>
	    <revision>
		<revnumber>$Revision: 1.3 $</revnumber>
		<date>$Date: 2005/08/24 22:26:18 $</date>
	    </revision>
	</revhistory>
    </sectioninfo>

    <title>Domain Module</title>

    <section id="domain.overview">
	<title>Overview</title>
	<para>
	    Domain module implements checks that based on domain table
	    determine if a host part of an <acronym>URI</acronym> is
	    "local" or not.  A "local" domain is one
	    that the proxy is responsible for.
	</para>
	<para>
	    Domain module operates in caching or non-caching mode depending on
	    value of module parameter <parameter>db_mode</parameter>. In
	    caching mode domain module reads the contents of domain table into
	    cache memory when the module is loaded.  After that domain table is
	    re-read only when module is given domain_reload fifo command.  Any
	    changes in domain table must thus be followed by domain_reload
	    command in order to reflect them in module behavior. In non-caching
	    mode domain module always queries domain table in the database.
	</para>
	<para>
	    Caching is implemented using a hash table. The size of the hash
	    table is given by HASH_SIZE constant defined in domain_mod.h. Its
	    "factory default" value is 128.
	</para>
    </section>

    <section id="domain.dep">
	<title>Dependencies</title>
	<para>
	    The module depends on the following modules (in the other words the listed modules
	    must be loaded before this module):
	    <itemizedlist>
		<listitem>
		    <para><emphasis>database</emphasis> - Any database module</para>
		</listitem>
	    </itemizedlist>
	</para>
    </section>

    <section id="known_limitations">
	<title>Known Limitations</title>
	<para>
	    There is an unlikely race condition on domain list update.  If a process uses a table,
	    which is reloaded at the same time twice through <acronym>FIFO</acronym>, the second
	    reload will delete the original table still in use by the process.
	</para>
    </section>

    <xi:include href="params.xml"/>
    <xi:include href="functions.xml"/>
    <xi:include href="fifo.xml"/>

</section>
