completed working around strbuf_* bugs so that rhizome works again.

This commit is contained in:
gardners 2012-05-21 22:45:08 +09:30
parent 3164a76b1e
commit f562a6361d
2 changed files with 11 additions and 2 deletions

View File

@ -369,6 +369,9 @@ int rhizome_queue_manifest_import(rhizome_manifest *m,
close(sock);
return -1;
}
#warning avoiding FORM_RHIZOME_DATASTORE_PATH corruption
snprintf(filename,1024,"%s/import/file.%s",
rhizome_datastore_path(),id);
q->manifest->dataFileName = strdup(filename);
q->file=fopen(filename,"w");
if (!q->file) {
@ -401,6 +404,9 @@ int rhizome_queue_manifest_import(rhizome_manifest *m,
char filename[1024];
if (!FORM_RHIZOME_DATASTORE_PATH(filename, "import/manifest.%s", id))
return -1;
#warning avoiding FORM_RHIZOME_DATASTORE_PATH corruption
snprintf(filename,1024,"%s/import/manifest.%s",
rhizome_datastore_path(),id);
if (!rhizome_write_manifest_file(m, filename)) {
rhizome_bundle_import(m, NULL, id,
NULL /* no additional groups */,
@ -521,6 +527,7 @@ int rhizome_fetch_poll()
char filename[1024];
if (!FORM_RHIZOME_DATASTORE_PATH(filename,"import/manifest.%s", id))
return -1;
#warning avoiding FORM_RHIZOME_DATASTORE_PATH bugs
snprintf(filename,1024,"%s/manifest.%s",rhizome_datastore_path(),id);
/* Do really write the manifest unchanged */
if (debug&DEBUG_RHIZOME) {

View File

@ -287,8 +287,10 @@ int overlay_rhizome_add_advertisements(int interface_number,overlay_buffer *e)
int overlay_rhizome_saw_advertisements(int i,overlay_frame *f, long long now)
{
if (!f) return -1;
if (debug&DEBUG_RHIZOME) fprintf(stderr,"rhizome f->bytecount=%d\n",
f->payload->length);
if (debug&DEBUG_RHIZOME) {
WHYF("rhizome f->bytecount=%d\n",f->payload->length);
dump("payload",f->payload->bytes,f->payload->length);
}
int ofs=0;
int ad_frame_type=f->payload->bytes[ofs++];