Comments (4)
Hi,
lwIP needs us to return ERR_ABRT from the listener callback if we have tcp_abort'ed the client. If we are not very careful to do that, lwIP could crash or misbehave.
DEAD_* is a mechanism to allow us to determine if a certain event has occurred in a certain time frame during processing. In this case, if DEAD_KILL_WITH is called in client_abort_pcb within SYNC_COMMIT (which directly runs pending job handlers), then DEAD_KILLED will be > 0. The whole thing is kind of a hack but is necessary.
from badvpn.
On the other hand I suppose the code could be changed to just do the minimum necessary in listener_accept_func, instead of running event loop processing, i.e. no SYNC_COMMIT and related stuff, always return ERR_OK. But it would not be optimal since we would delay sending/receiving that can be done right, so lwIP might do something suboptimal because of that. Probably not a big issue though.
from badvpn.
Ah, I think I remember, generally the pattern is that within a lwIP callback I directly run event loop jobs that have resulted from whatever actions were just started (e.g. adding a packet to a buffer), to make sure that all data processing that can be done is done right away - this is what the SYNC_COMMIT does. Without this, if lwIP gives us another packet right afterward, we might not be able to place it in the buffer at all, due to the way that the data processing pipeline works - the processing from the previous packet might be pending on the job queue still, so not ready to handle another packet.
from badvpn.
Thank you. @ambrop72
from badvpn.
Related Issues (20)
- socks5 udp doesn't work with IPv6 HOT 1
- why not using boost::asio
- 请问tun2socks透明代理udp该怎么做? HOT 2
- Forks
- Any limitations on Raspberry Pi? HOT 5
- Linux Router
- move_first_timers crash HOT 1
- BadVPN not Working Properly
- ERROR(udpgw): BConnection_Init failed HOT 8
- BADVPN ERROR
- out of UDP buffer
- Virtual netword adapter tap 9 via tun2socks. Need instruction HOT 4
- tun2socks и proxy ipv6
- Assertion failed in BReactor_badvpn.c
- How does the UdpGw daemon work? HOT 2
- tun2socks not support half-closing
- tun2socks on freebsd
- nss/ssl.h not found HOT 1
- 能否在Wiki中写一下tun2socks组件转发的UDP包结构? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from badvpn.