Good evening,

I've quickly added a bit of code to an existing application that polls an
OWserver running on another host and have come across what I think may be a bug.

OWFS 2.8p20 (module/ownet/c/src/c)

Specifically, I have added a simple function to the code that calls..

OWNET_init, OWNET_read then OWNET_close

All sounds simple, until the process started to hang after running a while.
Looking at the process using lsof, I found it had run out of file descriptors,
as the fd table was full of net connections to the owserver.

Looking through the code, it seems that in ow_connect.c around line 108, there
is a case statement that is responsible for calling 'FreeClientAddr' for the
'bus_server' mode - however, FreeClientAddr doesn't actually close the fd.

I've updated this case statement to check that 'target->iroutines.close' is
valid, and if it is, call that instead - as the close routine does close the
socket, and then calls FreeClientAddr itself.

I may be miles of track with where the fix should really be applied, but unless
I'm doing something wrong, looks like you've got a 'fd' leak with open sockets.

Hope this is of some help...

marty



------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to