Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1732186117, "reponame":"libwebsockets", "desc":"libwebsockets lightweight C networking library", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets", "f":3, "items": [ { "schema":"libjg2-1", "oid":{ "oid": "6328231f2aa628632344d96a58e25c3b194af506", "alias": [ "refs/heads/main"]},"tree": [ { "name": "README.async-dns.md","mode": "33188", "size":4396}, { "name": "README.build-android.md","mode": "33188", "size":2434}, { "name": "README.build-windows.md","mode": "33188", "size":6711}, { "name": "README.build.md","mode": "33188", "size":26826}, { "name": "README.captive-portal-detection.md","mode": "33188", "size":3677}, { "name": "README.cbor-cose.md","mode": "33188", "size":9805}, { "name": "README.cbor-lecp.md","mode": "33188", "size":12957}, { "name": "README.ci.md","mode": "33188", "size":911}, { "name": "README.cmake.md","mode": "33188", "size":2069}, { "name": "README.coding.md","mode": "33188", "size":53213}, { "name": "README.content-security-policy.md","mode": "33188", "size":5950}, { "name": "README.contributing.md","mode": "33188", "size":1144}, { "name": "README.crypto-apis.md","mode": "33188", "size":7884}, { "name": "README.ctest.md","mode": "33188", "size":16065}, { "name": "README.debugging.md","mode": "33188", "size":2310}, { "name": "README.display-list.md","mode": "33188", "size":5501}, { "name": "README.esp32.md","mode": "33188", "size":1917}, { "name": "README.event-libs.md","mode": "33188", "size":3325}, { "name": "README.event-loops-intro.md","mode": "33188", "size":13464}, { "name": "README.fault-injection.md","mode": "33188", "size":19941}, { "name": "README.h2-long-poll.md","mode": "33188", "size":1812}, { "name": "README.html-parser.md","mode": "33188", "size":16516}, { "name": "README.http-cache.md","mode": "33188", "size":1376}, { "name": "README.http-fallback.md","mode": "33188", "size":6663}, { "name": "README.http_parser.md","mode": "33188", "size":935}, { "name": "README.jit-trust.md","mode": "33188", "size":17627}, { "name": "README.jpeg-decoder.md","mode": "33188", "size":2992}, { "name": "README.json-lejp.md","mode": "33188", "size":5738}, { "name": "README.jwt.md","mode": "33188", "size":7305}, { "name": "README.libressl.md","mode": "33188", "size":2749}, { "name": "README.lifecycle.md","mode": "33188", "size":1650}, { "name": "README.logging.md","mode": "33188", "size":12285}, { "name": "README.lws_backtrace.md","mode": "33188", "size":7449}, { "name": "README.lws_cache.md","mode": "33188", "size":5489}, { "name": "README.lws_conmon.md","mode": "33188", "size":1467}, { "name": "README.lws_dll.md","mode": "33188", "size":3823}, { "name": "README.lws_fixed3232.md","mode": "33188", "size":2666}, { "name": "README.lws_map.md","mode": "33188", "size":3712}, { "name": "README.lws_metrics.md","mode": "33188", "size":11232}, { "name": "README.lws_ota.md","mode": "33188", "size":13090}, { "name": "README.lws_plugins.md","mode": "33188", "size":3368}, { "name": "README.lws_retry.md","mode": "33188", "size":3913}, { "name": "README.lws_struct.md","mode": "33188", "size":1554}, { "name": "README.lws_sul.md","mode": "33188", "size":4865}, { "name": "README.lws_system.md","mode": "33188", "size":8924}, { "name": "README.lwsws.md","mode": "33188", "size":25145}, { "name": "README.plugin-acme.md","mode": "33188", "size":6081}, { "name": "README.plugin-sshd-base.md","mode": "33188", "size":8128}, { "name": "README.png-decoder.md","mode": "33188", "size":2336}, { "name": "README.porting.md","mode": "33188", "size":2144}, { "name": "README.problems.md","mode": "33188", "size":3033}, { "name": "README.release-policy.md","mode": "33188", "size":5795}, { "name": "README.routing.md","mode": "33188", "size":2087}, { "name": "README.secure-streams.md","mode": "33188", "size":868}, { "name": "README.tcp_fastopen.md","mode": "33188", "size":895}, { "name": "README.test-apps.md","mode": "33188", "size":14872}, { "name": "README.tls-sessions.md","mode": "33188", "size":5256}, { "name": "README.udp.md","mode": "33188", "size":1789}, { "name": "README.unix-domain-reverse-proxy.md","mode": "33188", "size":4558}, { "name": "mainpage.md","mode": "33188", "size":1110}, { "name": "release-checklist","mode": "33188", "size":1100}],"s":{"c":1732046693,"u": 10008}} ,{"schema":"libjg2-1", "cid":"4ea72d82bff4f2b41ee332467b32b6ca", "oid":{ "oid": "6328231f2aa628632344d96a58e25c3b194af506", "alias": [ "refs/heads/main"]},"blobname": "READMEs/README.async-dns.md", "blob": "# Asynchronous DNS\n\n## Introduction\n\nLws now features optional asynchronous, ie, nonblocking recursive DNS\nresolution done on the event loop, enable `-DLWS_WITH_SYS_ASYNC_DNS\u003d1`\nat cmake to build it in.\n\n## Description\n\nThe default libc name resolution is via libc `getaddrinfo()`, which is\nblocking, possibly for quite long periods (seconds). If you are\ntaking care about latency, but want to create outgoing connections,\nyou can't tolerate this exception from the rule that everything in\nlws is nonblocking.\n\nLws' asynchronous DNS resolver creates a caching name resolver\nthat directly queries the configured nameserver itself over UDP,\nfrom the event loop.\n\nIt supports both ipv4 / A records and ipv6 / AAAA records (see later\nfor a description about how). One server supported over UDP :53,\nand the nameserver is autodicovered on linux, windows, and freertos.\n \nOther features\n\n - lws-style paranoid response parsing\n - random unique tid generation to increase difficulty of poisoning\n - it's really integrated with the lws event loop, it does not spawn\n threads or use the libc resolver, and of course no blocking at all\n - platform-specific server address capturing (from /etc/resolv.conf\n on linux, windows apis on windows)\n - LRU caching\n - piggybacking (multiple requests before the first completes go on\n a list on the first request, not spawn multiple requests)\n - observes TTL in cache\n - TTL and timeout use `lws_sul` timers on the event loop\n - Uses CNAME resolution inside the same response if present, otherwise\n recurses to resolve the CNAME (up to 3 deep)\n - ipv6 pieces only built if cmake `LWS_IPV6` enabled\n\n## Api\n\nIf enabled at cmake, the async DNS implementation is used automatically\nfor lws client connections. It's also possible to call it directly, see\nthe api-test-async-dns example for how.\n\nThe Api follows that of `getaddrinfo()` but results are not created on\nthe heap. Instead a single, const cached copy of the addrinfo struct\nchain is reference-counted, with `lws_async_dns_freeaddrinfo()` provided\nto deduct from the reference count. Cached items with a nonzero\nreference count can't be destroyed from the cache, so it's safe to keep\na pointer to the results and iterate through them.\n\n## Dealing with IPv4 and IPv6\n\nDNS is a very old standard that has some quirks... one of them is that\nmultiple queries are not supported in one packet, even though the protocol\nsuggests it is. This creates problems on ipv6 enabled systems, where\nit may prefer to have AAAA results, but the server may only have A records.\n\nTo square the circle, for ipv4 only systems (`LWS_IPV6\u003d0`) the resolver\nrequests only A records. For ipv6-capable systems, it always requests\nfirst A and then immediately afterwards AAAA records.\n\nTo simplify the implementation, the tid b0 is used to differentiate\nbetween A (b0 \u003d 0) and AAAA (b0 \u003d 1) requests and responses using the\nsame query body.\n\nThe first response to come back is parsed, and a cache entry made...\nit leaves a note in the query about the address of the last `struct addrinfo`\nrecord. When the second response comes, a second allocation is made,\nbut not added to the logical cache... instead it's chained on to the\nfirst cache entry and the `struct addrinfo` linked-list from the\nfirst cache entry is extended into the second one. At the time the\nsecond result arrives, the query is destroyed and the cached results\nprovided on the result callback.\n\n## Recursion\n\nWhere CNAMEs are returned, DNS servers may take two approaches... if the\nCNAME is also resolved by the same server and so it knows what it should\nresolve to, it may provide the CNAME resolution in the same response\npacket.\n\nIn the case the CNAME is actually resolved by a different name server,\nthe server with the CNAME does not have the information to hand to also\nresolve the CNAME in the same response. So it just leaves it for the\nclient to sort out.\n\nThe lws implementation can deal with both of these, first it \u0022recurses\u0022\n(it does not recurse on the process stack but uses its own manual stack)\nto look for results in the same packet that told it about the CNAME. If\nthere are no results, it resets the query to look instead for the CNAME,\nand restarts it. It allows this to happen for 3 CNAME deep.\n\nAt the end, either way, the cached result is set using the original\nquery name and the results from the last CNAME in the chain.\n\n\n","s":{"c":1732046693,"u": 10400}} ],"g": 1548,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "7d0a"}