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
84905f07
Commit
84905f07
authored
Sep 11, 2014
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed default DC. Fixed memory leak
parent
bb21fc5e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
+14
-9
auto-static.c
auto-static.c
+4
-3
binlog.c
binlog.c
+2
-2
loop.c
loop.c
+4
-2
tgl.h
tgl.h
+4
-2
No files found.
auto-static.c
View file @
84905f07
...
...
@@ -295,12 +295,12 @@ static void local_next_token (void) {
static
struct
paramed_type
*
fvars
[
MAX_FVARS
];
static
int
fvars_pos
;
void
add_var_to_be_freed
(
struct
paramed_type
*
P
)
{
static
void
add_var_to_be_freed
(
struct
paramed_type
*
P
)
{
assert
(
fvars_pos
<
MAX_FVARS
);
fvars
[
fvars_pos
++
]
=
P
;
}
void
free_vars_to_be_freed
(
void
)
{
static
void
free_vars_to_be_freed
(
void
)
{
int
i
;
for
(
i
=
0
;
i
<
fvars_pos
;
i
++
)
{
tgl_paramed_type_free
(
fvars
[
i
]);
...
...
@@ -314,8 +314,9 @@ int tglf_extf_autocomplete (const char *text, int text_len, int index, char **R,
buffer_end
=
data
+
data_len
;
autocomplete_mode
=
0
;
local_next_token
();
autocomplete_function_any
();
struct
paramed_type
*
P
=
autocomplete_function_any
();
free_vars_to_be_freed
();
if
(
P
)
{
tgl_paramed_type_free
(
P
);
}
}
if
(
autocomplete_mode
==
0
)
{
return
-
1
;
}
int
len
=
strlen
(
text
);
...
...
binlog.c
View file @
84905f07
...
...
@@ -1260,12 +1260,12 @@ static void create_new_binlog (void) {
packet_ptr
=
s
;
out_int
(
CODE_binlog_start
);
out_int
(
CODE_binlog_dc_option
);
out_int
(
1
);
out_int
(
tgl_state
.
test_mode
?
TG_SERVER_TEST_DC
:
TG_SERVER_DC
);
out_string
(
""
);
out_string
(
tgl_state
.
test_mode
?
TG_SERVER_TEST
:
TG_SERVER
);
out_int
(
443
);
out_int
(
CODE_binlog_default_dc
);
out_int
(
1
);
out_int
(
tgl_state
.
test_mode
?
TG_SERVER_TEST_DC
:
TG_SERVER_DC
);
int
fd
=
open
(
get_binlog_file_name
(),
O_WRONLY
|
O_EXCL
|
O_CREAT
,
0600
);
if
(
fd
<
0
)
{
...
...
loop.c
View file @
84905f07
...
...
@@ -485,8 +485,10 @@ void read_dc (int auth_file_fd, int id, unsigned ver) {
void
empty_auth_file
(
void
)
{
char
*
ip
=
tgl_state
.
test_mode
?
TG_SERVER_TEST
:
TG_SERVER
;
bl_do_dc_option
(
1
,
3
,
"DC1"
,
strlen
(
ip
),
ip
,
443
);
bl_do_set_working_dc
(
1
);
static
char
s
[
20
];
sprintf
(
s
,
"DC%d"
,
tgl_state
.
test_mode
?
TG_SERVER_TEST_DC
:
TG_SERVER_DC
);
bl_do_dc_option
(
tgl_state
.
test_mode
?
TG_SERVER_TEST_DC
:
TG_SERVER_DC
,
strlen
(
s
),
s
,
strlen
(
ip
),
ip
,
443
);
bl_do_set_working_dc
(
tgl_state
.
test_mode
?
TG_SERVER_TEST_DC
:
TG_SERVER_DC
);
}
int
need_dc_list_update
;
...
...
tgl.h
View file @
84905f07
...
...
@@ -24,8 +24,10 @@
#include <string.h>
#define TGL_MAX_DC_NUM 100
#define TG_SERVER "173.240.5.1"
#define TG_SERVER_TEST "173.240.5.253"
#define TG_SERVER "149.154.167.50"
#define TG_SERVER_TEST "149.154.167.40"
#define TG_SERVER_DC 2
#define TG_SERVER_TEST_DC 2
// JUST RANDOM STRING
#define TGL_BUILD "2012"
...
...
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