| Age | Commit message (Collapse) | Author |
|
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
|
|
- 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
|
|
make mod be pub
|
|
|
|
|
|
Test code update
|
|
- 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
|
|
|
|
- fix TimeoutSIt drop 时候 free 内存()
- TimeoutManager: get_next_wait_time 根据 c 代码,修正 定义 和 单元测试
- test_timeout_manger 单元测试
|
|
|
|
补充 TimeoutSItFlag 单元测试
|
|
- 修正 TimeoutSIt 实例申请 bug (Box::into_raw)
|
|
- timeout 申请内存在 rust 通过 Box::into_raw 将所有权交给 C 侧. 最后 Timeout drop 时 调用 C free释放
- 主要为了 is_pending is_expired 等方法减少样板代码
- 修正 NonNull 错误
- 简化 TimeoutType
- timeout_type timeout 的单元测试 通过
|
|
|
|
- 字符串常量补充 `\0`
- timeout_t 改为 rust 的 u64 类型
- 精简 timeouts 结构体声明(无需)
|
|
|
|
|
|
ffi 导出 bind 完整过了测试.
|
|
|
|
|
|
|
|
补充缺失的 struct 定义
|
|
- cfg1 测试不通过, 临时的 now 超过了 100 就 panic
- cfg2b 反而可以测试通过;
修正了 timeout.rs 的几个类型错误, 为一些结构体 提供默认初始化方法.
|
|
|
|
|
|
todo: 宏定义部分待检查.
|