lwip-devel
[Top][All Lists]
Advanced

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

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


From: Frédéric BERNON
Subject: RE : [lwip-devel] [bug #20021] conn->sem is only signaled one-way
Date: Wed, 4 Jul 2007 11:47:19 +0200

I let you do it? And where are we going if Simon Goldschmidth doesn't use the 
bugtracker now???? ;)
 
  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : address@hidden 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de Goldschmidt Simon
Envoyé : mercredi 4 juillet 2007 11:35
À : lwip-devel
Objet : RE: [lwip-devel] [bug #20021] conn->sem is only signaled one-way


OK for me!

> Follow-up Comment #22, bug #20021 (project lwip):
> 
> About socket layer: so, netconn_close is not called, we stay on a
> netconn_delete: ok, since this call do the job (and a smart
> linker will remove netconn_close/do_close from the code).
> 
> I see a little problem: netconn_delete is called inside the
> sys_sem_wait(socksem)/sys_sem_signal(socksem).
> 
> I think it could be a problem because any new socket can't be
> created during the close. Comments in lwip_close say it's 
> done because "/* We cannot allow multiple closes of the same 
> socket. */". Since others API file like lwip_send can call by 
> another thread in the same time, I think this protection is 
> not enough, and give more problem.
> 
> I propose to change the code like this :
> 
> int
> lwip_close(int s)
> {
>   struct lwip_socket *sock;
> 
>   LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_close(%d)n", s));
> 
>   sock = get_socket(s);
>   if (!sock) {
>     return -1;
>   }
> 
>   netconn_delete(sock->conn);
> 
>   sys_sem_wait(socksem);
>   if (sock->lastdata) {
>     netbuf_delete(sock->lastdata);
>   }
>   sock->lastdata   = NULL;
>   sock->lastoffset = 0;
>   sock->conn       = NULL;
>   sock_set_errno(sock, 0);
>   sys_sem_signal(socksem);
>   return 0;
> }
> 
> Comments?


_______________________________________________
lwip-devel mailing list
address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-devel

Attachment: Frédéric BERNON.vcf
Description: Frédéric BERNON.vcf


reply via email to

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