only add compression pointer length once
This commit is contained in:
		
							parent
							
								
									8148e25d18
								
							
						
					
					
						commit
						7f673f6fbf
					
				| @ -106,9 +106,6 @@ pdns.unpack = function (ab) { | ||||
|     q.className = classes[q.class]; | ||||
|     q.typeName = types[q.type]; | ||||
| 
 | ||||
|     // console.log('*********************');
 | ||||
|     // console.log(q.typeName);
 | ||||
| 
 | ||||
|     return q; | ||||
|   } | ||||
| 
 | ||||
| @ -129,7 +126,7 @@ pdns.unpack = function (ab) { | ||||
|     //, rdata: 0
 | ||||
|     , rdlength: 0 | ||||
|     }); | ||||
|     //console.log('unpackAnswer QNAME:');
 | ||||
|     //console.log('unpackAnswer [Q]NAME:');
 | ||||
|     //console.log(q);
 | ||||
|     total += q.byteLength; | ||||
|     q.className = classes[q.class]; | ||||
| @ -171,6 +168,7 @@ pdns.unpack = function (ab) { | ||||
| 
 | ||||
|     total += q.rdlength; | ||||
|     q.byteLength = total - ototal; | ||||
| 
 | ||||
|     return q; | ||||
|   } | ||||
| 
 | ||||
|  | ||||
| @ -34,8 +34,10 @@ exports.DNS_UNPACK_LABELS = function (ui8, ptr, q) { | ||||
| 
 | ||||
|       // we're not coming back!
 | ||||
|       ptr = cpptr; | ||||
|       if (!q.cpcount) { | ||||
|         q.byteLength += 2; // cp and len
 | ||||
|       } | ||||
|       q.cpcount += 1; | ||||
|       q.byteLength += 2; // cp and len
 | ||||
| 
 | ||||
|       // recursion
 | ||||
|       return exports.DNS_UNPACK_LABELS(ui8, ptr, q); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user