networking: Fix one place where the reference count was not being zeroed. This is really a cosmetic fix UNLESS CONFIG_DEBUG_NET is enabled, then it causes assertions

This commit is contained in:
Gregory Nutt 2014-02-25 16:41:11 -06:00
parent 89526241af
commit 817c49547a
2 changed files with 7 additions and 5 deletions

View File

@ -51,6 +51,7 @@ config EXAMPLES_NETTEST_CLIENTIP
EXAMPLES_NETTEST_CLIENTIP should be the same as
EXAMPLES_NETTEST_IPADDR (default). If the target is the server,
then the default value of EXAMPLES_NETTEST_CLIENTIP is set to the
gateway address, EXAMPLES_NETTEST_DRIPADDR.
host PC IP address (possibly the gateway address,
EXAMPLES_NETTEST_DRIPADDR?).
endif

View File

@ -134,10 +134,11 @@ void recv_server(void)
/* Configure to "linger" until all data is sent when the socket is closed */
#ifdef NETTEST_HAVE_SOLINGER
ling.l_onoff = 1;
ling.l_linger = 30; /* timeout is seconds */
if (setsockopt(acceptsd, SOL_SOCKET, SO_LINGER, &ling, sizeof(struct linger)) < 0)
{
ling.l_onoff = 1;
ling.l_linger = 30; /* timeout is seconds */
if (setsockopt(acceptsd, SOL_SOCKET, SO_LINGER, &ling, sizeof(struct linger)) < 0)
{
message("server: setsockopt SO_LINGER failure: %d\n", errno);
goto errout_with_acceptsd;
}