-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dynamically compiled modules from mod_http_upload
- Loading branch information
Janusz Jakubiec
authored and
Janusz Jakubiec
committed
Oct 27, 2021
1 parent
d106506
commit ece5632
Showing
3 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
%% Just a proxy interface module between the main mod_http_upload module and | ||
%% the backend modules (i.e. mod_http_upload_s3). | ||
-module(mod_http_upload_backend). | ||
|
||
-export([init/2, create_slot/7]). | ||
|
||
-define(MAIN_MODULE, mod_http_upload). | ||
%%-------------------------------------------------------------------- | ||
%% Callbacks | ||
%%-------------------------------------------------------------------- | ||
|
||
-callback create_slot(UTCDateTime :: calendar:datetime(), UUID :: binary(), | ||
Filename :: unicode:unicode_binary(), ContentType :: binary() | undefined, | ||
Size :: pos_integer(), Opts :: proplists:proplist()) -> | ||
{PUTURL :: binary(), GETURL :: binary(), Headers :: #{binary() => binary()}}. | ||
|
||
-spec init(HostType :: mongooseim:host_type(), Opts :: gen_mod:module_opts()) -> ok. | ||
init(HostType, Opts) -> | ||
mongoose_backend:init_per_host_type(HostType, ?MAIN_MODULE, [create_slot], Opts). | ||
|
||
-spec create_slot(HostType::mongooseim:host_type(), | ||
UTCDateTime :: calendar:datetime(), | ||
UUID :: binary(), | ||
Filename :: unicode:unicode_binary(), | ||
ContentType :: binary() | undefined, | ||
Size :: pos_integer(), | ||
Opts :: proplists:proplist()) -> | ||
{PUTURL :: binary(), GETURL :: binary(), Headers :: #{binary() => binary()}}. | ||
create_slot(HostType, UTCDateTime, UUID, Filename, ContentType, Size, Opts) -> | ||
Args = [UTCDateTime, UUID, Filename, ContentType, Size, Opts], | ||
mongoose_backend:call_tracked(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
|
||
-module(mod_http_upload_s3). | ||
-author('[email protected]'). | ||
-behaviour(mod_http_upload). | ||
-behaviour(mod_http_upload_backend). | ||
|
||
-export([create_slot/6]). | ||
|
||
|