| @@ -542,27 +542,27 @@ static DNSServiceErrorType ConnectToServ | | | @@ -542,27 +542,27 @@ static DNSServiceErrorType ConnectToServ |
542 | *p = sdr; | | 542 | *p = sdr; |
543 | // Preincrement counter before we use it -- it helps with debugging if we know the all-zeroes ID should never appear | | 543 | // Preincrement counter before we use it -- it helps with debugging if we know the all-zeroes ID should never appear |
544 | if (++(*ref)->uid.u32[0] == 0) | | 544 | if (++(*ref)->uid.u32[0] == 0) |
545 | ++(*ref)->uid.u32[1]; // In parent DNSServiceOp increment UID counter | | 545 | ++(*ref)->uid.u32[1]; // In parent DNSServiceOp increment UID counter |
546 | sdr->primary = *ref; // Set our primary pointer | | 546 | sdr->primary = *ref; // Set our primary pointer |
547 | sdr->sockfd = (*ref)->sockfd; // Inherit primary's socket | | 547 | sdr->sockfd = (*ref)->sockfd; // Inherit primary's socket |
548 | sdr->validator = (*ref)->validator; | | 548 | sdr->validator = (*ref)->validator; |
549 | sdr->uid = (*ref)->uid; | | 549 | sdr->uid = (*ref)->uid; |
550 | //printf("ConnectToServer sharing socket %d\n", sdr->sockfd); | | 550 | //printf("ConnectToServer sharing socket %d\n", sdr->sockfd); |
551 | } | | 551 | } |
552 | else | | 552 | else |
553 | { | | 553 | { |
554 | #ifdef SO_NOSIGPIPE | | 554 | #ifdef SO_NOSIGPIPE |
555 | const unsigned long optval = 1; | | 555 | const unsigned int optval = 1; |
556 | #endif | | 556 | #endif |
557 | #ifndef USE_TCP_LOOPBACK | | 557 | #ifndef USE_TCP_LOOPBACK |
558 | char* uds_serverpath = getenv(MDNS_UDS_SERVERPATH_ENVVAR); | | 558 | char* uds_serverpath = getenv(MDNS_UDS_SERVERPATH_ENVVAR); |
559 | if (uds_serverpath == NULL) | | 559 | if (uds_serverpath == NULL) |
560 | uds_serverpath = MDNS_UDS_SERVERPATH; | | 560 | uds_serverpath = MDNS_UDS_SERVERPATH; |
561 | else if (strlen(uds_serverpath) >= MAX_CTLPATH) | | 561 | else if (strlen(uds_serverpath) >= MAX_CTLPATH) |
562 | { | | 562 | { |
563 | uds_serverpath = MDNS_UDS_SERVERPATH; | | 563 | uds_serverpath = MDNS_UDS_SERVERPATH; |
564 | syslog(LOG_WARNING, "dnssd_clientstub ConnectToServer: using default path since env len is invalid"); | | 564 | syslog(LOG_WARNING, "dnssd_clientstub ConnectToServer: using default path since env len is invalid"); |
565 | } | | 565 | } |
566 | #endif | | 566 | #endif |
567 | *ref = NULL; | | 567 | *ref = NULL; |
568 | sdr->sockfd = socket(AF_DNSSD, SOCK_STREAM, 0); | | 568 | sdr->sockfd = socket(AF_DNSSD, SOCK_STREAM, 0); |