Comments (6)
This seems to work
if query_type == _lib.T_A:
host = _ffi.new("struct hostent **")
addrttls = _ffi.new("struct ares_addrttl[]", PYCARES_ADDRTTL_SIZE)
naddrttls = _ffi.new("int*", PYCARES_ADDRTTL_SIZE)
parse_status = _lib.ares_parse_a_reply(abuf, alen, host, addrttls, naddrttls)
if parse_status != _lib.ARES_SUCCESS:
result = None
status = parse_status
else:
if host[0].h_aliases[0] != _ffi.NULL:
result = ares_query_cname_result(host[0])
_lib.ares_free_hostent(host[0])
else:
result = [ares_query_a_result(addrttls[i]) for i in range(naddrttls[0])]
status = None
from pycares.
Nice! Is there a publicly available record we can use to test? If so, mind making a PR?
from pycares.
Well I guess we'd have to update this https://github.com/saghul/pycares/blob/master/tests/tests.py#L186 but I'm not exactly sure how we are supposed to build the response for each case?
from pycares.
Right. Up until this point I've used publicly available records instead of synthetic ones.
from pycares.
I'm not sure how we should go about generating the synthetic one, perhaps creating a fake server ?
from pycares.
Not sure, I suppose it might be tricky to test on Windows, that's why I relied on existing DNS records, though this is not ideal.
from pycares.
Related Issues (20)
- HELP: looking for new maintainers HOT 8
- Add aarch64 wheel HOT 1
- Pycares requires gcc 4.2? HOT 1
- python tests/tests.py fail when test [email protected] HOT 5
- 4.0.0 Q: how to build pycares against system installed c-ares ? HOT 2
- deps/c-ares/src/lib/ares__close_sockets.c: No such file or directory HOT 3
- gethostbyname() does not appear to work with lookups="f"
- python3 setup.py build failed in [email protected] on centos8_aarch64 HOT 2
- pytest failed in [email protected] on centos8_aarch64 HOT 1
- Error FileNotFound when installing pycares==4.1.1 HOT 8
- 4.1.2: pytest is failing HOT 5
- `pycares.reverse_address` Import Error HOT 2
- Security vulnerability HOT 2
- 4.2.0: sphinx warnings `reference target not found` HOT 2
- 3.11 wheels HOT 2
- Can't build from sources on EL8 HOT 3
- 4.2.2: pytest is failing in two units HOT 8
- Fail to install on centos docker HOT 4
- 4.3.0: pytest is failing in `tests/test_all.py::DNSTest::test_custom_resolvconf` unit HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycares.