ncannasse 8 năm trước cách đây
mục cha
commit
0e86539b32
1 tập tin đã thay đổi với 3 bổ sung5 xóa
  1. 3 5
      hxd/net/Socket.hx

+ 3 - 5
hxd/net/Socket.hx

@@ -308,7 +308,6 @@ class HLSocketInput extends SocketInput {
 			s.onError("Connection closed");
 			return;
 		}
-		//trace(">" + recvData.toBytes(recv).toHex());
 		var req = pos + len + recv;
 		if( req > size && pos >= (size >> 1) ) {
 			data.blit(0, data, pos, len);
@@ -343,10 +342,9 @@ class HLSocketInput extends SocketInput {
 	override function readBytes(s:haxe.io.Bytes, pos:Int, len:Int):Int {
 		if( pos < 0 || len < 0  || pos + len > s.length ) throw haxe.io.Error.OutsideBounds;
 		var max = len < this.len ? len : this.len;
-		@:privateAccess s.b.blit(pos, data, pos, max);
-		//trace("<" + s.sub(pos,len).toHex());
-		pos += max;
-		len -= max;
+		@:privateAccess s.b.blit(pos, data, this.pos, max);
+		this.pos += max;
+		this.len -= max;
 		return max;
 	}