Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Snowflake
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
David Fifield
Snowflake
Commits
5339ed2d
Commit
5339ed2d
authored
3 years ago
by
Cecylia Bocovich
Browse files
Options
Downloads
Patches
Plain Diff
Stop exporting internal code
parent
5927c2bd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/lib/http.go
+3
-3
3 additions, 3 deletions
server/lib/http.go
server/lib/snowflake.go
+3
-3
3 additions, 3 deletions
server/lib/snowflake.go
with
6 additions
and
6 deletions
server/lib/http.go
+
3
−
3
View file @
5339ed2d
...
...
@@ -60,14 +60,14 @@ func (conn *overrideReadConn) Read(p []byte) (int, error) {
return
conn
.
Reader
.
Read
(
p
)
}
type
HTTP
Handler
struct
{
type
http
Handler
struct
{
// pconn is the adapter layer between stream-oriented WebSocket
// connections and the packet-oriented KCP layer.
pconn
*
turbotunnel
.
QueuePacketConn
ln
*
SnowflakeListener
}
func
(
handler
*
HTTP
Handler
)
ServeHTTP
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
func
(
handler
*
http
Handler
)
ServeHTTP
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
ws
,
err
:=
upgrader
.
Upgrade
(
w
,
r
,
nil
)
if
err
!=
nil
{
log
.
Println
(
err
)
...
...
@@ -114,7 +114,7 @@ func (handler *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// of their stream. These clients use the WebSocket as a raw pipe, and expect
// their session to begin and end when this single WebSocket does.
func
oneshotMode
(
conn
net
.
Conn
,
addr
net
.
Addr
,
ln
*
SnowflakeListener
)
error
{
return
ln
.
Q
ueueConn
(
&
SnowflakeClientConn
{
Conn
:
conn
,
address
:
addr
})
return
ln
.
q
ueueConn
(
&
SnowflakeClientConn
{
Conn
:
conn
,
address
:
addr
})
}
// turbotunnelMode handles clients that sent turbotunnel.Token at the start of
...
...
This diff is collapsed.
Click to expand it.
server/lib/snowflake.go
+
3
−
3
View file @
5339ed2d
...
...
@@ -35,7 +35,7 @@ func NewSnowflakeServer(getCertificate func(*tls.ClientHelloInfo) (*tls.Certific
func
(
t
*
Transport
)
Listen
(
addr
net
.
Addr
)
(
*
SnowflakeListener
,
error
)
{
listener
:=
&
SnowflakeListener
{
addr
:
addr
,
queue
:
make
(
chan
net
.
Conn
,
65534
)}
handler
:=
HTTP
Handler
{
handler
:=
http
Handler
{
// pconn is shared among all connections to this server. It
// overlays packet-based client sessions on top of ephemeral
// WebSocket connections.
...
...
@@ -187,7 +187,7 @@ func (l *SnowflakeListener) acceptStreams(conn *kcp.UDPSession) error {
}
return
err
}
l
.
Q
ueueConn
(
&
SnowflakeClientConn
{
Conn
:
stream
,
address
:
addr
})
l
.
q
ueueConn
(
&
SnowflakeClientConn
{
Conn
:
stream
,
address
:
addr
})
}
}
...
...
@@ -226,7 +226,7 @@ func (l *SnowflakeListener) acceptSessions(ln *kcp.Listener) error {
}
}
func
(
l
*
SnowflakeListener
)
Q
ueueConn
(
conn
net
.
Conn
)
error
{
func
(
l
*
SnowflakeListener
)
q
ueueConn
(
conn
net
.
Conn
)
error
{
select
{
case
<-
l
.
closed
:
return
fmt
.
Errorf
(
"accepted connection on closed listener"
)
...
...
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