mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-08 11:34:13 +00:00
Issue #30, rewrite Rhizome fetch queues and slots
Causes SEGV in rhizomestress test.
This commit is contained in:
parent
5d62be7b0f
commit
a9d3a1387c
@ -168,7 +168,7 @@ schedule(&_sched_##X); }
|
||||
/* Pick next rhizome files to grab every few seconds
|
||||
from the priority list continuously being built from observed
|
||||
bundle announcements */
|
||||
SCHEDULE(rhizome_enqueue_suggestions, rhizome_fetch_interval_ms, rhizome_fetch_interval_ms*3);
|
||||
SCHEDULE(rhizome_start_next_queued_fetches, rhizome_fetch_interval_ms, rhizome_fetch_interval_ms*3);
|
||||
|
||||
/* Periodically check for new interfaces */
|
||||
SCHEDULE(overlay_interface_discover, 1, 100);
|
||||
|
12
rhizome.h
12
rhizome.h
@ -284,7 +284,6 @@ int rhizome_find_duplicate(const rhizome_manifest *m, rhizome_manifest **found,
|
||||
int rhizome_manifest_to_bar(rhizome_manifest *m,unsigned char *bar);
|
||||
long long rhizome_bar_version(unsigned char *bar);
|
||||
unsigned long long rhizome_bar_bidprefix_ll(unsigned char *bar);
|
||||
int rhizome_queue_manifest_import(rhizome_manifest *m, const struct sockaddr_in *peerip, int *manifest_kept);
|
||||
int rhizome_list_manifests(const char *service, const char *sender_sid, const char *recipient_sid, int limit, int offset);
|
||||
int rhizome_retrieve_manifest(const char *manifestid, rhizome_manifest **mp);
|
||||
int rhizome_retrieve_file(const char *fileid, const char *filepath,
|
||||
@ -325,10 +324,8 @@ int rhizome_sign_hash_with_key(rhizome_manifest *m,const unsigned char *sk,
|
||||
int rhizome_verify_bundle_privatekey(rhizome_manifest *m, const unsigned char *sk,
|
||||
const unsigned char *pk);
|
||||
int rhizome_find_bundle_author(rhizome_manifest *m);
|
||||
int rhizome_queue_ignore_manifest(rhizome_manifest *m,
|
||||
struct sockaddr_in *peerip,int timeout);
|
||||
int rhizome_ignore_manifest_check(rhizome_manifest *m,
|
||||
struct sockaddr_in *peerip);
|
||||
int rhizome_queue_ignore_manifest(rhizome_manifest *m, const struct sockaddr_in *peerip, int timeout);
|
||||
int rhizome_ignore_manifest_check(rhizome_manifest *m, const struct sockaddr_in *peerip);
|
||||
|
||||
/* one manifest is required per candidate, plus a few spare.
|
||||
so MAX_RHIZOME_MANIFESTS must be > MAX_CANDIDATES.
|
||||
@ -336,8 +333,7 @@ int rhizome_ignore_manifest_check(rhizome_manifest *m,
|
||||
#define MAX_RHIZOME_MANIFESTS 24
|
||||
#define MAX_CANDIDATES 16
|
||||
|
||||
int rhizome_suggest_queue_manifest_import(rhizome_manifest *m,
|
||||
struct sockaddr_in *peerip);
|
||||
int rhizome_suggest_queue_manifest_import(rhizome_manifest *m, const struct sockaddr_in *peerip);
|
||||
|
||||
typedef struct rhizome_http_request {
|
||||
struct sched_ent alarm;
|
||||
@ -543,7 +539,7 @@ extern int favicon_len;
|
||||
|
||||
int rhizome_import_from_files(const char *manifestpath,const char *filepath);
|
||||
int rhizome_fetch_request_manifest_by_prefix(const struct sockaddr_in *peerip, const unsigned char *prefix, size_t prefix_length);
|
||||
int rhizome_count_queued_imports();
|
||||
int rhizome_any_fetch_active();
|
||||
|
||||
struct http_response_parts {
|
||||
int code;
|
||||
|
@ -881,7 +881,7 @@ void rhizome_direct_http_dispatch(rhizome_direct_sync_request *r)
|
||||
/* Fetching the manifest, and then using it to see if we want to
|
||||
fetch the file for import is all handled asynchronously, so just
|
||||
wait for it to finish. */
|
||||
while (rhizome_count_queued_imports())
|
||||
while (rhizome_any_fetch_active())
|
||||
fd_poll();
|
||||
}
|
||||
|
||||
|
790
rhizome_fetch.c
790
rhizome_fetch.c
File diff suppressed because it is too large
Load Diff
2
serval.h
2
serval.h
@ -770,7 +770,7 @@ int fd_poll();
|
||||
void overlay_interface_discover(struct sched_ent *alarm);
|
||||
void overlay_dummy_poll(struct sched_ent *alarm);
|
||||
void overlay_route_tick(struct sched_ent *alarm);
|
||||
void rhizome_enqueue_suggestions(struct sched_ent *alarm);
|
||||
void rhizome_start_next_queued_fetches(struct sched_ent *alarm);
|
||||
void server_shutdown_check(struct sched_ent *alarm);
|
||||
void overlay_mdp_poll(struct sched_ent *alarm);
|
||||
void fd_periodicstats(struct sched_ent *alarm);
|
||||
|
Loading…
x
Reference in New Issue
Block a user