Faketls works now

This commit is contained in:
9seconds
2021-03-26 12:15:26 +03:00
parent 6d92d5fe21
commit f0efa4697e
4 changed files with 82 additions and 9 deletions
+2 -4
View File
@@ -9,11 +9,10 @@ type conn struct {
}
func (c conn) Read(p []byte) (int, error) {
ctx := c.relay.ctx
n, err := c.ReadWriteCloser.Read(p)
select {
case <-ctx.Done():
case <-c.relay.ctx.Done():
case c.relay.tickChannel <- struct{}{}:
}
@@ -21,11 +20,10 @@ func (c conn) Read(p []byte) (int, error) {
}
func (c conn) Write(p []byte) (int, error) {
ctx := c.relay.ctx
n, err := c.ReadWriteCloser.Write(p)
select {
case <-ctx.Done():
case <-c.relay.ctx.Done():
case c.relay.tickChannel <- struct{}{}:
}