~ubuntu-branches/debian/sid/git/sid

« back to all changes in this revision

Viewing changes to debian/diff/0010-transport-optionally-honor-DNS-SRV-records.diff

  • Committer: Package Import Robot
  • Author(s): Jonathan Nieder
  • Date: 2013-06-12 07:50:53 UTC
  • mfrom: (1.2.19) (2.1.31 experimental)
  • Revision ID: package-import@ubuntu.com-20130612075053-uue9xe0dq0rvm44y
Tags: 1:1.8.3.1-1
* merge branch debian-experimental
* new upstream point release (see RelNotes/1.8.3.1.txt).
* debian/watch: use xz-compressed tarballs from kernel.org.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 45fc5a20d12c748c4577a6b6edcd362a00eeec6f Mon Sep 17 00:00:00 2001
 
1
From 054edcda9a99374e78eeabfb4630edfa3d08d1da Mon Sep 17 00:00:00 2001
2
2
From: Jonathan Nieder <jrnieder@gmail.com>
3
3
Date: Mon, 6 Jun 2011 04:46:20 -0500
4
 
Subject: [PATCH 10/12] transport: optionally honor DNS SRV records
 
4
Subject: transport: optionally honor DNS SRV records
5
5
 
6
6
SRV records are an extra layer of indirection on top of A/AAAA records
7
7
mapping from domain names and service types to the hostnames of
52
52
 
53
53
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
54
54
---
55
 
 Makefile |   10 ++
56
 
 srv.c    |  321 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
57
 
 srv.h    |   15 +++
58
 
 tcp.c    |  100 ++++++++++++++------
 
55
 Makefile |  10 ++
 
56
 srv.c    | 321 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
57
 srv.h    |  15 +++
 
58
 tcp.c    | 100 ++++++++++++++------
59
59
 4 files changed, 418 insertions(+), 28 deletions(-)
60
60
 create mode 100644 srv.c
61
61
 create mode 100644 srv.h
62
62
 
63
63
diff --git a/Makefile b/Makefile
64
 
index ea44b91..51b8e48 100644
 
64
index 59028b6..2d1c6ed 100644
65
65
--- a/Makefile
66
66
+++ b/Makefile
67
 
@@ -151,6 +151,10 @@ all::
 
67
@@ -166,6 +166,10 @@ all::
68
68
 # Notably on Solaris hstrerror resides in libresolv and on Solaris 7
69
69
 # inet_ntop and inet_pton additionally reside there.
70
70
 #
74
74
+#
75
75
 # Define NO_MMAP if you want to avoid mmap.
76
76
 #
77
 
 # Define NO_PTHREADS if you do not have or do not want to use Pthreads.
78
 
@@ -1495,6 +1499,11 @@ endif
 
77
 # Define NO_SYS_POLL_H if you don't have sys/poll.h.
 
78
@@ -709,6 +713,7 @@ LIB_H += sha1-lookup.h
 
79
 LIB_H += shortlog.h
 
80
 LIB_H += sideband.h
 
81
 LIB_H += sigchain.h
 
82
+LIB_H += srv.h
 
83
 LIB_H += strbuf.h
 
84
 LIB_H += streaming.h
 
85
 LIB_H += string-list.h
 
86
@@ -1187,6 +1192,11 @@ endif
79
87
 ifdef NEEDS_NSL
80
88
        EXTLIBS += -lnsl
81
89
 endif
87
95
 ifdef NEEDS_RESOLV
88
96
        EXTLIBS += -lresolv
89
97
 endif
90
 
@@ -2174,6 +2183,7 @@ builtin/commit.o builtin/revert.o wt-status.o: wt-status.h
91
 
 builtin/tar-tree.o archive-tar.o: tar.h
92
 
 connect.o transport.o url.o http-backend.o: url.h
93
 
 connect.o daemon.o tcp.o: tcp.h
94
 
+tcp.o srv.o: srv.h
95
 
 http-fetch.o http-walker.o remote-curl.o transport.o walker.o: walker.h
96
 
 http.o http-walker.o http-push.o http-fetch.o remote-curl.o: http.h url.h
97
 
 
98
98
diff --git a/srv.c b/srv.c
99
99
new file mode 100644
100
100
index 0000000..2716206
529
529
                if (flags & CONNECT_VERBOSE)
530
530
-                       fprintf(stderr, "%s ", dns_name(&i));
531
531
-               break;
532
 
-       }
533
532
+                       fprintf(stderr, "done.\nConnecting to %s (port %s) ... ",
534
533
+                                       hosts[j].hostname, hosts[j].port);
535
534
+
554
553
+                               fprintf(stderr, "%s ", dns_name(&i));
555
554
+                       break;
556
555
+               }
 
556
+
 
557
+               dns_free(ai);
 
558
+
 
559
+               if (sockfd >= 0)
 
560
+                       break;
 
561
        }
557
562
 
558
563
-       dns_free(ai);
559
 
+               dns_free(ai);
560
 
 
 
564
-
561
565
-       if (sockfd < 0)
562
 
+               if (sockfd >= 0)
563
 
+                       break;
564
 
+       }
565
 
+
566
566
+       if (gai || sockfd < 0)
567
567
                die("unable to connect to %s:\n%s", host, error_message.buf);
568
568
 
582
582
 }
583
583
 
584
584
-- 
585
 
1.7.10
 
585
1.8.2.1
586
586