pkgsrc-wip/nzbget/patches/patch-ah

44 lines
1.4 KiB
Text

$NetBSD: patch-ah,v 1.2 2006/06/10 17:18:26 martijnb Exp $
--- ArticleDownloader.cpp.orig 2005-09-02 09:00:41.000000000 +0200
+++ ArticleDownloader.cpp
@@ -178,11 +178,14 @@ void ArticleDownloader::Run()
while( GlobalControl::GetInstance()->GetPause() )
{
SetLastUpdateTimeNow();
- usleep( 1000 * 1000 );
+ // usleep( 1000 * 1000 );
+ sleep(1);
}
line = pConnection->ReadLine();
+#if 0 // ReadLine never returns EOF, this check is bogus (And breaks when using gcc4)
+
// Have we encountered a timeout?
if( (int)line == EOF )
{
@@ -191,6 +194,7 @@ void ArticleDownloader::Run()
break;
}
+#endif
//detect end of article
if ((!line) || (!strcmp(line, ".\r\n")) || (!strcmp(line, ".\n")))
@@ -238,7 +242,6 @@ void ArticleDownloader::Run()
if (line)
{
g_pNZBQueueCoordinator->JobFinished( m_pJob, pConnection );
- MultiServerPool::GetInstance()->FreeConnection(level ,pConnection);
struct timeval StartTime, EndTime;
gettimeofday( &StartTime, 0 );
@@ -248,6 +251,7 @@ void ArticleDownloader::Run()
float fDeltaTime = ( (EndTime.tv_sec-StartTime.tv_sec) + (EndTime.tv_usec-StartTime.tv_usec) / 1000000 );
+ MultiServerPool::GetInstance()->FreeConnection(level ,pConnection);
// info( "UUDecode in %f seconds", fDeltaTime );
if (resFilename)