lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #20021] conn->sem is only signaled one-way


From: Frédéric Bernon
Subject: [lwip-devel] [bug #20021] conn->sem is only signaled one-way
Date: Wed, 04 Jul 2007 08:48:12 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

Follow-up Comment #21, bug #20021 (project lwip):

Since the job done in netconn_close/do_close is the same as the NETCONN_TCP
part of netconn_delete/do_delconn, the code is a redundant.

Some remarks about do_close_internal:

- "enum tcp_state old_state = conn->pcb.tcp->state;
   if ((old_state == SYN_RCVD) || (old_state == ESTABLISHED) ||
      (old_state == CLOSE_WAIT)) {"
  Why do you use a local variable and a "if" in this case, and not a switch
like for "err" some lines below?

- Even if it's no explicitly in our coding style, default is always the last
clause in our switchs. Why isn't it the case here, and why putting () around
err_t case (like "case (ERR_OK):" ?

- I feel dangerous to determine if FIN is sent or not which "err" return
value: ERR_BUF & ERR_MEM. You should be sure that any future code will not
change or add a error return value. More, if the MAC is "full", there is no
"official" value to return (we have talk about that there is some weeks). Of
course, to do something better, you should "break" the tcp_close. Or perhaps
check if the pcb->state is now FIN_WAIT_1?



    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?20021>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]