mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-07-27 04:48:17 +02:00
More refactor
This commit is contained in:
parent
33290f59e6
commit
e9b7b352cf
5 changed files with 180 additions and 570 deletions
|
@ -1,5 +1,7 @@
|
|||
package main
|
||||
|
||||
import "github.com/bolkedebruin/rdpgw/protocol"
|
||||
|
||||
// RejectOption represents an option used to control the way connection is
|
||||
// rejected.
|
||||
type RejectOption func(*rejectConnectionError)
|
||||
|
@ -22,7 +24,7 @@ func RejectionStatus(code int) RejectOption {
|
|||
|
||||
// RejectionHeader returns an option that makes connection to be rejected with
|
||||
// given HTTP headers.
|
||||
func RejectionHeader(h HandshakeHeader) RejectOption {
|
||||
func RejectionHeader(h protocol.HandshakeHeader) RejectOption {
|
||||
return func(err *rejectConnectionError) {
|
||||
err.header = h
|
||||
}
|
||||
|
@ -44,7 +46,7 @@ func RejectConnectionError(options ...RejectOption) error {
|
|||
type rejectConnectionError struct {
|
||||
reason string
|
||||
code int
|
||||
header HandshakeHeader
|
||||
header protocol.HandshakeHeader
|
||||
}
|
||||
|
||||
// Error implements error interface.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue