Ticket #9390: 0009-Check-for-publiic-relay-added.patch

File 0009-Check-for-publiic-relay-added.patch, 988 bytes (added by aruna1234, 15 months ago)
  • src/common/compat.c

    From a63921f693c3a84fdf14829a6c6fe81536e66ea0 Mon Sep 17 00:00:00 2001
    From: ArunaMaurya221B <aruna.maurya12@gmail.com>
    Date: Thu, 21 Dec 2017 23:57:48 +0530
    Subject: [PATCH 9/9] Check for publiic relay added
    
    ---
     src/common/compat.c | 9 +++++++--
     1 file changed, 7 insertions(+), 2 deletions(-)
    
    diff --git a/src/common/compat.c b/src/common/compat.c
    index dbe9918..32310d3 100644
    a b get_max_sockets(void) 
    16831683int
    16841684set_max_file_descriptors(rlim_t limit, int *max_out)
    16851685{
    1686   if(public_server_mode(get_options())) {
    16871686    if(limit < ULIMIT_BUFFER) {
    16881687      log_warn(LD_CONFIG,
    16891688             "ConnLimit must be at least %d. Failing.", ULIMIT_BUFFER);
    16901689      return -1;
    16911690    }
    1692   }
     1691    if(public_server_mode(get_options())){
     1692      if(limit < 8192){
     1693        log_warn(LD_CONFIG,
     1694               "Public Relay having too-low file descriptor limit");
     1695        return -1;
     1696      }
     1697    }
    16931698    return -1;
    16941699  }
    16951700