git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] http-push.c: DAV must support olny http and https scheme

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 12, 2009, 08:48 UTC
Message-ID
<7vd4bi9s1m.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1239371060-3978-1-git-send-email-catap@catap.ru>
"Kirill A. Korinskiy" <catap@catap.ru> writes:
Show 33 quoted lines
> If the response from remote web-server have scp or other not http-like
> scheme http-push can't go to change url, because DAV must work only
> over HTTP (http and https scheme).
>
> Signed-off-by: Kirill A. Korinskiy <catap@catap.ru>
> ---
>  http-push.c |   19 ++++++++++---------
>  1 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/http-push.c b/http-push.c
> index feeb340..48c9a04 100644
> --- a/http-push.c
> +++ b/http-push.c
> @@ -1457,16 +1457,17 @@ static void handle_remote_ls_ctx(struct xml_ctx *ctx, int tag_closed)
>  			}
>  		} else if (!strcmp(ctx->name, DAV_PROPFIND_NAME) && ctx->cdata) {
>  			char *path = ctx->cdata;
> -			if (*ctx->cdata == 'h') {
> -				path = strstr(path, "//");
> -				if (path) {
> -					path = strchr(path+2, '/');
> -				}
> -			}
> -			if (path) {
> -				path += repo->path_len;
> -				ls->dentry_name = xstrdup(path);
> +			if (!strcmp(ctx->cdata, "http://")) {
> +				path = strchr(path + sizeof("http://") - 1, '/');
> +			} else if (!strcmp(ctx->cdata, "https://")) {
> +				path = strchr(path + sizeof("https://") - 1, '/');
>  			}
> +
> +			path += remote->path_len;

http-push.c: In function 'handle_remote_ls_ctx': http-push.c:1466: error: 'remote' undeclared (first use in this function) http-push.c:1466: error: (Each undeclared identifier is reported only once http-push.c:1466: error: for each function it appears in.)

Ah, crap.
Show 8 quoted lines
> +			ls->dentry_name = xmalloc(strlen(path) -
> +						  remote->path_len + 1);
> +			strcpy(ls->dentry_name, path + remote->path_len);
>  		} else if (!strcmp(ctx->name, DAV_PROPFIND_COLLECTION)) {
>  			ls->dentry_flags |= IS_DIR;
>  		}
> -- 
> 1.6.2
Previous: Kirill A. KorinskiyNext: Mike Hommey
Message 2 of 7 in “http-push.c: DAV must support olny http and https scheme”
  1. http-push.c: DAV must support olny http and https schemeKirill A. Korinskiy, Apr 10, 2009
  2. Junio C HamanoApr 12, 2009
  3. Mike HommeyApr 12, 2009
  4. Junio C HamanoApr 12, 2009
  5. http-push.c: DAV must support olny http and https schemeKirill A. Korinskiy, Apr 12, 2009
  6. Junio C HamanoApr 12, 2009
  7. Matthieu MoyApr 13, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.