Ticket #9860: 0002-Preventing-junk-log-messages-when-ORPort-changes.patch

File 0002-Preventing-junk-log-messages-when-ORPort-changes.patch, 2.5 KB (added by rl1987, 6 years ago)
  • new file changes/bug9860

    From bde80330d4675eb0f02c27cb1ac303c60cdc7f5c Mon Sep 17 00:00:00 2001
    From: rl1987 <rl1987@sdf.lonestar.org>
    Date: Sat, 26 Oct 2013 14:11:31 +0300
    Subject: [PATCH 2/2] Preventing junk log messages when ORPort changes.
    
    ---
     changes/bug9860     | 3 +++
     src/or/config.c     | 9 ++++++---
     src/or/connection.c | 4 ++--
     3 files changed, 11 insertions(+), 5 deletions(-)
     create mode 100644 changes/bug9860
    
    diff --git a/changes/bug9860 b/changes/bug9860
    new file mode 100644
    index 0000000..4015806
    - +  
     1  o Minor bugfixes:
     2    - Avoid excessive log messages when changing ORPort via Tor control
     3      interface. Fixes bug 9860.
  • src/or/config.c

    diff --git a/src/or/config.c b/src/or/config.c
    index ec96b82..37c11b1 100644
    a b options_act_reversible(const or_options_t *old_options, char **msg) 
    10441044#endif
    10451045
    10461046  if (running_tor) {
    1047     int n_ports=0;
     1047    int n_ports = 0;
    10481048    /* We need to set the connection limit before we can open the listeners. */
    10491049    if (set_max_file_descriptors((unsigned)options->ConnLimit,
    10501050                                 &options->ConnLimit_) < 0) {
    options_act_reversible(const or_options_t *old_options, char **msg) 
    11511151  if (!running_tor)
    11521152    goto commit;
    11531153
    1154   /* Bail-out if config options haven't changed. */
     1154  /* Bail-out if logging-related config options haven't changed. */
    11551155  if (options && old_options)
    1156     if (config_lines_eq(options->Logs, old_options->Logs)) {
     1156    if (config_lines_eq(options->Logs, old_options->Logs) ||
     1157       options->LogTimeGranularity == old_options->LogTimeGranularity ||
     1158       options->RunAsDaemon == old_options->RunAsDaemon ||
     1159       options->LogMessageDomains == old_options->LogMessageDomains) {
    11571160      r = 0;
    11581161      goto done;
    11591162    }
  • src/or/connection.c

    diff --git a/src/or/connection.c b/src/or/connection.c
    index 8cf23ab..881284c 100644
    a b retry_all_listeners(smartlist_t *replaced_conns, 
    22452245  /* Any members that were still in 'listeners' don't correspond to
    22462246   * any configured port.  Kill 'em. */
    22472247  SMARTLIST_FOREACH_BEGIN(listeners, connection_t *, conn) {
    2248     log_notice(LD_NET, "Closing no-longer-configured %s on %s:%d",
    2249                conn_type_to_string(conn->type), conn->address, conn->port);
     2248    log_info(LD_NET, "Closing no-longer-configured %s on %s:%d",
     2249             conn_type_to_string(conn->type), conn->address, conn->port);
    22502250    if (replaced_conns) {
    22512251      smartlist_add(replaced_conns, conn);
    22522252    } else {