Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin J. Thompson
Tor
Commits
951d59d7
Commit
951d59d7
authored
6 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Use tor_getline() in dirserv.c to remove its upper line limit.
Closes ticket 26223.
parent
6574d4bd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/bug26223
+3
-0
3 additions, 0 deletions
changes/bug26223
src/feature/dircache/dirserv.c
+6
-4
6 additions, 4 deletions
src/feature/dircache/dirserv.c
with
9 additions
and
4 deletions
changes/bug26223
0 → 100644
+
3
−
0
View file @
951d59d7
o Minor features (directory authority):
- There is no longer an artificial upper limit on the length of bandwidth
lines. Closes ticket 26223.
This diff is collapsed.
Click to expand it.
src/feature/dircache/dirserv.c
+
6
−
4
View file @
951d59d7
...
...
@@ -2606,7 +2606,6 @@ int
dirserv_read_measured_bandwidths
(
const
char
*
from_file
,
smartlist_t
*
routerstatuses
)
{
char
line
[
512
];
FILE
*
fp
=
tor_fopen_cloexec
(
from_file
,
"r"
);
int
applied_lines
=
0
;
time_t
file_time
,
now
;
...
...
@@ -2617,9 +2616,10 @@ dirserv_read_measured_bandwidths(const char *from_file,
* version 1.1.0 */
int
line_is_after_headers
=
0
;
int
rv
=
-
1
;
char
*
line
=
NULL
;
size_t
n
=
0
;
/* Initialise line, so that we can't possibly run off the end. */
memset
(
line
,
0
,
sizeof
(
line
));
if
(
fp
==
NULL
)
{
log_warn
(
LD_CONFIG
,
"Can't open bandwidth file at configured location: %s"
,
...
...
@@ -2628,7 +2628,7 @@ dirserv_read_measured_bandwidths(const char *from_file,
}
/* If fgets fails, line is either unmodified, or indeterminate. */
if
(
!
f
get
s
(
line
,
sizeof
(
line
),
fp
)
)
{
if
(
tor_
getline
(
&
line
,
&
n
,
fp
)
<=
0
)
{
log_warn
(
LD_DIRSERV
,
"Empty bandwidth file"
);
goto
err
;
}
...
...
@@ -2659,7 +2659,7 @@ dirserv_read_measured_bandwidths(const char *from_file,
while
(
!
feof
(
fp
))
{
measured_bw_line_t
parsed_line
;
if
(
f
get
s
(
line
,
sizeof
(
line
),
fp
)
&&
strlen
(
line
)
)
{
if
(
tor_
getline
(
&
line
,
&
n
,
fp
)
>=
0
)
{
if
(
measured_bw_line_parse
(
&
parsed_line
,
line
,
line_is_after_headers
)
!=
-
1
)
{
/* This condition will be true when the first complete valid bw line
...
...
@@ -2682,6 +2682,8 @@ dirserv_read_measured_bandwidths(const char *from_file,
rv
=
0
;
err:
if
(
line
)
raw_free
(
line
);
if
(
fp
)
fclose
(
fp
);
return
rv
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment