new proto

This commit is contained in:
Sibesh Kar 2019-08-08 00:34:05 +05:30
parent a91646069e
commit b65099a6bc
15 changed files with 7 additions and 9 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -134,7 +134,6 @@ func (r *ClientRecorder) HandleRfbSegment(data *common.RfbSegment) error {
r.writeToDisk() r.writeToDisk()
case common.SegmentRectSeparator: case common.SegmentRectSeparator:
logger.Debugf("ClientRecorder.HandleRfbSegment: not writing rect") logger.Debugf("ClientRecorder.HandleRfbSegment: not writing rect")
//r.writeToDisk()
case common.SegmentBytes: case common.SegmentBytes:
logger.Debug("ClientRecorder.HandleRfbSegment: not writing bytes, len:", len(data.Bytes)) logger.Debug("ClientRecorder.HandleRfbSegment: not writing bytes, len:", len(data.Bytes))
if r.buffer.Len()+len(data.Bytes) > r.maxWriteSize-4 { if r.buffer.Len()+len(data.Bytes) > r.maxWriteSize-4 {
@ -146,20 +145,20 @@ func (r *ClientRecorder) HandleRfbSegment(data *common.RfbSegment) error {
r.serverInitMessage = data.Message.(*common.ServerInit) r.serverInitMessage = data.Message.(*common.ServerInit)
case common.SegmentFullyParsedClientMessage: case common.SegmentFullyParsedClientMessage:
clientMsg := data.Message.(common.ClientMessage) clientMsg := data.Message.(common.ClientMessage)
switch clientMsg.Type() { switch clientMsg.Type() {
case common.SetPixelFormatMsgType: case common.SetPixelFormatMsgType:
clientMsg := data.Message.(*server.MsgSetPixelFormat) clientMsg := data.Message.(*server.MsgSetPixelFormat)
logger.Debugf("ClientRecorder.HandleRfbSegment: client message %v", *clientMsg) logger.Debugf("ClientRecorder.HandleRfbSegment: client message %v", *clientMsg)
r.serverInitMessage.PixelFormat = clientMsg.PF r.serverInitMessage.PixelFormat = clientMsg.PF
case common.KeyEventMsgType: case common.KeyEventMsgType:
clientMsg := data.Message.(*server.MsgKeyEvent) clientMsg := data.Message.(common.ClientMessage)
logger.Debug("Recorder.HandleRfbSegment: writing bytes for KeyEventMsgType, len:", *clientMsg) logger.Debug("Recorder.HandleRfbSegment: writing bytes for KeyEventMsgType, len:", clientMsg)
clientMsg.Write(r.writer) binary.Write(r.writer, binary.BigEndian, clientMsg)
case common.PointerEventMsgType: case common.PointerEventMsgType:
clientMsg := data.Message.(*server.MsgPointerEvent) clientMsg := data.Message.(common.ClientMessage)
logger.Debug("Recorder.HandleRfbSegment: writing bytes for PointerEventMsgType, len:", *clientMsg) logger.Debug("Recorder.HandleRfbSegment: writing bytes for PointerEventMsgType, len:", clientMsg)
clientMsg.Write(r.writer) binary.Write(r.writer, binary.BigEndian, clientMsg)
default: default:
//return errors.New("unknown client message type:" + string(data.UpcomingObjectType)) //return errors.New("unknown client message type:" + string(data.UpcomingObjectType))
} }

View File

@ -132,7 +132,6 @@ func (vp *VncProxy) newServerConnHandler(cfg *server.ServerConfig, sconn *server
return err return err
} }
if session.Type == SessionTypeRecordingProxy { if session.Type == SessionTypeRecordingProxy {
cconn.Listeners.AddListener(rec_s)
cconn.Listeners.AddListener(rec_c) cconn.Listeners.AddListener(rec_c)
} }