1 commit 77838efb0748689ee77007a92d9a01e03e6dbdb7
2 Author: Stephan Bergmann <sbergman@redhat.com>
3 AuthorDate: Fri Nov 27 22:40:23 2015 +0100
4 Commit: Stephan Bergmann <sbergman@redhat.com>
5 CommitDate: Sat Nov 28 14:00:07 2015 +0100
7 Use proper return type for DNSServiceRefSockFD
9 ...which is e.g. unsigned long long for Windows 64-bit (and declaring the
10 function in dns_sd.h is not necessary, and the dnssd_sock_t typedef is not known
13 Change-Id: Iaa0eb03a83b76200204ba905313bcc27b5007b39
15 diff --git a/mDNSShared/dns_sd.h b/mDNSShared/dns_sd.h
16 index 31daaeb..faaa741 100644
17 --- a/mDNSShared/dns_sd.h
18 +++ b/mDNSShared/dns_sd.h
19 @@ -741,35 +741,6 @@ DNSServiceErrorType DNSSD_API DNSServiceGetProperty
21 *********************************************************************************************/
23 -/* DNSServiceRefSockFD()
25 - * Access underlying Unix domain socket for an initialized DNSServiceRef.
26 - * The DNS Service Discovery implementation uses this socket to communicate between the client and
27 - * the daemon. The application MUST NOT directly read from or write to this socket.
28 - * Access to the socket is provided so that it can be used as a kqueue event source, a CFRunLoop
29 - * event source, in a select() loop, etc. When the underlying event management subsystem (kqueue/
30 - * select/CFRunLoop etc.) indicates to the client that data is available for reading on the
31 - * socket, the client should call DNSServiceProcessResult(), which will extract the daemon's
32 - * reply from the socket, and pass it to the appropriate application callback. By using a run
33 - * loop or select(), results from the daemon can be processed asynchronously. Alternatively,
34 - * a client can choose to fork a thread and have it loop calling "DNSServiceProcessResult(ref);"
35 - * If DNSServiceProcessResult() is called when no data is available for reading on the socket, it
36 - * will block until data does become available, and then process the data and return to the caller.
37 - * The application is reponsible for checking the return value of DNSServiceProcessResult() to determine
38 - * if the socket is valid and if it should continue to process data on the socket.
39 - * When data arrives on the socket, the client is responsible for calling DNSServiceProcessResult(ref)
40 - * in a timely fashion -- if the client allows a large backlog of data to build up the daemon
41 - * may terminate the connection.
43 - * sdRef: A DNSServiceRef initialized by any of the DNSService calls.
45 - * return value: The DNSServiceRef's underlying socket descriptor, or -1 on
49 -int DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdRef);
52 /* DNSServiceProcessResult()
54 * Read a reply from the daemon, calling the appropriate application callback. This call will
55 diff --git a/mDNSShared/dnssd_clientstub.c b/mDNSShared/dnssd_clientstub.c
56 index c38197c..c6b50a2 100644
57 --- a/mDNSShared/dnssd_clientstub.c
58 +++ b/mDNSShared/dnssd_clientstub.c
59 @@ -799,7 +799,7 @@ cleanup:
63 -int DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdRef)
64 +dnssd_sock_t DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdRef)
66 if (!sdRef) { syslog(LOG_WARNING, "dnssd_clientstub DNSServiceRefSockFD called with NULL DNSServiceRef"); return dnssd_InvalidSocket; }
68 @@ -816,7 +816,7 @@ int DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdRef)
69 return dnssd_InvalidSocket;
72 - return (int) sdRef->sockfd;
73 + return sdRef->sockfd;
76 #if _DNS_SD_LIBDISPATCH
77 @@ -2025,7 +2025,7 @@ DNSServiceErrorType DNSSD_API DNSServiceSetDispatchQueue
78 dispatch_queue_t queue
81 - int dnssd_fd = DNSServiceRefSockFD(service);
82 + dnssd_sock_t dnssd_fd = DNSServiceRefSockFD(service);
83 if (dnssd_fd == dnssd_InvalidSocket) return kDNSServiceErr_BadParam;