Verified Commit 49c7ac23 authored by meskio's avatar meskio 🏔️
Browse files

Add STATUS version support

Closes: #1
parent c4847124
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -80,6 +80,8 @@ func main() {
		os.Exit(1)
		os.Exit(1)
	}
	}


	pt.ReportVersion("dummy-client", "0.1")

	if ptInfo.ProxyURL != nil {
	if ptInfo.ProxyURL != nil {
		pt.ProxyError("proxy is not supported")
		pt.ProxyError("proxy is not supported")
		os.Exit(1)
		os.Exit(1)
+2 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,8 @@ func main() {
		os.Exit(1)
		os.Exit(1)
	}
	}


	pt.ReportVersion("dummy-server", "0.1")

	listeners := make([]net.Listener, 0)
	listeners := make([]net.Listener, 0)
	for _, bindaddr := range ptInfo.Bindaddrs {
	for _, bindaddr := range ptInfo.Bindaddrs {
		switch bindaddr.MethodName {
		switch bindaddr.MethodName {
+6 −0
Original line number Original line Diff line number Diff line
@@ -343,6 +343,12 @@ func ProxyDone() {
	fmt.Fprintf(Stdout, "PROXY DONE\n")
	fmt.Fprintf(Stdout, "PROXY DONE\n")
}
}


// Emit a STATUS TYPE=version to provide the implementation and version of the PT.
// Can be called any time before CMETHODS DONE or SMETHODS DONE.
func ReportVersion(implementation string, version string) {
	line("STATUS", "TYPE=version", "IMPLEMENTATION="+encodeCString(implementation), "VERSION="+encodeCString(version))
}

// Unexported type to represent log severities, preventing external callers from
// Unexported type to represent log severities, preventing external callers from
// inventing new severity strings that may violate quoting rules.
// inventing new severity strings that may violate quoting rules.
//
//