some touchups (version, call return)

This commit is contained in:
2023-04-02 14:15:24 -07:00
parent 80aa96ed4e
commit eff339d8fe
2 changed files with 3 additions and 89 deletions

View File

@@ -29,7 +29,7 @@ func runExtensionCallback(name *C.char, function *C.char, data *C.char) C.int {
//export goRVExtensionVersion
func goRVExtensionVersion(output *C.char, outputsize C.size_t) {
result := C.CString("Version 1.0")
result := C.CString("Version 0.0.1")
defer C.free(unsafe.Pointer(result))
var size = C.strlen(result) + 1
if size > outputsize {
@@ -151,7 +151,7 @@ func goRVExtension(output *C.char, outputsize C.size_t, input *C.char) {
go callBackExample()
} else {
// Return a result through callextension Arma call
temp := fmt.Sprintf("Cavmetrics: %s", C.GoString(input))
temp := fmt.Sprintf("Rangermetrics: %s", C.GoString(input))
result := C.CString(temp)
defer C.free(unsafe.Pointer(result))
var size = C.strlen(result) + 1
@@ -159,6 +159,7 @@ func goRVExtension(output *C.char, outputsize C.size_t, input *C.char) {
size = outputsize
}
// start a goroutine to send the data to influx
go sendToInflux(C.GoString(input))
C.memmove(unsafe.Pointer(output), unsafe.Pointer(result), size)