mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 13:50:12 +08:00
add timeout for api calls
This commit is contained in:
parent
343ff659fc
commit
55ee8212dc
@ -11,7 +11,6 @@ import (
|
||||
"nekobox_core/internal/boxdns/winipcfg"
|
||||
"net/netip"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -24,7 +23,6 @@ var dnsIsSet bool
|
||||
|
||||
func HandleInterfaceChange(_ *control.Interface, _ int) {
|
||||
monitorForUnderlyingDNS()
|
||||
time.Sleep(2 * time.Second)
|
||||
if !dnsIsSet {
|
||||
return
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ namespace QtGrpc {
|
||||
|
||||
QNetworkReply::NetworkError Call(const QString &methodName,
|
||||
const google::protobuf::Message &req, google::protobuf::Message *rsp,
|
||||
int timeout_ms = 0) {
|
||||
int timeout_ms = 2000) {
|
||||
if (!NekoGui::dataStore->core_running) return QNetworkReply::NetworkError(-1919);
|
||||
|
||||
std::string reqStr;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user