Hi,
it seems that the X-Features header in GtkG is not integrated into
the header section correctly. The X-Features header is sent *after* a
newline (the newline normally terminates the header).
This probably means that GtkG is currently broken, because neither does GtkG
accept other GtkG connections with such a broken header nor will most other
clients accept this. GtkG reports the "X-Features: HSEP/0.2" header as "extra
bytes".
The bug is (at least) here:
else {
rw = gm_snprintf(gnet_response, sizeof(gnet_response),
"GNUTELLA/0.6 200 OK\r\n"
"User-Agent: %s\r\n"
"Pong-Caching: 0.1\r\n"
"Bye-Packet: 0.1\r\n"
"GGEP: 0.5\r\n"
"Vendor-Message: 0.1\r\n"
"Remote-IP: %s\r\n"
"Accept-Encoding: deflate\r\n"
"%s" /* Content-Encoding */
"%s" /* X-Ultrapeer */
"%s" /* X-Ultrapeer-Needed */
"%s" /* X-Query-Routing */
"X-Token: %s\r\n"
"X-Live-Since: %s\r\n"
"\r\n",
version_string, ip_to_gchar(n->socket->ip),
(n->attrs & NODE_A_TX_DEFLATE) ? compressing : empty,
current_peermode == NODE_P_NORMAL ? "" :
current_peermode == NODE_P_LEAF ?
"X-Ultrapeer: False\r\n" :
"X-Ultrapeer: True\r\n",
current_peermode != NODE_P_ULTRA ? "" :
node_ultra_count < ultra_max ? "X-Ultrapeer-Needed: True\r\n" :
node_leaf_count < max_leaves ? "X-Ultrapeer-Needed: False\r\n" :
"",
current_peermode != NODE_P_NORMAL ?
node_query_routing_header(n) : "",
tok_version(), start_rfc822_date);
header_features_generate(&xfeatures.connections,
gnet_response, sizeof(gnet_response), &rw);
}
Note that the "\r\n" is put into the buffer before calling
header_features_generate(). I don't have a fix currently. Perhaps the
X-Features header should be generated like some of the other headers using "%s"
in the original gm_snprintf() command?
Greetings,
Thomas.
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Gtk-gnutella-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel