Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1ecde0b25 | ||
|
|
8a2932128e | ||
|
|
030f32147b |
No files matched your search
@@ -56,7 +56,7 @@ func ICCCHandler(response http.ResponseWriter, request *http.Request) {
|
||||
|
||||
if listener == nil {
|
||||
// Case: No such listener
|
||||
Log.LogFull(senderName, LM.CategorySYSTEM, LM.LevelWARN, LM.SeverityCritical, LM.ImpactUnknown, LM.MessageNameCONFIGURATION, `Was not able to find the correct listener for these ICCC message.`, `channel=`+channel, `command=`+command, `hostname=`+Tools.ThisHostname())
|
||||
Log.LogFull(senderName, LM.CategorySYSTEM, LM.LevelWARN, LM.SeverityCritical, LM.ImpactUnknown, LM.MessageNameCONFIGURATION, `Was not able to find the correct listener for these ICCC message.`, `channel=`+channel, `command`+command, `hostname=`+Tools.ThisHostname())
|
||||
http.NotFound(response, request)
|
||||
} else {
|
||||
// Case: Everything is fine => deliver the message and read the answer:
|
||||
|
||||
+2
-3
@@ -6,7 +6,6 @@ import (
|
||||
"github.com/SommerEngineering/Ocean/Tools"
|
||||
"net/url"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Sign a message to secure it.
|
||||
@@ -33,7 +32,7 @@ func signMessage(data map[string][]string) (result url.Values) {
|
||||
// Now, loop over all the data:
|
||||
for _, key := range keys {
|
||||
// Get the value:
|
||||
value := data[key][0]
|
||||
value := data[key]
|
||||
|
||||
// Hash each key and value:
|
||||
fmt.Fprintf(hash, "key=%s :: value=%s\n", key, value)
|
||||
@@ -43,6 +42,6 @@ func signMessage(data map[string][]string) (result url.Values) {
|
||||
result = url.Values(data)
|
||||
|
||||
// Append the sign:
|
||||
result.Add(`checksum`, strings.ToUpper(fmt.Sprintf("%x", hash.Sum(nil))))
|
||||
result.Add(`checksum`, fmt.Sprintf("%x", hash.Sum(nil)))
|
||||
return
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package Log
|
||||
|
||||
// This function provides the project name for e.g. logging events
|
||||
// coming trough the ICCC.
|
||||
func GetProjectName() string {
|
||||
return projectName
|
||||
}
|
||||
+1
-7
@@ -121,16 +121,10 @@ func clearEntry(entry Meta.Entry) (result Meta.Entry) {
|
||||
// Remove white spaces from the parameters.
|
||||
func clearParameters(oldParameters []string) (result []string) {
|
||||
for n := 0; n < len(oldParameters); n++ {
|
||||
// Remove white spaces:
|
||||
oldParameters[n] = removeWhitespaces(oldParameters[n])
|
||||
|
||||
// Is content left after removing?
|
||||
if oldParameters[n] != `` {
|
||||
// Yes, some content is still there. Thus, commit this entry:
|
||||
result = append(result, oldParameters[n])
|
||||
}
|
||||
}
|
||||
|
||||
result = oldParameters
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ func ICCCNewLogEventReceiver(data map[string][]string) (result map[string][]stri
|
||||
|
||||
// Provide a log entry:
|
||||
logEntry := LM.Entry{}
|
||||
logEntry.Project = Log.GetProjectName()
|
||||
logEntry.Sender = LM.Sender(messageData.Sender)
|
||||
logEntry.Category = LM.ParseCategory(messageData.Category)
|
||||
logEntry.Level = LM.ParseLevel(messageData.Level)
|
||||
|
||||
@@ -29,7 +29,7 @@ func icccComponentStartUpMessageReceiver(data map[string][]string) (result map[s
|
||||
messageData := obj.(SystemMessages.ICCCComponentStartUpMessage)
|
||||
|
||||
// Provide a log entry:
|
||||
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameSTARTUP, `ICCC message: The external component is now up and ready.`, fmt.Sprintf("ipAddressPort='%s'", messageData.IPAddressPort), fmt.Sprintf("name='%s'", messageData.Name), fmt.Sprintf("version='%s'", messageData.Version))
|
||||
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameSTARTUP, `ICCC message: The external component is now up and ready.`, fmt.Sprintf("ipAddressPort=%s", messageData.IPAddressPort), fmt.Sprintf("name=", messageData.Name), fmt.Sprintf("version=", messageData.Version))
|
||||
|
||||
// An answer is necessary:
|
||||
return ICCC.Message2Data("", "", SystemMessages.AnswerACK)
|
||||
|
||||
@@ -29,7 +29,7 @@ func icccOceanStartUpMessageReceiver(data map[string][]string) (result map[strin
|
||||
messageData := obj.(SystemMessages.ICCCOceanStartUpMessage)
|
||||
|
||||
// Provide a log entry:
|
||||
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameSTARTUP, `ICCC message: The Ocean server is now up and ready.`, fmt.Sprintf("public server='%s'", messageData.PublicIPAddressPort), fmt.Sprintf("admin server='%s'", messageData.AdminIPAddressPort), fmt.Sprintf("Ocean's version='%s'", messageData.OceanVersion))
|
||||
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameSTARTUP, `ICCC message: The Ocean server is now up and ready.`, fmt.Sprintf("public server=%s", messageData.PublicIPAddressPort), fmt.Sprintf("admin server=%s", messageData.AdminIPAddressPort), fmt.Sprintf("Ocean's version=%s", messageData.OceanVersion))
|
||||
|
||||
// An answer is necessary:
|
||||
return ICCC.Message2Data("", "", SystemMessages.AnswerACK)
|
||||
|
||||
@@ -105,7 +105,7 @@ func initSystem() {
|
||||
ICCC.Registrar(ICCC.ChannelICCC, `ICCC::DeleteListener`, ICCC.ICCCDeleteListenerReceiver)
|
||||
ICCC.Registrar(ICCC.ChannelICCC, `ICCC::DeleteHost`, ICCC.ICCCDeleteHostReceiver)
|
||||
ICCC.Registrar(ICCC.ChannelICCC, `ICCC::ListenerUpdate`, ICCC.ICCCListenerUpdateReceiver)
|
||||
ICCC.Registrar(ICCC.ChannelPING, `Ping::Ping`, ICCC.ICCCPingReceiver)
|
||||
ICCC.Registrar(ICCC.ChannelICCC, `Ping::Ping`, ICCC.ICCCPingReceiver)
|
||||
ICCC.Registrar(ICCC.ChannelSYSTEM, `System::Version`, ICCC.ICCCGetVersionReceiver)
|
||||
ICCC.Registrar(ICCC.ChannelICCC, `ICCC::GetHosts`, ICCC.ICCCGetHostsReceiver)
|
||||
ICCC.Registrar(ICCC.ChannelICCC, `ICCC::GetListeners`, ICCC.ICCCGetListenersReceiver)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Version
|
||||
|
||||
var (
|
||||
oceansVersion string = `2.0.6` // Ocean's current version
|
||||
oceansVersion string = `2.0.3` // Ocean's current version
|
||||
)
|
||||
Reference in new issue
Block a user