{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1752651005,
"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":"52bf67fad1fa7b7f55348a4b46953ac2",
"commit": {"type":"commit",
"time": 1553120370,
"time_ofs": 480,
"oid_tree": { "oid": "3de1dc6b7872dd5cc3017b1efd32412cdc0d1ce3", "alias": []},
"oid":{ "oid": "8dd33833685948c7597f8b4d21f5e9b66d6d153f", "alias": []},
"msg": "lws_dll_foreach_safe",
"sig_commit": { "git_time": { "time": 1553120370, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1552896765, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }},
"body": "lws_dll_foreach_safe"
,
"diff": "diff --git a/include/libwebsockets/lws-misc.h b/include/libwebsockets/lws-misc.h\nindex 00bf4d6..823c240 100644\n--- a/include/libwebsockets/lws-misc.h\n+++ b/include/libwebsockets/lws-misc.h\n@@ -187,6 +187,11 @@ lws_dll_add_front(struct lws_dll *d, struct lws_dll *phead);\n LWS_VISIBLE LWS_EXTERN void\n lws_dll_remove(struct lws_dll *d);\n \n+/* another way to do lws_start_foreach_dll_safe() on a list via a cb */\n+\n+LWS_VISIBLE LWS_EXTERN int\n+lws_dll_foreach_safe(struct lws_dll *phead, int (*cb)(struct lws_dll *d));\n+\n struct lws_dll_lws { /* typed as struct lws * */\n \tstruct lws_dll_lws *prev;\n \tstruct lws_dll_lws *next;\ndiff --git a/lib/core/libwebsockets.c b/lib/core/libwebsockets.c\nindex ae10e5a..40b64d7 100644\n--- a/lib/core/libwebsockets.c\n+++ b/lib/core/libwebsockets.c\n@@ -138,6 +138,17 @@ lws_dll_remove(struct lws_dll *d)\n \td-\u003enext \u003d NULL;\n }\n \n+int\n+lws_dll_foreach_safe(struct lws_dll *phead, int (*cb)(struct lws_dll *d))\n+{\n+\tlws_start_foreach_dll_safe(struct lws_dll *, p, tp, phead-\u003enext) {\n+\t\tif (cb(p))\n+\t\t\treturn 1;\n+\t} lws_end_foreach_dll_safe(p, tp);\n+\n+\treturn 0;\n+}\n+\n #if !(defined(LWS_PLAT_OPTEE) \u0026\u0026 !defined(LWS_WITH_NETWORK))\n \n LWS_VISIBLE lws_usec_t\n","s":{"c":1752651005,"u": 2404}}
],"g": 3211,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}