This diff is against 03/25/2002 version CVS Index: StdAfx.h =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/StdAfx.h,v retrieving revision 1.94 diff -r1.94 StdAfx.h 171c171 < #define NODECACHE_SIZE 200 --- > #define NODECACHE_SIZE 3000 Index: resource.h =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/resource.h,v retrieving revision 1.68 diff -r1.68 resource.h 117a118 > #define IDC_BUTTON_FORPROFIT 1005 121a123 > #define IDC_BUTTON_ALL 1006 243a246 > #define IDC_BUTTON_GNUTELLA 1121 365a369,375 > #define IDC_LIST_BLOCK 1229 > #define IDC_EDIT_IDSTR 1230 > #define IDC_EDIT_VENDORID 1231 > #define IDC_RADIO_MODEL_OPENSOURCE 1232 > #define IDC_RADIO_MODEL_CUSTOM 1233 > #define IDC_EDIT_CUSTOM 1234 > #define IDC_BUTTON_OPENSOURCE 1235 464c474 < #define _APS_NEXT_CONTROL_VALUE 1229 --- > #define _APS_NEXT_CONTROL_VALUE 1236 Index: PrefLocalNetwork.h =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/PrefLocalNetwork.h,v retrieving revision 1.5 diff -r1.5 PrefLocalNetwork.h 23a24,25 > CStatic m_staticMessage; > CEdit m_ebCustom; 40a43,44 > void DoBlock(); > void DoServers(); 47a52,56 > afx_msg void OnRadioModelCustom(); > afx_msg void OnRadioModelOpensource(); > afx_msg void OnButtonGnutella(); > afx_msg void OnButtonOpensource(); > afx_msg void OnChangeEditCustom(); Index: PrefLocalNetwork.cpp =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/PrefLocalNetwork.cpp,v retrieving revision 1.6 diff -r1.6 PrefLocalNetwork.cpp 63a64,65 > DDX_Control(pDX, IDC_STATIC_MESSAGE, m_staticMessage); > DDX_Control(pDX, IDC_EDIT_CUSTOM, m_ebCustom); 76a79,83 > ON_BN_CLICKED(IDC_RADIO_MODEL_CUSTOM, OnRadioModelCustom) > ON_BN_CLICKED(IDC_RADIO_MODEL_OPENSOURCE, OnRadioModelOpensource) > ON_BN_CLICKED(IDC_BUTTON_GNUTELLA, OnButtonGnutella) > ON_BN_CLICKED(IDC_BUTTON_OPENSOURCE, OnButtonOpensource) > ON_EN_CHANGE(IDC_EDIT_CUSTOM, OnChangeEditCustom) 91a99,100 > m_ebCustom.EnableWindow(false); > if(m_pDoc->ModeNetwork == "GNUTELLA") 92a102,108 > else if(m_pDoc->ModeNetwork == "OPENSOURCE") > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_OPENSOURCE))->SetCheck(true); > else > { > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_CUSTOM))->SetCheck(true); > m_ebCustom.EnableWindow(true); > } 118a135 > m_ebCustom.SetWindowText(m_pDoc->ModeNetwork); 123a141,159 > > > void CPrefLocalNetwork::OnRadioModelOpensource() > { > m_pDoc->ModeNetwork = "OPENSOURCE"; > DoServers(); // reset the cache servers > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_INTERNET))->SetCheck(false); > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_CUSTOM))->SetCheck(false); > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_PRIVATE))->SetCheck(false); > m_ebCustom.SetWindowText(m_pDoc->ModeNetwork); > m_chkIRCServer.EnableWindow(false); > m_ebIRCServer.EnableWindow(false); > m_ebCustom.EnableWindow(false); > > SetModified(); > } > > > // Gnutella Net Radio Button 125a162,165 > m_pDoc->ModeNetwork = "GNUTELLA"; > DoServers(); // reset the cache servers > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_OPENSOURCE))->SetCheck(false); > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_CUSTOM))->SetCheck(false); 127c167 < --- > m_ebCustom.SetWindowText(m_pDoc->ModeNetwork); 129a170 > m_ebCustom.EnableWindow(false); 134c175,176 < void CPrefLocalNetwork::OnRadioModelPrivate() --- > > void CPrefLocalNetwork::OnRadioModelCustom() 135a178 > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_OPENSOURCE))->SetCheck(false); 137,139c180,181 < < < m_chkIRCServer.EnableWindow(true); --- > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_PRIVATE))->SetCheck(false); > m_chkIRCServer.EnableWindow(false); 140a183,185 > m_ebCustom.EnableWindow(true); > m_staticMessage.SetWindowText( > "You should restart Gnucleus after entering a new custom name."); 141a187,197 > SetModified(); > } > > void CPrefLocalNetwork::OnRadioModelPrivate() > { > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_OPENSOURCE))->SetCheck(false); > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_INTERNET))->SetCheck(false); > ((CButton*) GetDlgItem(IDC_RADIO_MODEL_CUSTOM))->SetCheck(false); > m_chkIRCServer.EnableWindow(true); > m_ebIRCServer.EnableWindow(false); > m_ebCustom.EnableWindow(false); 171,184d226 < if(((CButton*) GetDlgItem(IDC_RADIO_MODEL_INTERNET))->GetCheck()) < { < if(m_pPrefs->m_NetworkModel == NETWORK_PRIVATE) < AfxMessageBox("Restart Gnucleus to use on the Internet"); < < m_pPrefs->m_NetworkModel = NETWORK_INTERNET; < < m_pPrefs->m_Lan = false; < m_pPrefs->m_InternalUpdate = false; < m_pPrefs->m_InternalIRC = false; < } < < //else if(((CButton*) GetDlgItem(IDC_RADIO_MODEL_LAN))->GetCheck()) < // m_pPrefs->m_NetworkModel = NETWORK_LAN; 186c228 < else if(((CButton*) GetDlgItem(IDC_RADIO_MODEL_PRIVATE))->GetCheck()) --- > if(((CButton*) GetDlgItem(IDC_RADIO_MODEL_PRIVATE))->GetCheck()) 208a251,254 > { > if(m_pPrefs->m_NetworkModel == NETWORK_PRIVATE) > AfxMessageBox("Restart Gnucleus to use on the Internet"); > 210c256,273 < --- > > m_pPrefs->m_Lan = false; > m_pPrefs->m_InternalUpdate = false; > m_pPrefs->m_InternalIRC = false; > > // set the network name for custom > if(((CButton*) GetDlgItem(IDC_RADIO_MODEL_CUSTOM))->GetCheck()) > { > CString store1; > > m_ebCustom.GetWindowText(store1); > m_pDoc->ModeNetwork = store1; > } > } > > //else if(((CButton*) GetDlgItem(IDC_RADIO_MODEL_LAN))->GetCheck()) > // m_pPrefs->m_NetworkModel = NETWORK_LAN; > 214a278,326 > void CPrefLocalNetwork::DoBlock() > { > int idx = 0, start = 0; > bool addit; > std::vector::iterator itBlock; > CString IDstr, VendorID; > BlockClient NewBlockClient; > > // The format is "ClientName\tVEND\n" for each entry > while((idx = m_pPrefs->FPClients.Find("\t",start)) != -1) > { > // get the IDstr then the 'VendorID' from data string > IDstr = ""; VendorID = ""; > IDstr = m_pPrefs->FPClients.Mid(start,(idx - start)); > start = idx + 1; > > if ((idx = m_pPrefs->FPClients.Find("\n",start)) != -1) > { > if (idx > start) > VendorID = m_pPrefs->FPClients.Mid(start,(idx - start)); > } > else break; > > if ((start = m_pPrefs->FPClients.Find("\n",start)) == -1) break; > start++; > > addit = true; // see if it is already there > for (itBlock = m_pPrefs->m_BlockClient.begin(); itBlock != m_pPrefs->m_BlockClient.end(); itBlock++) > { > if (IDstr == (*itBlock).IDstr) > { > addit = false; > break; > } > } > if (addit) > { > NewBlockClient.IDstr = IDstr; > NewBlockClient.VendorID[0] = VendorID.GetAt(0); > NewBlockClient.VendorID[1] = VendorID.GetAt(1); > NewBlockClient.VendorID[2] = VendorID.GetAt(2); > NewBlockClient.VendorID[3] = VendorID.GetAt(3); > m_pPrefs->m_BlockClient.push_back(NewBlockClient); > } > } > > m_staticMessage.SetWindowText( > "Check Preferences->Connect and Servers for any changes..."); > } 216a329,383 > void CPrefLocalNetwork::DoServers() > { > // Hostcache Servers > char buffer[256]; > CString KeyName; > CString ServerLabel = m_pDoc->ModeNetwork + " Servers"; > CString ServerFile = m_pDoc->m_RunPath + "GnuServers.ini"; // from Preferences.cpp > > m_pPrefs->m_HostServers.clear(); > for(int i = 1; ; i++) > { > KeyName.Format("Server%ld", i); > > if(GetPrivateProfileString( ServerLabel, KeyName, "", buffer, 256, ServerFile) > 0) > { > int pos; > CString Host(buffer); > > if( (pos = Host.Find(":", 0)) != -1) > { > Node Server; > Server.Port = atoi(Host.Mid(pos + 1, Host.GetLength() - pos)); > Server.Host = Host.Mid(0, pos); > > m_pPrefs->m_HostServers.push_back(Server); > } > } > else > break; > } > > m_staticMessage.SetWindowText( > "Check Preferences->Connect and Servers for any changes..."); > } > > > // we do our best to set it all up now > void CPrefLocalNetwork::OnButtonOpensource() > { > m_pDoc->ModeNetwork = "OPENSOURCE"; > DoBlock(); > SetModified(); > } > > void CPrefLocalNetwork::OnButtonGnutella() > { > m_pDoc->ModeNetwork = "GNUTELLA"; > DoBlock(); > SetModified(); > } > > void CPrefLocalNetwork::OnChangeEditCustom() > { > SetModified(); > } Index: Preferences.h =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/Preferences.h,v retrieving revision 1.21 diff -r1.21 Preferences.h 39a40 > void SetBlockStrings(); 75a77,79 > // Connect Servers > std::vector m_BlockClient; > 114a119,120 > CString FPClients; > CString FreeClients; Index: Preferences.cpp =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/Preferences.cpp,v retrieving revision 1.34 diff -r1.34 Preferences.cpp 119a120 > SetBlockStrings(); 155a157,158 > GetPrivateProfileString("LocalNetwork", "NetName", "OPENSOURCE", buffer, 256, ConfigFile); > m_pDoc->ModeNetwork = buffer; 205c208,243 < --- > > // Blocked Clients > CString KeyName2; > BlockClient NewBlockClient; > > for(i = 1; ; i++) > { > KeyName.Format("IDstr%ld", i); > KeyName2.Format("VendorID%ld", i); > > if(GetPrivateProfileString( "Blocked Clients", KeyName, "", buffer, 256, ConfigFile) > 0) > { > NewBlockClient.IDstr = buffer; > > if(GetPrivateProfileString( "Blocked Clients", KeyName2, "", buffer, 256, ConfigFile) > 0) > { > NewBlockClient.VendorID[0] = buffer[0]; > NewBlockClient.VendorID[1] = buffer[1]; > NewBlockClient.VendorID[2] = buffer[2]; > NewBlockClient.VendorID[3] = buffer[3]; > } > else > { > NewBlockClient.VendorID[0] = 'Z'; // for no match "ZZZZ" > NewBlockClient.VendorID[1] = 'Z'; > NewBlockClient.VendorID[2] = 'Z'; > NewBlockClient.VendorID[3] = 'Z'; > } > > m_BlockClient.push_back(NewBlockClient); > } > else > break; > } > > 335a374 > WritePrivateProfileString("LocalNetwork", "NetName", m_pDoc->ModeNetwork, ConfigFile); 370a410,431 > WritePrivateProfileString("Blocked Clients", NULL, NULL, ConfigFile); > > std::vector::iterator BlockIt; > > for (i = 1, BlockIt = m_BlockClient.begin(); BlockIt != m_BlockClient.end(); BlockIt++) > { > KeyName.Format("IDstr%ld", i); > > CString Insert = BlockIt->IDstr; > > WritePrivateProfileString ("Blocked Clients", KeyName, Insert, ConfigFile); > > KeyName.Format("VendorID%ld", i); > > Insert.Format("%c%c%c%c", BlockIt->VendorID[0], BlockIt->VendorID[1], > BlockIt->VendorID[2], BlockIt->VendorID[3]); > > WritePrivateProfileString ("Blocked Clients", KeyName, Insert, ConfigFile); > > i++; > } > 451a513 > CString ServerLabel = m_pDoc->ModeNetwork + " Servers"; 457c519 < if(GetPrivateProfileString( "Connect Servers", KeyName, "", buffer, 256, ServerFile) > 0) --- > if(GetPrivateProfileString( ServerLabel, KeyName, "", buffer, 256, ServerFile) > 0) 542c604,605 < WritePrivateProfileString("Connect Servers", NULL, NULL, ServerFile); --- > CString ServerLabel = m_pDoc->ModeNetwork + " Servers"; > WritePrivateProfileString(ServerLabel, NULL, NULL, ServerFile); 555c618 < WritePrivateProfileString ("Connect Servers", KeyName, Insert, ServerFile); --- > WritePrivateProfileString (ServerLabel, KeyName, Insert, ServerFile); 740a804,833 > } > > > void CPreferences::SetBlockStrings() > { > // Users can add/edit their own, but this is a good start > // Strict format here, for internal use only > // include all fields correctly, case matters > // and you can be as exact as you like "Gnucleus 1.6.0.0" > > // For profit clients, no source code > FPClients = > "BearShare\tBEAR\n" > "LimeWire\tLIME\n" > "Gnucleus 1.6.0.0\tMRPH\n" > "Morpheus\tMRPH\n" > "SwapNut\tSNUT\n" > "ToadNode\tTOAD\n" ; > > // Open source, no profit clients > FreeClients = > "Gnucleus\tGNUC\n" > "Gtk-Gnutella\tGTKG\n" > "Gnut\tGNUT\n" > "Hagelslag\tHSLG\n" > "Mactella\tMACT\n" > "MyNapster\tMNAP\n" > "NapShare\tNAPS\n" > "Phex\tPHEX\n" > "Qtella\tQTEL\n" ; Index: PrefConnectServers.h =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/PrefConnectServers.h,v retrieving revision 1.2 diff -r1.2 PrefConnectServers.h 33a34 > virtual BOOL OnSetActive(); Index: PrefConnectServers.cpp =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/PrefConnectServers.cpp,v retrieving revision 1.6 diff -r1.6 PrefConnectServers.cpp 102a103,109 > return TRUE; // return TRUE unless you set the focus to a control > // EXCEPTION: OCX Property Pages should return FALSE > } > > > BOOL CPrefConnectServers::OnSetActive() > { 105c112,113 < --- > > m_lstServers.DeleteAllItems(); 115,117c123,124 < < return TRUE; // return TRUE unless you set the focus to a control < // EXCEPTION: OCX Property Pages should return FALSE --- > > return CPropertyPage::OnSetActive(); 119a127 > 223a232 > Index: PrefConnect.h =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/PrefConnect.h,v retrieving revision 1.3 diff -r1.3 PrefConnect.h 21d20 < 23a23,27 > CListCtrl m_listBlock; > CEdit m_ebVendorID; > CEdit m_ebIDstr; > CButton m_btnRemove; > CButton m_btnAdd; 35a40 > virtual BOOL OnSetActive(); 45d49 < 54a59,63 > afx_msg void OnButtonAdd(); > afx_msg void OnButtonRemove(); > afx_msg void OnRclickListBlock(NMHDR* pNMHDR, LRESULT* pResult); > afx_msg void OnButtonForprofit(); > afx_msg void OnButtonAll(); Index: PrefConnect.cpp =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/PrefConnect.cpp,v retrieving revision 1.4 diff -r1.4 PrefConnect.cpp 68a69,73 > DDX_Control(pDX, IDC_LIST_BLOCK, m_listBlock); > DDX_Control(pDX, IDC_EDIT_VENDORID, m_ebVendorID); > DDX_Control(pDX, IDC_EDIT_IDSTR, m_ebIDstr); > DDX_Control(pDX, IDC_BUTTON_REMOVE, m_btnRemove); > DDX_Control(pDX, IDC_BUTTON_ADD, m_btnAdd); 88a94,98 > ON_BN_CLICKED(IDC_BUTTON_ADD, OnButtonAdd) > ON_BN_CLICKED(IDC_BUTTON_REMOVE, OnButtonRemove) > ON_NOTIFY(NM_RCLICK, IDC_LIST_BLOCK, OnRclickListBlock) > ON_BN_CLICKED(IDC_BUTTON_FORPROFIT, OnButtonForprofit) > ON_BN_CLICKED(IDC_BUTTON_ALL, OnButtonAll) 92a103 > 100a112,124 > // Setup listbox > int offSet = m_listBlock.GetScrollLimit(SB_VERT) ? ::GetSystemMetrics(SM_CXVSCROLL) + 3 : 4; > > CRect rect; > m_listBlock.GetWindowRect(&rect); > > m_listBlock.InsertColumn( 0, "IDstr", LVCFMT_LEFT, > (rect.Width() - offSet) * 3/4, 0); > m_listBlock.InsertColumn( 1, "VendorID", LVCFMT_LEFT, > (rect.Width() - offSet) * 1/4, 1); > > m_listBlock.SetExtendedStyle(LVS_EX_FULLROWSELECT); > 139a164,185 > > BOOL CPrefConnect::OnSetActive() > { > > // Load list box > std::vector::iterator itBlock; > CString Insert; > > m_listBlock.DeleteAllItems(); > for (itBlock = m_pPrefs->m_BlockClient.begin(); itBlock != m_pPrefs->m_BlockClient.end(); itBlock++) > { > int pos = m_listBlock.GetItemCount(); > m_listBlock.InsertItem(pos, (*itBlock).IDstr); > Insert.Format("%c%c%c%c", itBlock->VendorID[0], itBlock->VendorID[1], > itBlock->VendorID[2], itBlock->VendorID[3]); > m_listBlock.SetItemText(pos, 1, Insert); > } > > return CPropertyPage::OnSetActive(); > } > > 192a239 > BlockClient itBlock; 231a279,296 > > m_pPrefs->m_BlockClient.clear(); > > for(int i = 0; i < m_listBlock.GetItemCount(); i++) > { > CString IDstr = m_listBlock.GetItemText(i, 0), > VendorID = m_listBlock.GetItemText(i, 1); > > > itBlock.IDstr = IDstr; > itBlock.VendorID[0] = VendorID[0]; > itBlock.VendorID[1] = VendorID[1]; > itBlock.VendorID[2] = VendorID[2]; > itBlock.VendorID[3] = VendorID[3]; > > m_pPrefs->m_BlockClient.push_back(itBlock); > } > 232a298,414 > } > > void CPrefConnect::OnButtonForprofit() > { > int pos, idx = 0, start = 0; > > // The format is "ClientName\tVEND\n" for each entry > while((idx = m_pPrefs->FPClients.Find("\t",start)) != -1) > { > // get the IDstr then the 'VendorID' from data string > pos = m_listBlock.GetItemCount(); > m_listBlock.InsertItem(pos, m_pPrefs->FPClients.Mid(start,(idx - start))); > start = idx + 1; > > if ((idx = m_pPrefs->FPClients.Find("\n",start)) != -1) > { > if (idx > start) > m_listBlock.SetItemText(pos, 1, m_pPrefs->FPClients.Mid(start,(idx - start))); > } > else break; > > if ((start = m_pPrefs->FPClients.Find("\n",start)) == -1) break; > start++; > } > > SetModified(); > } > > void CPrefConnect::OnButtonAll() > { > int pos, idx = 0, start = 0; > > // The format is "ClientName\tVEND\n" for each entry > while((idx = m_pPrefs->FreeClients.Find("\t",start)) != -1) > { > // get the IDstr then the 'VendorID' from data string > pos = m_listBlock.GetItemCount(); > m_listBlock.InsertItem(pos, m_pPrefs->FreeClients.Mid(start,(idx - start))); > start = idx + 1; > > if ((idx = m_pPrefs->FreeClients.Find("\n",start)) != -1) > { > if (idx > start) > m_listBlock.SetItemText(pos, 1, m_pPrefs->FreeClients.Mid(start,(idx - start))); > } > else break; > > if ((start = m_pPrefs->FreeClients.Find("\n",start)) == -1) break; > start++; > } > > idx = start = 0; > > while((idx = m_pPrefs->FPClients.Find("\t",start)) != -1) > { > // get the IDstr then the 'VendorID' from data string > pos = m_listBlock.GetItemCount(); > m_listBlock.InsertItem(pos, m_pPrefs->FPClients.Mid(start,(idx - start))); > start = idx + 1; > > if ((idx = m_pPrefs->FPClients.Find("\n",start)) != -1) > { > if (idx > start) > m_listBlock.SetItemText(pos, 1, m_pPrefs->FPClients.Mid(start,(idx - start))); > } > else break; > > if ((start = m_pPrefs->FPClients.Find("\n",start)) == -1) break; > start++; > } > > SetModified(); > > } > > void CPrefConnect::OnButtonAdd() > { > int pos = -1; > CString IDstr, VendorID; > > m_ebIDstr.GetWindowText(IDstr); > m_ebVendorID.GetWindowText(VendorID); > > if(IDstr == "") IDstr = "none"; > IDstr = IDstr.Left(64); // trim it at 64 > if(VendorID == "" || VendorID.GetLength() < 4) VendorID ="ZZZZ"; > VendorID = VendorID.Left(4); // trim it to 4 characters > > pos = m_listBlock.GetItemCount(); > m_listBlock.InsertItem(pos, IDstr); > m_listBlock.SetItemText(pos, 1, VendorID); > > SetModified(); > > } > > void CPrefConnect::OnButtonRemove() > { > int nItem; > POSITION pos = m_listBlock.GetFirstSelectedItemPosition(); > > while(pos) > { > pos = m_listBlock.GetFirstSelectedItemPosition(); > nItem = m_listBlock.GetNextSelectedItem(pos); > > m_listBlock.DeleteItem(nItem); > } > > SetModified(); > > } > > void CPrefConnect::OnRclickListBlock(NMHDR* pNMHDR, LRESULT* pResult) > { > > *pResult = 0; Index: Packet.h =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/Packet.h,v retrieving revision 1.17 diff -r1.17 Packet.h 69a70,75 > struct BlockClient > { > CString IDstr; > byte VendorID[4]; // 0 - 3 > }; > Index: GnuUpload.cpp =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/GnuUpload.cpp,v retrieving revision 1.54 diff -r1.54 GnuUpload.cpp 177a178,179 > int idx = 0; > CString HoldLower; 189a192,202 > std::vector::iterator BlockIt; > > for (BlockIt = m_pPrefs->m_BlockClient.begin(); BlockIt != m_pPrefs->m_BlockClient.end(); BlockIt++) > { > if(m_pShell->m_GetRequest.Find(BlockIt->IDstr) != -1) > { > m_pShell->m_Error = "Blocked"; > Send_HttpNotFound(); // so they don't keep trying > } > } > 190a204 > Index: GnuSock.h =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/GnuSock.h,v retrieving revision 1.13 diff -r1.13 GnuSock.h 38a39 > void Send_HttpNotFound(); Index: GnuSock.cpp =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/GnuSock.cpp,v retrieving revision 1.63 diff -r1.63 GnuSock.cpp 168c168 < --- > 171c171 < if(AgentPos != -1 && HandScan.Find("Mozilla") > AgentPos) --- > if(AgentPos != -1 && HandScan.Find("mozilla") > AgentPos) 176a177,194 > // Block clients in list > if(AgentPos != -1) > { > > std::vector::iterator BlockIt; > > for (BlockIt = m_pPrefs->m_BlockClient.begin(); BlockIt != m_pPrefs->m_BlockClient.end(); BlockIt++) > { > // use not lowercased string > if(m_Handshake.Find(BlockIt->IDstr,AgentPos) != -1) > { > Send_HttpNotFound(); // keep them from hitting again > return; > } > } > > } > 349a368,386 > } > > void CGnuSock::Send_HttpNotFound() > { > CString Version = GNUCLEUS_VERSION; > > CString Http404 = "HTTP 404\r\n"; > Http404 += "Server: Gnucleus " + Version + "\r\n"; > Http404 += "Content-type:text/html\r\n\r\n"; > Http404 += "\r\n"; > Http404 += "404 Not Found\r\n"; > Http404 += "\r\n"; > Http404 += "

