Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Net single tcp packet #1522

Merged
merged 10 commits into from
Sep 8, 2017
Merged

Net single tcp packet #1522

merged 10 commits into from
Sep 8, 2017

Conversation

grgustaf
Copy link
Contributor

@grgustaf grgustaf commented Sep 7, 2017

No description provided.

This is useful so you can make sure your sample flashed correctly and
you're running the sample you think you are.

Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
This patch renames the control flag for the code that records the file
and function that signalled a callback to INSTRUMENT_CALLBACKS. This
lets you easily turn it on or off instead of tying it to DEBUG_BUILD.

I just encountered a bug where I get a segfault on K64F with
DEBUG_BUILD; turning this feature off fixes it so that's what I'm
going to do for now.

Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
Because we defer the handling of new connections, it's possible for
the new connection socket to be closed before we handle the first data
packet, or even before we get around to accepting the new connection.
The correct thing to do in this case is to still report the new
connection, and report the data received, but mark the socket as
closed so we don't allow writing to it. Then once the connection and
data have been report it, we issue a close event.

To do this, we register the server handle, not the socket handle,
with tcp_received, and then look up the socket based on the context
the packet came in on. So we also had to do that for the client
sockets, for which we added a "no_server" stub handle.

Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
@grgustaf
Copy link
Contributor Author

grgustaf commented Sep 7, 2017

Fixes #1512

There was no reason to keep them around since the functions inside
were no longer held; this only exacerbated memory leak problems.

Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
Because this was still a deferred emit while receive_packet and
clear_closed were using immediate emits, the 'connection' event would
end up happening *after* the 'data' and 'close' events, so there was
no one signed up to hear them.

Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
Does nothing in release mode, but in debug mode if an assertion fails
it prints a message and hangs to make sure it's noticed.

Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
@brianjjones
Copy link
Contributor

LGTM +1

@qiaojingx
Copy link

Test with commit 79e8164 + #1522. Issue #1512 is fixed, but new issues are brought. Detail info please refer to #1512.
Not fix #1521, #1518.

@grgustaf grgustaf merged commit 5403f92 into intel:master Sep 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants