require header match
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 27s
Build and Publish / BuildAndDeploy (push) Successful in 2m16s

This commit is contained in:
matst80
2024-11-12 22:31:19 +01:00
parent 438358e4b3
commit e1b254668f
6 changed files with 52 additions and 7 deletions

View File

@@ -69,6 +69,7 @@ func (m *TCPServerMux) handleFunction(connection net.Conn, messageType PoolMessa
function, ok := m.functions[messageType]
m.mu.RUnlock()
if ok {
connection.Write(header[:])
responseType, responseData, err := function(data)
if err != nil {
errData := []byte(err.Error())
@@ -93,6 +94,8 @@ func (m *TCPServerMux) handleFunction(connection net.Conn, messageType PoolMessa
packetsSent.Inc()
_, err = connection.Write(responseData)
return true, err
} else {
log.Printf("No pool handler for type: %d\n", messageType)
}
return false, nil
}