8000 Quick fixes to sender MSS, socket locking by saminiir · Pull Request #11 · saminiir/level-ip · GitHub
[go: up one dir, main page]

Skip to content

Quick fixes to sender MSS, socket locking - #11

Merged
saminiir merged 19 commits into
masterfrom
devel
Sep 16, 2017
Merged

saminiir merged 19 commits into
masterfrom
devel

Conversation

@saminiir
Copy link
Copy Markdown
Owner

Stability improvements with improved (simplified) locking scheme. See #10

Artificially lowered and hardcoded sender MSS, in order to accommodate lower ranges. Correctly determining the MSS is in TODO.

End-to-end test suites have their hackish sleeps increased, since TravisCI VM sporadically fails. A proper test framework is in TODO.

saminiir added 19 commits July 20, 2017 21:19
Doh, the obvious mistake here was that the data was not read
from the correct index.
No real reason, just feels like this is more tolerant of coding errors
(and thus harder to debug ;-)
Otherwise, a double-free error can occur.
Also, do not print anything if mutex is already locke when using
`trylock`
Timer engine now spawns worker threads to run the actual tasks.

Sockets are now strictly locked with sock->lock, since this
simplifies the interplay between timers, input handler and
the user socket handler.
Oops, this caused doublelocking (timer_free) and timers
were never released.
Not sure if this helps that much, but if clearly a thread
only needs to read data from the socket, it can use `rdlock` then.
Lvl-ip spends its most time here, and felt like the 1ms resolution
is a bit too fine for the purposes.
We really want to lock it and not bail out.

Also, added error printing if the lock can't be acquired.
This still isn't how I'd like it to be, but the twist is that
we need to lock the timer, remove it from the list, and only
then can we unlock it. Which begs the question, if refcnt is 0,
nobody should be able to acquire the timer reference anymore!
I know, sleeping like this is not that maintainable. Proper solution
would be to poll the HTTP server for when it's up.
…imer-dispatch

Refactor/use worker threads in timer dispatch
Not sure why it takes so long, but the difference is noticeable
now.
For some reason, TravisCI fails sporadically a lot on this.
Increasing the sleep time seems to help, or then I'm just chasing
a red herring!
This is a hack to tolerate lower ranges in the network better.

Parsing the sender MSS from the synack is on the TODO list.
@saminiir
saminiir merged commit e61e5ba into master Sep 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0