mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Keep quoted log messages ASCII.
This commit is contained in:
parent
17fd424647
commit
c519813cf7
2 changed files with 6 additions and 6 deletions
|
@ -56,7 +56,7 @@ func (c *webRTCConn) Read(b []byte) (int, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *webRTCConn) Write(b []byte) (int, error) {
|
func (c *webRTCConn) Write(b []byte) (int, error) {
|
||||||
log.Printf("webrtc Write %d %q", len(b), string(b))
|
log.Printf("webrtc Write %d %+q", len(b), string(b))
|
||||||
c.dc.Send(b)
|
c.dc.Send(b)
|
||||||
return len(b), nil
|
return len(b), nil
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ func dialWebRTC(config *webrtc.Configuration) (*webRTCConn, error) {
|
||||||
close(openChan)
|
close(openChan)
|
||||||
}
|
}
|
||||||
dc.OnMessage = func(msg []byte) {
|
dc.OnMessage = func(msg []byte) {
|
||||||
log.Printf("OnMessage channel %d %q", len(msg), msg)
|
log.Printf("OnMessage channel %d %+q", len(msg), msg)
|
||||||
n, err := pw.Write(msg)
|
n, err := pw.Write(msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pw.CloseWithError(err)
|
pw.CloseWithError(err)
|
||||||
|
@ -236,10 +236,10 @@ func readSignalingMessages(f *os.File) {
|
||||||
s := bufio.NewScanner(f)
|
s := bufio.NewScanner(f)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
msg := s.Text()
|
msg := s.Text()
|
||||||
log.Printf("readSignalingMessages loop %q", msg)
|
log.Printf("readSignalingMessages loop %+q", msg)
|
||||||
sdp := webrtc.DeserializeSessionDescription(msg)
|
sdp := webrtc.DeserializeSessionDescription(msg)
|
||||||
if sdp == nil {
|
if sdp == nil {
|
||||||
log.Printf("ignoring invalid signal message %q", msg)
|
log.Printf("ignoring invalid signal message %+q", msg)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
signalChan <- sdp
|
signalChan <- sdp
|
||||||
|
|
|
@ -103,7 +103,7 @@ func datachannelHandler(conn *webRTCConn) {
|
||||||
pw.Close()
|
pw.Close()
|
||||||
}
|
}
|
||||||
dc.OnMessage = func(msg []byte) {
|
dc.OnMessage = func(msg []byte) {
|
||||||
log.Printf("OnMessage channel %d %q", len(msg), msg)
|
log.Printf("OnMessage channel %d %+q", len(msg), msg)
|
||||||
n, err := pw.Write(msg)
|
n, err := pw.Write(msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pw.CloseWithError(err)
|
pw.CloseWithError(err)
|
||||||
|
@ -144,7 +144,7 @@ func readSignalingMessages(signalChan chan *webrtc.SessionDescription, f *os.Fil
|
||||||
msg := s.Text()
|
msg := s.Text()
|
||||||
sdp := webrtc.DeserializeSessionDescription(msg)
|
sdp := webrtc.DeserializeSessionDescription(msg)
|
||||||
if sdp == nil {
|
if sdp == nil {
|
||||||
log.Printf("ignoring invalid signal message %q", msg)
|
log.Printf("ignoring invalid signal message %+q", msg)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
signalChan <- sdp
|
signalChan <- sdp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue