Removed comments
This commit is contained in:
@@ -41,8 +41,6 @@ func ReceivePacket(key [32]byte, conn *net.UDPConn) common.Packet {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// fmt.Printf("Decrypted Packet, Sync: %v, Type: %v\n", pck.Sync, pck.Flag)
|
|
||||||
|
|
||||||
return pck
|
return pck
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +110,6 @@ func GetFile(path string, address string) {
|
|||||||
|
|
||||||
StartConnection(request.Sid, key, fmt.Sprintf("%v:13375", address))
|
StartConnection(request.Sid, key, fmt.Sprintf("%v:13375", address))
|
||||||
|
|
||||||
// udpAddr, err := net.ResolveUDPAddr("udp", "0.0.0.0:13374")
|
|
||||||
udpAddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%v:13374", address))
|
udpAddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%v:13374", address))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
@@ -227,7 +224,6 @@ func GetFile(path string, address string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
offset := (int64(pck.Sync) - int64(ackPck.Sync+1)) * int64(common.MaxDataSize)
|
offset := (int64(pck.Sync) - int64(ackPck.Sync+1)) * int64(common.MaxDataSize)
|
||||||
// fmt.Printf("Sync: %v, Offset: %v\n", pck.sync, offset)
|
|
||||||
|
|
||||||
_, err = file.WriteAt(pck.Data, offset)
|
_, err = file.WriteAt(pck.Data, offset)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -242,11 +242,8 @@ func (server *Server) sendPTE(conn *net.UDPConn, addr *net.UDPAddr, pck *common.
|
|||||||
file := filepath.Join(server.parentFilePath, path)
|
file := filepath.Join(server.parentFilePath, path)
|
||||||
file = filepath.Clean(file)
|
file = filepath.Clean(file)
|
||||||
|
|
||||||
// fmt.Sprintf("%v\\*", server.parentFilePath)
|
|
||||||
matched, err := filepath.Match(filepath.Join(server.parentFilePath, "*"), file)
|
matched, err := filepath.Match(filepath.Join(server.parentFilePath, "*"), file)
|
||||||
|
|
||||||
fmt.Println(filepath.Join(server.parentFilePath, "*"))
|
|
||||||
|
|
||||||
if err != nil || !matched {
|
if err != nil || !matched {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"ParentFilePath": server.parentFilePath,
|
"ParentFilePath": server.parentFilePath,
|
||||||
@@ -383,8 +380,6 @@ func (server *Server) handleConnection(conn net.Conn) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// fmt.Println(buf)
|
|
||||||
|
|
||||||
rsaPck := common.RsaPacketFromBytes(buf[0:r])
|
rsaPck := common.RsaPacketFromBytes(buf[0:r])
|
||||||
key, err := rsaPck.ExtractKey(server.rsa)
|
key, err := rsaPck.ExtractKey(server.rsa)
|
||||||
if err != nil && !errors.Is(err, io.EOF) {
|
if err != nil && !errors.Is(err, io.EOF) {
|
||||||
|
|||||||
Reference in New Issue
Block a user