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
7f75a004
Commit
7f75a004
authored
Sep 08, 2014
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed rare crush in case of multiple query answers
parent
8c206952
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
queries.c
queries.c
+23
-10
No files found.
queries.c
View file @
7f75a004
...
@@ -826,7 +826,9 @@ static int msg_send_on_answer (struct query *q UU) {
...
@@ -826,7 +826,9 @@ static int msg_send_on_answer (struct query *q UU) {
assert
(
x
==
CODE_messages_sent_message
||
x
==
CODE_messages_sent_message_link
);
assert
(
x
==
CODE_messages_sent_message
||
x
==
CODE_messages_sent_message_link
);
int
id
=
fetch_int
();
// id
int
id
=
fetch_int
();
// id
struct
tgl_message
*
M
=
q
->
extra
;
struct
tgl_message
*
M
=
q
->
extra
;
if
(
M
->
id
!=
id
)
{
bl_do_set_msg_id
(
M
,
id
);
bl_do_set_msg_id
(
M
,
id
);
}
int
date
=
fetch_int
();
int
date
=
fetch_int
();
int
pts
=
fetch_int
();
int
pts
=
fetch_int
();
//tglu_fetch_seq ();
//tglu_fetch_seq ();
...
@@ -837,9 +839,11 @@ static int msg_send_on_answer (struct query *q UU) {
...
@@ -837,9 +839,11 @@ static int msg_send_on_answer (struct query *q UU) {
bl_do_set_pts
(
pts
);
bl_do_set_pts
(
pts
);
bl_do_msg_seq_update
(
id
);
bl_do_msg_seq_update
(
id
);
}
else
{
}
else
{
if
(
seq
>
tgl_state
.
seq
+
1
)
{
vlogprintf
(
E_NOTICE
,
"Hole in seq
\n
"
);
vlogprintf
(
E_NOTICE
,
"Hole in seq
\n
"
);
tgl_do_get_difference
(
0
,
0
,
0
);
tgl_do_get_difference
(
0
,
0
,
0
);
}
}
}
if
(
x
==
CODE_messages_sent_message_link
)
{
if
(
x
==
CODE_messages_sent_message_link
)
{
assert
(
skip_type_any
(
TYPE_TO_PARAM_1
(
vector
,
TYPE_TO_PARAM
(
contacts_link
)))
>=
0
);
assert
(
skip_type_any
(
TYPE_TO_PARAM_1
(
vector
,
TYPE_TO_PARAM
(
contacts_link
)))
>=
0
);
}
}
...
@@ -1066,8 +1070,11 @@ static int mark_read_on_receive (struct query *q UU) {
...
@@ -1066,8 +1070,11 @@ static int mark_read_on_receive (struct query *q UU) {
bl_do_set_pts
(
pts
);
bl_do_set_pts
(
pts
);
bl_do_set_seq
(
seq
);
bl_do_set_seq
(
seq
);
}
else
{
}
else
{
if
(
seq
>
tgl_state
.
seq
+
1
)
{
vlogprintf
(
E_NOTICE
,
"Hole in seq
\n
"
);
tgl_do_get_difference
(
0
,
0
,
0
);
tgl_do_get_difference
(
0
,
0
,
0
);
}
}
}
int
offset
=
fetch_int
();
// offset
int
offset
=
fetch_int
();
// offset
int
*
t
=
q
->
extra
;
int
*
t
=
q
->
extra
;
...
@@ -1394,9 +1401,11 @@ static int send_file_on_answer (struct query *q UU) {
...
@@ -1394,9 +1401,11 @@ static int send_file_on_answer (struct query *q UU) {
bl_do_set_pts
(
pts
);
bl_do_set_pts
(
pts
);
bl_do_msg_seq_update
(
M
->
id
);
bl_do_msg_seq_update
(
M
->
id
);
}
else
{
}
else
{
if
(
seq
>
tgl_state
.
seq
+
1
)
{
vlogprintf
(
E_NOTICE
,
"Hole in seq
\n
"
);
vlogprintf
(
E_NOTICE
,
"Hole in seq
\n
"
);
tgl_do_get_difference
(
0
,
0
,
0
);
tgl_do_get_difference
(
0
,
0
,
0
);
}
}
}
if
(
q
->
callback
)
{
if
(
q
->
callback
)
{
((
void
(
*
)(
void
*
,
int
,
struct
tgl_message
*
))
q
->
callback
)(
q
->
callback_extra
,
1
,
M
);
((
void
(
*
)(
void
*
,
int
,
struct
tgl_message
*
))
q
->
callback
)(
q
->
callback_extra
,
1
,
M
);
...
@@ -1814,9 +1823,11 @@ static int fwd_msg_on_answer (struct query *q UU) {
...
@@ -1814,9 +1823,11 @@ static int fwd_msg_on_answer (struct query *q UU) {
bl_do_set_pts
(
pts
);
bl_do_set_pts
(
pts
);
bl_do_msg_seq_update
(
M
->
id
);
bl_do_msg_seq_update
(
M
->
id
);
}
else
{
}
else
{
if
(
seq
>
tgl_state
.
seq
+
1
)
{
vlogprintf
(
E_NOTICE
,
"Hole in seq
\n
"
);
vlogprintf
(
E_NOTICE
,
"Hole in seq
\n
"
);
tgl_do_get_difference
(
0
,
0
,
0
);
tgl_do_get_difference
(
0
,
0
,
0
);
}
}
}
//print_message (M);
//print_message (M);
if
(
q
->
callback
)
{
if
(
q
->
callback
)
{
((
void
(
*
)(
void
*
,
int
,
struct
tgl_message
*
))
q
->
callback
)
(
q
->
callback_extra
,
1
,
M
);
((
void
(
*
)(
void
*
,
int
,
struct
tgl_message
*
))
q
->
callback
)
(
q
->
callback_extra
,
1
,
M
);
...
@@ -1952,9 +1963,11 @@ static int rename_chat_on_answer (struct query *q UU) {
...
@@ -1952,9 +1963,11 @@ static int rename_chat_on_answer (struct query *q UU) {
bl_do_set_pts
(
pts
);
bl_do_set_pts
(
pts
);
bl_do_msg_seq_update
(
M
->
id
);
bl_do_msg_seq_update
(
M
->
id
);
}
else
{
}
else
{
if
(
seq
>
tgl_state
.
seq
+
1
)
{
vlogprintf
(
E_NOTICE
,
"Hole in seq
\n
"
);
vlogprintf
(
E_NOTICE
,
"Hole in seq
\n
"
);
tgl_do_get_difference
(
0
,
0
,
0
);
tgl_do_get_difference
(
0
,
0
,
0
);
}
}
}
//print_message (M);
//print_message (M);
if
(
q
->
callback
)
{
if
(
q
->
callback
)
{
((
void
(
*
)(
void
*
,
int
,
struct
tgl_message
*
))
q
->
callback
)
(
q
->
callback_extra
,
1
,
M
);
((
void
(
*
)(
void
*
,
int
,
struct
tgl_message
*
))
q
->
callback
)
(
q
->
callback_extra
,
1
,
M
);
...
...
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