mirror of
https://github.com/sbt/sbt.git
synced 2026-10-06 10:03:56 +02:00
Merge pull request #3523 from guillaumebort/1.0.x
Sbt server could miss some messages
This commit is contained in:
@@ -30,8 +30,8 @@ abstract class ServerConnection(connection: Socket) {
|
||||
bytesRead = in.read(readBuffer)
|
||||
buffer = buffer ++ readBuffer.toVector.take(bytesRead)
|
||||
// handle un-framing
|
||||
val delimPos = buffer.indexOf(delimiter)
|
||||
if (delimPos > 0) {
|
||||
var delimPos = buffer.indexOf(delimiter)
|
||||
while (delimPos > -1) {
|
||||
val chunk = buffer.take(delimPos)
|
||||
buffer = buffer.drop(delimPos + 1)
|
||||
|
||||
@@ -47,6 +47,7 @@ abstract class ServerConnection(connection: Socket) {
|
||||
case event: StringEvent => onLogEntry(event)
|
||||
}
|
||||
)
|
||||
delimPos = buffer.indexOf(delimiter)
|
||||
}
|
||||
|
||||
} catch {
|
||||
|
||||
@@ -29,8 +29,8 @@ final class NetworkChannel(val name: String, connection: Socket, structure: Buil
|
||||
bytesRead = in.read(readBuffer)
|
||||
buffer = buffer ++ readBuffer.toVector.take(bytesRead)
|
||||
// handle un-framing
|
||||
val delimPos = buffer.indexOf(delimiter)
|
||||
if (delimPos > 0) {
|
||||
var delimPos = buffer.indexOf(delimiter)
|
||||
while (delimPos > -1) {
|
||||
val chunk = buffer.take(delimPos)
|
||||
buffer = buffer.drop(delimPos + 1)
|
||||
|
||||
@@ -40,6 +40,7 @@ final class NetworkChannel(val name: String, connection: Socket, structure: Buil
|
||||
errorDesc => println("Got invalid chunk from client: " + errorDesc),
|
||||
onCommand
|
||||
)
|
||||
delimPos = buffer.indexOf(delimiter)
|
||||
}
|
||||
|
||||
} catch {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
### Bug fixes
|
||||
|
||||
- In some cases sbt server was missing some messages. By [@guillaumebort][@guillaumebort].
|
||||
|
||||
[@guillaumebort]: https://github.com/guillaumebort
|
||||
Reference in New Issue
Block a user