Skip to content

Commit 09c548d

Browse files
celcel
authored andcommitted
Merge PRs #1, #2, jhs#3
Fix %pXbUQg/kZJGH13GaxApbVcAwf5iYgeZ6AglQH8FPjt8=.sha256 jhs#5 is not completely correct or necessary so is not merged.
4 parents fc1c0f3 + 5466b8b + bcc16d9 + a77ad84 commit 09c548d

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

convenient.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
require('defaultable')(module,
66
{ 'convenient' : true
7-
, 'ttl' : 3600
7+
, 'ttl' : 10
88
}, function(module, exports, DEFS, require) {
99

1010
function noop() {}
@@ -85,12 +85,6 @@ function final_response(res, value) {
8585

8686
function well_formed_record(record) {
8787
record.class = record.class || 'IN'
88-
89-
var zone_minimum = DEFS.ttl
90-
if(soa_record)
91-
zone_minimum = soa_record.data.ttl
92-
93-
record.ttl = Math.max(record.ttl || 0, zone_minimum)
9488
}
9589
}
9690

encode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ State.prototype.encode = function(full_domain, position_offset, option) {
217217
, bytes
218218

219219
var i = 0
220-
var max_iterations = 40 // Enough for 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa
220+
var max_iterations = 127 // Theoretical upper limit for number of labels in a DNS name; see https://en.wikipedia.org/wiki/Subdomain#Overview
221221

222222
while(++i < max_iterations) {
223223
if(domain == '') {

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Response.prototype.end = function(value) {
221221
var self = this
222222

223223
var msg = convenient.final_response(self, value)
224-
, data = msg.toBinary()
224+
, data = msg ? msg.toBinary() : self.toBinary()
225225

226226
if(udp4Or6(self.connection.type)&& data.length > 512)
227227
return self.emit('error', 'UDP responses greater than 512 bytes not yet implemented')

0 commit comments

Comments
 (0)