lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #16830] err_tcp() posts to connection mailbox when no


From: Frédéric Bernon
Subject: [lwip-devel] [bug #16830] err_tcp() posts to connection mailbox when no pend on the mailbox is active
Date: Thu, 05 Apr 2007 12:26:35 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

Follow-up Comment #7, bug #16830 (project lwip):

>the tcpip thread will get the message from the program thread anyway to, for
example, send data, which it will then try and do even though an error had
been indicated for this connection. 

Yes, it's right, even if in netconn_recv, netconn_send & netconn_write, there
is at a beginning :

  if (conn->err != ERR_OK) {
    return conn->err;
  }

If tcpip_thread invoke err_tcp() just after this checking, you can send a
message to api_msg. One "easy" solution is just to add a such checking at
api_msg_input() beginning (and to post a null message to unblock calling
thread if there is an error).

void
api_msg_input(struct api_msg *msg)
{ struct api_msg_msg msg_copy;
  msg_copy=msg->msg;
  if (msg_copy.conn->err != ERR_OK) {
    sys_mbox_post(msg_copy.conn->mbox, NULL);
  } else {
    decode[msg->type](&msg_copy);
  }
}

It a better solution, even if we add one more check in tcpip_thread. It's not
in remplacement from the api_lib ones, because they help to reduce
tcpip_thread "interruption"...

What do you think about these idea, and are you agree I update in CVS?


    _______________________________________________________

Reply to this item at:

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

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





reply via email to

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