Skip to content

Commit dc171a5

Browse files
Setup Streaming after httpcontext is initialized
1 parent ab2cc19 commit dc171a5

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

dotnet/src/dotnetframework/GxClasses/Middleware/GXHttp.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,8 +1851,6 @@ public bool IsMain
18511851
get { return _isMain; }
18521852
}
18531853
#endif
1854-
1855-
18561854
public void ProcessRequest(HttpContext httpContext)
18571855
{
18581856
localHttpContext = httpContext;
@@ -1877,6 +1875,7 @@ public void ProcessRequest(HttpContext httpContext)
18771875
InitPrivates();
18781876
try
18791877
{
1878+
SetStreaming();
18801879
SendHeaders();
18811880
string clientid = context.ClientID; //Send clientid cookie (before response HasStarted) if necessary, since UseResponseBuffering is not in .netcore3.0
18821881

@@ -1928,6 +1927,17 @@ public void ProcessRequest(HttpContext httpContext)
19281927
throw new Exception("GXApplication exception", e);
19291928
}
19301929
}
1930+
protected virtual bool ChunkedStreaming() { return false; }
1931+
1932+
private void SetStreaming()
1933+
{
1934+
#if !NETCORE
1935+
if (ChunkedStreaming())
1936+
{
1937+
context.HttpContext.Response.Buffer = false;
1938+
}
1939+
#endif
1940+
}
19311941
internal string DumpHeaders(HttpContext httpContext)
19321942
{
19331943
StringBuilder str = new StringBuilder();

dotnet/src/dotnetframework/GxClasses/Model/GXWebProcedure.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public override void webExecute() { }
4040
public override void initialize() { }
4141
protected override void createObjects() { }
4242
public override void skipLines(long nToSkip) { }
43-
protected virtual bool ChunkedStreaming() { return false; }
4443

4544
public override void cleanup()
4645
{
@@ -49,15 +48,6 @@ public override void cleanup()
4948
context.DeleteReferer();
5049
}
5150
}
52-
public GXWebProcedure()
53-
{
54-
#if !NETCORE
55-
if (ChunkedStreaming())
56-
{
57-
context.HttpContext.Response.Buffer = false;
58-
}
59-
#endif
60-
}
6151
protected override void SetCompression(HttpContext httpContext)
6252
{
6353
if (!ChunkedStreaming())

0 commit comments

Comments
 (0)