// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire-method.cc,v 1.2 1998/11/01 05:27:30 jgg Exp $
+// $Id: acquire-method.cc,v 1.8 1998/11/14 01:39:41 jgg Exp $
/* ######################################################################
Acquire Method
if ((Flags & SendConfig) == SendConfig)
strcat(End,"Send-Config: true\n");
+
+ if ((Flags & LocalOnly) == LocalOnly)
+ strcat(End,"Local-Only: true\n");
strcat(End,"\n");
if (write(STDOUT_FILENO,S,strlen(S)) != (signed)strlen(S))
exit(100);
SetNonBlock(STDIN_FILENO,true);
+
+ Queue = 0;
}
/*}}}*/
// AcqMethod::Fail - A fetch has failed /*{{{*/
if (Res.MD5Sum.empty() == false)
End += snprintf(End,sizeof(S) - (End - S),"MD5Sum: %s\n",Res.MD5Sum.c_str());
+ if (Res.ResumePoint != 0)
+ End += snprintf(End,sizeof(S) - (End - S),"Resume-Point: %u\n",
+ Res.ResumePoint);
+
if (Res.IMSHit == true)
strcat(End,"IMS-Hit: true\n");
End = S + strlen(S);
if (Single == false)
if (WaitFd(STDIN_FILENO) == false)
return 0;
- }
-
- if (ReadMessages(STDIN_FILENO,Messages) == false)
- return 0;
+ if (ReadMessages(STDIN_FILENO,Messages) == false)
+ return 0;
+ }
+
// Single mode exits if the message queue is empty
if (Single == true && Messages.empty() == true)
return 0;
Tmp->Uri = LookupTag(Message,"URI");
Tmp->DestFile = LookupTag(Message,"FileName");
- StrToTime(LookupTag(Message,"Last-Modified"),Tmp->LastModified);
+ if (StrToTime(LookupTag(Message,"Last-Modified"),Tmp->LastModified) == false)
+ Tmp->LastModified = 0;
+
Tmp->Next = 0;
// Append it to the list
FetchItem **I = &Queue;
- for (; *I != 0 && (*I)->Next != 0; I = &(*I)->Next);
+ for (; *I != 0; I = &(*I)->Next);
*I = Tmp;
-
+
+ // Notify that this item is to be fetched.
if (Fetch(Tmp) == false)
Fail();
+
break;
}
}
// sprintf the description
char S[1024];
- unsigned int Len = snprintf(S,sizeof(S),"101 Log\nURI: %s\n"
+ unsigned int Len = snprintf(S,sizeof(S),"102 Status\nURI: %s\n"
"Message: ",CurrentURI.c_str());
vsnprintf(S+Len,sizeof(S)-Len,Format,args);
// AcqMethod::FetchResult::FetchResult - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-pkgAcqMethod::FetchResult::FetchResult() : LastModified(0),
- IMSHit(false), Size(0)
+pkgAcqMethod::FetchResult::FetchResult() : LastModified(0),
+ IMSHit(false), Size(0), ResumePoint(0)
{
}
/*}}}*/