asbai
asbai
@noloader Hi Jeffrey Thanks for your reply > Well, I don't see the code for the ByteExSink so I can't comment on what it is doing. I suspect you can...
I think we can achieve this by sacrificing time or space efficiency only when the above extreme situations occur. This will ensure that we maintain optimal performance in most cases,...
> I could give the maximum value of the marker a special meaning where I switch to a slow linear search instead Does this mean that in that case, all...
If I understand correctly, you means there will be two linear search algorithms, one is we currently used (the fast version), and the other slower one is used to solve...
最简 POC (共 5 行代码): 1. 打开 dns_server.c。 2. 新增一行代码:`#define _dns_server_get_return_ttl(ttl) (ttl >= 10 ? 10 : ttl)`。 3. 将 `_dns_server_process_answer_A` 和 `_dns_server_process_answer_AAAA` 中的 `_dns_server_get_conf_ttl` 调用替换为 `_dns_server_get_return_ttl` (影响 4 行代码)。...
抱歉,刚才抓包看了下,好像上面的 POC 不足以保证返回的 ttl-max。我只是快速过了一下代码,感觉要是连 _dns_server_get_answer 里的 _dns_server_get_conf_ttl 都替换的话,应该会影响到 SmartDNS 的缓存 ttl 吧?
> 可以取用all-best-ip代码分支测试。参数为`rr-ttl-reply-max`,表示返回给客户端的最大ttl值,不影响cache的时间。 收到,多谢!
> 可以取用all-best-ip代码分支测试。参数为`rr-ttl-reply-max`,表示返回给客户端的最大ttl值,不影响cache的时间。 可以了,但是 `rr-ttl-reply-max` 好像会随时间递减。例如: 1. 设置 `rr-ttl-reply-max 10`,重启 smartdns。 2. `dig google.com @1.1.1.1` 实际返回 TTL 是 300。 3. 一秒后 `dig google.com`,此时 TTL 返回 10,此时 `google.com` 条目在 **smartdns cache** 内的实际...
> rr-ttl-reply-max表示的是返回最大值,是会递减的,就是这样设计的。并不是返回一个固定值。 这个递减是会循环的,不是减少到0,就一直返回0。是会再次变成最大值。 多谢回复 :-) 这样递减的好处是什么呢?相比较而言,是不是我们之前提起的 “取 `min(dns_conf_rr_ttl_rely_max, actual_ttl)`” 更合理一些?毕竟记录的实际 TTL 还剩 298 呢,此时返回 10 感觉比 返回 9 更合理一些,希望考虑。
> 更新了。 好使!期待合入 Master :-D