fix: ooporthelper connection_refused (#974)
Closes https://github.com/ooni/probe/issues/2338 Co-authored-by: decfox <decfox@github.com>
This commit is contained in:
parent
18a9523496
commit
62e9f8e101
2 changed files with 19 additions and 6 deletions
|
|
@ -31,7 +31,7 @@ func shutdown(ctx context.Context, l net.Listener) {
|
|||
}
|
||||
|
||||
// TODO(DecFox): Add the ability of an echo service to generate some traffic
|
||||
func handleConnetion(ctx context.Context, conn net.Conn) {
|
||||
func handleConnection(ctx context.Context, conn net.Conn) {
|
||||
defer conn.Close()
|
||||
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
|
||||
defer cancel()
|
||||
|
|
@ -48,10 +48,10 @@ func listenTCP(ctx context.Context, port string) {
|
|||
for {
|
||||
conn, err := listener.Accept()
|
||||
if err != nil {
|
||||
log.Infof("listener unable to accept connections on port%s", port)
|
||||
log.Infof("listener unable to accept connections on port: %s", port)
|
||||
return
|
||||
}
|
||||
go handleConnetion(ctx, conn)
|
||||
go handleConnection(ctx, conn)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue