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
009453f9
Commit
009453f9
authored
12 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'linus/task-5891'
parents
ee1b8196
ad61282f
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/bug5891
+5
-0
5 additions, 0 deletions
changes/bug5891
src/or/rephist.c
+22
-21
22 additions, 21 deletions
src/or/rephist.c
with
27 additions
and
21 deletions
changes/bug5891
0 → 100644
+
5
−
0
View file @
009453f9
o Minor bugfixes:
- Fix a bug where a bridge authority crashes if it has seen no
directory requests when it's time to write statistics to disk.
Fixes bug 5891. Also fixes bug 5508 in a better way.
This diff is collapsed.
Click to expand it.
src/or/rephist.c
+
22
−
21
View file @
009453f9
...
@@ -2650,24 +2650,30 @@ rep_hist_format_desc_stats(time_t now)
...
@@ -2650,24 +2650,30 @@ rep_hist_format_desc_stats(time_t now)
const
char
*
key
;
const
char
*
key
;
void
*
val
;
void
*
val
;
unsigned
size
;
unsigned
size
;
int
*
vals
;
int
*
vals
,
max
=
0
,
q3
=
0
,
md
=
0
,
q1
=
0
,
min
=
0
;
int
n
=
0
;
int
n
=
0
;
if
(
!
start_of_served_descs_stats_interval
)
if
(
!
start_of_served_descs_stats_interval
)
return
NULL
;
return
NULL
;
size
=
digestmap_size
(
served_descs
);
size
=
digestmap_size
(
served_descs
);
if
(
size
==
0
)
if
(
size
>
0
)
{
return
NULL
;
vals
=
tor_malloc
(
size
*
sizeof
(
int
));
vals
=
tor_malloc
(
size
*
sizeof
(
int
));
for
(
iter
=
digestmap_iter_init
(
served_descs
);
!
digestmap_iter_done
(
iter
);
for
(
iter
=
digestmap_iter_init
(
served_descs
);
!
digestmap_iter_done
(
iter
);
iter
=
digestmap_iter_next
(
served_descs
,
iter
))
{
iter
=
digestmap_iter_next
(
served_descs
,
iter
)
)
{
uintptr_t
count
;
uintptr_t
count
;
digestmap_iter_get
(
iter
,
&
key
,
&
val
);
digestmap_iter_get
(
iter
,
&
key
,
&
val
);
count
=
(
uintptr_t
)
val
;
count
=
(
uintptr_t
)
val
;
vals
[
n
++
]
=
(
int
)
count
;
vals
[
n
++
]
=
(
int
)
count
;
(
void
)
key
;
(
void
)
key
;
}
max
=
find_nth_int
(
vals
,
size
,
size
-
1
);
q3
=
find_nth_int
(
vals
,
size
,
(
3
*
size
-
1
)
/
4
);
md
=
find_nth_int
(
vals
,
size
,
(
size
-
1
)
/
2
);
q1
=
find_nth_int
(
vals
,
size
,
(
size
-
1
)
/
4
);
min
=
find_nth_int
(
vals
,
size
,
0
);
tor_free
(
vals
);
}
}
format_iso_time
(
t
,
now
);
format_iso_time
(
t
,
now
);
...
@@ -2678,14 +2684,8 @@ rep_hist_format_desc_stats(time_t now)
...
@@ -2678,14 +2684,8 @@ rep_hist_format_desc_stats(time_t now)
t
,
t
,
(
unsigned
)
(
now
-
start_of_served_descs_stats_interval
),
(
unsigned
)
(
now
-
start_of_served_descs_stats_interval
),
total_descriptor_downloads
,
total_descriptor_downloads
,
size
,
size
,
max
,
q3
,
md
,
q1
,
min
);
find_nth_int
(
vals
,
size
,
size
-
1
),
find_nth_int
(
vals
,
size
,
(
3
*
size
-
1
)
/
4
),
find_nth_int
(
vals
,
size
,
(
size
-
1
)
/
2
),
find_nth_int
(
vals
,
size
,
(
size
-
1
)
/
4
),
find_nth_int
(
vals
,
size
,
0
));
tor_free
(
vals
);
return
result
;
return
result
;
}
}
...
@@ -2705,6 +2705,7 @@ rep_hist_desc_stats_write(time_t now)
...
@@ -2705,6 +2705,7 @@ rep_hist_desc_stats_write(time_t now)
return
start_of_served_descs_stats_interval
+
WRITE_STATS_INTERVAL
;
return
start_of_served_descs_stats_interval
+
WRITE_STATS_INTERVAL
;
str
=
rep_hist_format_desc_stats
(
now
);
str
=
rep_hist_format_desc_stats
(
now
);
tor_assert
(
str
!=
NULL
);
statsdir
=
get_datadir_fname
(
"stats"
);
statsdir
=
get_datadir_fname
(
"stats"
);
if
(
check_private_dir
(
statsdir
,
CPD_CREATE
,
get_options
()
->
User
)
<
0
)
{
if
(
check_private_dir
(
statsdir
,
CPD_CREATE
,
get_options
()
->
User
)
<
0
)
{
...
...
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