summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/CompileServer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-07-12 13:05:13 +0000
committerMartin Odersky <odersky@gmail.com>2006-07-12 13:05:13 +0000
commit8592375f95a644f0bae55b4ce9215b4533cba2d4 (patch)
tree4dc29cb2a7c56c3c7c47da9d3b643646b952959f /src/compiler/scala/tools/nsc/CompileServer.scala
parentb53dced1215bffa82ae3f4aa38f614e4a0f48a7d (diff)
downloadscala-8592375f95a644f0bae55b4ce9215b4533cba2d4.tar.gz
scala-8592375f95a644f0bae55b4ce9215b4533cba2d4.tar.bz2
scala-8592375f95a644f0bae55b4ce9215b4533cba2d4.zip
Made fsc safer and scriptable
Fixed position errors for imported prefixes Fixed symbol literals (bug369)
Diffstat (limited to 'src/compiler/scala/tools/nsc/CompileServer.scala')
-rw-r--r--src/compiler/scala/tools/nsc/CompileServer.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/CompileServer.scala b/src/compiler/scala/tools/nsc/CompileServer.scala
index 53ca8dff56..256bc6bdd5 100644
--- a/src/compiler/scala/tools/nsc/CompileServer.scala
+++ b/src/compiler/scala/tools/nsc/CompileServer.scala
@@ -5,7 +5,7 @@
// $Id$
package scala.tools.nsc
-import scala.tools.util.{SocketServer, StringOps}
+import scala.tools.util.SocketServer
import scala.tools.nsc.util.Position
import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
import scala.tools.nsc.doc.DocGenerator
@@ -69,12 +69,14 @@ object CompileServer extends SocketServer {
System.out.println("New session, total memory = "+runtime.totalMemory()+
", max memory = "+runtime.maxMemory()+
", free memory = "+runtime.freeMemory)
+ val passWord = CompileSocket.getPassWord(port)
+ val guestPassWord = in.readLine()
val input = in.readLine()
- if (input != null) {
+ if (input != null && passWord == guestPassWord) {
try {
inSession = true
progress = true
- val args = StringOps.words(input)
+ val args = input.split("\0").toList
if (args contains "-shutdown") {
out.println("[Scala compile server exited]")
shutDown = true
@@ -110,7 +112,7 @@ object CompileServer extends SocketServer {
else if (command.files.isEmpty)
reporter.info(null, command.usageMsg, true)
else {
- try {scala.tools.nsc.CompileServer
+ try {
if (compiler != null && settingsAreCompatible(command.settings, compiler.settings)) {
compiler.settings = command.settings
compiler.reporter = reporter