Commit f9b0be52 authored by Nick Mathewson's avatar Nick Mathewson 🤹
Browse files

Use LD_BUG as appropriate; convert rend* and router* to new logging interface;...

Use LD_BUG as appropriate; convert rend* and router* to new logging interface; use new circ_log_path interface


svn:r5302
parent fa338d85
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ buf_normalize(buf_t *buf)
  } else {
    char *newmem, *oldmem;
    size_t sz = (buf->mem+buf->len)-buf->cur;
    warn(LD_GENERAL, "Unexpected non-normalized buffer.");
    warn(LD_BUG, "Unexpected non-normalized buffer.");
    newmem = GUARDED_MEM(tor_malloc(ALLOC_LEN(buf->len)));
    SET_GUARDS(newmem, buf->len);
    memcpy(newmem, buf->cur, sz);
@@ -807,7 +807,7 @@ fetch_from_buf_http(buf_t *buf,
  buf_normalize(buf);

  if (buf_nul_terminate(buf)<0) {
    warn(LD_GENERAL,"Couldn't nul-terminate buffer");
    warn(LD_BUG,"Couldn't nul-terminate buffer");
    return -1;
  }
  headers = buf->cur;
+2 −2
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ circuit_expire_building(time_t now)
      else
        log_fn(LOG_INFO,"Abandoning circ %d (state %d:%s, purpose %d)", victim->n_circ_id,
               victim->state, circuit_state_to_string(victim->state), victim->purpose);
      circuit_log_path(LOG_INFO,victim);
      circuit_log_path(LOG_INFO,LD_CIRC,victim);
      circuit_mark_for_close(victim);
    }
  }
@@ -1123,7 +1123,7 @@ connection_ap_handshake_attach_circuit(connection_t *conn)
    log_fn(LOG_DEBUG,"Attaching apconn to circ %d (stream %d sec old).",
           circ->n_circ_id, conn_age);
    /* here, print the circ's path. so people can figure out which circs are sucking. */
    circuit_log_path(LOG_INFO,circ);
    circuit_log_path(LOG_INFO,LD_APP,circ);

    /* We have found a suitable circuit for our conn. Hurray. */
    return connection_ap_handshake_attach_chosen_circuit(conn, circ);
+1 −1
Original line number Diff line number Diff line
@@ -359,7 +359,7 @@ connection_ap_expire_beginning(void)
    log_fn(LOG_NOTICE,"Stream is %d seconds late on address '%s'. Retrying.",
           (int)(now - conn->timestamp_lastread),
           safe_str(conn->socks_request->address));
    circuit_log_path(LOG_NOTICE, circ);
    circuit_log_path(LOG_NOTICE, LD_APP, circ);
    /* send an end down the circuit */
    connection_edge_end(conn, END_STREAM_REASON_TIMEOUT, conn->cpath_layer);
    /* un-mark it as ending, since we're going to reuse it */
+4 −4
Original line number Diff line number Diff line
@@ -1327,7 +1327,7 @@ handle_getinfo_helper(const char *question, char **answer)
        case AP_CONN_STATE_OPEN:
          state = "SUCCEEDED"; break;
        default:
          warn(LD_GENERAL, "Asked for stream in unknown state %d",
          warn(LD_BUG, "Asked for stream in unknown state %d",
                 conns[i]->state);
          continue;
        }
@@ -2318,7 +2318,7 @@ control_event_circuit_status(circuit_t *circ, circuit_status_event_t tp)
      case CIRC_EVENT_FAILED: status = "FAILED"; break;
      case CIRC_EVENT_CLOSED: status = "CLOSED"; break;
      default:
        warn(LD_GENERAL, "Unrecognized status code %d", (int)tp);
        warn(LD_BUG, "Unrecognized status code %d", (int)tp);
        return 0;
      }
    send_control1_event(EVENT_CIRCUIT_STATUS,
@@ -2389,7 +2389,7 @@ control_event_stream_status(connection_t *conn, stream_status_event_t tp)
      case STREAM_EVENT_NEW_RESOLVE: status = "NEWRESOLVE"; break;
      case STREAM_EVENT_FAILED_RETRIABLE: status = "DETACHED"; break;
      default:
        warn(LD_GENERAL, "Unrecognized status code %d", (int)tp);
        warn(LD_BUG, "Unrecognized status code %d", (int)tp);
        return 0;
      }
    circ = circuit_get_by_edge_conn(conn);
@@ -2431,7 +2431,7 @@ control_event_or_conn_status(connection_t *conn,or_conn_status_event_t tp)
      case OR_CONN_EVENT_FAILED: status = "FAILED"; break;
      case OR_CONN_EVENT_CLOSED: status = "CLOSED"; break;
      default:
        warn(LD_GENERAL, "Unrecognized status code %d", (int)tp);
        warn(LD_BUG, "Unrecognized status code %d", (int)tp);
        return 0;
      }
    send_control1_event(EVENT_OR_CONN_STATUS,
+0 −1
Original line number Diff line number Diff line
@@ -117,7 +117,6 @@ onion_pending_remove(circuit_t *circ)
  } else { /* we need to hunt through the rest of the list */
    for ( ;tmpo->next && tmpo->next->circ != circ; tmpo=tmpo->next) ;
    if (!tmpo->next) {
      /* XX is there a better category here? */
      debug(LD_GENERAL,"circ (p_circ_id %d) not in list, probably at cpuworker.",circ->p_circ_id);
      return;
    }
Loading