148 lines
6.5 KiB
C#
148 lines
6.5 KiB
C#
using System;
|
|
using System.IO;
|
|
using BestHTTP.PlatformSupport.FileSystem;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP
|
|
{
|
|
// Token: 0x0200196D RID: 6509
|
|
[Token(Token = "0x200196D")]
|
|
internal sealed class FileConnection : ConnectionBase
|
|
{
|
|
// Token: 0x060096E3 RID: 38627 RVA: 0x001EAFC0 File Offset: 0x001E91C0
|
|
[Token(Token = "0x60096E3")]
|
|
[Address(RVA = "0x2A70930", Offset = "0x2A6F930", VA = "0x182A70930")]
|
|
public FileConnection(string serverAddress)
|
|
: base(serverAddress)
|
|
{
|
|
}
|
|
|
|
// Token: 0x060096E4 RID: 38628 RVA: 0x001EAFD4 File Offset: 0x001E91D4
|
|
[Token(Token = "0x60096E4")]
|
|
[Address(RVA = "0x2A70260", Offset = "0x2A6F260", VA = "0x182A70260", Slot = "6")]
|
|
internal override void Abort(HTTPConnectionStates newState)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060096E4)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.FileConnection::Abort(BestHTTP.HTTPConnectionStates)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_1C:
|
|
stloc:NotImplementedException(var_3_21, newobj:NotImplementedException(NotImplementedException::.ctor))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x060096E5 RID: 38629 RVA: 0x001EB004 File Offset: 0x001E9204
|
|
[Token(Token = "0x60096E5")]
|
|
[Address(RVA = "0x2A702F0", Offset = "0x2A6F2F0", VA = "0x182A702F0", Slot = "7")]
|
|
protected override void ThreadFunc(object param)
|
|
{
|
|
int num;
|
|
HTTPRequest <CurrentRequest>k__BackingField5;
|
|
do
|
|
{
|
|
num = 0;
|
|
IIOService ioservice = HTTPManager.IOService;
|
|
HTTPRequest <CurrentRequest>k__BackingField = this.<CurrentRequest>k__BackingField;
|
|
if (<CurrentRequest>k__BackingField.<IsRedirected>k__BackingField)
|
|
{
|
|
}
|
|
string localPath = <CurrentRequest>k__BackingField.<Uri>k__BackingField.LocalPath;
|
|
num += num;
|
|
num++;
|
|
Stream[] array = new Stream[2];
|
|
MemoryStream memoryStream = new MemoryStream();
|
|
if (memoryStream != 0)
|
|
{
|
|
}
|
|
array[0] = memoryStream;
|
|
if (num != 0)
|
|
{
|
|
}
|
|
array[1] = num;
|
|
StreamList streamList = new StreamList(array);
|
|
streamList.Write("HTTP/1.1 200 Ok\r\n");
|
|
streamList.Write("Content-Type: application/octet-stream\r\n");
|
|
string text2;
|
|
string text = "Content-Length: " + text2 + "\r\n";
|
|
streamList.Write(text);
|
|
streamList.Write("\r\n");
|
|
HTTPResponse httpresponse;
|
|
this.<CurrentRequest>k__BackingField.<Response>k__BackingField = httpresponse;
|
|
this.<CurrentRequest>k__BackingField.<Response>k__BackingField.Dispose();
|
|
this.<CurrentRequest>k__BackingField.<Response>k__BackingField = num;
|
|
if (streamList != 0)
|
|
{
|
|
}
|
|
if (num != 0)
|
|
{
|
|
goto IL_1DE;
|
|
}
|
|
if (num != -1)
|
|
{
|
|
}
|
|
num++;
|
|
if (num != 0)
|
|
{
|
|
}
|
|
if (num != 0)
|
|
{
|
|
goto IL_1E4;
|
|
}
|
|
if (num != -1)
|
|
{
|
|
}
|
|
num++;
|
|
HTTPRequest <CurrentRequest>k__BackingField2 = this.<CurrentRequest>k__BackingField;
|
|
HTTPRequest <CurrentRequest>k__BackingField3;
|
|
if (<CurrentRequest>k__BackingField2 != 0)
|
|
{
|
|
int num2 = 0;
|
|
<CurrentRequest>k__BackingField2.<Response>k__BackingField = num2;
|
|
if (this.<State>k__BackingField == HTTPConnectionStates.AbortRequested)
|
|
{
|
|
<CurrentRequest>k__BackingField3 = this.<CurrentRequest>k__BackingField;
|
|
<CurrentRequest>k__BackingField3.<State>k__BackingField = (HTTPRequestStates)((ulong)5L);
|
|
}
|
|
}
|
|
HTTPRequest <CurrentRequest>k__BackingField4;
|
|
if (<CurrentRequest>k__BackingField3 == (ulong)8L)
|
|
{
|
|
<CurrentRequest>k__BackingField4 = this.<CurrentRequest>k__BackingField;
|
|
<CurrentRequest>k__BackingField4.<State>k__BackingField = (HTTPRequestStates)((ulong)7L);
|
|
}
|
|
this.<CurrentRequest>k__BackingField.<Exception>k__BackingField = <CurrentRequest>k__BackingField4;
|
|
this.<CurrentRequest>k__BackingField.<State>k__BackingField = (HTTPRequestStates)((ulong)4L);
|
|
this.<State>k__BackingField = (HTTPConnectionStates)((ulong)9L);
|
|
<CurrentRequest>k__BackingField5 = this.<CurrentRequest>k__BackingField;
|
|
if (<CurrentRequest>k__BackingField5.<State>k__BackingField == HTTPRequestStates.Processing)
|
|
{
|
|
if (<CurrentRequest>k__BackingField5.<Response>k__BackingField != (ulong)0L)
|
|
{
|
|
break;
|
|
}
|
|
<CurrentRequest>k__BackingField5.<State>k__BackingField = (HTTPRequestStates)((ulong)4L);
|
|
}
|
|
}
|
|
while (num != 0);
|
|
<CurrentRequest>k__BackingField5.<State>k__BackingField = (HTTPRequestStates)((ulong)3L);
|
|
return;
|
|
IL_1DE:
|
|
throw new NullReferenceException();
|
|
IL_1E4:
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
}
|