]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote branch 'origin/maint-0.2.1'
authorNick Mathewson <nickm@torproject.org>
Sun, 24 Jan 2010 01:46:57 +0000 (20:46 -0500)
committerNick Mathewson <nickm@torproject.org>
Sun, 24 Jan 2010 01:46:57 +0000 (20:46 -0500)
1  2 
src/common/tortls.c
src/or/router.c

index 86f07a270a71d93dfa9aa44b4ae22eb29a8fdfc2,beab5356c50cb0ed981779c53a200159d92a53ae..4bb2291b1f3f52dea41f9192067b7b7fc98f05d8
@@@ -198,17 -179,17 +198,19 @@@ tls_log_errors(tor_tls_t *tls, int seve
      msg = (const char*)ERR_reason_error_string(err);
      lib = (const char*)ERR_lib_error_string(err);
      func = (const char*)ERR_func_error_string(err);
 +    if (!state)
 +      state = (st>=0)?ssl_state_to_string(st):"---";
      if (!msg) msg = "(null)";
+     if (!lib) lib = "(null)";
+     if (!func) func = "(null)";
      if (doing) {
 -      log(severity, LD_NET, "TLS error while %s%s%s: %s (in %s:%s)",
 +      log(severity, domain, "TLS error while %s%s%s: %s (in %s:%s:%s)",
            doing, addr?" with ":"", addr?addr:"",
 -          msg, lib, func);
 +          msg, lib, func, state);
      } else {
 -      log(severity, LD_NET, "TLS error%s%s: %s (in %s:%s)",
 +      log(severity, domain, "TLS error%s%s: %s (in %s:%s:%s)",
            addr?" with ":"", addr?addr:"",
 -          msg, lib, func);
 +          msg, lib, func, state);
      }
    }
  }
diff --cc src/or/router.c
index e14f237728befbd8e29093dd77666852f3f341fc,97f411dcd6d06ba478ab0e20c8028316cc34b3e5..827df0302ce3faf32f0cd730e36b6424c2e1c8b4
@@@ -1377,11 -1380,11 +1377,12 @@@ router_rebuild_descriptor(int force
    ei->cache_info.published_on = ri->cache_info.published_on;
    memcpy(ei->cache_info.identity_digest, ri->cache_info.identity_digest,
           DIGEST_LEN);
 -  ei->cache_info.signed_descriptor_body = tor_malloc(8192);
 -  if (extrainfo_dump_to_string(ei->cache_info.signed_descriptor_body, 8192,
 -                               ei, get_identity_key()) < 0) {
 +  ei_size = options->ExtraInfoStatistics ? MAX_EXTRAINFO_UPLOAD_SIZE : 8192;
 +  ei->cache_info.signed_descriptor_body = tor_malloc(ei_size);
 +  if (extrainfo_dump_to_string(ei->cache_info.signed_descriptor_body,
 +                               ei_size, ei, get_identity_key()) < 0) {
      log_warn(LD_BUG, "Couldn't generate extra-info descriptor.");
+     routerinfo_free(ri);
      extrainfo_free(ei);
      return -1;
    }