Fixed fat-fingered typing mistake: Revision 6623 was only supposed to check in the...
authorcheshire@apple.com <cheshire@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Fri, 28 Aug 2009 19:23:34 +0000 (19:23 +0000)
committercheshire@apple.com <cheshire@apple.com@214c2c4a-bf3b-4dcf-9390-e4dd3010487d>
Fri, 28 Aug 2009 19:23:34 +0000 (19:23 +0000)
git-svn-id: http://svn.macosforge.org/repository/mdnsresponder/trunk@6634 214c2c4a-bf3b-4dcf-9390-e4dd3010487d

Clients/dns-sd.c
mDNSCore/mDNSDebug.h
mDNSCore/mDNSEmbeddedAPI.h
mDNSMacOSX/mDNSMacOSX.c
mDNSMacOSX/mDNSResponder.xcodeproj/project.pbxproj

index a58cb00..8995eb0 100644 (file)
@@ -68,7 +68,7 @@ cl dns-sd.c -I../mDNSShared -DNOT_HAVE_GETOPT ws2_32.lib ..\mDNSWindows\DLL\Rele
 // This also useful to work around link errors when you're working on an older version of Mac OS X,
 // and trying to build a newer version of the "dns-sd" command which uses new API entry points that
 // aren't in the system's /usr/lib/libSystem.dylib.
-// #define TEST_NEW_CLIENTSTUB 1
+//#define TEST_NEW_CLIENTSTUB 1
 
 #include <ctype.h>
 #include <stdio.h>                     // For stdout, stderr
@@ -143,14 +143,13 @@ cl dns-sd.c -I../mDNSShared -DNOT_HAVE_GETOPT ws2_32.lib ..\mDNSWindows\DLL\Rele
 
                return name;
                }
-
-       static size_t _sa_len(const struct sockaddr *addr)
-               {
-               if (addr->sa_family == AF_INET) return (sizeof(struct sockaddr_in));
-               else if (addr->sa_family == AF_INET6) return (sizeof(struct sockaddr_in6));
-               else return (sizeof(struct sockaddr));
-               }
-
+\r
+       static size_t _sa_len(const struct sockaddr *addr)\r
+               {\r
+               if (addr->sa_family == AF_INET) return (sizeof(struct sockaddr_in));\r
+               else if (addr->sa_family == AF_INET6) return (sizeof(struct sockaddr_in6));\r
+               else return (sizeof(struct sockaddr));\r
+               }\r
 #   define SA_LEN(addr) (_sa_len(addr))
 
 #else
@@ -170,6 +169,7 @@ cl dns-sd.c -I../mDNSShared -DNOT_HAVE_GETOPT ws2_32.lib ..\mDNSWindows\DLL\Rele
 #endif
 
 #include "dns_sd.h"
+
 #include "ClientCommon.h"
 
 #if TEST_NEW_CLIENTSTUB
@@ -616,7 +616,6 @@ static void DNSSD_API reg_reply(DNSServiceRef sdref, const DNSServiceFlags flags
                printf("Error %d\n", errorCode);
 
        if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout);
-       //usleep(260000); stopNow = 1;  // Allow 250ms for service to announce PTR record, then exit
        }
 
 // Output the wire-format domainname pointed to by rd
@@ -940,10 +939,6 @@ static char *gettype(char *buffer, char *typ)
        return(typ);
        }
 
-typedef struct { char i; void *ptr; } atest;
-
-atest *atestp = NULL;
-
 int main(int argc, char **argv)
        {
        DNSServiceErrorType err;
@@ -965,10 +960,6 @@ int main(int argc, char **argv)
        if (sizeof(argv) == 8) printf("Running in 64-bit mode\n");
 #endif
 
-       printf("CMSG_DATA %d\n", (int)CMSG_DATA(0));
-       printf("atestp->ptr %d\n", (int)&atestp->ptr);
-       printf("ALIGN(1) %d\n", (int)ALIGN(1));
-
        // Test code for TXTRecord functions
        //TXTRecordRef txtRecord;
        //TXTRecordCreate(&txtRecord, 0, NULL);
@@ -1072,8 +1063,7 @@ int main(int argc, char **argv)
                                        if (argc < opi+1) goto Fail;
                                        rrtype = (argc <= opi+1) ? kDNSServiceType_A  : GetRRType(argv[opi+1]);
                                        rrclass = (argc <= opi+2) ? kDNSServiceClass_IN : atoi(argv[opi+2]);
-                                       //if (rrtype == kDNSServiceType_TXT || rrtype == kDNSServiceType_PTR) flags |= kDNSServiceFlagsLongLivedQuery;
-                                       printf("Query %s %d %d not using kDNSServiceFlagsLongLivedQuery\n", argv[opi+0], rrtype, rrclass);
+                                       if (rrtype == kDNSServiceType_TXT || rrtype == kDNSServiceType_PTR) flags |= kDNSServiceFlagsLongLivedQuery;
                                        err = DNSServiceQueryRecord(&client, flags, opinterface, argv[opi+0], rrtype, rrclass, qr_reply, NULL);
                                        break;
                                        }
@@ -1199,7 +1189,6 @@ int main(int argc, char **argv)
        // Be sure to deallocate the DNSServiceRef when you're finished
        if (client   ) DNSServiceRefDeallocate(client   );
        if (client_pa) DNSServiceRefDeallocate(client_pa);
-       //usleep(150000);
        return 0;
 
 Fail:
index 8bfd982..4c8ada9 100755 (executable)
@@ -50,10 +50,10 @@ typedef enum
 
 // Set this symbol to 1 to do extra debug checks on malloc() and free()
 // Set this symbol to 2 to write a log message for every malloc() and free()
-#define MACOSX_MDNS_MALLOC_DEBUGGING 1
+//#define MACOSX_MDNS_MALLOC_DEBUGGING 1
 
-#define ForceAlerts 1
-#define LogTimeStamps 1
+//#define ForceAlerts 1
+//#define LogTimeStamps 1
 
 #define USE_SEPARATE_UDNS_SERVICE_LIST 1
 
index 3ac93f3..ebe6b28 100755 (executable)
@@ -1799,7 +1799,7 @@ extern const mDNSOpaque64 zeroOpaque64;
 
 #define localdomain           (*(const domainname *)"\x5" "local")
 #define DeviceInfoName        (*(const domainname *)"\xC" "_device-info" "\x4" "_tcp")
-#define SleepProxyServiceType (*(const domainname *)"\xC" "_xleep-proxy" "\x4" "_udp")
+#define SleepProxyServiceType (*(const domainname *)"\xC" "_sleep-proxy" "\x4" "_udp")
 
 // ***************************************************************************
 #if 0
index 6ef2af1..d4420d5 100644 (file)
 // If OfferSleepProxyService is set non-zero (typically via command-line switch),
 // then we'll offer sleep proxy service on desktop Macs that are set to never sleep.
 // We currently do not offer sleep proxy service on laptops, or on machines that are set to go to sleep.
-mDNSexport int OfferSleepProxyService = 95;
+mDNSexport int OfferSleepProxyService = 0;
 
 mDNSexport int OSXVers;
 mDNSexport int KQueueFD;
@@ -2617,6 +2617,7 @@ mDNSexport void AutoTunnelCallback(mDNS *const m, DNSQuestion *question, const R
                }
        else if (question->qtype == kDNSType_A)
                {
+               ClientTunnel *old = mDNSNULL;
                LogInfo("AutoTunnelCallback: SRV target addr %.4a", &answer->rdata->u.ipv4);
                question->ThisQInterval = -1;           // So we know this tunnel setup has completed
                tun->rmt_outer = answer->rdata->u.ipv4;
@@ -2635,9 +2636,9 @@ mDNSexport void AutoTunnelCallback(mDNS *const m, DNSQuestion *question, const R
                        if (!mDNSSameClientTunnel(&(*p)->rmt_inner, &tun->rmt_inner)) p = &(*p)->next;
                        else
                                {
-                               ClientTunnel *old = *p;
-                               *p = old->next;
                                LogInfo("Found existing AutoTunnel for %##s %.16a", tun->dstname.c, &tun->rmt_inner);
+                               old = *p;
+                               *p = old->next;
                                if (old->q.ThisQInterval >= 0) mDNS_StopQuery(m, &old->q);
                                else if (!mDNSSameIPv6Address(old->loc_inner, tun->loc_inner) ||
                                                 !mDNSSameIPv4Address(old->loc_outer, tun->loc_outer) ||
index 471270e..193dfa6 100644 (file)
                08FB7793FE84155DC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = D284BE2B0ADD78180027CCDF /* Build configuration list for PBXProject "mDNSResponder" */;
+                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        mainGroup = 08FB7794FE84155DC02AAC07 /* mDNSResponder */;
                        projectDirPath = "";
                D284BE2C0ADD78180027CCDF /* Development */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               ARCHS = (
-                                       ppc,
-                                       i386,
-                               );
                                CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
                                DEAD_CODE_STRIPPING = YES;
                                GCC_PREPROCESSOR_DEFINITIONS = (
                                GCC_ENABLE_FIX_AND_CONTINUE = NO;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
                                INSTALL_PATH = "/Library/Application Support/Bonjour";
-                               MACOSX_DEPLOYMENT_TARGET = 10.4;
+                               MACOSX_DEPLOYMENT_TARGET = "";
                                OTHER_CFLAGS = "";
                                OTHER_LDFLAGS = "";
                                OTHER_REZFLAGS = "";
                                GCC_SYMBOLS_PRIVATE_EXTERN = NO;
                                INFOPLIST_FILE = "PreferencePane/Info-PreferencePane.plist";
                                INSTALL_PATH = /AppleInternal/Library/PreferencePanes;
-                               MACOSX_DEPLOYMENT_TARGET = 10.4;
+                               MACOSX_DEPLOYMENT_TARGET = "";
                                OTHER_CFLAGS = "";
                                OTHER_LDFLAGS = "-twolevel_namespace";
                                OTHER_REZFLAGS = "";