Commit 113367bc authored by Nick Mathewson's avatar Nick Mathewson 🐘
Browse files

r14722@catbus: nickm | 2007-08-20 10:54:29 -0400

 Add debugging warning to not abort in the case of bug 483.  This is probably not an actual error case, so we should figure out what is really causing it and do something more sensible.


svn:r11215
parent ed801a8d
Loading
Loading
Loading
Loading
+9 −1
Changes for src/or/connection.c: 9 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -931,7 +931,15 @@ connection_handle_listener_read(connection_t *conn, int new_type)
  if (options->ConstrainedSockets)
    set_constrained_socket_buffers(news, (int)options->ConstrainedSockSize);

  tor_assert(((struct sockaddr*)addrbuf)->sa_family == conn->socket_family);
  if (((struct sockaddr*)addrbuf)->sa_family != conn->socket_family) {
    log_warn(LD_BUG, "A listener connection returned a socket with a "
             "mismatched family. %s for addr_family %d gave us a socket "
             "with address family %d.", conn_type_to_string(conn->type),
             (int)conn->socket_family,
             (int)((struct sockaddr*)addrbuf)->sa_family);
    tor_close_socket(news);
    return 0;
  }

  if (conn->socket_family == AF_INET) {
    if (check_sockaddr_in((struct sockaddr*)addrbuf, remotelen, LOG_INFO)<0) {