Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1745990768, "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":"c6056dd470e2505417ae909ae941341c", "commit": {"type":"commit", "time": 1520762836, "time_ofs": 480, "oid_tree": { "oid": "21a90f14bd834ff1991c3dc0ee7ce2751a022927", "alias": []}, "oid":{ "oid": "ad5dbda120129d1674a475b562c64940e65361bb", "alias": []}, "msg": "access log: only produce when vh log file set", "sig_commit": { "git_time": { "time": 1520762836, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }, "sig_author": { "git_time": { "time": 1520470734, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }}, "body": "access log: only produce when vh log file set" , "diff": "diff --git a/lib/server/access-log.c b/lib/server/access-log.c\nindex 4230fc9..400a6b9 100644\n--- a/lib/server/access-log.c\n+++ b/lib/server/access-log.c\n@@ -51,6 +51,10 @@ lws_prepare_access_log_info(struct lws *wsi, char *uri_ptr, int meth)\n \ttime_t t \u003d time(NULL);\n \tint l \u003d 256, m;\n \n+\t/* only worry about preparing it if we store it */\n+\tif (wsi-\u003evhost \u0026\u0026 wsi-\u003evhost-\u003elog_fd \u003d\u003d (int)LWS_INVALID_FILE)\n+\t\treturn;\n+\n \tif (wsi-\u003eaccess_log_pending)\n \t\tlws_access_log(wsi);\n \n@@ -123,6 +127,9 @@ lws_access_log(struct lws *wsi)\n \t *p1 \u003d wsi-\u003eaccess_log.referrer;\n \tint l;\n \n+\tif (wsi-\u003evhost \u0026\u0026 wsi-\u003evhost-\u003elog_fd \u003d\u003d (int)LWS_INVALID_FILE)\n+\t\treturn 0;\n+\n \tif (!wsi-\u003eaccess_log_pending)\n \t\treturn 0;\n \n@@ -147,11 +154,8 @@ lws_access_log(struct lws *wsi)\n \t\tp[sizeof(ass) - 6 - l] \u003d '\u005c0';\n \tl +\u003d lws_snprintf(ass + l, sizeof(ass) - 1 - l, \u0022\u005c\u0022 \u005c\u0022%s\u005c\u0022\u005cn\u0022, p);\n \n-\tif (wsi-\u003evhost-\u003elog_fd !\u003d (int)LWS_INVALID_FILE) {\n-\t\tif (write(wsi-\u003evhost-\u003elog_fd, ass, l) !\u003d l)\n-\t\t\tlwsl_err(\u0022Failed to write log\u005cn\u0022);\n-\t} else\n-\t\tlwsl_notice(\u0022%s\u0022, ass);\n+\tif (write(wsi-\u003evhost-\u003elog_fd, ass, l) !\u003d l)\n+\t\tlwsl_err(\u0022Failed to write log\u005cn\u0022);\n \n \tif (wsi-\u003eaccess_log.header_log) {\n \t\tlws_free(wsi-\u003eaccess_log.header_log);\n","s":{"c":1745990768,"u": 1163}} ],"g": 1868,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}