Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
18bcc743
Commit
18bcc743
authored
Oct 18, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error handling.
parent
96957ef7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
babel.c
babel.c
+8
-5
babel.h
babel.h
+1
-1
No files found.
babel.c
View file @
18bcc743
...
...
@@ -483,7 +483,9 @@ main(int argc, char **argv)
#endif
init_signals
();
resize_receive_buffer
(
1500
);
rc
=
resize_receive_buffer
(
1500
);
if
(
rc
<
0
)
goto
fail
;
check_networks
();
if
(
receive_buffer
==
NULL
)
goto
fail
;
...
...
@@ -826,17 +828,17 @@ schedule_neighbours_check(int msecs, int override)
timeval_min
(
&
check_neighbours_timeout
,
&
timeout
);
}
void
int
resize_receive_buffer
(
int
size
)
{
if
(
size
<=
receive_buffer_size
)
return
;
return
0
;
if
(
receive_buffer
==
NULL
)
{
receive_buffer
=
malloc
(
size
);
if
(
receive_buffer
==
NULL
)
{
perror
(
"malloc(receive_buffer)"
);
return
;
return
-
1
;
}
receive_buffer_size
=
size
;
}
else
{
...
...
@@ -844,11 +846,12 @@ resize_receive_buffer(int size)
new
=
realloc
(
receive_buffer
,
size
);
if
(
new
==
NULL
)
{
perror
(
"realloc(receive_buffer)"
);
return
;
return
-
1
;
}
receive_buffer
=
new
;
receive_buffer_size
=
size
;
}
return
1
;
}
static
void
...
...
babel.h
View file @
18bcc743
...
...
@@ -77,4 +77,4 @@ extern int max_request_hopcount;
extern
int
update_interval
;
void
schedule_neighbours_check
(
int
msecs
,
int
override
);
void
resize_receive_buffer
(
int
size
);
int
resize_receive_buffer
(
int
size
);
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