mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 05:31:44 +00:00
report go version on startup
This commit is contained in:
@@ -9,6 +9,7 @@ void (*uwsgi_go_helper_env_add_c)(void *, char *, int, char *, int);
|
||||
void (*uwsgi_go_helper_request_c)(void *, struct wsgi_request *);
|
||||
int (*uwsgi_go_helper_signal_handler_c)(int, void *);
|
||||
void (*uwsgi_go_helper_run_core_c)(int);
|
||||
char *(*uwsgi_go_helper_version_c)();
|
||||
|
||||
void uwsgi_go_post_fork() {
|
||||
uwsgi_go_helper_post_fork_c();
|
||||
@@ -43,6 +44,9 @@ int uwsgi_go_init() {
|
||||
uwsgi_go_get_symbol(uwsgi_go_helper_request)
|
||||
uwsgi_go_get_symbol(uwsgi_go_helper_signal_handler)
|
||||
uwsgi_go_get_symbol(uwsgi_go_helper_run_core)
|
||||
uwsgi_go_get_symbol(uwsgi_go_helper_version)
|
||||
|
||||
uwsgi_log("Go version \"%s\" initialized\n", uwsgi_go_helper_version_c());
|
||||
|
||||
// call PostInit()
|
||||
uwsgi_go_helper_post_init_c();
|
||||
|
||||
@@ -29,6 +29,7 @@ import (
|
||||
"strings"
|
||||
"strconv"
|
||||
"io"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
// this stores the modifier used by the go plugin (default 11)
|
||||
@@ -386,6 +387,12 @@ func uwsgi_go_helper_request(env *map[string]string, wsgi_req *C.struct_wsgi_req
|
||||
}
|
||||
}
|
||||
|
||||
//export uwsgi_go_helper_version
|
||||
func uwsgi_go_helper_version() *C.char {
|
||||
v := runtime.Version()
|
||||
return C.CString(v)
|
||||
}
|
||||
|
||||
//export uwsgi_go_helper_signal_handler
|
||||
func uwsgi_go_helper_signal_handler(signum int, handler *func(int)) int {
|
||||
(*handler)(signum)
|
||||
|
||||
Reference in New Issue
Block a user