URL:
  <http://gna.org/bugs/?18082>

                 Summary: Odd auth code
                 Project: Freeciv
            Submitted by: akfaew
            Submitted on: Thu 28 Apr 2011 01:24:16 PM GMT
                Category: None
                Severity: 2 - Minor
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any
        Operating System: None
         Planned Release: 

    _______________________________________________________

Details:

I've noticed some strange code in trunk:

sernet.c:
    619       if (srvarg.auth_enabled
    620           && !pconn->server.is_closing
    621           && pconn->server.status != AS_ESTABLISHED) {
    622         auth_process_status(pconn);
    623       }

only place where auth_process_status is called is from sernet.c

auth.c:
    216 void auth_process_status(struct connection *pconn)
    217 {
    218   switch(pconn->server.status) {
...
    255     break;
    256   case AS_ESTABLISHED:
    257     /* this better fail bigtime */
    258     fc_assert(pconn->server.status != AS_ESTABLISHED);
    259     break;
    260   }
    261 }

I might be tired, but I read this as:
if pconn->server.status != AS_ESTABLISHED run auth_process_status(pconn), and
inside that if pconn->server.status == AS_ESTABLISHED then fail if
pconn->server.status == AS_ESTABLISHED, which is rather confusing.

I'm not sure whether I am supposed to report this, but something does not
seem right to me.




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?18082>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to