Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mtproto_proxy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mtproto_proxy
Commits
15bff248
Unverified
Commit
15bff248
authored
Oct 17, 2018
by
Сергей Прохоров
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bit more logging
parent
b0f6ee29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
mtp_down_conn.erl
src/mtp_down_conn.erl
+3
-1
mtp_handler.erl
src/mtp_handler.erl
+3
-3
No files found.
src/mtp_down_conn.erl
View file @
15bff248
...
...
@@ -115,6 +115,8 @@ handle_info(do_connect, #state{dc_id = DcId} = State) ->
terminate
(_
Reason
,
#state
{
upstreams
=
Ups
})
->
%% Should I do this or dc_pool? Maybe only when reason is 'normal'?
lager
:
warning
(
"Downstream terminates with reason
~p
; len(upstreams)=
~p
"
,
[_
Reason
,
map_size
(
Ups
)]),
Self
=
self
(),
lists
:
foreach
(
fun
(
Upstream
)
->
...
...
@@ -228,7 +230,7 @@ up_send(Packet, ConnId, #state{upstreams_rev = UpsRev} = St) ->
ok
=
mtp_handler
:
send
(
Upstream
,
Packet
),
St
;
error
->
lager
:
warning
(
"Unknown connection_id=
~w
; ups=
~w
"
,
[
ConnId
,
maps
:
keys
(
UpsRev
)
]),
lager
:
warning
(
"Unknown connection_id=
~w
"
,
[
ConnId
]),
ClosedPacket
=
mtp_rpc
:
encode_packet
(
remote_closed
,
ConnId
),
{
ok
,
St1
}
=
down_send
(
ClosedPacket
,
St
),
St1
...
...
src/mtp_handler.erl
View file @
15bff248
...
...
@@ -176,7 +176,7 @@ terminate(_Reason, #state{started_at = Started} = S) ->
mtp_metric
:
histogram_observe
(
[
?
APP
,
session_lifetime
,
seconds
],
erlang
:
convert_time_unit
(
Lifetime
,
millisecond
,
native
),
#
{}),
lager
:
debug
(
"terminate
~p
"
,
[_
Reason
]),
lager
:
info
(
"terminate
~p
"
,
[_
Reason
]),
ok
.
code_change
(_
OldVsn
,
State
,
_
Extra
)
->
...
...
@@ -262,7 +262,7 @@ up_send(Packet, #state{stage = tunnel,
codec
=
UpCodec
,
sock
=
Sock
,
transport
=
Transport
}
=
S
)
->
lager
:
debug
(
">TG
:
~p
"
,
[
Packet
]),
%% lager:debug(">Up
: ~p", [Packet]),
{
Encoded
,
UpCodec1
}
=
mtp_layer
:
encode_packet
(
Packet
,
UpCodec
),
mtp_metric
:
rt
([
?
APP
,
upstream_send_duration
,
seconds
],
fun
()
->
...
...
@@ -280,7 +280,7 @@ up_send(Packet, #state{stage = tunnel,
{
ok
,
S
#state
{
codec
=
UpCodec1
}}.
down_send
(
Packet
,
#state
{
down
=
Down
}
=
S
)
->
lager
:
debug
(
"<TG
:
~p
"
,
[
Packet
]),
%% lager:debug(">Down
: ~p", [Packet]),
ok
=
mtp_down_conn
:
send
(
Down
,
Packet
),
{
ok
,
S
}.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment