summaryrefslogtreecommitdiff
path: root/audio/libopendaap/patches/patch-aa
blob: 613df4eb72edbdd0963b04a4f9d6733435b76305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$NetBSD: patch-aa,v 1.1 2004/08/01 16:13:32 kristerw Exp $

--- mDNS/mDNS.c.orig	Sun Aug  1 18:03:05 2004
+++ mDNS/mDNS.c	Sun Aug  1 18:04:13 2004
@@ -5410,12 +5410,12 @@
 
 	for (i = 0; i < totalrecords && ptr && ptr < end; i++)
 		{
+		char buf[1000];
 		LargeCacheRecord pkt;
 		const mDNSu8 RecordType = (mDNSu8)((i < response->h.numAnswers) ? kDNSRecordTypePacketAns : kDNSRecordTypePacketAdd);
 		ptr = GetLargeResourceRecord(m, response, ptr, end, InterfaceID, RecordType, &pkt);
 		if (!ptr) break;		// Break out of the loop and clean up our CacheFlushRecords list before exiting
 
-                char buf[1000];
                 ConvertDomainNameToCString(&pkt.r.resrec.name, buf);
                 verbosedebugf("%s\n", buf);
 		// 1. Check that this packet resource record does not conflict with any of ours
@@ -5500,9 +5500,10 @@
 		// 2. See if we want to add this packet resource record to our cache
 		if (m->rrcache_size)	// Only try to cache answers if we have a cache to put them in
 			{
-                verbosedebugf("caching\n");
-			mDNSu32 slot = HashSlot(&pkt.r.resrec.name);
+			mDNSu32 slot;
 			CacheRecord *rr;
+                verbosedebugf("caching\n");
+			slot = HashSlot(&pkt.r.resrec.name);
 			// 2a. Check if this packet resource record is already in our cache
 			for (rr = m->rrcache_hash[slot]; rr; rr=rr->next)
 				{