FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 06-01-2011, 07:30 PM
Dan McGee
 
Default lib/dload.c: remove assumption in continuation logic

On Wed, Jun 1, 2011 at 2:24 PM, Dave Reisner <d@falconindy.com> wrote:
> Callers to curl_download_internal now tell us if its okay to continue a
> transfer, so obey this instead of using a heuristic.
>
> Signed-off-by: Dave Reisner <d@falconindy.com>
> ---
> *lib/libalpm/dload.c | * *6 ++----
> *1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
> index 3d90130..c79e5d2 100644
> --- a/lib/libalpm/dload.c
> +++ b/lib/libalpm/dload.c
> @@ -202,10 +202,8 @@ static int curl_download_internal(const char *url, const char *localpath,
> * * * * * * * *curl_easy_setopt(handle->curl, CURLOPT_USERAGENT, useragent);
> * * * *}
>
> - * * * /* TODO: no assuming here. the calling function should tell us what's kosher */
> - * * * if(!force && stat(destfile, &st) == 0) {
> - * * * * * * * /* assume its a sync, so we're starting from scratch. but, only download
> - * * * * * * * ** our local is out of date. */
> + * * * if(!force && stat(destfile, &st) == 0 && !allow_resume) {
> + * * * * * * * /* start from scratch, but only download our local is out of date. */
"only download if our" ? Missing a word here. Otherwise patch looks
good, although I'd check both of the simple things before doing the
stat.
!force && !allow_resume && stat()

> * * * * * * * *curl_easy_setopt(handle->curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
> * * * * * * * *curl_easy_setopt(handle->curl, CURLOPT_TIMEVALUE, (long)st.st_mtime);
> * * * *} else if(stat(tempfile, &st) == 0 && allow_resume) {
> --
> 1.7.5.2
>
>
>
 

Thread Tools




All times are GMT. The time now is 01:42 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org