mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
localize ptInfo and iceServers vars, separate copy-paste helpers, move some logging
to more sensible locations
This commit is contained in:
parent
b6f15a8d5c
commit
fedb124313
4 changed files with 41 additions and 38 deletions
|
@ -38,6 +38,7 @@ func NewPeers(max int) *Peers {
|
|||
|
||||
// As part of |SnowflakeCollector| interface.
|
||||
func (p *Peers) Collect() error {
|
||||
|
||||
cnt := p.Count()
|
||||
if cnt >= p.capacity {
|
||||
s := fmt.Sprintf("At capacity [%d/%d]", cnt, p.capacity)
|
||||
|
@ -59,6 +60,7 @@ func (p *Peers) Collect() error {
|
|||
|
||||
// As part of |SnowflakeCollector| interface.
|
||||
func (p *Peers) Pop() *webRTCConn {
|
||||
|
||||
// Blocks until an available snowflake appears.
|
||||
snowflake, ok := <-p.snowflakeChan
|
||||
if !ok {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue