Commit 6e3ae006 authored by Honfika's avatar Honfika

call the event handlers from http/2 code

parent 578fd98c
...@@ -63,6 +63,7 @@ namespace Titanium.Web.Proxy.Http2 ...@@ -63,6 +63,7 @@ namespace Titanium.Web.Proxy.Http2
while (true) while (true)
{ {
int read = await ForceRead(input, headerBuffer, 0, 9, cancellationToken); int read = await ForceRead(input, headerBuffer, 0, 9, cancellationToken);
onCopy(headerBuffer, 0, read);
if (read != 9) if (read != 9)
{ {
return; return;
...@@ -75,6 +76,7 @@ namespace Titanium.Web.Proxy.Http2 ...@@ -75,6 +76,7 @@ namespace Titanium.Web.Proxy.Http2
headerBuffer[8]; headerBuffer[8];
read = await ForceRead(input, buffer, 0, length, cancellationToken); read = await ForceRead(input, buffer, 0, length, cancellationToken);
onCopy(buffer, 0, read);
if (read != length) if (read != length)
{ {
return; return;
...@@ -138,7 +140,7 @@ namespace Titanium.Web.Proxy.Http2 ...@@ -138,7 +140,7 @@ namespace Titanium.Web.Proxy.Http2
while (bytesToRead > 0) while (bytesToRead > 0)
{ {
int read = await input.ReadAsync(buffer, offset, bytesToRead, cancellationToken); int read = await input.ReadAsync(buffer, offset, bytesToRead, cancellationToken);
if (read == -1) if (read == 0)
{ {
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment