mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	debian wheezy upnp fix
This commit is contained in:
		
							parent
							
								
									ae28df5276
								
							
						
					
					
						commit
						94fc1a1cee
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -82,8 +82,10 @@ namespace transport
 | 
			
		|||
		int nerror = 0;
 | 
			
		||||
#if MINIUPNPC_API_VERSION >= 14
 | 
			
		||||
		m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, 2, &nerror);
 | 
			
		||||
#else
 | 
			
		||||
#elseif MINIUPNPC_API_VERSION >= 8
 | 
			
		||||
		m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, &nerror);
 | 
			
		||||
#else
 | 
			
		||||
		m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0);
 | 
			
		||||
#endif
 | 
			
		||||
		{
 | 
			
		||||
			// notify satrting thread
 | 
			
		||||
| 
						 | 
				
			
			@ -155,7 +157,11 @@ namespace transport
 | 
			
		|||
		std::string strType (GetProto (address)), strPort (std::to_string (address->port));
 | 
			
		||||
		int r;
 | 
			
		||||
		std::string strDesc; i2p::config::GetOption("upnp.name", strDesc);
 | 
			
		||||
#if MINIUPNPC_API_VERSION >= 8
 | 
			
		||||
		r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0, "0");
 | 
			
		||||
#else
 | 
			
		||||
		r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0);
 | 
			
		||||
#endif
 | 
			
		||||
		if (r!=UPNPCOMMAND_SUCCESS)
 | 
			
		||||
		{
 | 
			
		||||
			LogPrint (eLogError, "UPnP: AddPortMapping (", m_NetworkAddr, ":", strPort, ") failed with code ", r);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue