summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_application.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2017-10-05 16:46:18 +0300
committerValentin Bartenev <vbart@nginx.com>2017-10-05 16:46:18 +0300
commit096562c0b14656354fcb0eb7b7c6d524f5fb1f1d (patch)
treeefd6dd7b94951778e132d84591d77ae8d7ecf469 /src/nxt_application.c
parent653e9854637e129cd6a92adaff96784220165eea (diff)
downloadunit-096562c0b14656354fcb0eb7b7c6d524f5fb1f1d.tar.gz
unit-096562c0b14656354fcb0eb7b7c6d524f5fb1f1d.tar.bz2
Improved applications versions handling.
Diffstat (limited to '')
-rw-r--r--src/nxt_application.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nxt_application.c b/src/nxt_application.c
index 36e855b8..2ecec636 100644
--- a/src/nxt_application.c
+++ b/src/nxt_application.c
@@ -291,8 +291,8 @@ nxt_app_start(nxt_task_t *task, void *data)
nxt_app = lang->module;
if (nxt_app == NULL) {
- nxt_debug(task, "application language module: %V \"%s\"",
- &lang->version, lang->file);
+ nxt_debug(task, "application language module: %s \"%s\"",
+ lang->version, lang->file);
nxt_app = nxt_app_module_load(task, lang->file);
}
@@ -1020,8 +1020,14 @@ nxt_app_lang_module(nxt_runtime_t *rt, nxt_str_t *name)
n = rt->languages->nelts;
for (i = 0; i < n; i++) {
+
+ /*
+ * Versions are sorted in descending order
+ * so first match chooses the highest version.
+ */
+
if (nxt_str_eq(&lang[i].type, name->start, type_length)
- && nxt_str_start(&lang[i].version, version, version_length))
+ && nxt_strvers_match(lang[i].version, version, version_length))
{
return &lang[i];
}