net_server: Run DHCP negotiation on a separate thread to fix hangs.
Previously we ran DHCP negotiation on the looper thread. This meant that we just blocked it for long periods of time, which stopped configuration settings changes from working properly, and causing the Network preferences panel to hang when net_server failed to respond to its messages. Now, we spawn a separate thread to do the real work on, and unlock the looper around the recvfrom() with long timeouts. There's now a kMsgAutoConfigureFailed that is sent when auto-configuration fails, so that the AutoconfigLooper can fallback as before. Additionally, the main NetServer class quits loopers for devices on any configuration change, rather than deferring it unecessarily (and possibly wrongly, in some cases.) Fixes #18037. Probably fixes #17300 and may help with others.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#define kNetServerSignature "application/x-vnd.haiku-net_server"
|
||||
|
||||
#define kMsgConfigureInterface 'COif'
|
||||
#define kMsgAutoConfigureFailed 'COaf'
|
||||
#define kMsgConfigureResolver 'COrs'
|
||||
#define kMsgCountPersistentNetworks 'CPnw'
|
||||
#define kMsgGetPersistentNetwork 'GPnw'
|
||||
|
||||
Reference in New Issue
Block a user