All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Khapyorsky <sashak@voltaire.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Trivial support for cloning and fetching via ftp://.
Date: Sat, 16 Sep 2006 13:51:31 +0300	[thread overview]
Message-ID: <20060916105131.GC17504@sashak.voltaire.com> (raw)
In-Reply-To: <20060916100147.GA17504@sashak.voltaire.com>

On 13:01 Sat 16 Sep     , Sasha Khapyorsky wrote:
> On 02:12 Sat 16 Sep     , Junio C Hamano wrote:
> > Sasha Khapyorsky <sashak@voltaire.com> writes:
> > 
> > > Something like this?
> > >
> > > With this change I'm able to clone
> > > ftp://ftp.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git
> > 
> > I think without you would have, just with extra error messages
> > that http codepath filters out.
> 
> No, not really, without change it fails later:
> 
> $ git-clone ftp://ftp.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git
> error: RETR response: 550 (curl_result = 19, http_code = 550, sha1 = 63b98080daa35f0d682db04f4fb7ada010888752)
> Getting pack list for ftp://ftp.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git/
> Getting alternates list for ftp://ftp.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git/
> Also look at ftp://ftp.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/
> Getting pack list for ftp://ftp.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/
> Getting index for pack 477061883bee3d10bece6e3432355b61ba02e594
> error: Unable to find 63b98080daa35f0d682db04f4fb7ada010888752 under ftp://ftp.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git/
> Cannot obtain needed none 63b98080daa35f0d682db04f4fb7ada010888752
> while processing commit 0000000000000000000000000000000000000000.
> 
> > 
> > > diff --git a/http-fetch.c b/http-fetch.c
> > > index a113bb8..46d6029 100644
> > > --- a/http-fetch.c
> > > +++ b/http-fetch.c
> > > @@ -324,7 +324,9 @@ static void process_object_response(void
> > >  
> > >  	/* Use alternates if necessary */
> > >  	if (obj_req->http_code == 404 ||
> > > -	    obj_req->curl_result == CURLE_FILE_COULDNT_READ_FILE) {
> > > +	    obj_req->curl_result == CURLE_FILE_COULDNT_READ_FILE ||
> > > +	    (obj_req->http_code == 550 &&
> > > +	     obj_req->curl_result == CURLE_FTP_COULDNT_RETR_FILE)) {
> > 
> > Here you do the same as the code would for HTTP 404 when you get
> > 550 _and_ RETR failure...
> > 
> > > @@ -538,7 +540,9 @@ static void process_alternates_response(
> > >  		}
> > >  	} else if (slot->curl_result != CURLE_OK) {
> > >  		if (slot->http_code != 404 &&
> > > -		    slot->curl_result != CURLE_FILE_COULDNT_READ_FILE) {
> > > +		    slot->curl_result != CURLE_FILE_COULDNT_READ_FILE &&
> > > +		    (slot->http_code != 550 &&
> > > +		     slot->curl_result != CURLE_FTP_COULDNT_RETR_FILE)) {
> > >  			got_alternates = -1;
> > 
> > ... but you say, while the original code says "declare error if
> > it is not HTTP 404", "oh by the way, if it is 550 _or_ if it
> > is RETR failure then do not trigger this if()".  I suspect you
> > meant to say this?
> > 
> > 	    (slot->http_code != 550 ||
> > 	     slot->curl_result != CURLE_FTP_COULDNT_RETR_FILE)) {
> 
> I think with less strict checking this could be done so, but with _and_
> this also ensures that we are really in FTP mode.

Hmm, saying this I see that original code doesn't do it for specific
case. So for this case we could do:

 	    !(slot->http_code == 550 &&
 	     slot->curl_result == CURLE_FTP_COULDNT_RETR_FILE)) {

Sasha

  reply	other threads:[~2006-09-16 10:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-14  2:24 [PATCH] Trivial support for cloning and fetching via ftp:// Sasha Khapyorsky
2006-09-14  6:57 ` Junio C Hamano
2006-09-16  2:37   ` Sasha Khapyorsky
2006-09-16  9:12     ` Junio C Hamano
2006-09-16 10:01       ` Sasha Khapyorsky
2006-09-16 10:51         ` Sasha Khapyorsky [this message]
2006-09-16 17:29         ` Junio C Hamano
2006-09-16 17:41           ` Sasha Khapyorsky
2006-09-16 17:58             ` Junio C Hamano
2006-09-16 18:00               ` Junio C Hamano
2006-09-16 19:54                 ` Sasha Khapyorsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060916105131.GC17504@sashak.voltaire.com \
    --to=sashak@voltaire.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.