Ticket #9390: 0011-Bug-9390-Check-for-public-relay-added-at-the-end-of-.patch

File 0011-Bug-9390-Check-for-public-relay-added-at-the-end-of-.patch, 1.4 KB (added by aruna1234, 15 months ago)
  • src/common/compat.c

    From 2069dbf4c40dd3a5e5d6184a1152a242fa8145ba Mon Sep 17 00:00:00 2001
    From: ArunaMaurya221B <aruna.maurya12@gmail.com>
    Date: Fri, 22 Dec 2017 16:54:47 +0530
    Subject: [PATCH 11/11] Bug-9390 Check for public relay added at the end of
     max_file_descriptors()
    
    ---
     src/common/compat.c | 18 ++++++++----------
     1 file changed, 8 insertions(+), 10 deletions(-)
    
    diff --git a/src/common/compat.c b/src/common/compat.c
    index 2e72c54..2cce603 100644
    a b set_max_file_descriptors(rlim_t limit, int *max_out) 
    16881688             "ConnLimit must be at least %d. Failing.", ULIMIT_BUFFER);
    16891689      return -1;
    16901690    }
    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       return -1;
    1698     }
    1699     return -1;
    1700   }
    17011691
    17021692  /* Define some maximum connections values for systems where we cannot
    17031693   * automatically determine a limit. Re Cygwin, see
    set_max_file_descriptors(rlim_t limit, int *max_out) 
    17891779    limit = INT_MAX;
    17901780  tor_assert(max_out);
    17911781  *max_out = max_sockets = (int)limit - ULIMIT_BUFFER;
     1782   if(public_server_mode(get_options())){
     1783      if(limit < 8192){
     1784        log_warn(LD_CONFIG,
     1785               "Public Relay having too-low file descriptor limit");
     1786        return -1;
     1787      }
     1788      return -1;
     1789    }
    17921790  return 0;
    17931791}
    17941792