feat(ftp): support upload, download and PASV rebind (#13)

Co-authored-by: E99p1ant <[email protected]>
This commit is contained in:
Li4n0
2021-05-05 12:59:50 +08:00
committed by GitHub
co-authored by E99p1ant
parent 3d8507e682
commit b39ee101f9
15 changed files with 374 additions and 146 deletions
+3 -3
View File
@@ -317,7 +317,7 @@ func (l *Listener) handle(conn net.Conn, connectionID uint32, acceptTime time.Ti
}
c.RecycleReadPacket()
if con, ok := c.conn.(*tls.Conn); ok {
if con, ok := c.Conn.(*tls.Conn); ok {
connState := con.ConnectionState()
tlsVerStr := tlsVersionToString(connState.Version)
if tlsVerStr != "" {
@@ -619,8 +619,8 @@ func (l *Listener) parseClientHandshakePacket(c *Conn, firstTime bool, data []by
// Check for SSL.
if firstTime && l.TLSConfig != nil && clientFlags&CapabilityClientSSL > 0 {
// Need to switch to TLS, and then re-read the packet.
conn := tls.Server(c.conn, l.TLSConfig)
c.conn = conn
conn := tls.Server(c.Conn, l.TLSConfig)
c.Conn = conn
c.bufferedReader.Reset(conn)
c.Capabilities |= CapabilityClientSSL
return "", "", nil, nil