Gnutella Forums  

Go Back   Gnutella Forums > Discontinued Gnutella Client Forums > Qtella (Linux/Unix)
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

Qtella (Linux/Unix) Qtella has been discontinued. We highly recommend you use an actively developed client instead.


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3 (permalink)  
Old March 12th, 2002
Unregistered
Guest
 
Posts: n/a
Default

in the file "Servent.cpp" change "Servent::slotReadyRead()" as below:

Code:
void Servent::slotReadyRead()
{
  char   cbuff[4096+10];

  _last_input = time(NULL);

  do
    {
      int rd = _socket->readBlock(cbuff, 4096);
      _buffer.append(cbuff, rd);
    }
  while(_socket->bytesAvailable() > 0);

  if( (state() == Waiting) && (_buffer.find("\r\n\r\n") != std::string::npos) )
    {
      _header = _buffer.substr(0, _buffer.find("\r\b\r\n"));

      std::string b = _buffer;

      if( _buffer.substr(0, 9) != "GNUTELLA/" )
	{
	  slotError(-1);
	  return;
	}

      _buffer.erase(0, 9);

      // get version

      std::string::size_type idx = _buffer.find(" ");
      if( idx == std::string::npos )
	{
	  slotError(-1);
	  return;
	}

      _version = _buffer.substr(0, idx);

      _buffer.erase(0, idx + 1); // delete version number with space from buffer

      // get status code

      idx = _buffer.find(" ");
      if( idx == std::string::npos )
	{
	  slotError(-1);
	  return;
	}

      std::string status = _buffer.substr(0, idx);
      _buffer.erase(0, idx + 1); // delete status code with space from buffer


/////////////////////// THIS IS THE MOD !!!!!!


      // keep that BS off my screen!
      idx = _buffer.find("BearShare");
      if( idx != std::string::npos )
	{
	  slotError(-1);
	  return;
	}



      // get user agent information

      idx = _buffer.find("User-Agent:");
      if( idx != std::string::npos )
	{
	  _buffer.erase(0, idx + 11);
	  idx = _buffer.find_first_not_of(" ");
	  _buffer.erase(0, idx);
	  idx = _buffer.find("\r\n");
	  _user_agent = _buffer.substr(0, idx);
	}

      if( status != "200")
	{
	  slotError(-1);
	  return;
	}

      // status code is 200 ok

      idx = _buffer.find("\r\n\r\n"); // find end of header
      _buffer.erase(0, idx + 4);      // delete header from buffer

      setState(Connected);

      std::string r("GNUTELLA/0.6 200 OK\r\n\r\n");
      sendMessageDirect(r);

      int ttl = _parent->_parent->ui_spinbox_ttl->value();
      Ping p(1, 0, _id);
      sendMessageDirect(p._data);  // send initial ping
      _parent->_statistic.out_ping_n++;
      _parent->_statistic.out_ping_b += p._data.size();
      return;
    }

  else

    while( _buffer.size() >= HEADER_SIZE )
      {
	Q_UINT32 payload  = Message::str_uint32(_buffer.substr(19, 4).data());

	if(payload > 20000)
	  {
	    _buffer.erase();
	    slotError(-1);
	    return;
	  }

	if( _buffer.size() >= (HEADER_SIZE + payload) )
	  {
	    _input++;

	    if(_message_buffer.size() < 30)
	      _message_buffer.push_back(_buffer.substr(0, HEADER_SIZE + payload));

	    _buffer.erase(0, HEADER_SIZE + payload);
	    _bytes_in += HEADER_SIZE + payload;
	  }
	else
	  return;
      }
}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Isp Block HYDROGLOCK Connection Problems 3 June 29th, 2006 10:19 AM
The IP or some way to block it. shade11 General Gnutella / Gnutella Network Discussion 5 March 14th, 2006 11:11 AM
Block host should block them form uploading too Sleepless New Feature Requests 0 February 13th, 2006 06:47 PM
Clients blocking other clients Zultrax General Gnutella Development Discussion 5 June 1st, 2004 01:41 AM
How can i block most clients ??? Unregistered General Gnutella / Gnutella Network Discussion 2 June 24th, 2001 06:53 PM


All times are GMT -7. The time now is 01:56 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.