Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Snowflake WebExtension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Anti-censorship
Pluggable Transports
Snowflake WebExtension
Commits
febb4936
Commit
febb4936
authored
5 years ago
by
David Fifield
Browse files
Options
Downloads
Patches
Plain Diff
Refactor SOCKS-related logging.
parent
aa399985
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/snowflake.go
+2
-3
2 additions, 3 deletions
client/snowflake.go
with
2 additions
and
3 deletions
client/snowflake.go
+
2
−
3
View file @
febb4936
...
...
@@ -47,9 +47,7 @@ func ConnectLoop(snowflakes sf.SnowflakeCollector) {
// Accept local SOCKS connections and pass them to the handler.
func
socksAcceptLoop
(
ln
*
pt
.
SocksListener
,
snowflakes
sf
.
SnowflakeCollector
)
{
defer
ln
.
Close
()
log
.
Println
(
"Started SOCKS listener."
)
for
{
log
.
Println
(
"SOCKS listening..."
)
conn
,
err
:=
ln
.
AcceptSocks
()
if
err
!=
nil
{
if
err
,
ok
:=
err
.
(
net
.
Error
);
ok
&&
err
.
Temporary
()
{
...
...
@@ -58,7 +56,7 @@ func socksAcceptLoop(ln *pt.SocksListener, snowflakes sf.SnowflakeCollector) {
log
.
Printf
(
"SOCKS accept error: %s"
,
err
)
break
}
log
.
Print
ln
(
"SOCKS accepted: "
,
conn
.
Req
)
log
.
Print
f
(
"SOCKS accepted:
%v
"
,
conn
.
Req
)
err
=
sf
.
Handler
(
conn
,
snowflakes
)
if
err
!=
nil
{
log
.
Printf
(
"handler error: %s"
,
err
)
...
...
@@ -167,6 +165,7 @@ func main() {
pt
.
CmethodError
(
methodName
,
err
.
Error
())
break
}
log
.
Printf
(
"Started SOCKS listener at %v."
,
ln
.
Addr
())
go
socksAcceptLoop
(
ln
,
snowflakes
)
pt
.
Cmethod
(
methodName
,
ln
.
Version
(),
ln
.
Addr
())
listeners
=
append
(
listeners
,
ln
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment