Merge branch 'master-MC1.8.9' of github.com:MightyPirates/OpenComputers into master-MC1.9.4

This commit is contained in:
Florian Nücke 2016-07-18 20:09:15 +02:00
commit 792331ba77

View File

@ -267,7 +267,7 @@ object InternetCard {
@Callback(doc = """function([n:number]):string -- Tries to read data from the socket stream. Returns the read byte array.""")
def read(context: Context, args: Arguments): Array[AnyRef] = this.synchronized {
val n = math.min(Settings.get.maxReadBuffer, math.max(0, args.optInteger(1, Int.MaxValue)))
val n = math.min(Settings.get.maxReadBuffer, math.max(0, args.optInteger(0, Int.MaxValue)))
if (checkConnected()) {
val buffer = ByteBuffer.allocate(n)
val read = channel.read(buffer)
@ -392,7 +392,7 @@ object InternetCard {
@Callback(doc = """function([n:number]):string -- Tries to read data from the response. Returns the read byte array.""")
def read(context: Context, args: Arguments): Array[AnyRef] = this.synchronized {
val n = math.min(Settings.get.maxReadBuffer, math.max(0, args.optInteger(1, Int.MaxValue)))
val n = math.min(Settings.get.maxReadBuffer, math.max(0, args.optInteger(0, Int.MaxValue)))
if (checkResponse()) {
if (eof && queue.isEmpty) result(Unit)
else {