Gnutella Forums  

Go Back   Gnutella Forums > Current Gnutella Client Forums > GnucDNA Based Clients > Gnucleus (Windows)
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

Gnucleus (Windows) For assistance for users with the Gnucleus program. Important links: Updated Gnucleus 2.2.0.0 Installer! and also Updated Connection Caches for Gnucleus!


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old March 12th, 2002
Unregistered
Guest
 
Posts: n/a
Default

For uploads, modify CGnuUpload::OnReceive in the file GnuUpload.cpp, two lines added for one header check, works for push or normal uploads.

Code:
void CGnuUpload::OnReceive(int nErrorCode)
{
	byte* pBuff = new byte[6000];

	DWORD dwBuffLength = Receive(pBuff, 4096);

	switch (dwBuffLength)
	{
	case 0:
		m_pShell->m_Error = "Bad Push";
		Close();
		delete [] pBuff;
		return;
		break;
	case SOCKET_ERROR:
		m_pShell->m_Error = "Bad Push";
		Close();
		delete [] pBuff;
		return;
		break;
	}

	pBuff[dwBuffLength] = 0;
	CString Header(pBuff);
	m_pShell->m_Handshake += Header;
	m_pShell->m_GetRequest += Header;

	// New Upload
	if(m_pShell->m_GetRequest.Find("\r\n\r\n") != -1)
	{
		CString Handshake = m_pShell->m_GetRequest;

		// keep any BS off my screen
		if(Handshake.Find("BearShare") != -1) Close();

		if(Handshake.Find("GET /get/") == 0)
		{
			// Get Node info
			CString Host;
			UINT    nPort;
			GetPeerName(Host, nPort);

			// Set Variables
			m_pShell->m_Host = StrtoIP(Host);
			m_pShell->m_Port = 0;

			m_pShell->VerifyFile(Handshake);
		}
		else
		{
			m_pShell->m_Error = "Bad Push";
			Close();
		}
	}

	delete [] pBuff;

	CAsyncSocket::OnReceive(nErrorCode);
}
Reply With Quote
Reply


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
Re: Re: Vinnie, You have no excuse Unregistered Site Feedback 0 July 6th, 2002 11:23 AM
Vinnie vs. Morgwen??? Morgwen General Gnutella / Gnutella Network Discussion 21 December 30th, 2001 06:22 AM
Vinnie kills Phex, mad as hell Unregistered Gnucleus (Windows) 0 July 16th, 2001 11:17 AM
*Vinnie... Unregistered BearShare Open Discussion 2 May 25th, 2001 11:09 AM


All times are GMT -7. The time now is 09:46 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.