(route string, uuid string)
| 1037 | } |
| 1038 | |
| 1039 | func (console *Console) handleShellPanelCommand(route string, uuid string) { |
| 1040 | sMessage := protocol.PrepareAndDecideWhichSProtoToLower(global.G_Component.Conn, global.G_Component.Secret, global.G_Component.UUID) |
| 1041 | |
| 1042 | header := &protocol.Header{ |
| 1043 | Sender: protocol.ADMIN_UUID, |
| 1044 | Accepter: uuid, |
| 1045 | MessageType: protocol.SHELLCOMMAND, |
| 1046 | RouteLen: uint32(len([]byte(route))), |
| 1047 | Route: route, |
| 1048 | } |
| 1049 | |
| 1050 | console.ready <- true |
| 1051 | |
| 1052 | for { |
| 1053 | select { |
| 1054 | case tCommand := <-console.getCommand: |
| 1055 | shellCommandMess := &protocol.ShellCommand{ |
| 1056 | CommandLen: uint64(len(tCommand)), |
| 1057 | Command: tCommand, |
| 1058 | } |
| 1059 | protocol.ConstructMessage(sMessage, header, shellCommandMess, false) |
| 1060 | sMessage.SendMessage() |
| 1061 | case <-console.mgr.ConsoleManager.Exit: |
| 1062 | return |
| 1063 | } |
| 1064 | } |
| 1065 | } |
| 1066 | |
| 1067 | func (console *Console) handleSSHPanelCommand(route string, uuid string) { |
| 1068 | sMessage := protocol.PrepareAndDecideWhichSProtoToLower(global.G_Component.Conn, global.G_Component.Secret, global.G_Component.UUID) |
no test coverage detected