mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Use reconnect timeout on client (#12)
This commit is contained in:
parent
f205a0be59
commit
8a2e7a6041
3 changed files with 36 additions and 25 deletions
|
@ -5,6 +5,7 @@ package main
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
|
@ -66,6 +67,9 @@ func (bc *BrokerChannel) Negotiate(offer *webrtc.SessionDescription) (
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
log.Printf("BrokerChannel Response:\n%s\n\n", resp.Status)
|
||||
if http.StatusOK != resp.StatusCode {
|
||||
return nil, errors.New("no answer from broker.")
|
||||
}
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if nil != err {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue