Use context

This commit is contained in:
Bolke de Bruin 2020-07-25 11:48:11 +02:00
parent 5de3767e70
commit 39c73fc8fc
3 changed files with 21 additions and 20 deletions

View file

@ -2,6 +2,7 @@ package protocol
import (
"bytes"
"context"
"encoding/binary"
"errors"
"github.com/bolkedebruin/rdpgw/transport"
@ -71,7 +72,7 @@ func NewHandler(s *SessionInfo, conf *HandlerConf) *Handler {
const tunnelId = 10
func (h *Handler) Process() error {
func (h *Handler) Process(ctx context.Context) error {
for {
pt, sz, pkt, err := h.ReadMessage()
if err != nil {