optimizate: pass the current timeout to the ID generator as a parameter, instead of getting the time from the ID generator itself
This commit is contained in:
@@ -90,18 +90,18 @@ struct session_manager_stat
|
||||
};
|
||||
|
||||
struct session_manager;
|
||||
struct session_manager *session_manager_new(struct session_manager_options *opts, uint64_t now);
|
||||
struct session_manager *session_manager_new(struct session_manager_options *opts, uint64_t now_ms);
|
||||
void session_manager_free(struct session_manager *mgr);
|
||||
void session_manager_record_duplicated_packet(struct session_manager *mgr, const struct packet *pkt, uint64_t now);
|
||||
void session_manager_record_duplicated_packet(struct session_manager *mgr, const struct packet *pkt);
|
||||
|
||||
struct session *session_manager_new_session(struct session_manager *mgr, const struct packet *pkt, uint64_t now);
|
||||
struct session *session_manager_new_session(struct session_manager *mgr, const struct packet *pkt, uint64_t now_ms);
|
||||
void session_manager_free_session(struct session_manager *mgr, struct session *sess);
|
||||
|
||||
struct session *session_manager_lookup_session(struct session_manager *mgr, const struct packet *pkt, uint64_t now);
|
||||
int session_manager_update_session(struct session_manager *mgr, struct session *sess, const struct packet *pkt, uint64_t now);
|
||||
struct session *session_manager_lookup_session(struct session_manager *mgr, const struct packet *pkt, uint64_t now_ms);
|
||||
int session_manager_update_session(struct session_manager *mgr, struct session *sess, const struct packet *pkt, uint64_t now_ms);
|
||||
|
||||
// return session need free by session_manager_free_session()
|
||||
struct session *session_manager_get_expired_session(struct session_manager *mgr, uint64_t now);
|
||||
struct session *session_manager_get_expired_session(struct session_manager *mgr, uint64_t now_ms);
|
||||
struct session *session_manager_get_evicted_session(struct session_manager *mgr);
|
||||
|
||||
// return 0: have already timeout session
|
||||
|
||||
Reference in New Issue
Block a user