1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
<html>
<head>
<title>AOLserver</title>
</head>
<body>
<h1>AOLserver urlspace Data Structure</h1>
<p>
<small>
$Header: /cvsroot/aolserver/aolserver.com/docs/devel/tech/urlspace.html,v 1.1 2002/03/07 19:15:35 kriston Exp $
</small>
<p>
<h2>The urlspace Trie</h2>
<pre>
There are four basic data structures used in maintaining the urlspace
trie. They are:
1. Junction
A junction is nothing more than a list of channels.
2. Channel
A channel points to a branch which ultimately leads to nodes
that match a particular "filter", such as "*.html". The filter
is the last section of a URL mask, and is the only part of
the mask that may contain wildcards.
3. Branch
A branch represents one part of a URL, such as a server, method,
directory, or wildcard filename. It has a list of branches
representing sub-URLs as well as a pointer to a list of Nodes.
4. Node
A node stores URL-specific data, as well as a pointer to the
cleanup function.
Another data structure, called an Index, which is manipulated by the
Ns_Index API calls, is used by the urlspace code. An Index is an
ordered list of pointers. The order is determined by callback
functions. See index.c for the scoop on that.
Here is what the urlspace data structure would look like after
calling
Ns_UrlSpecificSet("server1", "GET", "/foo/bar/*.html", myID, myData,
0, MyDeleteProc);
------------------------------------------------------------------------------
urlspace: JUNCTION
byname: INDEX [*][ ][ ][ ][ ]
|
+--------------+
|
V
CHANNEL
filter: CHAR* "*.html"
trie: TRIE
indexnode: INDEX* (NULL)
branches: INDEX [*][ ][ ][ ][ ]
|
+-----------------------------+
|
V
BRANCH
word: CHAR* "server1"
node: TRIE
indexnode: INDEX* (NULL)
branches: INDEX [*][ ][ ][ ][ ]
|
+--------------------------+
|
V
BRANCH
word: CHAR* "GET"
node: TRIE
indexnode: INDEX* (NULL)
branches: INDEX [*][ ][ ][ ][ ]
|
+--------------------------+
|
V
BRANCH
word: CHAR* "foo"
node: TRIE
indexnode: INDEX* (NULL)
branches: INDEX [*][ ][ ][ ][ ]
|
+--------------------------+
|
V
BRANCH
word: CHAR* "*.html"
node: TRIE
indexnode: INDEX* -----------------> [*][ ][ ][ ][ ]
branches: INDEX [ ][ ][ ][ ][ ] |
|
+---------------------------------------------+
|
V
NODE
id: INT myID
dataInherit: VOID* myData
dataNoInherit: VOID* 0
deleteFuncInherit: VOID(*)(VOID*) MyDeleteProc
deleteFuncNoInherit: VOID(*)(VOID*) 0
</pre>
<p>
</body>
</html>
|