summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2023-09-22TimeoutCallBack wraps timeout_cb to simplify callback function writing, ↵HEADmasterzy
still have some problem: - `arg: &'a mut T ` need be `&'a mut T` or `&'a T` ? - for RefCell::new(session), how to ensure the life cycle? test code update
2023-09-22Enable periodic timeout : TimeoutType::INTzy
- periodic timeout, start time only supports relative time. - first expired on now + timeout, then expired at now + timeout + timeout + .. TimeoutManager - add Iterator for expired_timeouts and netx_tiemouts - expired_timeout support periodic timeout, only return quote (Ownership still on C side) test code update
2023-09-22mv test_timeout.rs to /tests/zy
make mod be pub
2023-09-22test_callback updatezy
2023-09-21tiemout_bind.rs: allow non_upper_casezy
2023-09-21TimeoutSItFlag: remove CLEARzy
Test code update
2023-09-21change Timeout ref timeout -> Timeout = timeoutzy
- use ref can not fix timeout's life cycle. - rewrite is_pending / is_expired , no need `& mut self` anymore. - fix drop for Timeout. TimeoutSItFlag - remove TIMEOUTS_CLEAR: make sure when call TimeoutManager::next_timeout , any list will not chang. TimeoutManager - add: Pass in ownership of the Timeout object - next_expired_timeout -> expired_timeout: Ownership of timeout objects moved from c to rust - next_timeout: return next quote of timeout objects Test code update
2023-09-21find bug: Timeout should 1to1 with timeout.zy
2023-09-20- TimeoutCallBack 定义 和 单元测试(通过)zy
- fix TimeoutSIt drop 时候 free 内存() - TimeoutManager: get_next_wait_time 根据 c 代码,修正 定义 和 单元测试 - test_timeout_manger 单元测试
2023-09-20timeout_cb 修改 函数指针名称 和 定义zy
2023-09-20TimeoutSItFlag -> i32zy
补充 TimeoutSItFlag 单元测试
2023-09-20- 简化 TimeoutSItFlagzy
- 修正 TimeoutSIt 实例申请 bug (Box::into_raw)
2023-09-20fix errzy
- timeout 申请内存在 rust 通过 Box::into_raw 将所有权交给 C 侧. 最后 Timeout drop 时 调用 C free释放 - 主要为了 is_pending is_expired 等方法减少样板代码 - 修正 NonNull 错误 - 简化 TimeoutType - timeout_type timeout 的单元测试 通过
2023-09-20high level api (no test yet)zy
2023-09-20完善bindzy
- 字符串常量补充 `\0` - timeout_t 改为 rust 的 u64 类型 - 精简 timeouts 结构体声明(无需)
2023-09-20更多注释zy
2023-09-15重命名文件 -> bind 与 封装区分zy
2023-09-15check_intervals 完成, 与 test-timeout.c 输出相同.zy
ffi 导出 bind 完整过了测试.
2023-09-15修正一个变量类型zy
2023-09-15remove TODO..zy
2023-09-15test: check_randomized finishzy
2023-09-15移除 `#[link(name = "timeout")]` 声明,提前到 build.rs 中.zy
补充缺失的 struct 定义
2023-09-13仿照 test-timeout.c 编写 test_timeout.rszy
- cfg1 测试不通过, 临时的 now 超过了 100 就 panic - cfg2b 反而可以测试通过; 修正了 timeout.rs 的几个类型错误, 为一些结构体 提供默认初始化方法.
2023-09-13lib.rszy
2023-09-13timeouts_it 等定义zy
2023-09-12timeout.h ffi 绑定和部分测试zy
todo: 宏定义部分待检查.