AmendHub

Download:

jcs

/

subtext

/

amendments

/

488

dnr: Don't require a pointer to a pointer for DNSResolveName

Also provide a default yielder if none provided

jcs made amendment 488 about 1 year ago
--- dnr.c Wed Apr 19 09:12:18 2023 +++ dnr.c Sat Apr 22 16:16:18 2023 @@ -309,7 +309,7 @@ MXInfo(char *hostName, struct returnRec *returnRecPtr, #endif OSErr -DNSResolveName(char **name, unsigned long *ipAddress, void (*yielder)(void)) +DNSResolveName(char *name, unsigned long *ipAddress, void (*yielder)(void)) { OSErr osErr; struct hostInfo aHostInfo; @@ -319,14 +319,16 @@ DNSResolveName(char **name, unsigned long *ipAddress, if (osErr) return osErr; - osErr = StrToAddr(*name, &aHostInfo, (ResultProcPtr)StrToAddrMarkDone, + osErr = StrToAddr(name, &aHostInfo, (ResultProcPtr)StrToAddrMarkDone, (char *)&done); if (osErr == cacheFault) { /* StrToAddrMarkDone will set done when DNS resolution finishes */ while (!done) { - if (yielder != NULL) + if (yielder) yielder(); + else + SystemTask(); } } --- tcp.h Wed Mar 8 10:07:09 2023 +++ tcp.h Sat Apr 22 16:15:40 2023 @@ -59,7 +59,7 @@ OSErr _UDPSend(UDPiopb *pb, StreamPtr stream, wdsEntry OSErr _UDPRelease(UDPiopb *pb, StreamPtr stream, Ptr userData, UDPIOCompletionProc ioCompletion, Boolean async); -OSErr DNSResolveName(char **name, unsigned long *ipAddress, +OSErr DNSResolveName(char *name, unsigned long *ipAddress, void (*yielder)(void)); pascal void StrToAddrMarkDone(struct hostInfo *hi, char *data);