mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 01:05:48 +01:00 
			
		
		
		
	Add support for unix socket connection to redis (#5179)
This commit is contained in:
		
				
					committed by
					
						
						Loïc Blot
					
				
			
			
				
	
			
			
			
						parent
						
							3e30731c1a
						
					
				
				
					commit
					5da3ed19a3
				
			@@ -44,7 +44,8 @@ Database_Redis::Database_Redis(Settings &conf)
 | 
			
		||||
	}
 | 
			
		||||
	const char *addr = tmp.c_str();
 | 
			
		||||
	int port = conf.exists("redis_port") ? conf.getU16("redis_port") : 6379;
 | 
			
		||||
	ctx = redisConnect(addr, port);
 | 
			
		||||
	// if redis_address contains '/' assume unix socket, else hostname/ip
 | 
			
		||||
	ctx = tmp.find('/') != std::string::npos ? redisConnectUnix(addr) : redisConnect(addr, port);
 | 
			
		||||
	if (!ctx) {
 | 
			
		||||
		throw DatabaseException("Cannot allocate redis context");
 | 
			
		||||
	} else if (ctx->err) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user