diff options
Diffstat (limited to 'src/main/scala/com/tylerstonge/honeypot/ftp/FtpHandler.scala')
-rw-r--r-- | src/main/scala/com/tylerstonge/honeypot/ftp/FtpHandler.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/scala/com/tylerstonge/honeypot/ftp/FtpHandler.scala b/src/main/scala/com/tylerstonge/honeypot/ftp/FtpHandler.scala index b7b6f03..313bf64 100644 --- a/src/main/scala/com/tylerstonge/honeypot/ftp/FtpHandler.scala +++ b/src/main/scala/com/tylerstonge/honeypot/ftp/FtpHandler.scala @@ -15,6 +15,7 @@ object FtpHandler { class FtpHandler(client: ActorRef) extends Actor { val log: LoggingAdapter = Logging(context.system, this) + var fileReceiver: ActorRef = ActorRef.noSender override def receive: Receive = { case Received(data) => client ! Write(ByteString.apply(parse(sanitize(data)))) @@ -39,11 +40,12 @@ class FtpHandler(client: ActorRef) extends Actor { val r = new Random() val p1 = r.nextInt(200) val p2 = r.nextInt(200) - context.actorOf(FtpFileReceiver.props(p1 * 256 + p2, client), name = "passive-connection") + fileReceiver = context.actorOf(FtpFileReceiver.props(p1 * 256 + p2, client), name = "passive-connection") Thread.sleep(256) "227 entering passive mode (127,0,0,1," + p1 + "," + p2 + ")\n" case "stor" => log.debug("stor: {}", msg(1)) + fileReceiver ! SetName(msg(1)) "150 File status okay; about to open data connection.\n" case _ => log.debug("unsupported command received: {}", msg.mkString(" ")) |