mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-29 05:55:13 +08:00
🦄 Sync 2026-08-01 08:33:22
This commit is contained in:
1 parent
d0edc0afd7
commit
e37e0024d0
9 files changed
+130
-226
No files matched your search
+2
-2
@@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dae
|
||||
PKG_VERSION:=2026.07.31
|
||||
PKG_RELEASE:=27
|
||||
PKG_RELEASE:=28
|
||||
|
||||
PKG_SOURCE:=dae-src-2026.07.31-18eb66eae445.tar.gz
|
||||
PKG_SOURCE:=dae-src-2026.07.31-66d15d5a12f7.tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/kenzok8/openwrt-daede/releases/download/dae-src
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_HASH:=skip
|
||||
|
||||
@@ -1,40 +1,114 @@
|
||||
diff --git a/cmd/reload_manager.go b/cmd/reload_manager.go
|
||||
index c78910c..bcc1a37 100644
|
||||
--- a/cmd/reload_manager.go
|
||||
+++ b/cmd/reload_manager.go
|
||||
@@ -411,0 +412,3 @@ func dnsConfigFingerprint(dns config.Dns
|
||||
@@ -423,5 +423,8 @@ func dnsConfigFingerprint(dns config.Dns) string {
|
||||
b.WriteString("max_cache_size=")
|
||||
b.WriteString(strconv.Itoa(dns.MaxCacheSize))
|
||||
b.WriteByte(';')
|
||||
+ b.WriteString("response_ttl=")
|
||||
+ b.WriteString(strconv.Itoa(dns.ResponseTtl))
|
||||
+ b.WriteByte(';')
|
||||
return b.String()
|
||||
}
|
||||
diff --git a/cmd/run_shutdown_test.go b/cmd/run_shutdown_test.go
|
||||
index f8f731f..4dcdcff 100644
|
||||
--- a/cmd/run_shutdown_test.go
|
||||
+++ b/cmd/run_shutdown_test.go
|
||||
@@ -605,0 +606 @@ func TestDNSConfigFingerprintCoversAllDn
|
||||
@@ -609,6 +609,7 @@ func TestDNSConfigFingerprintCoversAllDnsFields(t *testing.T) {
|
||||
"OptimisticCache": {},
|
||||
"OptimisticCacheTtl": {},
|
||||
"MaxCacheSize": {},
|
||||
+ "ResponseTtl": {},
|
||||
}
|
||||
|
||||
dnsType := reflect.TypeOf(config.Dns{})
|
||||
diff --git a/config/config.go b/config/config.go
|
||||
index e688e88..af28da5 100644
|
||||
--- a/config/config.go
|
||||
+++ b/config/config.go
|
||||
@@ -156,0 +157 @@ type Dns struct {
|
||||
@@ -160,6 +160,7 @@ type Dns struct {
|
||||
OptimisticCache bool `mapstructure:"optimistic_cache" default:"true"`
|
||||
OptimisticCacheTtl int `mapstructure:"optimistic_cache_ttl" default:"60"`
|
||||
MaxCacheSize int `mapstructure:"max_cache_size" default:"0"`
|
||||
+ ResponseTtl int `mapstructure:"response_ttl" default:"0"`
|
||||
}
|
||||
|
||||
type Routing struct {
|
||||
diff --git a/config/desc.go b/config/desc.go
|
||||
index 513cf7e..9b3c1a2 100644
|
||||
--- a/config/desc.go
|
||||
+++ b/config/desc.go
|
||||
@@ -68,0 +69 @@ var DnsDesc = Desc{
|
||||
@@ -66,6 +66,7 @@ var GlobalDesc = Desc{
|
||||
var DnsDesc = Desc{
|
||||
"ipversion_prefer": "For example, if ipversion_prefer is 4 and the domain name has both type A and type AAAA records, the dae will only respond to type A queries and response empty answer to type AAAA queries.",
|
||||
"fixed_domain_ttl": "Give a fixed ttl for domains. Zero means that dae will request to upstream every time and not cache DNS results for these domains.",
|
||||
+ "response_ttl": "Override the TTL returned to downstream DNS clients. Zero keeps dae's default behavior.",
|
||||
"upstream": "Value can be scheme://host:port, where the scheme can be tcp/udp/tcp+udp.\nIf host is a domain and has both IPv4 and IPv6 record, dae will automatically choose IPv4 or IPv6 to use according to group policy (such as min latency policy).\nPlease make sure DNS traffic will go through and be forwarded by dae, which is REQUIRED for domain routing.\nIf dial_mode is \"ip\", the upstream DNS answer SHOULD NOT be polluted, so domestic public DNS is not recommended.",
|
||||
"request": `DNS request routing for ordinary client traffic uses qname and qtype.
|
||||
Built-in outbounds for ordinary DNS requests: asis, reject.
|
||||
diff --git a/control/control_plane.go b/control/control_plane.go
|
||||
index 5df98db..a543f3b 100644
|
||||
--- a/control/control_plane.go
|
||||
+++ b/control/control_plane.go
|
||||
@@ -774,0 +775 @@ func NewControlPlane(
|
||||
@@ -771,6 +771,7 @@ func newControlPlaneWithContextOptions(
|
||||
}
|
||||
plane.dnsRouting = dnsUpstream
|
||||
plane.dnsFixedDomainTtl = fixedDomainTtl
|
||||
+ plane.dnsResponseTtl = dnsConfig.ResponseTtl
|
||||
@@ -1273,0 +1275 @@ func (c *ControlPlane) dnsControllerOption() *DnsControllerOption {
|
||||
+ ResponseTtl: c.dnsResponseTtl,
|
||||
dnsControllerOption := plane.dnsControllerOption()
|
||||
dnsControllerOption.OptimisticCache = dnsConfig.OptimisticCache
|
||||
dnsControllerOption.OptimisticCacheTtl = dnsConfig.OptimisticCacheTtl
|
||||
@@ -1256,6 +1257,7 @@ func (c *ControlPlane) dnsControllerOption() *DnsControllerOption {
|
||||
Log: c.log,
|
||||
LifecycleContext: c.ctx,
|
||||
ConcurrencyLimit: 0,
|
||||
+ ResponseTtl: c.dnsResponseTtl,
|
||||
CacheAccessCallback: func(cache *DnsCache) (err error) {
|
||||
if err = c.core.BatchUpdateDomainRouting(cache); err != nil {
|
||||
return fmt.Errorf("BatchUpdateDomainRouting: %w", err)
|
||||
diff --git a/control/dns_control.go b/control/dns_control.go
|
||||
index d5bf872..b52132d 100644
|
||||
--- a/control/dns_control.go
|
||||
+++ b/control/dns_control.go
|
||||
@@ -80,0 +81 @@ type DnsControllerOption struct {
|
||||
@@ -82,6 +82,7 @@ type DnsControllerOption struct {
|
||||
OptimisticCache bool
|
||||
OptimisticCacheTtl int // 0 means never expire (rely on LRU eviction)
|
||||
MaxCacheSize int // maximum number of cache entries (0 = unlimited)
|
||||
+ ResponseTtl int
|
||||
@@ -96,0 +98 @@ type dnsControllerRuntimeState struct {
|
||||
}
|
||||
|
||||
type dnsControllerRuntimeState struct {
|
||||
@@ -94,6 +95,7 @@ type dnsControllerRuntimeState struct {
|
||||
bestDialerChooser func(ctx context.Context, req *udpRequest, upstream *dns.Upstream) (*dialArgument, error)
|
||||
timeoutExceedCallback func(dialArgument *dialArgument, err error)
|
||||
fixedDomainTtl map[string]int
|
||||
+ responseTtl int
|
||||
@@ -174,0 +177,3 @@ func normalizeDnsRuntimeBehavior(option *DnsControllerOption) (qtypePrefer uint
|
||||
}
|
||||
|
||||
type dnsControllerStore struct {
|
||||
@@ -170,6 +172,9 @@ func normalizeDnsRuntimeBehavior(option *DnsControllerOption) (qtypePrefer uint1
|
||||
if err != nil {
|
||||
return 0, false, 0, 0, err
|
||||
}
|
||||
+ if option.ResponseTtl < 0 {
|
||||
+ return 0, false, 0, 0, fmt.Errorf("response_ttl must be greater than or equal to 0")
|
||||
+ }
|
||||
@@ -424,0 +430 @@ func (c *DnsController) TryUpdateRuntime(routing *dns.Dns, option *DnsControlle
|
||||
optimisticCacheTtl = option.OptimisticCacheTtl
|
||||
maxCacheSize = option.MaxCacheSize
|
||||
if optimisticCacheTtl == 0 && maxCacheSize == 0 {
|
||||
@@ -422,6 +427,7 @@ func (c *DnsController) updateRuntime(option *DnsControllerOption, routing *dns.
|
||||
bestDialerChooser: option.BestDialerChooser,
|
||||
timeoutExceedCallback: option.TimeoutExceedCallback,
|
||||
fixedDomainTtl: option.FixedDomainTtl,
|
||||
+ responseTtl: option.ResponseTtl,
|
||||
@@ -1550 +1556,7 @@ func (c *DnsController) NormalizeAndCacheDnsResp_(msg *dnsmessage.Msg, response
|
||||
})
|
||||
return nil
|
||||
}
|
||||
@@ -1547,10 +1553,16 @@ func (c *DnsController) NormalizeAndCacheDnsResp_(msg *dnsmessage.Msg, responseC
|
||||
ttl = 31536000
|
||||
}
|
||||
|
||||
- // For A/AAAA records, we set TTL to 0 to prevent downstream caching while we manage it.
|
||||
+ responseTtl := 0
|
||||
+ if rt := c.runtime(); rt != nil {
|
||||
@@ -43,9 +117,16 @@
|
||||
+
|
||||
+ // For A/AAAA records, we set TTL to 0 by default to prevent downstream caching while we manage it.
|
||||
+ // When response_ttl is set, use it as the downstream-visible TTL.
|
||||
@@ -1553 +1565 @@ func (c *DnsController) NormalizeAndCacheDnsResp_(msg *dnsmessage.Msg, response
|
||||
if q.Qtype == dnsmessage.TypeA || q.Qtype == dnsmessage.TypeAAAA {
|
||||
for i := range msg.Answer {
|
||||
- msg.Answer[i].Header().Ttl = 0
|
||||
+ msg.Answer[i].Header().Ttl = uint32(responseTtl)
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/control/dns_response_ttl_test.go b/control/dns_response_ttl_test.go
|
||||
new file mode 100644
|
||||
index 0000000..0e5406e
|
||||
--- /dev/null
|
||||
+++ b/control/dns_response_ttl_test.go
|
||||
@@ -0,0 +1,64 @@
|
||||
@@ -113,9 +194,23 @@
|
||||
+ })
|
||||
+ }
|
||||
+}
|
||||
diff --git a/control/dns_runtime.go b/control/dns_runtime.go
|
||||
index b871cc3..0c1d9c6 100644
|
||||
--- a/control/dns_runtime.go
|
||||
+++ b/control/dns_runtime.go
|
||||
@@ -22,0 +23 @@ type controlPlaneDNSRuntime struct {
|
||||
@@ -20,6 +20,7 @@ type controlPlaneDNSRuntime struct {
|
||||
dnsController *DnsController
|
||||
dnsRouting *dns.Dns
|
||||
dnsFixedDomainTtl map[string]int
|
||||
+ dnsResponseTtl int
|
||||
@@ -264,0 +266 @@ func (r *controlPlaneDNSRuntime) release() {
|
||||
dnsListener *DNSListener
|
||||
dnsListenerStopRegistered bool
|
||||
delayDNSListenerStart bool
|
||||
@@ -262,6 +263,7 @@ func (r *controlPlaneDNSRuntime) releaseRetainedState() {
|
||||
r.dnsController = nil
|
||||
r.dnsRouting = nil
|
||||
r.dnsFixedDomainTtl = nil
|
||||
+ r.dnsResponseTtl = 0
|
||||
r.dnsListener = nil
|
||||
r.dnsListenerStopRegistered = false
|
||||
r.delayDNSListenerStart = false
|
||||
+2
-2
@@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=daed
|
||||
PKG_VERSION:=2026.07.31
|
||||
PKG_RELEASE:=35
|
||||
PKG_RELEASE:=36
|
||||
|
||||
PKG_SOURCE:=daed-src-2026.07.31-8505f3fb8a86.tar.gz
|
||||
PKG_SOURCE:=daed-src-2026.07.31-178adbdeb296.tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/kenzok8/openwrt-daede/releases/download/daed-src
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_HASH:=skip
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=26.7.24
|
||||
PKG_RELEASE:=198
|
||||
PKG_VERSION:=26.8.1
|
||||
PKG_RELEASE:=199
|
||||
PKG_PO_VERSION:=$(PKG_VERSION)
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
|
||||
@@ -8,17 +8,17 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=Nginxer
|
||||
LUCI_DESCRIPTION:=Standard OpenWrt set including full admin with ppp support and the default Bootstrap theme
|
||||
PKG_VERSION:=0.0.1
|
||||
PKG_RELEASE:=8
|
||||
PKG_VERSION:=0.0.2
|
||||
PKG_RELEASE:=9
|
||||
LUCI_DEPENDS:=+luci-nginx
|
||||
|
||||
define Package/luci-nginxer/postrm
|
||||
#!/bin/sh
|
||||
/etc/init.d/uhttpd enabled
|
||||
/etc/init.d/uhttpd enable
|
||||
/etc/init.d/uhttpd start
|
||||
exit 0
|
||||
endef
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@@ -8,7 +8,11 @@ if [ "$nginxer" != 1 ]; then
|
||||
uci set nginx._redirect2ssl.access_log='off; # logd openwrt'
|
||||
uci set nginx.global.nginxer='1'
|
||||
uci commit nginx
|
||||
|
||||
# fix firmware upload failed
|
||||
sed -i 's/client_max_body_size 128M;/client_max_body_size 256M;/g' /etc/nginx/uci.conf.template
|
||||
|
||||
# /etc/init.d/uhttpd running || /etc/init.d/uhttpd disable
|
||||
/etc/init.d/nginx reload
|
||||
fi
|
||||
exit 0
|
||||
exit 0
|
||||
+2
-2
@@ -10,12 +10,12 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=natflow
|
||||
PKG_VERSION:=20260531
|
||||
PKG_RELEASE:=55
|
||||
PKG_RELEASE:=56
|
||||
|
||||
PKG_SOURCE:=$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://github.com/ptpt52/natflow.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e155710bcb0afec0af934c18151ac8c3b4f315aa
|
||||
PKG_SOURCE_VERSION:=acfc551285777dc17e2477e6742578e520a89d8b
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_MAINTAINER:=Chen Minqiang <ptpt52@gmail.com>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=teleproxy
|
||||
PKG_VERSION:=4.16.0
|
||||
PKG_RELEASE:=22
|
||||
PKG_RELEASE:=23
|
||||
|
||||
PKG_MAINTAINER:=Kosntantine Shevlakov <shevlakov@132lan.ru>
|
||||
PKG_LICENSE:=GPLv2
|
||||
@@ -10,7 +10,7 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/teleproxy/teleproxy.git
|
||||
PKG_SOURCE_VERSION:=d5342b5983dee738ee94d66f77ff27ea24932755
|
||||
PKG_SOURCE_VERSION:=b76d18e776188929404d9272d636f4348f752102
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
@@ -25,7 +25,7 @@ define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=MTProxy OpenWRT package
|
||||
DEPENDS:=+libopenssl +zlib
|
||||
DEPENDS:=+libopenssl +zlib +libatomic
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
From 92322894187a5203277e80b8e462946d8dc3b4a0 Mon Sep 17 00:00:00 2001
|
||||
From: Nikolay Kulikov <nikolayof23@gmail.com>
|
||||
Date: Sun, 31 May 2026 18:09:53 +0300
|
||||
Subject: [PATCH 1/2] common: remove unused code from kprintf.c
|
||||
|
||||
The following functions:
|
||||
reopen_logs()
|
||||
kdb_write()
|
||||
nck_pwrite()
|
||||
are never called, so remove them to eliminate dead code.
|
||||
|
||||
The global variable 'reindex_speed' is no longer needed after deleting
|
||||
the kdb_write() function, so remove it too.
|
||||
|
||||
Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
|
||||
---
|
||||
src/common/kprintf.c | 68 --------------------------------------------
|
||||
src/common/kprintf.h | 7 -----
|
||||
src/engine/engine.h | 1 -
|
||||
3 files changed, 76 deletions(-)
|
||||
|
||||
diff --git a/src/common/kprintf.c b/src/common/kprintf.c
|
||||
index 64f8213..950b153 100644
|
||||
--- a/src/common/kprintf.c
|
||||
+++ b/src/common/kprintf.c
|
||||
@@ -69,10 +69,6 @@ void reopen_logs_ext (int slave_mode) {
|
||||
}
|
||||
}
|
||||
|
||||
-void reopen_logs (void) {
|
||||
- reopen_logs_ext (0);
|
||||
-}
|
||||
-
|
||||
int hexdump (const void *start, const void *end) {
|
||||
char s[256];
|
||||
const char *ptr = start;
|
||||
@@ -101,66 +97,6 @@ int hexdump (const void *start, const void *end) {
|
||||
return end - start;
|
||||
}
|
||||
|
||||
-
|
||||
-double reindex_speed = (32 << 20);
|
||||
-
|
||||
-void kdb_write (int fd, const void *buf, long long count, const char *filename) {
|
||||
- assert (count >= 0);
|
||||
-
|
||||
- static double total_count;
|
||||
- static double last_time;
|
||||
- int write_fail_count = 0;
|
||||
- while (count) {
|
||||
- long long l = !reindex_speed ? count : count >= (1 << 20) ? (1 << 20) : count;
|
||||
-
|
||||
- if (reindex_speed) {
|
||||
- double t = get_utime_monotonic ();
|
||||
- total_count = total_count * exp ((last_time - t) * 0.1);
|
||||
- last_time = t;
|
||||
-
|
||||
- if (total_count > reindex_speed) {
|
||||
- double k = log (total_count / reindex_speed) * 10;
|
||||
- assert (k >= 0);
|
||||
- struct timespec ts;
|
||||
- ts.tv_nsec = ((int)((k - floor (k)) * 1e9)) % 1000000000;
|
||||
- ts.tv_sec = (int)k;
|
||||
- nanosleep (&ts, 0);
|
||||
- }
|
||||
- }
|
||||
- long long w = write (fd, buf, l);
|
||||
- if (w <= 0) {
|
||||
- assert (-1 <= w);
|
||||
- if (write_fail_count < 10000 && (w == 0 || errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)) {
|
||||
- write_fail_count++;
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- fprintf (stderr, "kdb_write: write %lld bytes to the file '%s' returns %lld. %m\n", l, filename, w);
|
||||
- exit (1);
|
||||
- }
|
||||
- assert (w <= l);
|
||||
- write_fail_count = 0;
|
||||
-
|
||||
- if (reindex_speed) {
|
||||
- static long long data_after_fsync;
|
||||
- data_after_fsync += w;
|
||||
- if (data_after_fsync >= (1 << 20)) {
|
||||
- if (fsync (fd) < 0) {
|
||||
- fprintf (stderr, "kdb_write: fsyncing file '%s' failed. %m\n", filename);
|
||||
- exit (1);
|
||||
- }
|
||||
- data_after_fsync = 0;
|
||||
- }
|
||||
- double t = get_utime_monotonic ();
|
||||
- total_count = total_count * exp ((last_time - t) * 0.1);
|
||||
- last_time = t;
|
||||
- total_count += w * 0.1;
|
||||
- }
|
||||
- count -= w;
|
||||
- buf += w;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static inline void kwrite_print_int (char **s, const char *name, int name_len, int i) {
|
||||
if (i < 0) {
|
||||
i = INT_MAX;
|
||||
@@ -276,7 +212,3 @@ void kprintf (const char *format, ...) {
|
||||
void nck_write (int fd, const void *data, size_t len) {
|
||||
if (write (fd, data, len)) {}
|
||||
}
|
||||
-
|
||||
-void nck_pwrite (int fd, const void *data, size_t len, off_t offset) {
|
||||
- if (pwrite (fd, data, len, offset)) {}
|
||||
-}
|
||||
diff --git a/src/common/kprintf.h b/src/common/kprintf.h
|
||||
index a80b853..00d80bd 100644
|
||||
--- a/src/common/kprintf.h
|
||||
+++ b/src/common/kprintf.h
|
||||
@@ -31,15 +31,9 @@
|
||||
extern int verbosity;
|
||||
extern const char *logname;
|
||||
|
||||
-void reopen_logs (void);
|
||||
void reopen_logs_ext (int slave_mode);
|
||||
int hexdump (const void *start, const void *end);
|
||||
|
||||
-extern double reindex_speed;
|
||||
-
|
||||
-// safely writes buf to fd, considering write speed limit
|
||||
-void kdb_write (int fd, const void *buf, long long count, const char *filename);
|
||||
-
|
||||
// write message with timestamp and pid, safe to call inside handler
|
||||
int kwrite (int fd, const void *buf, int count);
|
||||
|
||||
@@ -53,4 +47,3 @@ void kprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
} while (0)
|
||||
|
||||
void nck_write (int fd, const void *data, size_t len);
|
||||
-void nck_pwrite (int fd, const void *data, size_t len, off_t offset);
|
||||
diff --git a/src/engine/engine.h b/src/engine/engine.h
|
||||
index 337998e..24ee255 100644
|
||||
--- a/src/engine/engine.h
|
||||
+++ b/src/engine/engine.h
|
||||
@@ -202,7 +202,6 @@ ENGINE_INT_PARAM(required_cpu_threads,required_cpu_threads);
|
||||
ENGINE_INT_PARAM(required_tcp_cpu_threads,required_tcp_cpu_threads);
|
||||
ENGINE_INT_PARAM(required_tcp_io_threads,required_tcp_io_threads);
|
||||
|
||||
-void reopen_logs (void);
|
||||
int default_main (server_functions_t *F, int argc, char *argv[]);
|
||||
void default_parse_extra_args (int argc, char *argv[]);
|
||||
void engine_tl_init (struct tl_act_extra *(*parse)(struct tl_in_state *,long long), void (*stat)(), int (get_op)(struct tl_in_state *), double timeout, const char *name);
|
||||
|
||||
From 2373fbd911f4078514111e9ae6f358f443f85608 Mon Sep 17 00:00:00 2001
|
||||
From: Nikolay Kulikov <nikolayof23@gmail.com>
|
||||
Date: Sun, 31 May 2026 18:18:52 +0300
|
||||
Subject: [PATCH 2/2] common: replace nck_write() with a direct call to write()
|
||||
|
||||
This function wraps the write() system call, but doesn't perform any
|
||||
success checks. Replace it with a direct write() call, which will make
|
||||
the code a bit clearer.
|
||||
|
||||
Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
|
||||
---
|
||||
src/common/kprintf.c | 6 +-----
|
||||
src/common/kprintf.h | 2 --
|
||||
2 files changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/common/kprintf.c b/src/common/kprintf.c
|
||||
index 950b153..1049e61 100644
|
||||
--- a/src/common/kprintf.c
|
||||
+++ b/src/common/kprintf.c
|
||||
@@ -91,7 +91,7 @@ int hexdump (const void *start, const void *end) {
|
||||
}
|
||||
}
|
||||
s[p ++] = '\n';
|
||||
- nck_write (2, s, p);
|
||||
+ write (2, s, p);
|
||||
ptr += 16;
|
||||
}
|
||||
return end - start;
|
||||
@@ -208,7 +208,3 @@ void kprintf (const char *format, ...) {
|
||||
//while (flock (2, LOCK_UN) < 0 && errno == EINTR);
|
||||
errno = old_errno;
|
||||
}
|
||||
-
|
||||
-void nck_write (int fd, const void *data, size_t len) {
|
||||
- if (write (fd, data, len)) {}
|
||||
-}
|
||||
diff --git a/src/common/kprintf.h b/src/common/kprintf.h
|
||||
index 00d80bd..51578df 100644
|
||||
--- a/src/common/kprintf.h
|
||||
+++ b/src/common/kprintf.h
|
||||
@@ -45,5 +45,3 @@ void kprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
} \
|
||||
kprintf ((format), ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
-
|
||||
-void nck_write (int fd, const void *data, size_t len);
|
||||
Reference in new issue
Block a user