report go version on startup

This commit is contained in:
Unbit
2013-02-14 12:11:49 +01:00
parent 4c9d30cc1b
commit a89eb5d8cb
2 changed files with 11 additions and 0 deletions
+4
View File
@@ -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();
+7
View File
@@ -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)