Skip to content

Commit 7b2c5aa

Browse files
committed
Request: get_module_*_conf are unsafe for the noted reason.
1 parent c764960 commit 7b2c5aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/http/request.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl Request {
159159
///
160160
/// # Safety
161161
/// Caller must ensure that type `T` matches the configuration type for the specified module.
162-
pub fn get_module_main_conf<T>(&self, module: &ngx_module_t) -> Option<&'static T> {
162+
pub unsafe fn get_module_main_conf<T>(&self, module: &ngx_module_t) -> Option<&'static T> {
163163
// SAFETY: main conf is either NULL or allocated with ngx_p(c)alloc and
164164
// explicitly initialized by the module
165165
unsafe {
@@ -174,7 +174,7 @@ impl Request {
174174
///
175175
/// # Safety
176176
/// Caller must ensure that type `T` matches the configuration type for the specified module.
177-
pub fn get_module_srv_conf<T>(&self, module: &ngx_module_t) -> Option<&'static T> {
177+
pub unsafe fn get_module_srv_conf<T>(&self, module: &ngx_module_t) -> Option<&'static T> {
178178
// SAFETY: server conf is either NULL or allocated with ngx_p(c)alloc and
179179
// explicitly initialized by the module
180180
unsafe {
@@ -189,7 +189,7 @@ impl Request {
189189
///
190190
/// # Safety
191191
/// Caller must ensure that type `T` matches the configuration type for the specified module.
192-
pub fn get_module_loc_conf<T>(&self, module: &ngx_module_t) -> Option<&'static T> {
192+
pub unsafe fn get_module_loc_conf<T>(&self, module: &ngx_module_t) -> Option<&'static T> {
193193
// SAFETY: location conf is either NULL or allocated with ngx_p(c)alloc and
194194
// explicitly initialized by the module
195195
unsafe {

0 commit comments

Comments
 (0)