Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
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
tg
Commits
e0fff964
Commit
e0fff964
authored
Oct 26, 2013
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restart query on bad server salt
parent
4f494a57
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
mtproto-client.c
mtproto-client.c
+13
-0
queries.c
queries.c
+8
-0
queries.h
queries.h
+1
-0
No files found.
mtproto-client.c
View file @
e0fff964
...
@@ -1052,6 +1052,16 @@ void work_packed (struct connection *c, long long msg_id) {
...
@@ -1052,6 +1052,16 @@ void work_packed (struct connection *c, long long msg_id) {
in_gzip
=
0
;
in_gzip
=
0
;
}
}
void
work_bad_server_salt
(
struct
connection
*
c
UU
,
long
long
msg_id
UU
)
{
assert
(
fetch_int
()
==
(
int
)
CODE_bad_server_salt
);
long
long
id
=
fetch_long
();
query_restart
(
id
);
fetch_int
();
// seq_no
fetch_int
();
// error_code
long
long
new_server_salt
=
fetch_long
();
GET_DC
(
c
)
->
server_salt
=
new_server_salt
;
}
void
rpc_execute_answer
(
struct
connection
*
c
,
long
long
msg_id
UU
)
{
void
rpc_execute_answer
(
struct
connection
*
c
,
long
long
msg_id
UU
)
{
if
(
verbosity
>=
5
)
{
if
(
verbosity
>=
5
)
{
hexdump_in
();
hexdump_in
();
...
@@ -1085,6 +1095,9 @@ void rpc_execute_answer (struct connection *c, long long msg_id UU) {
...
@@ -1085,6 +1095,9 @@ void rpc_execute_answer (struct connection *c, long long msg_id UU) {
case
CODE_gzip_packed
:
case
CODE_gzip_packed
:
work_packed
(
c
,
msg_id
);
work_packed
(
c
,
msg_id
);
return
;
return
;
case
CODE_bad_server_salt
:
work_bad_server_salt
(
c
,
msg_id
);
return
;
}
}
logprintf
(
"Unknown message:
\n
"
);
logprintf
(
"Unknown message:
\n
"
);
hexdump_in
();
hexdump_in
();
...
...
queries.c
View file @
e0fff964
...
@@ -74,6 +74,14 @@ int alarm_query (struct query *q) {
...
@@ -74,6 +74,14 @@ int alarm_query (struct query *q) {
return
0
;
return
0
;
}
}
void
query_restart
(
long
long
id
)
{
struct
query
*
q
=
query_get
(
id
);
if
(
q
)
{
remove_event_timer
(
&
q
->
ev
);
alarm_query
(
q
);
}
}
struct
query
*
send_query
(
struct
dc
*
DC
,
int
ints
,
void
*
data
,
struct
query_methods
*
methods
,
void
*
extra
)
{
struct
query
*
send_query
(
struct
dc
*
DC
,
int
ints
,
void
*
data
,
struct
query_methods
*
methods
,
void
*
extra
)
{
assert
(
DC
);
assert
(
DC
);
assert
(
DC
->
auth_key_id
);
assert
(
DC
->
auth_key_id
);
...
...
queries.h
View file @
e0fff964
...
@@ -53,6 +53,7 @@ struct query *send_query (struct dc *DC, int len, void *data, struct query_metho
...
@@ -53,6 +53,7 @@ struct query *send_query (struct dc *DC, int len, void *data, struct query_metho
void
query_ack
(
long
long
id
);
void
query_ack
(
long
long
id
);
void
query_error
(
long
long
id
);
void
query_error
(
long
long
id
);
void
query_result
(
long
long
id
);
void
query_result
(
long
long
id
);
void
query_restart
(
long
long
id
);
void
insert_event_timer
(
struct
event_timer
*
ev
);
void
insert_event_timer
(
struct
event_timer
*
ev
);
void
remove_event_timer
(
struct
event_timer
*
ev
);
void
remove_event_timer
(
struct
event_timer
*
ev
);
...
...
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