Not Available

\r\n"; > Http404 += "File not available from this server.\r\n"; > Http404 += "\r\n"; > Http404 += "\r\n\r\n"; > > Send(Http404, Http404.GetLength()); > Close(); Index: GnuNode.h =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/GnuNode.h,v retrieving revision 1.36 diff -r1.36 GnuNode.h 71,73d70 < CString m_NetworkName; < bool m_Guerilla; < 156a154 > bool InspectQueryHitPacket(packet_QueryHit*); Index: GnuNode.cpp =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/GnuNode.cpp,v retrieving revision 1.103 diff -r1.103 GnuNode.cpp 77,79d76 < < m_NetworkName = m_pDoc->ModeNetwork; < m_Guerilla = false; 400,408d396 < < // Check if this connection is in 'Guerilla' mode < if(m_Handshake.Find("GUERILLA ") != -1) < { < m_NetworkName = "GUERILLA"; < m_Guerilla = true; < } < < 410c398 < if(m_Handshake.Find(m_NetworkName + " CONNECT/") != -1) --- > if(m_Handshake.Find(m_pDoc->ModeNetwork + " CONNECT/") != -1) 420a409,426 > // Block clients on list > CString UserAgent = FindHeader("User-Agent"); > if(!UserAgent.IsEmpty()) > { > std::vector::iterator BlockIt; > > for (BlockIt = m_pPrefs->m_BlockClient.begin(); BlockIt != m_pPrefs->m_BlockClient.end(); BlockIt++) > { > if(UserAgent.Find(BlockIt->IDstr) != -1) > { > Close(); > return; > } > } > > } > > 617a624,641 > // Block clients on list > CString UserAgent = FindHeader("User-Agent"); > if(!UserAgent.IsEmpty()) > { > std::vector::iterator BlockIt; > > for (BlockIt = m_pPrefs->m_BlockClient.begin(); BlockIt != m_pPrefs->m_BlockClient.end(); BlockIt++) > { > if(UserAgent.Find(BlockIt->IDstr) != -1) > { > Close(); > return; > } > } > > } > > 846c870 < Handshake = m_NetworkName + "/0.6 200 OK\r\n"; --- > Handshake = m_pDoc->ModeNetwork + "/0.6 200 OK\r\n"; 859c883 < Handshake = m_NetworkName + "/0.6 200 OK\r\n"; --- > Handshake = m_pDoc->ModeNetwork + "/0.6 200 OK\r\n"; 909c933 < Handshake = m_NetworkName + "/0.6 503 BUSY\r\n"; --- > Handshake = m_pDoc->ModeNetwork + "/0.6 503 BUSY\r\n"; 1268a1293 > 1286a1312,1379 > // applies only to a Query Hit Packet > bool CGnuNode::InspectQueryHitPacket(packet_QueryHit* QueryHit) > { > // check the TTL > if(!InspectPacket(&QueryHit->Header)) return false; > > /* > packet_Log* Log = pPacket; > packet_QueryHit* QueryHit = (packet_QueryHit*) Log->Header; > byte* Packet = (byte*) QueryHit; > > bool ExtendedPacket = false; > bool Firewall = false; > bool Busy = false; > bool Stable = false; > bool ActualSpeed = false; > */ > int HitsLeft = QueryHit->TotalHits, i; > // DWORD NextPos = 34; > DWORD Length = makeD(flipX(QueryHit->Header.Payload)) + 23; > byte* Packet = (byte*) QueryHit; > > // Find start of QHD > int ItemCount = 0; > for(i = 42; i < Length - 16; i++) > if(Packet[i] == 0) > { > while(Packet[++i] != 0) > if(i > Length - 16) > break; > > ItemCount++; > > if(ItemCount != QueryHit->TotalHits) > i += 9; > else > break; > } > > packet_QueryHitEx* QHD = (packet_QueryHitEx*) &Packet[i + 1]; > > CString Vendor( (char*) QHD->VendorID, 4); > > > // Block clients in list > std::vector::iterator BlockIt; > for (BlockIt = m_pPrefs->m_BlockClient.begin(); BlockIt != m_pPrefs->m_BlockClient.end(); BlockIt++) > { > // this makes check very fast > if(QHD->VendorID[0] == BlockIt->VendorID[0]) > { > if(QHD->VendorID[1] == BlockIt->VendorID[1]) > { > if(QHD->VendorID[2] == BlockIt->VendorID[2]) > { > if(QHD->VendorID[3] == BlockIt->VendorID[3]) > { > return false; > } > } > } > } > } > > return true; > } > > 1742c1835 < if(!InspectPacket(&QueryHit->Header)) --- > if(!InspectQueryHitPacket(QueryHit)) Index: GnuControl.h =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/GnuControl.h,v retrieving revision 1.26 diff -r1.26 GnuControl.h 14a15 > #define TIMEOUT_HOST_CACHE 30000 117a119,120 > > UINT m_Check_Host_Cache_time; Index: GnuControl.cpp =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/GnuControl.cpp,v retrieving revision 1.69 diff -r1.69 GnuControl.cpp 77a78 > m_Check_Host_Cache_time = GetTickCount() + TIMEOUT_HOST_CACHE; 684a686,698 > } > > // If no hosts at all, try all perm hosts again after a while > if (m_Check_Host_Cache_time <= GetTickCount()) > { > if ( (m_pCache->m_PermNodes.size() + > m_pCache->m_RealNodes.size()) == 0) > { > // Add permanent servers from preferences > for(int i = 0; i < m_pPrefs->m_HostServers.size(); i++) > m_pCache->m_PermNodes.push_back(m_pPrefs->m_HostServers[i]); > } > m_Check_Host_Cache_time = GetTickCount() + TIMEOUT_HOST_CACHE; Index: GnucleusDoc.cpp =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/GnucleusDoc.cpp,v retrieving revision 1.76 diff -r1.76 GnucleusDoc.cpp 128c128 < ModeNetwork = "GNUTELLA"; --- > // ModeNetwork = "GNUTELLA"; 185c185 < ModeNetwork = "GNUTELLA"; // you:GNUTELLA me:GUERILLA --- > // ModeNetwork = "GNUTELLA"; // you:GNUTELLA me:GUERILLA Index: Gnucleus.rc =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/Gnucleus.rc,v retrieving revision 1.108 diff -r1.108 Gnucleus.rc 561c561 < GROUPBOX "Node Management",IDC_STATIC,10,10,255,80 --- > GROUPBOX "Node Management",IDC_STATIC,10,10,255,60 563c563 < BS_AUTOCHECKBOX | WS_TABSTOP,20,30,165,10 --- > BS_AUTOCHECKBOX | WS_TABSTOP,20,20,165,10 565,566c565,566 < BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,20,52,60,10 < EDITTEXT IDC_EDIT_MIN_CONNECTS,80,50,19,12,ES_AUTOHSCROLL | --- > BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,20,35,55,10 > EDITTEXT IDC_EDIT_MIN_CONNECTS,75,35,19,12,ES_AUTOHSCROLL | 569,570c569,570 < BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,110,52,55,10 < EDITTEXT IDC_EDIT_MAX_CONNECTS,170,50,19,12,ES_AUTOHSCROLL | --- > BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,105,35,55,10 > EDITTEXT IDC_EDIT_MAX_CONNECTS,165,35,19,12,ES_AUTOHSCROLL | 572c572 < LTEXT "connections",IDC_STATIC,194,52,41,10 --- > LTEXT "connections",IDC_STATIC,195,35,41,10 574c574 < "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,20,72,95, --- > "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,20,50,95, 576c576 < EDITTEXT IDC_EDIT_DROP_FRIENDS,120,70,19,12,ES_AUTOHSCROLL | --- > EDITTEXT IDC_EDIT_DROP_FRIENDS,115,50,19,12,ES_AUTOHSCROLL | 578c578,589 < LTEXT "friends",IDC_STATIC,146,72,35,10 --- > LTEXT "friends",IDC_STATIC,140,50,35,10 > GROUPBOX "Blocked Clients",IDC_STATIC,10,70,255,95 > CONTROL "List2",IDC_LIST_BLOCK,"SysListView32",LVS_REPORT | > LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,120,80,135,80 > RTEXT "IDstr:",IDC_STATIC,25,85,19,10 > EDITTEXT IDC_EDIT_IDSTR,50,85,55,12,ES_AUTOHSCROLL > RTEXT "VendorID:",IDC_STATIC,15,100,30,10 > EDITTEXT IDC_EDIT_VENDORID,50,100,55,12,ES_AUTOHSCROLL > DEFPUSHBUTTON "Add",IDC_BUTTON_ADD,65,120,40,15 > PUSHBUTTON "Remove",IDC_BUTTON_REMOVE,65,140,40,15 > PUSHBUTTON "For Profit",IDC_BUTTON_FORPROFIT,20,140,40,15 > PUSHBUTTON "Enter All",IDC_BUTTON_ALL,20,120,40,15 1188,1190c1199,1201 < GROUPBOX "My Network Model",IDC_STATIC,10,10,255,110 < CONTROL "Regular node on the internet",IDC_RADIO_MODEL_INTERNET, < "Button",BS_AUTORADIOBUTTON,20,30,170,10 --- > GROUPBOX "My Network Model",IDC_STATIC,10,10,255,170 > CONTROL "Regular node on Gnutella Net",IDC_RADIO_MODEL_INTERNET, > "Button",BS_AUTORADIOBUTTON,20,45,105,10 1192c1203 < "Button",BS_AUTORADIOBUTTON,20,80,170,10 --- > "Button",BS_AUTORADIOBUTTON,20,75,170,10 1194,1195c1205,1206 < BS_AUTOCHECKBOX | WS_TABSTOP,35,98,90,10 < EDITTEXT IDC_EDIT_IRCSERVER,128,95,110,12,ES_AUTOHSCROLL --- > BS_AUTOCHECKBOX | WS_TABSTOP,35,90,75,10 > EDITTEXT IDC_EDIT_IRCSERVER,110,90,110,12,ES_AUTOHSCROLL 1197c1208 < BS_AUTOCHECKBOX | WS_TABSTOP,35,45,110,10 --- > BS_AUTOCHECKBOX | WS_TABSTOP,25,125,110,10 1199,1200c1210,1221 < TBS_NOTICKS | WS_TABSTOP,129,60,76,10 < LTEXT "Max Processor Usage, 10%",IDC_STATIC,35,60,89,10 --- > TBS_NOTICKS | WS_TABSTOP,129,140,76,10 > LTEXT "Max Processor Usage, 10%",IDC_STATIC,35,140,89,10 > CONTROL "Node on OpenSource P2P Net",IDC_RADIO_MODEL_OPENSOURCE, > "Button",BS_AUTORADIOBUTTON,20,30,110,10 > CONTROL "Custom net name",IDC_RADIO_MODEL_CUSTOM,"Button", > BS_AUTORADIOBUTTON,20,60,68,10 > EDITTEXT IDC_EDIT_CUSTOM,90,60,125,12,ES_AUTOHSCROLL > PUSHBUTTON "Change settings to this",IDC_BUTTON_GNUTELLA,130,45,80, > 10 > PUSHBUTTON "Change settings to this",IDC_BUTTON_OPENSOURCE,130,30, > 80,10 > LTEXT "",IDC_STATIC_MESSAGE,30,165,220,8 1428c1449 < BOTTOMMARGIN, 168 --- > BOTTOMMARGIN, 172 Index: ConnectAdvanced.cpp =================================================================== RCS file: /cvsroot/gnucleus/GnucleusR2/ConnectAdvanced.cpp,v retrieving revision 1.9 diff -r1.9 ConnectAdvanced.cpp 113c113 < m_ebHost.SetWindowText("router.limewire.com"); --- > m_ebHost.SetWindowText("connect1.gnutellanet.com"); 151c151,155 < m_lstKnown.InsertItem(0, "Cache Full"); --- > { > CString TmpMsg; > TmpMsg.Format("Cache Full (%d IPs)", CacheSize); > m_lstKnown.InsertItem(0, TmpMsg); > } 283c287,291 < m_lstKnown.InsertItem(pos, "Cache Full"); --- > { > CString TmpMsg; > TmpMsg.Format("Cache Full (%d IPs)", CacheSize); > m_lstKnown.InsertItem(pos, TmpMsg); > } 345c353,357 < m_lstKnown.SetItemText(pos, 0, "Cache Full"); --- > { > CString TmpMsg; > TmpMsg.Format("Cache Full (%d IPs)", CacheSize); > m_lstKnown.SetItemText(pos, 0, TmpMsg); > }