(sess *Session)
| 340 | } |
| 341 | |
| 342 | func (m *CLIBridgeModule) ptyToClient(sess *Session) { |
| 343 | buf := make([]byte, 4096) |
| 344 | for { |
| 345 | n, err := sess.PtyFile.Read(buf) |
| 346 | if n > 0 { |
| 347 | data := buf[:n] |
| 348 | if sess.isTelnet { |
| 349 | data = escapeIAC(data) |
| 350 | } |
| 351 | connections.SendRawTo(data, sess.ConnectionId) |
| 352 | } |
| 353 | if err != nil { |
| 354 | return |
| 355 | } |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | func escapeIAC(data []byte) []byte { |
| 360 | count := 0 |
no test coverage detected