mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	[services] handle binding errors in tunnels, webconsole
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
		
							parent
							
								
									4d48d35ad7
								
							
						
					
					
						commit
						d991cc3b96
					
				
					 4 changed files with 18 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -317,7 +317,7 @@ namespace i2p
 | 
			
		|||
			bool http; i2p::config::GetOption("http.enabled", http);
 | 
			
		||||
			if (http) {
 | 
			
		||||
				std::string httpAddr; i2p::config::GetOption("http.address", httpAddr);
 | 
			
		||||
				uint16_t    httpPort; i2p::config::GetOption("http.port",		 httpPort);
 | 
			
		||||
				uint16_t    httpPort; i2p::config::GetOption("http.port", httpPort);
 | 
			
		||||
				LogPrint(eLogInfo, "Daemon: starting HTTP Server at ", httpAddr, ":", httpPort);
 | 
			
		||||
				d.httpServer = std::unique_ptr<i2p::http::HTTPServer>(new i2p::http::HTTPServer(httpAddr, httpPort));
 | 
			
		||||
				d.httpServer->Start();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1226,10 +1226,15 @@ namespace http {
 | 
			
		|||
			i2p::config::SetOption("http.pass", pass);
 | 
			
		||||
			LogPrint(eLogInfo, "HTTPServer: password set to ", pass);
 | 
			
		||||
		}
 | 
			
		||||
		m_IsRunning = true;
 | 
			
		||||
		m_Thread = std::unique_ptr<std::thread>(new std::thread (std::bind (&HTTPServer::Run, this)));
 | 
			
		||||
		m_Acceptor.listen ();
 | 
			
		||||
		Accept ();
 | 
			
		||||
 | 
			
		||||
		try {
 | 
			
		||||
			m_IsRunning = true;
 | 
			
		||||
			m_Thread = std::unique_ptr<std::thread>(new std::thread (std::bind (&HTTPServer::Run, this)));
 | 
			
		||||
			m_Acceptor.listen ();
 | 
			
		||||
			Accept ();
 | 
			
		||||
		} catch (std::exception& ex) {
 | 
			
		||||
			LogPrint (eLogError, "HTTPServer: failed to start webconsole: ", ex.what ());
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	void HTTPServer::Stop ()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue