<rdar://problem/4141221> Use a case insensitive compare operation to check whether a printer with the same name has already been installed.
Revision 1.33 2005/07/11 20:17:15 shersche
-<rdar://4124524> UI fixes associated with CUPS printer workaround fix.
+<rdar://problem/4124524> UI fixes associated with CUPS printer workaround fix.
Revision 1.32 2005/07/07 17:53:20 shersche
Fix problems associated with the CUPS printer workaround fix.
<rdar://problem/4124524> UI fixes for CUPS workaround
Revision 1.17 2005/07/11 20:17:15 shersche
-<rdar://4124524> UI fixes associated with CUPS printer workaround fix.
+<rdar://problem/4124524> UI fixes associated with CUPS printer workaround fix.
Revision 1.16 2005/07/07 17:53:20 shersche
Fix problems associated with the CUPS printer workaround fix.
<rdar://problem/4190104> Use "application/octet-stream" to determine if CUPS shared queue supports raw
Revision 1.26 2005/07/11 20:17:15 shersche
-<rdar://4124524> UI fixes associated with CUPS printer workaround fix.
+<rdar://problem/4124524> UI fixes associated with CUPS printer workaround fix.
Revision 1.25 2005/07/07 17:53:20 shersche
Fix problems associated with the CUPS printer workaround fix.
include /Developer/Makefiles/pb_makefiles/platform.make
-MVERS = "mDNSResponder-108"
+MVERS = "mDNSResponder-108.2"
install:
cd "$(SRCROOT)/mDNSMacOSX"; xcodebuild install OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS)
Change History (most recent first):
$Log: SamplemDNSClient.c,v $
+Revision 1.47 2006/01/10 02:29:22 cheshire
+<rdar://problem/4403861> Cosmetic IPv6 address display problem in mDNS test tool
+
Revision 1.46 2004/11/02 01:32:34 cheshire
<rdar://problem/3861705> Update code so it still compiles when DNSServiceDiscovery.h is deprecated
else if (address->sa_family == AF_INET6)
{
struct sockaddr_in6 *ip6 = (struct sockaddr_in6 *)address;
- u_int16_t *w = ip6->sin6_addr.__u6_addr.__u6_addr16;
+ u_int8_t *b = ip6->sin6_addr.__u6_addr.__u6_addr8;
union { uint16_t s; u_char b[2]; } port = { ip6->sin6_port };
uint16_t PortAsNumber = ((uint16_t)port.b[0]) << 8 | port.b[1];
char ipstring[40];
char ifname[IF_NAMESIZE + 1] = "";
- sprintf(ipstring, "%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X", w[0], w[1], w[2], w[3], w[4], w[5], w[6], w[7]);
+ sprintf(ipstring, "%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X",
+ b[0x0], b[0x1], b[0x2], b[0x3], b[0x4], b[0x5], b[0x6], b[0x7],
+ b[0x8], b[0x9], b[0xA], b[0xB], b[0xC], b[0xD], b[0xE], b[0xF]);
if (ip6->sin6_scope_id) { ifname[0] = '%'; if_indextoname(ip6->sin6_scope_id, &ifname[1]); }
printf("%s%s:%u", ipstring, ifname, PortAsNumber);
}
JAVA_ARCHIVE_COMPRESSION = YES;
JAVA_ARCHIVE_TYPE = JAR;
JAVA_COMPILER_DEBUGGING_SYMBOLS = NO;
- JAVA_COMPILER_TARGET_VM_VERSION = 1.2;
+ JAVA_COMPILER_SOURCE_VERSION = 1.4;
+ JAVA_COMPILER_TARGET_VM_VERSION = 1.4;
JAVA_SOURCE_SUBDIR = .;
LIBRARY_STYLE = STATIC;
MACOSX_DEPLOYMENT_TARGET = 10.2;
PURE_JAVA = YES;
REZ_EXECUTABLE = YES;
SECTORDER_FLAGS = "";
+ STRIPFLAGS = "-S";
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
};
comments = "Multiplatform .jar file that implements Java interface to DNS-SD";
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ -d ${OBJROOT}/mDNSResponder.build/${CONFIGURATION} ]; then BUILD_DIR=${OBJROOT}/mDNSResponder.build/${CONFIGURATION}; else BUILD_DIR=${OBJROOT}/mDNSResponder.build; fi\njavah -force -classpath ${BUILD_DIR}/dns_sd.jar.build/JavaClasses/ -o ${BUILD_DIR}/dns_sd.jar.build/DNSSD.java.h com.apple.dnssd.AppleDNSSD com.apple.dnssd.AppleBrowser com.apple.dnssd.AppleResolver com.apple.dnssd.AppleRegistration com.apple.dnssd.AppleQuery com.apple.dnssd.AppleDomainEnum com.apple.dnssd.AppleService";
+ shellScript = "if [ -d ${OBJROOT}/mDNSResponder.build/${CONFIGURATION} ]; then BUILD_DIR=${OBJROOT}/mDNSResponder.build/${CONFIGURATION}; else BUILD_DIR=${OBJROOT}/mDNSResponder.build; fi\njavah -force -J-Xbootclasspath/p:${BUILD_DIR}/dns_sd.jar.build/JavaClasses -o ${BUILD_DIR}/dns_sd.jar.build/DNSSD.java.h com.apple.dnssd.AppleDNSSD com.apple.dnssd.AppleBrowser com.apple.dnssd.AppleResolver com.apple.dnssd.AppleRegistration com.apple.dnssd.AppleQuery com.apple.dnssd.AppleDomainEnum com.apple.dnssd.AppleService";
};
DB2CC4560662DE4500335AB3 = {
fileRef = DB2CC4430662DD1100335AB3;
PRODUCT_NAME = libjdns_sd.jnilib;
REZ_EXECUTABLE = YES;
SECTORDER_FLAGS = "";
+ STRIPFLAGS = "-S";
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
};
comments = "Platform-specific JNI library that bridges dns_sd.jar to <dns_sd.h>.";
PREBINDING = NO;
PRODUCT_NAME = Bonjour;
SECTORDER_FLAGS = "";
+ STRIPFLAGS = "-S";
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
WRAPPER_EXTENSION = prefPane;
};
PRODUCT_NAME = ddnswriteconfig;
REZ_EXECUTABLE = YES;
SECTORDER_FLAGS = "";
+ STRIPFLAGS = "-S";
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
};
dependencies = (
Change History (most recent first):
$Log: DNSSD.java,v $
+Revision 1.9 2005/10/26 01:52:24 cheshire
+<rdar://problem/4316286> Race condition in Java code (doesn't work at all on Linux)
+
Revision 1.8 2005/07/11 01:55:21 cheshire
<rdar://problem/4175511> Race condition in Java API
public void stop() { this.HaltOperation(); }
- /* Block for timeout ms (or forever if -1). Returns 1 if data present, 0 if timed out, -1 if not browsing. */
- protected native int BlockForData( int msTimeout);
+ /* Block until data arrives, or one second passes. Returns 1 if data present, 0 otherwise. */
+ protected native int BlockForData();
/* Call ProcessResults when data appears on socket descriptor. */
protected native int ProcessResults();
{
while ( true )
{
- // We have to be very careful here. Suppose our DNS-SD operation is stopped from some other thread,
+ // Note: We want to allow our DNS-SD operation to be stopped from other threads, so we have to
+ // block waiting for data *outside* the synchronized section. Because we're doing this unsynchronized
+ // we have to write some careful code. Suppose our DNS-SD operation is stopped from some other thread,
// and then immediately afterwards that thread (or some third, unrelated thread) starts a new DNS-SD
// operation. The Unix kernel always allocates the lowest available file descriptor to a new socket,
// so the same file descriptor is highly likely to be reused for the new operation, and if our old
// locking DOESN'T prevent the callback routine from stopping its own operation, but DOES prevent
// any other thread from stopping it until after the callback has completed and returned to us here.
- int result = BlockForData(-1);
- if (result != 1) break; // If socket has been closed, time to terminate this thread
+ int result = BlockForData();
synchronized (this)
{
if (fNativeContext == 0) break; // Some other thread stopped our DNSSD operation; time to terminate this thread
+ if (result == 0) continue; // If BlockForData() said there was no data, go back and block again
result = ProcessResults();
if (fNativeContext == 0) break; // Event listener stopped its own DNSSD operation; terminate this thread
if (result != 0) { fListener.operationFailed(this, result); break; } // If error, notify listener
Change History (most recent first):
$Log: DNSSDException.java,v $
+Revision 1.3 2005/07/10 22:19:01 cheshire
+Add missing error codes to list of public static final ints
+
Revision 1.2 2004/04/30 21:48:27 rpantos
Change line endings for CVS.
public static final int BAD_FLAGS = -65543;
public static final int UNSUPPORTED = -65544;
public static final int NOT_INITIALIZED = -65545;
+ public static final int NO_CACHE = -65546;
public static final int ALREADY_REGISTERED = -65547;
public static final int NAME_CONFLICT = -65548;
public static final int INVALID = -65549;
+ public static final int FIREWALL = -65550;
public static final int INCOMPATIBLE = -65551;
public static final int BAD_INTERFACE_INDEX = -65552;
+ public static final int REFUSED = -65553;
+ public static final int NOSUCHRECORD = -65554;
+ public static final int NOAUTH = -65555;
+ public static final int NOSUCHKEY = -65556;
+ public static final int NATTRAVERSAL = -65557;
+ public static final int DOUBLENAT = -65558;
+ public static final int BADTIME = -65559;
+ public static final int BADSIG = -65560;
+ public static final int BADKEY = -65561;
+ public static final int TRANSIENT = -65562;
/** Returns the sub-code that identifies the particular error. */
abstract public int getErrorCode();
Change History (most recent first):
$Log: JNISupport.c,v $
+Revision 1.13 2005/10/26 01:52:24 cheshire
+<rdar://problem/4316286> Race condition in Java code (doesn't work at all on Linux)
+
Revision 1.12 2005/07/13 19:20:32 cheshire
<rdar://problem/4175511> Race condition in Java API
Additional cleanup suggested by Roger -- NewContext() doesn't need ownerClass parameter any more
}
-JNIEXPORT jint JNICALL Java_com_apple_dnssd_AppleService_BlockForData( JNIEnv *pEnv, jobject pThis, jint msTimeout)
-/* Block for timeout ms (or forever if -1). Returns 1 if data present, 0 if timed out, -1 if not browsing. */
+JNIEXPORT jint JNICALL Java_com_apple_dnssd_AppleService_BlockForData( JNIEnv *pEnv, jobject pThis)
+/* Block until data arrives, or one second passes. Returns 1 if data present, 0 otherwise. */
{
-#if AUTO_CALLBACKS
- return -1; // BlockForData() not supported with AUTO_CALLBACKS
-#else // AUTO_CALLBACKS
+// BlockForData() not supported with AUTO_CALLBACKS
+#if !AUTO_CALLBACKS
jclass cls = (*pEnv)->GetObjectClass( pEnv, pThis);
jfieldID contextField = (*pEnv)->GetFieldID( pEnv, cls, "fNativeContext", "I");
- jint rc = -1;
if ( contextField != 0)
{
{
fd_set readFDs;
int sd = DNSServiceRefSockFD( pContext->ServiceRef);
- struct timeval timeout = { msTimeout / 1000, 10 * (msTimeout % 1000) };
- struct timeval *pTimeout = msTimeout == -1 ? NULL : &timeout;
-
+ struct timeval timeout = { 1, 0 };
FD_ZERO( &readFDs);
FD_SET( sd, &readFDs);
- rc = select( sd + 1, &readFDs, (fd_set*) NULL, (fd_set*) NULL, pTimeout);
+ // Q: Why do we poll here?
+ // A: Because there's no other thread-safe way to do it.
+ // Mac OS X terminates a select() call if you close one of the sockets it's listening on, but Linux does not,
+ // and arguably Linux is correct (See <http://www.ussg.iu.edu/hypermail/linux/kernel/0405.1/0418.html>)
+ // The problem is that the Mac OS X behaviour assumes that it's okay for one thread to close a socket while
+ // some other thread is monitoring that socket in select(), but the difficulty is that there's no general way
+ // to make that thread-safe, because there's no atomic way to enter select() and release a lock simultaneously.
+ // If we try to do this without holding any lock, then right as we jump to the select() routine,
+ // some other thread could stop our operation (thereby closing the socket),
+ // and then that thread (or even some third, unrelated thread)
+ // could do some other DNS-SD operation (or some other operation that opens a new file descriptor)
+ // and then we'd blindly resume our fall into the select() call, now blocking on a file descriptor
+ // that may coincidentally have the same numerical value, but is semantically unrelated
+ // to the true file descriptor we thought we were blocking on.
+ // We can't stop this race condition from happening, but at least if we wake up once a second we can detect
+ // when fNativeContext has gone to zero, and thereby discover that we were blocking on the wrong fd.
+
+ if (select( sd + 1, &readFDs, (fd_set*) NULL, (fd_set*) NULL, &timeout) == 1) return(1);
}
}
-
- return rc;
-#endif // AUTO_CALLBACKS
+#endif // !AUTO_CALLBACKS
+ return(0);
}
.\" @APPLE_LICENSE_HEADER_END@
.\"
.\" $Log: dns-sd.1,v $
+.\" Revision 1.5 2005/07/04 23:12:35 cheshire
+.\" <rdar://problem/4103628> The dns-sd command first appeared in Mac OS X 10.4 (Tiger)
+.\"
.\" Revision 1.4 2005/02/16 02:29:32 cheshire
.\" Update terminology
.\"
.Sh HISTORY
The
.Nm
-command first appeared in Mac OS X 10.3 (Panther).
+command first appeared in Mac OS X 10.4 (Tiger).
<rdar://problem/3459141>: crash/hang in abort_client
Revision 1.24 2003/10/21 20:59:40 ksekar
-<rdar://problem/3335216>: handle blocked clients moreefficiently
+<rdar://problem/3335216>: handle blocked clients more efficiently
Revision 1.23 2003/09/23 02:12:43 cheshire
Also include port number in list of services registered via new UDS API
m_key += '.';
}
- // <rdar://problem/ >
+ // <rdar://problem/4192119>
//
// Prepend "$" to the key name, so that there will
// be no conflict between the zone name and the key
<rdar://problem/4192011> Save Wide-Area preferences in a different spot in the registry so they don't get removed when doing an update install.
Revision 1.36 2005/09/11 22:12:42 herscher
-<rdar://4247793> Remove dependency on WMI. Ensure that the Windows firewall is turned on before trying to configure it.
+<rdar://problem/4247793> Remove dependency on WMI. Ensure that the Windows firewall is turned on before trying to configure it.
Revision 1.35 2005/06/30 18:29:49 shersche
<rdar://problem/4090059> Don't overwrite the localized service description text