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
2961f108
Commit
2961f108
authored
Oct 25, 2013
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ask dialog list at start. Try resend query on timeout
parent
7d61e25a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
loop.c
loop.c
+2
-0
queries.c
queries.c
+12
-1
queries.h
queries.h
+2
-0
No files found.
loop.c
View file @
2961f108
...
...
@@ -254,6 +254,8 @@ int loop (void) {
rl_attempted_completion_function
=
(
CPPFunction
*
)
complete_text
;
rl_completion_entry_function
=
complete_none
;
do_get_dialog_list
();
return
main_loop
();
}
queries.c
View file @
2961f108
...
...
@@ -61,7 +61,16 @@ int alarm_query (struct query *q) {
}
tree_delete_query
(
queries_tree
,
q
);
q
->
ev
.
timeout
=
get_double_time
()
+
QUERY_TIMEOUT
;
//insert_event_timer (&q->ev);
insert_event_timer
(
&
q
->
ev
);
clear_packet
();
out_int
(
CODE_msg_container
);
out_long
(
q
->
msg_id
);
out_int
(
q
->
seq_no
);
out_int
(
4
*
q
->
data_len
);
out_ints
(
q
->
data
,
q
->
data_len
);
encrypt_send_message
(
q
->
session
->
c
,
packet_buffer
,
packet_ptr
-
packet_buffer
,
0
);
return
0
;
}
...
...
@@ -80,6 +89,8 @@ struct query *send_query (struct dc *DC, int ints, void *data, struct query_meth
q
->
data
=
malloc
(
4
*
ints
);
memcpy
(
q
->
data
,
data
,
4
*
ints
);
q
->
msg_id
=
encrypt_send_message
(
DC
->
sessions
[
0
]
->
c
,
data
,
ints
,
1
);
q
->
session
=
DC
->
sessions
[
0
];
q
->
seq_no
=
DC
->
sessions
[
0
]
->
seq_no
-
1
;
if
(
verbosity
)
{
logprintf
(
"Msg_id is %lld %p
\n
"
,
q
->
msg_id
,
q
);
}
...
...
queries.h
View file @
2961f108
...
...
@@ -39,10 +39,12 @@ struct query {
long
long
msg_id
;
int
data_len
;
int
flags
;
int
seq_no
;
void
*
data
;
struct
query_methods
*
methods
;
struct
event_timer
ev
;
struct
dc
*
DC
;
struct
session
*
session
;
void
*
extra
;
};
...
...
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