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
df06d085
Commit
df06d085
authored
Sep 23, 2014
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more clear
parent
c03d91a5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
9 deletions
+21
-9
interface.c
interface.c
+4
-0
loop.c
loop.c
+9
-9
mtproto-client.c
mtproto-client.c
+4
-0
mtproto-client.h
mtproto-client.h
+1
-0
structures.c
structures.c
+3
-0
No files found.
interface.c
View file @
df06d085
...
...
@@ -967,6 +967,7 @@ extern char *downloads_directory;
extern
char
*
config_directory
;
extern
char
*
binlog_file_name
;
extern
char
*
lua_file
;
extern
struct
event
*
term_ev
;
void
do_clear
(
int
arg_num
,
struct
arg
args
[],
struct
in_ev
*
ev
)
{
tgl_free_all
();
...
...
@@ -980,6 +981,9 @@ void do_clear (int arg_num, struct arg args[], struct in_ev *ev) {
free
(
config_directory
);
free
(
binlog_file_name
);
free
(
lua_file
);
clear_history
();
event_free
(
term_ev
);
event_base_free
(
tgl_state
.
ev_base
);
do_halt
(
0
);
}
...
...
loop.c
View file @
df06d085
...
...
@@ -153,28 +153,28 @@ static void stdin_read_callback_line (evutil_socket_t fd, short what, void *arg)
stdin_read_callback_all
(
2
,
what
,
arg
);
}
struct
event
*
term_ev
=
0
;
void
net_loop
(
int
flags
,
int
(
*
is_end
)(
void
))
{
delete_stdin_event
=
0
;
if
(
verbosity
>=
E_DEBUG
)
{
logprintf
(
"Starting netloop
\n
"
);
}
struct
event
*
ev
=
0
;
if
(
flags
&
3
)
{
if
(
flags
&
1
)
{
ev
=
event_new
(
tgl_state
.
ev_base
,
0
,
EV_READ
|
EV_PERSIST
,
stdin_read_callback_char
,
0
);
term_
ev
=
event_new
(
tgl_state
.
ev_base
,
0
,
EV_READ
|
EV_PERSIST
,
stdin_read_callback_char
,
0
);
}
else
{
ev
=
event_new
(
tgl_state
.
ev_base
,
0
,
EV_READ
|
EV_PERSIST
,
stdin_read_callback_line
,
0
);
term_
ev
=
event_new
(
tgl_state
.
ev_base
,
0
,
EV_READ
|
EV_PERSIST
,
stdin_read_callback_line
,
0
);
}
event_add
(
ev
,
0
);
event_add
(
term_
ev
,
0
);
}
int
last_get_state
=
time
(
0
);
while
(
!
is_end
||
!
is_end
())
{
event_base_loop
(
tgl_state
.
ev_base
,
EVLOOP_ONCE
);
if
(
ev
&&
delete_stdin_event
)
{
event_free
(
ev
);
ev
=
0
;
if
(
term_
ev
&&
delete_stdin_event
)
{
event_free
(
term_
ev
);
term_
ev
=
0
;
}
#ifdef USE_LUA
...
...
@@ -202,8 +202,8 @@ void net_loop (int flags, int (*is_end)(void)) {
}
}
if
(
ev
)
{
event_free
(
ev
);
if
(
term_
ev
)
{
event_free
(
term_
ev
);
}
if
(
verbosity
>=
E_DEBUG
)
{
...
...
mtproto-client.c
View file @
df06d085
...
...
@@ -1443,3 +1443,7 @@ void tgls_free_dc (struct tgl_dc *DC) {
if
(
DC
->
ev
)
{
event_free
(
DC
->
ev
);
}
tfree
(
DC
,
sizeof
(
*
DC
));
}
void
tgls_free_pubkey
(
void
)
{
RSA_free
(
pubKey
);
}
mtproto-client.h
View file @
df06d085
...
...
@@ -56,4 +56,5 @@ void tgln_insert_msg_id (struct tgl_session *S, long long id);
void
tglmp_on_start
(
void
);
void
tgl_dc_authorize
(
struct
tgl_dc
*
DC
);
void
tgls_free_dc
(
struct
tgl_dc
*
DC
);
void
tgls_free_pubkey
(
void
);
#endif
structures.c
View file @
df06d085
...
...
@@ -30,6 +30,7 @@
#include "tree.h"
#include "loop.h"
#include <openssl/aes.h>
#include <openssl/bn.h>
#include <openssl/sha.h>
#include "queries.h"
#include "binlog.h"
...
...
@@ -1882,6 +1883,8 @@ void tgl_free_all (void) {
for
(
i
=
0
;
i
<=
tgl_state
.
max_dc_num
;
i
++
)
if
(
tgl_state
.
DC_list
[
i
])
{
tgls_free_dc
(
tgl_state
.
DC_list
[
i
]);
}
BN_CTX_free
(
tgl_state
.
BN_ctx
);
tgls_free_pubkey
();
}
int
tgl_print_stat
(
char
*
s
,
int
len
)
{
...
...
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