forked from quic-go/quic-go
log requests in the interop server
This commit is contained in:
@@ -95,7 +95,7 @@ func (s *Server) handleConn(sess quic.Session) {
|
|||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
if err := s.handleStream(str); err != nil {
|
if err := s.handleStream(str); err != nil {
|
||||||
log.Printf("Handling stream failed: %s", err.Error())
|
log.Printf("Handling stream failed: %s\n", err.Error())
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
@@ -109,6 +109,9 @@ func (s *Server) handleStream(str quic.Stream) error {
|
|||||||
request := string(reqBytes)
|
request := string(reqBytes)
|
||||||
request = strings.TrimRight(request, "\r\n")
|
request = strings.TrimRight(request, "\r\n")
|
||||||
request = strings.TrimRight(request, " ")
|
request = strings.TrimRight(request, " ")
|
||||||
|
|
||||||
|
log.Printf("Received request: %s\n", request)
|
||||||
|
|
||||||
if request[:5] != "GET /" {
|
if request[:5] != "GET /" {
|
||||||
str.CancelWrite(42)
|
str.CancelWrite(42)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user