Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang
erlang
4142-megaco-Types-and-spec-for-megaco-process_r...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 4142-megaco-Types-and-spec-for-megaco-process_received_me.patch of Package erlang
From 89ff17265b7f5a6028e26dd2430c78e712044e8a Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Tue, 2 Jan 2024 18:29:57 +0100 Subject: [PATCH 22/46] [megaco] Types and spec for megaco:process_received_message/4,5 OTP-18920 --- lib/megaco/doc/src/megaco.xml | 24 ++++++++++-------------- lib/megaco/src/app/megaco.erl | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/lib/megaco/doc/src/megaco.xml b/lib/megaco/doc/src/megaco.xml index e5930a5b35..b7c11df74d 100644 --- a/lib/megaco/doc/src/megaco.xml +++ b/lib/megaco/doc/src/megaco.xml @@ -2039,16 +2039,9 @@ megaco_incr_timer() = #megaco_incr_timer{} </func> <func> - <name since="">process_received_message(ReceiveHandle, ControlPid, SendHandle, BinMsg) -> ok</name> - <name since="">process_received_message(ReceiveHandle, ControlPid, SendHandle, BinMsg, Extra) -> ok</name> + <name name="process_received_message" arity="4" clause_i="1" since=""/> + <name name="process_received_message" arity="5" clause_i="1" since=""/> <fsummary>Process a received message</fsummary> - <type> - <v>ReceiveHandle = #megaco_receive_handle{}</v> - <v>ControlPid = pid()</v> - <v>SendHandle = term()</v> - <v>BinMsg = binary()</v> - <v>Extra = term()</v> - </type> <desc> <p>Process a received message</p> @@ -2064,18 +2057,21 @@ megaco_incr_timer() = #megaco_incr_timer{} callback functions will be invoked. See megaco_user for more info about the callback arguments.</p> - <p>The argument <c>Extra</c> is just an opaque data structure passed to the user + <p>The argument <c>Extra</c> is just an opaque data structure passed + to the user via the callback functions in the <seeerl marker="megaco_user">user callback module</seeerl>. Note however that if <c>Extra</c> has the value <c>extra_undefined</c> the argument will be ignored (same as if <c>process_received_message/4</c> had been called). See the documentation for the behaviour of the callback module, - <seeerl marker="megaco_user">megaco_user</seeerl>, for more info. </p> - <p>Note that all processing is done in the context of the calling + <seeerl marker="megaco_user">megaco_user</seeerl>, + for more info. </p> + <p>Note that all processing is done in the context of the calling process. A transport module could call this function via one of the - <c><![CDATA[spawn]]></c> functions (e.g. <c><![CDATA[spawn_opt]]></c>). See also - <c><![CDATA[receive_message/4,5]]></c>. + <c><![CDATA[spawn]]></c> functions + (e.g. <c><![CDATA[spawn_opt]]></c>). + See also <c><![CDATA[receive_message/4,5]]></c>. </p> <p>If the message cannot be decoded the following callback function will be invoked:</p> diff --git a/lib/megaco/src/app/megaco.erl b/lib/megaco/src/app/megaco.erl index 4a4d7dc8d7..4c05bbeee9 100644 --- a/lib/megaco/src/app/megaco.erl +++ b/lib/megaco/src/app/megaco.erl @@ -601,11 +601,28 @@ cancel(ConnHandle, Reason) -> %% Process a received message %%----------------------------------------------------------------- +-spec process_received_message(ReceiveHandle, ControlPid, SendHandle, BinMsg) -> + ok when + ReceiveHandle :: receive_handle(), + ControlPid :: pid(), + SendHandle :: send_handle(), + BinMsg :: binary(). + process_received_message(ReceiveHandle, ControlPid, SendHandle, BinMsg) -> megaco_messenger:process_received_message(ReceiveHandle, ControlPid, SendHandle, BinMsg). -process_received_message(ReceiveHandle, ControlPid, SendHandle, BinMsg, Extra) -> +-spec process_received_message(ReceiveHandle, + ControlPid, SendHandle, BinMsg, Extra) -> + ok when + ReceiveHandle :: receive_handle(), + ControlPid :: pid(), + SendHandle :: send_handle(), + BinMsg :: binary(), + Extra :: term(). + +process_received_message(ReceiveHandle, + ControlPid, SendHandle, BinMsg, Extra) -> megaco_messenger:process_received_message(ReceiveHandle, ControlPid, SendHandle, BinMsg, Extra). -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor