addressed nits

This commit is contained in:
emmaus 2018-08-21 15:29:39 +00:00
commit b4fea798c7

View file

@ -125,6 +125,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
int SocketFlags = Context.RequestData.ReadInt32(); int SocketFlags = Context.RequestData.ReadInt32();
(long ReceivePosition, long ReceiveLength) = Context.Request.GetBufferType0x22(); (long ReceivePosition, long ReceiveLength) = Context.Request.GetBufferType0x22();
byte[] ReceivedBuffer = new byte[ReceiveLength]; byte[] ReceivedBuffer = new byte[ReceiveLength];
try try
@ -152,6 +153,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
int SocketFlags = Context.RequestData.ReadInt32(); int SocketFlags = Context.RequestData.ReadInt32();
(long SentPosition, long SentSize) = Context.Request.GetBufferType0x21(); (long SentPosition, long SentSize) = Context.Request.GetBufferType0x21();
byte[] SentBuffer = Context.Memory.ReadBytes(SentPosition, SentSize); byte[] SentBuffer = Context.Memory.ReadBytes(SentPosition, SentSize);
try try
@ -180,6 +182,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
Context.Request.SendBuff[0].Size); Context.Request.SendBuff[0].Size);
(long AddressPosition, long AddressSize) = Context.Request.GetBufferType0x21(Index: 1); (long AddressPosition, long AddressSize) = Context.Request.GetBufferType0x21(Index: 1);
byte[] AddressBuffer = Context.Memory.ReadBytes(AddressPosition, AddressSize); byte[] AddressBuffer = Context.Memory.ReadBytes(AddressPosition, AddressSize);
if (!Sockets[SocketId].Handle.Connected) if (!Sockets[SocketId].Handle.Connected)
@ -284,6 +287,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
int SocketId = Context.RequestData.ReadInt32(); int SocketId = Context.RequestData.ReadInt32();
(long AddressPosition, long AddressSize) = Context.Request.GetBufferType0x21(); (long AddressPosition, long AddressSize) = Context.Request.GetBufferType0x21();
byte[] AddressBuffer = Context.Memory.ReadBytes(AddressPosition, AddressSize); byte[] AddressBuffer = Context.Memory.ReadBytes(AddressPosition, AddressSize);
try try
@ -308,6 +312,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
int SocketId = Context.RequestData.ReadInt32(); int SocketId = Context.RequestData.ReadInt32();
(long AddressPosition, long AddressSize) = Context.Request.GetBufferType0x21(); (long AddressPosition, long AddressSize) = Context.Request.GetBufferType0x21();
byte[] AddressBuffer = Context.Memory.ReadBytes(AddressPosition, AddressSize); byte[] AddressBuffer = Context.Memory.ReadBytes(AddressPosition, AddressSize);
try try
@ -386,6 +391,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
int SocketId = Context.RequestData.ReadInt32(); int SocketId = Context.RequestData.ReadInt32();
(long SentPosition, long SentSize) = Context.Request.GetBufferType0x21(); (long SentPosition, long SentSize) = Context.Request.GetBufferType0x21();
byte[] SentBuffer = Context.Memory.ReadBytes(SentPosition, SentSize); byte[] SentBuffer = Context.Memory.ReadBytes(SentPosition, SentSize);
try try
@ -412,14 +418,13 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
int SocketId = Context.RequestData.ReadInt32(); int SocketId = Context.RequestData.ReadInt32();
(long ReceivePosition, long ReceiveLength) = Context.Request.GetBufferType0x22(); (long ReceivePosition, long ReceiveLength) = Context.Request.GetBufferType0x22();
byte[] ReceivedBuffer = new byte[ReceiveLength]; byte[] ReceivedBuffer = new byte[ReceiveLength];
try try
{ {
int BytesRead = Sockets[SocketId].Handle.Receive(ReceivedBuffer); int BytesRead = Sockets[SocketId].Handle.Receive(ReceivedBuffer);
//Logging.Debug("Received Buffer:" + Environment.NewLine + Logging.HexDump(ReceivedBuffer));
Context.Memory.WriteBytes(ReceivePosition, ReceivedBuffer); Context.Memory.WriteBytes(ReceivePosition, ReceivedBuffer);
Context.ResponseData.Write(BytesRead); Context.ResponseData.Write(BytesRead);