Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Documentation: refer to gitworkflows(7) from tutorial and git(1)
  daemon: Strictly parse the "extra arg" part of the command
  • Loading branch information
Junio C Hamano committed Jun 7, 2009
2 parents 6096d75 + 801a011 commit 3ff7e17
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
5 changes: 4 additions & 1 deletion Documentation/git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ The link:user-manual.html#git-concepts[git concepts chapter of the
user-manual] and linkgit:gitcore-tutorial[7] both provide
introductions to the underlying git architecture.

See linkgit:gitworkflows[7] for an overview of recommended workflows.

See also the link:howto-index.html[howto] documents for some useful
examples.

Expand Down Expand Up @@ -649,7 +651,8 @@ SEE ALSO
linkgit:gittutorial[7], linkgit:gittutorial-2[7],
link:everyday.html[Everyday Git], linkgit:gitcvs-migration[7],
linkgit:gitglossary[7], linkgit:gitcore-tutorial[7],
linkgit:gitcli[7], link:user-manual.html[The Git User's Manual]
linkgit:gitcli[7], link:user-manual.html[The Git User's Manual],
linkgit:gitworkflows[7]

GIT
---
Expand Down
4 changes: 4 additions & 0 deletions Documentation/gittutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,9 @@ digressions that may be interesting at this point are:
smart enough to perform a close-to-optimal search even in the
case of complex non-linear history with lots of merged branches.

* linkgit:gitworkflows[7]: Gives an overview of recommended
workflows.

* link:everyday.html[Everyday GIT with 20 Commands Or So]

* linkgit:gitcvs-migration[7]: Git for CVS users.
Expand All @@ -661,6 +664,7 @@ linkgit:gitcvs-migration[7],
linkgit:gitcore-tutorial[7],
linkgit:gitglossary[7],
linkgit:git-help[1],
linkgit:gitworkflows[7],
link:everyday.html[Everyday git],
link:user-manual.html[The Git User's Manual]

Expand Down
5 changes: 4 additions & 1 deletion connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,10 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
git_tcp_connect(fd, host, flags);
/*
* Separate original protocol components prog and path
* from extended components with a NUL byte.
* from extended host header with a NUL byte.
*
* Note: Do not add any other headers here! Doing so
* will cause older git-daemon servers to crash.
*/
packet_write(fd[1],
"%s %s%chost=%s%c",
Expand Down
10 changes: 6 additions & 4 deletions daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ static char *xstrdup_tolower(const char *str)
}

/*
* Separate the "extra args" information as supplied by the client connection.
* Read the host as supplied by the client connection.
*/
static void parse_extra_args(char *extra_args, int buflen)
static void parse_host_arg(char *extra_args, int buflen)
{
char *val;
int vallen;
char *end = extra_args + buflen;

while (extra_args < end && *extra_args) {
if (extra_args < end && *extra_args) {
saw_extended_args = 1;
if (strncasecmp("host=", extra_args, 5) == 0) {
val = extra_args + 5;
Expand All @@ -436,6 +436,8 @@ static void parse_extra_args(char *extra_args, int buflen)
/* On to the next one */
extra_args = val + vallen;
}
if (extra_args < end && *extra_args)
die("Invalid request");
}

/*
Expand Down Expand Up @@ -545,7 +547,7 @@ static int execute(struct sockaddr *addr)
hostname = canon_hostname = ip_address = tcp_port = NULL;

if (len != pktlen)
parse_extra_args(line + len + 1, pktlen - len - 1);
parse_host_arg(line + len + 1, pktlen - len - 1);

for (i = 0; i < ARRAY_SIZE(daemon_service); i++) {
struct daemon_service *s = &(daemon_service[i]);
Expand Down

0 comments on commit 3ff7e17

Please sign in to comment.