Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1750825421, "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", "cid":"21c24804ce0672ac2c519331eb925425", "commit": {"type":"commit", "time": 1699531487, "time_ofs": 0, "oid_tree": { "oid": "121911cf9da4695e870499c0a0b24f03b9fa0833", "alias": []}, "oid":{ "oid": "3454cd1f8aade94264b04047b41fb61a215f3bda", "alias": []}, "msg": "test: async dns: handle dynamic ads on warmcat", "sig_commit": { "git_time": { "time": 1699531487, "offset": 0 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }, "sig_author": { "git_time": { "time": 1699531367, "offset": 0 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }}, "body": "test: async dns: handle dynamic ads on warmcat\n\nWe use warmcat dns for testing, but for a while it has become dynamic\nbreaking the tests.\n\nFix up the affected tests with IPv4 addresses from getaddrinfo() so they\npass when they match these results.\n" , "diff": "diff --git a/minimal-examples-lowlevel/api-tests/api-test-async-dns/main.c b/minimal-examples-lowlevel/api-tests/api-test-async-dns/main.c\nindex ff61e07..6a9a32f 100644\n--- a/minimal-examples-lowlevel/api-tests/api-test-async-dns/main.c\n+++ b/minimal-examples-lowlevel/api-tests/api-test-async-dns/main.c\n@@ -69,7 +69,7 @@ static const struct ipparser_tests {\n \n #define TEST_FLAG_NOCHECK_RESULT_IP 0x100000\n \n-static const struct async_dns_tests {\n+static struct async_dns_tests {\n \tconst char *dns_name;\n \tint recordtype;\n \tint addrlen;\n@@ -391,12 +391,50 @@ void sigint_handler(int sig)\n }\n \n int\n+fixup(int idx)\n+{\n+\tstruct addrinfo hints, *ai;\n+\tint m;\n+\n+\tmemset(\u0026hints, 0, sizeof(hints));\n+\thints.ai_family \u003d AF_INET;\n+\thints.ai_socktype \u003d SOCK_STREAM;\n+\thints.ai_flags \u003d AI_PASSIVE;\n+\n+\tm \u003d getaddrinfo(adt[idx].dns_name, \u002280\u0022, \u0026hints, \u0026ai);\n+\tif (m) {\n+\t\tlwsl_err(\u0022Unable to look up %s: %s\u0022, adt[0].dns_name,\n+\t\t\t\tgai_strerror(m));\n+\t\treturn 1;\n+\t}\n+\tadt[idx].ads[0] \u003d (uint8_t)((struct sockaddr *)ai-\u003eai_addr)-\u003esa_data[2];\n+\tadt[idx].ads[1] \u003d (uint8_t)((struct sockaddr *)ai-\u003eai_addr)-\u003esa_data[3];\n+\tadt[idx].ads[2] \u003d (uint8_t)((struct sockaddr *)ai-\u003eai_addr)-\u003esa_data[4];\n+\tadt[idx].ads[3] \u003d (uint8_t)((struct sockaddr *)ai-\u003eai_addr)-\u003esa_data[5];\n+\n+\tfreeaddrinfo(ai);\n+\n+\tlwsl_notice(\u0022%s: %u.%u.%u.%u\u005cn\u0022, __func__,\n+\t\tadt[idx].ads[0], adt[idx].ads[1], adt[idx].ads[2], adt[idx].ads[3]);\n+\n+\treturn 0;\n+}\n+\n+int\n main(int argc, const char **argv)\n {\n \tint n \u003d 1, logs \u003d LLL_USER | LLL_ERR | LLL_WARN | LLL_NOTICE;\n \tstruct lws_context_creation_info info;\n \tconst char *p;\n \n+\t/* fixup dynamic target addresses we're testing against */\n+\n+\tfixup(0);\n+\tfixup(1);\n+\tfixup(2);\n+\tfixup(5);\n+\tfixup(6);\n+\n \t/* the normal lws init */\n \n \tsignal(SIGINT, sigint_handler);\n","s":{"c":1750806040,"u": 2376}} ],"g": 796,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "7d0a"}