mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-26 11:21:22 +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"
|
"nekobox_core/internal/boxdns/winipcfg"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -24,7 +23,6 @@ var dnsIsSet bool
|
|||||||
|
|
||||||
func HandleInterfaceChange(_ *control.Interface, _ int) {
|
func HandleInterfaceChange(_ *control.Interface, _ int) {
|
||||||
monitorForUnderlyingDNS()
|
monitorForUnderlyingDNS()
|
||||||
time.Sleep(2 * time.Second)
|
|
||||||
if !dnsIsSet {
|
if !dnsIsSet {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -145,7 +145,7 @@ namespace QtGrpc {
|
|||||||
|
|
||||||
QNetworkReply::NetworkError Call(const QString &methodName,
|
QNetworkReply::NetworkError Call(const QString &methodName,
|
||||||
const google::protobuf::Message &req, google::protobuf::Message *rsp,
|
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);
|
if (!NekoGui::dataStore->core_running) return QNetworkReply::NetworkError(-1919);
|
||||||
|
|
||||||
std::string reqStr;
|
std::string reqStr;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user