Author: grothoff Date: 2006-03-11 20:45:21 -0800 (Sat, 11 Mar 2006) New Revision: 2489
Modified: GNUnet/src/applications/fs/fsui/download.c GNUnet/src/applications/fs/fsui/upload.c Log: split Modified: GNUnet/src/applications/fs/fsui/download.c =================================================================== --- GNUnet/src/applications/fs/fsui/download.c 2006-03-12 04:38:37 UTC (rev 2488) +++ GNUnet/src/applications/fs/fsui/download.c 2006-03-12 04:45:21 UTC (rev 2489) @@ -181,10 +181,12 @@ static int testTerminate(void * cls) { FSUI_DownloadList * dl = cls; - if (dl->signalTerminate == YES) + + if (dl->signalTerminate == YES) { return SYSERR; - else + } else { return OK; + } } /** @@ -288,7 +290,13 @@ dl->ctx->ecb(dl->ctx->ecbClosure, &event); dl->signalTerminate = YES; + LOG(LOG_DEBUG, + "ECRS returned SYSERR for download, setting sig terminate for %p\n", + dl); } else { + LOG(LOG_DEBUG, + "ECRS returned OK for download, setting sig terminate for %p\n", + dl); dl->signalTerminate = YES; GNUNET_ASSERT(dl != &dl->ctx->activeDownloads); while ( (dl != NULL) && @@ -313,7 +321,7 @@ dl = dl->parent; } } -#if DEBUG_DTM +#if DEBUG_DTM || 1 LOG(LOG_DEBUG, "Download thread for `%s' terminated (%s)...\n", dl->filename, @@ -339,15 +347,15 @@ FSUI_DownloadList * root; unsigned long long totalBytes; + LOG(LOG_DEBUG, + "Scheduling download of '%s'\n", + filename); GNUNET_ASSERT(ctx != NULL); if (! (ECRS_isFileUri(uri) || ECRS_isLocationUri(uri)) ) { BREAK(); /* wrong type of URI! */ return SYSERR; } - LOG(LOG_DEBUG, - "Starting download of file `%s'\n", - filename); dl = MALLOC(sizeof(FSUI_DownloadList)); memset(dl, 0, sizeof(FSUI_DownloadList)); cronTime(&dl->startTime); @@ -422,13 +430,6 @@ list->ctx->activeDownloadThreads, list->ctx->threadPoolSize); #endif - LOG(LOG_DEBUG, - "Download thread manager investigates pending downlod of file `%s' (%d, %llu/%llu, %d)\n", - list->filename, - list->signalTerminate, - list->completed, - list->total, - list->finished); ret = NO; /* should this one be started? */ if ( (list->ctx->threadPoolSize @@ -437,9 +438,9 @@ ( (list->total > list->completed) || (list->total == 0) ) && (list->finished == NO) ) { -#if DEBUG_DTM +#if DEBUG_DTM || 1 LOG(LOG_DEBUG, - "Download thread manager schedules active downlod of file `%s'\n", + "Download thread manager starts downlod of file `%s'\n", list->filename); #endif list->signalTerminate = NO; @@ -459,7 +460,7 @@ (list->signalTerminate == NO) ) { #if DEBUG_DTM LOG(LOG_DEBUG, - "Download thread manager aborts active downlod of file `%s' (%u/%u downloads)\n", + "Download thread manager aborts active download of file `%s' (%u/%u downloads)\n", list->filename, list->ctx->activeDownloadThreads, list->ctx->threadPoolSize); @@ -474,9 +475,9 @@ /* has this one "died naturally"? */ if (list->signalTerminate == YES) { -#if DEBUG_DTM +#if DEBUG_DTM || 1 LOG(LOG_DEBUG, - "Download thread manager collects inactive downlod of file `%s'\n", + "Download thread manager collects inactive download of file `%s'\n", list->filename); #endif PTHREAD_JOIN(&list->handle, Modified: GNUnet/src/applications/fs/fsui/upload.c =================================================================== --- GNUnet/src/applications/fs/fsui/upload.c 2006-03-12 04:38:37 UTC (rev 2488) +++ GNUnet/src/applications/fs/fsui/upload.c 2006-03-12 04:45:21 UTC (rev 2489) @@ -32,10 +32,13 @@ #define DEBUG_UPLOAD NO -/* LE <= 0.5.8 compatibility code */ +/* LE <= 0.5.8/0.5.12 compatibility code */ #ifndef EXTRACTOR_SPLIT #define EXTRACTOR_SPLIT 90 #endif +#ifndef EXTRACTOR_LOWERCASE +#define EXTRACTOR_LOWERCASE 101 +#endif /** * Data used to keep track of the files in the @@ -328,6 +331,9 @@ ECRS_delFromMetaData(meta, EXTRACTOR_SPLIT, NULL); + ECRS_delFromMetaData(meta, + EXTRACTOR_LOWERCASE, + NULL); utc->dir->fis[utc->dir->fiCount-1].meta = meta; utc->dir->fis[utc->dir->fiCount-1].uri = uri; } else { @@ -343,7 +349,8 @@ /** * Thread that does the upload. */ -static void * uploadThread(UploadThreadClosure * utc) { +static void * uploadThread(void * cls) { + UploadThreadClosure * utc = cls; struct ECRS_URI * uri; struct ECRS_URI * keywordUri; FSUI_Event event; @@ -557,7 +564,7 @@ utc->tl = tl; tl->isDone = NO; if (0 != PTHREAD_CREATE(&tl->handle, - (PThreadMain) &uploadThread, + &uploadThread, utc, 128 * 1024)) { LOG_STRERROR(LOG_ERROR, "PTHREAD_CREATE"); @@ -626,7 +633,7 @@ utc->tl = tl; tl->isDone = NO; if (0 != PTHREAD_CREATE(&tl->handle, - (PThreadMain) &uploadThread, + &uploadThread, utc, 128 * 1024)) { LOG_STRERROR(LOG_ERROR, "PTHREAD_CREATE"); _______________________________________________ GNUnet-SVN mailing list GNUnet-SVN@gnu.org http://lists.gnu.org/mailman/listinfo/gnunet-svn