net/tcp: Same change to tcp_send_buffered.c probably also applies to tcp_send_unbuffered.c.

This commit is contained in:
Gregory Nutt 2017-10-19 16:14:18 -06:00
parent 09f3e9ce5c
commit 5a416be95b
2 changed files with 23 additions and 3 deletions

View file

@ -13,10 +13,21 @@ STATUS
will not build to completion. Missing logic includes:
- GPIO support,
- Peripheral clocking support,
- System timer initialization, and
- Serial driver.
2017-10-19: Much of that logic is in place but there are a few things
still missing.
- Mini-UART Baud divisor calculation,
- Start-up logic. My understand from what I have read on the internet
is the PiZero OS starts up in hypervisor mode with the MMU and I- and
D-Caches enabled. This probaby means that the standard, classic ARM
startup logic at at arch/arm/src/arm/up_head.S will need to be replaced
with some custom logic.
No testing has yet been performed.
Basic Setup
===========

View file

@ -398,9 +398,18 @@ static uint16_t tcpsend_eventhandler(FAR struct net_driver_s *dev,
{
ninfo("Lost connection\n");
/* Report not connected */
/* We could get here recursively through the callback actions of
* tcp_lost_connection(). So don't repeat that action if we have
* already been disconnected.
*/
if (_SS_ISCONNECTED(psock->s_flags))
{
/* Report not connected */
tcp_lost_connection(pstate->snd_sock, pstate->snd_cb, flags);
}
tcp_lost_connection(pstate->snd_sock, pstate->snd_cb, flags);
pstate->snd_sent = -ENOTCONN;
goto end_wait;
}