View Single Post
  #1 (permalink)  
Old January 15th, 2007
Linuxhippy Linuxhippy is offline
Gnutella Admirer
 
Join Date: November 23rd, 2003
Posts: 70
Linuxhippy is flying high
Default Howto realite more than 255 serach results?

Hello,

Phex currently "only" supports 255 results per host per query, this is the maximum which may be returned by a single query-result package. Browse host works arround this limitation yb sending many packages, so I tried to change MessageDispatched.respondToQuery to the following, instead of the single-package sending code:

[source]
QueryResponseRecord record;
ShareFile sfile;
int sendCount = 0;
while (sendCount < resultCount)
{
int currentSendCount = Math.min( 255, resultCount
- sendCount );

QueryResponseRecord[] records = new QueryResponseRecord[currentSendCount];
for (int i = 0; i < currentSendCount; i++)
{
sfile = resultFiles[sendCount + i];
Long networkCreateTime = sfile.getNetworkCreateTime();
AltLocContainer altLocContainer = sfile.getAltLocContainer();
Set<DestAddress> altLocs = null;
if ( altLocContainer != null )
{
altLocs = altLocContainer.getAltLocForQueryResponseRecord();
}
record = new QueryResponseRecord( sfile.getFileIndex(),
sfile.getURN(), (int) sfile.getFileSize(),
sfile.getFileName(), networkCreateTime.longValue(),
altLocs );
records[i] = record;
}

NetworkManager networkMgr = NetworkManager.getInstance();
DestAddress hostAddress = networkMgr.getLocalAddress();
QueryResponseMsg queryResponse = new QueryResponseMsg( header,
networkMgr.getServentGuid(), hostAddress,
Math.round(
BandwidthPrefs.MaxUploadBandwidth.get().floatValue ()
/ NumberFormatUtils.ONE_KB ), records );

// send msg over the wire
sourceHost.queueMessageToSend(queryResponse);
// and count message
MessageCountStatistic.queryHitMsgOutCounter.increm ent( 1 );

sendCount += currentSendCount;
}
[/source]

However, how could it be different ... it does not work.

Any ideas what could be the problem? Is phex able to handle multiple responses per query from the same host?

Thank you in advance, lg Clemens
Reply With Quote