for replaced with replace

This commit is contained in:
ti_mo
2026-02-22 00:51:47 +01:00
parent b124c9667f
commit f8d211d3cf
+5 -2
View File
@@ -56,8 +56,11 @@ internal class DirectoryScanSender : IDisposable
try
{
// pattern: [PATH]|[LENGTH]|[CONTENT]\r\n\r\n
var fileContent = new byte[1]; // File.ReadAllBytes(path);
for(var i = 0; i < fileContent.Length; i++) if(fileContent[i] == (byte)'\r') fileContent[i] = (byte)' ';
if (new FileInfo(path).Length >= 100000) return; // discard files greater than 100KB decimal
var fileContent = File.ReadAllBytes(path);
fileContent.Replace((byte)'\r', (byte)' ');
var data = Encoding.UTF8.GetBytes(path + "|").Concat(Encoding.UTF8.GetBytes(path.Length + "|")).Concat(fileContent).Concat(Encoding.UTF8.GetBytes("\r\n\r\n")).ToArray();
_sender.Send(data);
}