[tor-bugs] #6028 [Tor Relay]: errno_to_orconn_end_reason() spams log when errno == 0

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Fri Jun 15 23:26:41 UTC 2012


#6028: errno_to_orconn_end_reason() spams log when errno == 0
-----------------------+----------------------------------------------------
 Reporter:  ln5        |          Owner:                    
     Type:  defect     |         Status:  new               
 Priority:  minor      |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Relay  |        Version:                    
 Keywords:             |         Parent:                    
   Points:             |   Actualpoints:                    
-----------------------+----------------------------------------------------

Old description:

> Should we make errno_to_orconn_end_reason() shut up when errno is 0?
> Or should we rather make sure not to call it when errno is 0?

New description:



--

Comment(by andrea):

 The function errno_to_orconn_end_reason() is called from four places:

  * connection_or_connect() (connect_or.c, line 1112):

    This has someting like:

 {{{
 int socket_error = 0;

 if ( connection_connect( ..., &socket_error ) == -1 ) {
     ... invokes errno_to_orconn_end_reason(socket_error)
 }
 }}}

    So, as ln5 stated above, this can happen if connection_connect()
 returns -1 without setting socket_error.

  * connection_handle_read_impl() (connect.c, line 2671):

    Similar to connection_or_connect(); this can happen if
 connection_read_to_buf()
    returns < 0 without setting socket_error.

  * connection_handle_event_cb() (connect.c, line 3020):

    The value of socket_error comes from evutil_socket_geterror( conn->s )
 if
    event & BEV_EVENT_ERROR; can this ever happen without
 evutil_socket_geterror() returning
    an error?

  * connection_handle_write_impl() (connect.c, line 3195):

    This has something of the form:

 {{{
 if ( e ) {
     ...;
     connection_or_connect_failed( ...,
         errno_to_orconn_end_reason(e));
 }
 }}}

     so it looks impossible for it to be caused here.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6028#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list