diff options
author | Calle Dybedahl <calle@init.se> | 2015-03-26 15:04:31 +0100 |
---|---|---|
committer | Calle Dybedahl <calle@init.se> | 2015-03-26 15:04:31 +0100 |
commit | 08036930f85370f16f104fb25524b318dc3042bb (patch) | |
tree | 445d4d38dfcc138e39129c619f6530f89383207f /src | |
parent | d8ec518fa77426aef2c24ab05fe3b2faf232893b (diff) |
Remove checks that did more harm than good (SvOK does not process get magic).
Diffstat (limited to 'src')
-rw-r--r-- | src/LDNS.xs | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/LDNS.xs b/src/LDNS.xs index 4dabe65..d59f0d4 100644 --- a/src/LDNS.xs +++ b/src/LDNS.xs @@ -137,10 +137,6 @@ new(class, ...) ldns_status s; ldns_rdf *addr; - if ( !SvOK(ST(i)) || !SvPOK(ST(i)) ) { - continue; /* Skip non-strings */ - } - addr = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_A, SvPV_nolen(ST(i))); if ( addr == NULL) { addr = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_AAAA, SvPV_nolen(ST(i))); @@ -901,22 +897,19 @@ packet_answerfrom(obj,...) CODE: if(items >= 2) { - if(SvOK(ST(1)) && SvPOK(ST(1))) - { - ldns_rdf *address; + ldns_rdf *address; - address = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_A, SvPV_nolen(ST(1))); - if(address == NULL) - { - address = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_AAAA, SvPV_nolen(ST(1))); - } - if(address == NULL) - { - croak("Failed to parse IP address: %s", SvPV_nolen(ST(1))); - } + address = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_A, SvPV_nolen(ST(1))); + if(address == NULL) + { + address = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_AAAA, SvPV_nolen(ST(1))); + } + if(address == NULL) + { + croak("Failed to parse IP address: %s", SvPV_nolen(ST(1))); + } - ldns_pkt_set_answerfrom(obj, address); - } + ldns_pkt_set_answerfrom(obj, address); } RETVAL = ldns_rdf2str(ldns_pkt_answerfrom(obj)); OUTPUT: |