Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: prevented loading HTTP subsystem only modules in non-HTTP sub… #211

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/resty/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
local subsystem = ngx.config.subsystem


-- regex module should be loaded first to inject ngx.re for other modules
require "resty.core.regex"

require "resty.core.shdict"
require "resty.core.time"


if subsystem == 'http' then
require "resty.core.uri"
require "resty.core.hash"
require "resty.core.base64"
require "resty.core.regex"
require "resty.core.exit"
require "resty.core.var"
require "resty.core.ctx"
require "resty.core.exit"
require "resty.core.hash"
require "resty.core.misc"
require "resty.core.ndk"
require "resty.core.phase"
require "resty.core.request"
require "resty.core.response"
require "resty.core.time"
require "resty.core.uri"
require "resty.core.var"
require "resty.core.worker"
require "resty.core.phase"
require "resty.core.ndk"
end


Expand Down
4 changes: 3 additions & 1 deletion lib/resty/core/base64.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
-- Copyright (C) Yichun Zhang (agentzh)


local ffi = require 'ffi'
local base = require "resty.core.base"
base.allows_subsystem('http')


local ffi = require 'ffi'
local ffi_string = ffi.string
local C = ffi.C
local ngx = ngx
Expand Down
5 changes: 4 additions & 1 deletion lib/resty/core/ctx.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
-- Copyright (C) Yichun Zhang (agentzh)


local base = require "resty.core.base"
base.allows_subsystem('http')


local ffi = require 'ffi'
local debug = require 'debug'
local base = require "resty.core.base"
local misc = require "resty.core.misc"


Expand Down
5 changes: 4 additions & 1 deletion lib/resty/core/exit.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
-- Copyright (C) Yichun Zhang (agentzh)


local base = require "resty.core.base"
base.allows_subsystem('http')


local ffi = require 'ffi'
local ffi_string = ffi.string
local C = ffi.C
local ngx = ngx
local error = error
local base = require "resty.core.base"
local get_string_buf = base.get_string_buf
local get_size_ptr = base.get_size_ptr
local get_request = base.get_request
Expand Down
5 changes: 4 additions & 1 deletion lib/resty/core/hash.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
-- Copyright (C) Yichun Zhang (agentzh)


local base = require "resty.core.base"
base.allows_subsystem('http')


local ffi = require 'ffi'
local ffi_string = ffi.string
local ffi_new = ffi.new
Expand All @@ -9,7 +13,6 @@ local ngx = ngx
local type = type
local tostring = tostring
local error = error
local base = require "resty.core.base"


ffi.cdef[[
Expand Down
3 changes: 2 additions & 1 deletion lib/resty/core/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@


local base = require "resty.core.base"
local ffi = require "ffi"
base.allows_subsystem('http')


local ffi = require "ffi"
local FFI_NO_REQ_CTX = base.FFI_NO_REQ_CTX
local FFI_BAD_CONTEXT = base.FFI_BAD_CONTEXT
local new_tab = base.new_tab
Expand Down
4 changes: 3 additions & 1 deletion lib/resty/core/phase.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
local ffi = require 'ffi'
local base = require "resty.core.base"
base.allows_subsystem('http')


local ffi = require 'ffi'
local C = ffi.C
local FFI_ERROR = base.FFI_ERROR
local get_request = base.get_request
Expand Down
3 changes: 2 additions & 1 deletion lib/resty/core/request.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
-- Copyright (C) Yichun Zhang (agentzh)


local ffi = require 'ffi'
local base = require "resty.core.base"
base.allows_subsystem('http')


local ffi = require 'ffi'
local FFI_BAD_CONTEXT = base.FFI_BAD_CONTEXT
local FFI_DECLINED = base.FFI_DECLINED
local FFI_OK = base.FFI_OK
Expand Down
3 changes: 2 additions & 1 deletion lib/resty/core/response.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
-- Copyright (C) Yichun Zhang (agentzh)


local ffi = require 'ffi'
local base = require "resty.core.base"
base.allows_subsystem('http')


local ffi = require 'ffi'
local C = ffi.C
local ffi_cast = ffi.cast
local ffi_str = ffi.string
Expand Down
5 changes: 4 additions & 1 deletion lib/resty/core/uri.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
-- Copyright (C) Yichun Zhang (agentzh)


local base = require "resty.core.base"
base.allows_subsystem('http')


local ffi = require 'ffi'
local ffi_string = ffi.string
local C = ffi.C
local ngx = ngx
local type = type
local tostring = tostring
local base = require "resty.core.base"
local get_string_buf = base.get_string_buf


Expand Down
4 changes: 3 additions & 1 deletion lib/resty/core/var.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
-- Copyright (C) Yichun Zhang (agentzh)


local ffi = require 'ffi'
local base = require "resty.core.base"
base.allows_subsystem('http')


local ffi = require 'ffi'
local ffi_new = ffi.new
local ffi_str = ffi.string
local C = ffi.C
Expand Down
3 changes: 2 additions & 1 deletion lib/resty/core/worker.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
-- Copyright (C) Yichun Zhang (agentzh)


local ffi = require 'ffi'
local base = require "resty.core.base"
base.allows_subsystem('http')


local ffi = require 'ffi'
local C = ffi.C


Expand Down