|
|
@ -43,18 +43,19 @@ func (ts *TELNETServer) Accept() (net.Conn, error) {
|
|
|
|
return conn, err
|
|
|
|
return conn, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (ts *TELNETServer) Handle(conn net.Conn) {
|
|
|
|
func (ts *TELNETServer) Handle(wml watermill.LoggerAdapter) func(conn net.Conn) {
|
|
|
|
|
|
|
|
logger := wml.With(
|
|
|
|
|
|
|
|
watermill.LogFields{
|
|
|
|
|
|
|
|
// "correlation_id": correlationID,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
return func(conn net.Conn) {
|
|
|
|
s := bufio.NewScanner(conn)
|
|
|
|
s := bufio.NewScanner(conn)
|
|
|
|
defer conn.Close()
|
|
|
|
defer conn.Close()
|
|
|
|
// i need to create an ecs Renderer that targets a iw.Writer (net.Conn)
|
|
|
|
// i need to create an ecs Renderer that targets a iw.Writer (net.Conn)
|
|
|
|
// the renderer
|
|
|
|
// the renderer
|
|
|
|
|
|
|
|
|
|
|
|
correlationID := watermill.NewUUID()
|
|
|
|
correlationID := watermill.NewUUID()
|
|
|
|
ts.logger = ts.logger.With(
|
|
|
|
|
|
|
|
watermill.LogFields{
|
|
|
|
|
|
|
|
"correlation_id": correlationID,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for s.Scan() {
|
|
|
|
for s.Scan() {
|
|
|
|
t := s.Text()
|
|
|
|
t := s.Text()
|
|
|
@ -64,6 +65,7 @@ func (ts *TELNETServer) Handle(conn net.Conn) {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.Fatalln("couldn't write to telnet.raw")
|
|
|
|
log.Fatalln("couldn't write to telnet.raw")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ts.logger.Trace("received bytes over telnet", nil)
|
|
|
|
logger.Trace("received bytes over telnet", nil)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|