aboutsummaryrefslogtreecommitdiffstats
path: root/golib/eows/eows-in.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-03-09 15:57:36 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-03-09 16:08:53 +0100
commitf1e97cdbcc13318cb3de39d9e67bc0241614dfcc (patch)
tree04188e8d91e6b1b6a77d21614237f96f2bbbed1f /golib/eows/eows-in.go
parentabbf89a5589f2c92f786bb45c5cd613a318a9e24 (diff)
Improved PtyMode (eows lib).
- renamed PtsMode to PtyMode - used byte array instead of string - allowed terminal echo on/off (PtyMode only) - fixed support escaped and control characters (PtyMode only) Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'golib/eows/eows-in.go')
-rw-r--r--golib/eows/eows-in.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/golib/eows/eows-in.go b/golib/eows/eows-in.go
index 89ca891..5e74c76 100644
--- a/golib/eows/eows-in.go
+++ b/golib/eows/eows-in.go
@@ -13,21 +13,21 @@ type DoneChan struct {
err error
}
-// cmdPumpStdin is in charge of receive characters and send them to stdin
-func (e *ExecOverWS) cmdPumpStdin(inw *os.File) {
+// pumpStdin is in charge of receive characters and send them to stdin
+func (e *ExecOverWS) pumpStdin(inw *os.File) {
done := make(chan DoneChan, 1)
if e.InputEvent != "" && e.InputCB != nil {
- err := (*e.SocketIO).On(e.InputEvent, func(stdin string) {
- in, err := e.InputCB(e, string(stdin))
+ err := (*e.SocketIO).On(e.InputEvent, func(stdin []byte) {
+ in, err := e.InputCB(e, stdin)
if err != nil {
e.logDebug("Error stdin: %s", err.Error())
inw.Close()
return
}
- if _, err := inw.Write([]byte(in)); err != nil {
+ if _, err := inw.Write(in); err != nil {
e.logError("Error while writing to stdin: %s", err.Error())
}
})