<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g2.doxu.org/index.php?action=history&amp;feed=atom&amp;title=QHT</id>
	<title>QHT - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://g2.doxu.org/index.php?action=history&amp;feed=atom&amp;title=QHT"/>
	<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=QHT&amp;action=history"/>
	<updated>2026-04-28T13:32:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://g2.doxu.org/index.php?title=QHT&amp;diff=2899&amp;oldid=prev</id>
		<title>Dcat at 04:12, 1 January 2009</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=QHT&amp;diff=2899&amp;oldid=prev"/>
		<updated>2009-01-01T04:12:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:12, 1 January 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Packets}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= /QHT - Query Hash Table =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= /QHT - Query Hash Table =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dcat</name></author>
	</entry>
	<entry>
		<id>https://g2.doxu.org/index.php?title=QHT&amp;diff=1648&amp;oldid=prev</id>
		<title>Dcat at 04:49, 20 March 2005</title>
		<link rel="alternate" type="text/html" href="https://g2.doxu.org/index.php?title=QHT&amp;diff=1648&amp;oldid=prev"/>
		<updated>2005-03-20T04:49:59Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= /QHT - Query Hash Table =&lt;br /&gt;
&lt;br /&gt;
The query hash table update packet supplies an update to the query hash table for&lt;br /&gt;
the sending node. It supports two operations: clear existing table, and patch existing&lt;br /&gt;
table with new data.&lt;br /&gt;
&lt;br /&gt;
== Sending ==&lt;br /&gt;
&lt;br /&gt;
The /QHT packet should be sent when the local or aggregate query hash table has&lt;br /&gt;
changed.&lt;br /&gt;
&lt;br /&gt;
== Receiving ==&lt;br /&gt;
&lt;br /&gt;
Upon receiving a /QHT packet, the local hub should patch the query hash table for&lt;br /&gt;
the connection on which the packet was received. If the connection is to a leaf node,&lt;br /&gt;
the hub should update its aggregate table and queue a propagation of that table to&lt;br /&gt;
neighbouring hubs in the cluster.&lt;br /&gt;
&lt;br /&gt;
== Payload ==&lt;br /&gt;
&lt;br /&gt;
The payload is of the same format as Gnutella1's &amp;quot;query routing protocol&amp;quot; message:&lt;br /&gt;
The first byte is a command byte, 0x00 indicates a reset command, while 0x01&lt;br /&gt;
indicates a patch command.&lt;br /&gt;
&lt;br /&gt;
=== Reset ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
BYTE command; // = 0 (reset)&lt;br /&gt;
LONG table_size_in_entries; // = 2^(size_in_bits)&lt;br /&gt;
BYTE infinity; // = 1&lt;br /&gt;
} QHT_RESET;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A reset packet establishes a new table and clears it (replacing any existing table). In&lt;br /&gt;
Gnutella2 the value of infinity must always be 1. Note that the table size is measured&lt;br /&gt;
in entries rather than bits, so it is equal to 2&amp;lt;sup&amp;gt;N&amp;lt;/sup&amp;gt; where N is the number of bits.&lt;br /&gt;
&lt;br /&gt;
=== Patch ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
BYTE command; // = 1 (patch)&lt;br /&gt;
BYTE fragment_no; // = number of this patch fragment&lt;br /&gt;
BYTE fragment_count; // = number of patch fragments&lt;br /&gt;
BYTE compression; // = 0 for none, = 1 for deflate&lt;br /&gt;
BYTE bits; // = 1 for Gnutella2&lt;br /&gt;
(data)&lt;br /&gt;
} QHT_PATCH;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Patches may be fragmented into more than one packet if necessary, in which case&lt;br /&gt;
the fragment number and count fields are used to reassemble the patch. Note that&lt;br /&gt;
fragments must be sent in correct order.&lt;br /&gt;
&lt;br /&gt;
Patches may be compressed - in this case the whole patch is compressed, rather&lt;br /&gt;
than compressing fragments individually. One compression type is defined: deflate&lt;br /&gt;
compression.&lt;br /&gt;
&lt;br /&gt;
Gnutella2 always uses tables with 1 bit per entry, so the bit count must be 1.&lt;br /&gt;
&lt;br /&gt;
The patch data in uncompressed form is of (2&amp;lt;sup&amp;gt;N&amp;lt;/sup&amp;gt;)/8 bytes length, where N is the&lt;br /&gt;
table bit size. This is exactly the same size as the table which is being patched. To&lt;br /&gt;
apply the patch, simply XOR the existing table with the patch data. In other words,&lt;br /&gt;
whenever there is a 1 bit, the bit in the existing table is toggled.&lt;/div&gt;</summary>
		<author><name>Dcat</name></author>
	</entry>
</feed>