mirror of
https://github.com/open5gs/open5gs.git
synced 2025-11-02 21:13:40 +00:00
[POOL] refactor memory in HTTP server (#3196)
Removed ogs_pool_cycle() from HTTP2 session and stream context and changed it to find by hash id.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -45,6 +45,7 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e)
|
||||
af_sess_t *sess = NULL;
|
||||
|
||||
ogs_sbi_stream_t *stream = NULL;
|
||||
ogs_pool_id_t stream_id = 0;
|
||||
ogs_sbi_request_t *request = NULL;
|
||||
|
||||
ogs_sbi_nf_instance_t *nf_instance = NULL;
|
||||
@@ -68,8 +69,16 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e)
|
||||
case OGS_EVENT_SBI_SERVER:
|
||||
request = e->h.sbi.request;
|
||||
ogs_assert(request);
|
||||
stream = e->h.sbi.data;
|
||||
ogs_assert(stream);
|
||||
|
||||
stream_id = OGS_POINTER_TO_UINT(e->h.sbi.data);
|
||||
ogs_assert(stream_id >= OGS_MIN_POOL_ID &&
|
||||
stream_id <= OGS_MAX_POOL_ID);
|
||||
|
||||
stream = ogs_sbi_stream_find_by_id(stream_id);
|
||||
if (!stream) {
|
||||
ogs_error("STREAM has already been removed [%d]", stream_id);
|
||||
break;
|
||||
}
|
||||
|
||||
rv = ogs_sbi_parse_request(&message, request);
|
||||
if (rv != OGS_OK) {
|
||||
@@ -501,7 +510,9 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e)
|
||||
break;
|
||||
}
|
||||
|
||||
stream = sbi_xact->assoc_stream;
|
||||
if (sbi_xact->assoc_stream_id >= OGS_MIN_POOL_ID &&
|
||||
sbi_xact->assoc_stream_id <= OGS_MAX_POOL_ID)
|
||||
stream = ogs_sbi_stream_find_by_id(sbi_xact->assoc_stream_id);
|
||||
/* Here, we should not use ogs_assert(stream)
|
||||
* since 'namf-comm' service has no an associated stream. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user