Use config file settings for http
[git.git] / connect.c
index 39d320c..247f02f 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -284,6 +284,10 @@ static enum protocol get_protocol(const char *name)
                return PROTO_SSH;
        if (!strcmp(name, "git"))
                return PROTO_GIT;
+       if (!strcmp(name, "git+ssh"))
+               return PROTO_SSH;
+       if (!strcmp(name, "ssh+git"))
+               return PROTO_SSH;
        die("I don't handle protocol '%s'", name);
 }
 
@@ -397,7 +401,7 @@ static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path)
 
                memset(&sa, 0, sizeof sa);
                sa.sin_family = he->h_addrtype;
-               sa.sin_port = nport;
+               sa.sin_port = htons(nport);
                memcpy(&sa.sin_addr, ap, he->h_length);
 
                if (connect(sockfd, (struct sockaddr *)&sa, sizeof sa) < 0) {