Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
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
The Tor Project
Core
Tor
Commits
33841a60
Commit
33841a60
authored
8 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'teor/fix18809-warnings' into maint-0.2.8
parents
0d6f293e
2d21f03c
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
src/or/networkstatus.c
+5
-1
5 additions, 1 deletion
src/or/networkstatus.c
src/test/test_connection.c
+9
-11
9 additions, 11 deletions
src/test/test_connection.c
with
14 additions
and
12 deletions
src/or/networkstatus.c
+
5
−
1
View file @
33841a60
...
...
@@ -1236,7 +1236,11 @@ networkstatus_get_reasonably_live_consensus(time_t now, int flavor)
/** Check if we need to download a consensus during tor's bootstrap phase.
* If we have no consensus, or our consensus is unusably old, return 1.
* As soon as we have received a consensus, return 0, even if we don't have
* enough certificates to validate it. */
* enough certificates to validate it.
* If a fallback directory gives us a consensus we can never get certs for,
* check_consensus_waiting_for_certs() will wait 20 minutes before failing
* the cert downloads. After that, a new consensus will be fetched from a
* randomly chosen fallback. */
MOCK_IMPL
(
int
,
networkstatus_consensus_is_bootstrapping
,(
time_t
now
))
{
...
...
This diff is collapsed.
Click to expand it.
src/test/test_connection.c
+
9
−
11
View file @
33841a60
...
...
@@ -652,12 +652,8 @@ test_conn_download_status(void *arg)
{
dir_connection_t
*
conn
=
NULL
;
dir_connection_t
*
conn2
=
NULL
;
dir_connection_t
*
conn3
=
NULL
;
dir_connection_t
*
conn4
=
NULL
;
connection_t
*
ap_conn
=
NULL
;
connection_t
*
ap_conn2
=
NULL
;
/* we never create an ap_conn for conn3 */
connection_t
*
ap_conn4
=
NULL
;
consensus_flavor_t
usable_flavor
=
(
consensus_flavor_t
)
arg
;
...
...
@@ -760,7 +756,8 @@ test_conn_download_status(void *arg)
conn
->
base_
.
state
=
TEST_CONN_STATE
;
/* more connections, all not downloading */
conn3
=
test_conn_download_status_add_a_connection
(
res
);
/* ignore the return value, it's free'd using the connection list */
(
void
)
test_conn_download_status_add_a_connection
(
res
);
tt_assert
(
networkstatus_consensus_is_already_downloading
(
res
)
==
0
);
tt_assert
(
networkstatus_consensus_is_already_downloading
(
other_res
)
==
0
);
tt_assert
(
connection_dir_count_by_purpose_and_resource
(
...
...
@@ -784,8 +781,9 @@ test_conn_download_status(void *arg)
/* more connections, two downloading (should never happen, but needs
* to be tested for completeness) */
conn2
->
base_
.
state
=
TEST_CONN_DL_STATE
;
ap_conn2
=
test_conn_get_linked_connection
(
TO_CONN
(
conn2
),
TEST_CONN_ATTACHED_STATE
);
/* ignore the return value, it's free'd using the connection list */
(
void
)
test_conn_get_linked_connection
(
TO_CONN
(
conn2
),
TEST_CONN_ATTACHED_STATE
);
tt_assert
(
networkstatus_consensus_is_already_downloading
(
res
)
==
1
);
tt_assert
(
networkstatus_consensus_is_already_downloading
(
other_res
)
==
0
);
tt_assert
(
connection_dir_count_by_purpose_and_resource
(
...
...
@@ -823,8 +821,9 @@ test_conn_download_status(void *arg)
* cache directory documents), both flavors downloading
*/
conn4
->
base_
.
state
=
TEST_CONN_DL_STATE
;
ap_conn4
=
test_conn_get_linked_connection
(
TO_CONN
(
conn4
),
TEST_CONN_ATTACHED_STATE
);
/* ignore the return value, it's free'd using the connection list */
(
void
)
test_conn_get_linked_connection
(
TO_CONN
(
conn4
),
TEST_CONN_ATTACHED_STATE
);
tt_assert
(
networkstatus_consensus_is_already_downloading
(
res
)
==
1
);
tt_assert
(
networkstatus_consensus_is_already_downloading
(
other_res
)
==
1
);
tt_assert
(
connection_dir_count_by_purpose_and_resource
(
...
...
@@ -833,10 +832,9 @@ test_conn_download_status(void *arg)
tt_assert
(
connection_dir_count_by_purpose_and_resource
(
TEST_CONN_RSRC_PURPOSE
,
other_res
)
==
1
);
conn4
->
base_
.
state
=
TEST_CONN_STATE
;
done:
/* the teardown function removes all the connections */
;
/* the teardown function removes all the connections
in the global list
*/
;
}
#define CONNECTION_TESTCASE(name, fork, setup) \
...
...
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