Improved handling of BEGIN_REQUEST flags.
This commit is contained in:
parent
63e8a462d4
commit
05f4367790
|
@ -86,6 +86,7 @@ public class ClientGenerator extends Generator
|
|||
// Generate the FCGI_BEGIN_REQUEST frame
|
||||
beginRequestBuffer.putInt(0x01_01_00_00 + request);
|
||||
beginRequestBuffer.putInt(0x00_08_00_00);
|
||||
// Hardcode RESPONDER role and KEEP_ALIVE flag
|
||||
beginRequestBuffer.putLong(0x00_01_01_00_00_00_00_00L);
|
||||
beginRequestBuffer.flip();
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ public class BeginRequestContentParser extends ContentParser
|
|||
if (buffer.remaining() >= 5)
|
||||
{
|
||||
buffer.position(buffer.position() + 5);
|
||||
onStart(getRequest(), role);
|
||||
onStart();
|
||||
reset();
|
||||
return true;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ public class BeginRequestContentParser extends ContentParser
|
|||
buffer.get();
|
||||
if (++cursor == 5)
|
||||
{
|
||||
onStart(getRequest(), role);
|
||||
onStart();
|
||||
reset();
|
||||
return true;
|
||||
}
|
||||
|
@ -107,9 +107,9 @@ public class BeginRequestContentParser extends ContentParser
|
|||
return false;
|
||||
}
|
||||
|
||||
private void onStart(int request, int role)
|
||||
private void onStart()
|
||||
{
|
||||
listener.onStart(request, FCGI.Role.from(role));
|
||||
listener.onStart(getRequest(), FCGI.Role.from(role), flags);
|
||||
}
|
||||
|
||||
private void reset()
|
||||
|
|
|
@ -41,12 +41,12 @@ public class ServerParser extends Parser
|
|||
|
||||
public interface Listener extends Parser.Listener
|
||||
{
|
||||
public void onStart(int request, FCGI.Role role);
|
||||
public void onStart(int request, FCGI.Role role, int flags);
|
||||
|
||||
public static class Adapter extends Parser.Listener.Adapter implements Listener
|
||||
{
|
||||
@Override
|
||||
public void onStart(int request, FCGI.Role role)
|
||||
public void onStart(int request, FCGI.Role role, int flags)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,8 +115,9 @@ public class ServerFCGIConnection extends AbstractConnection
|
|||
private class ServerListener implements ServerParser.Listener
|
||||
{
|
||||
@Override
|
||||
public void onStart(int request, FCGI.Role role)
|
||||
public void onStart(int request, FCGI.Role role, int flags)
|
||||
{
|
||||
// TODO: handle flags
|
||||
HttpChannelOverFCGI channel = new HttpChannelOverFCGI(connector, configuration, getEndPoint(),
|
||||
new HttpTransportOverFCGI(connector.getByteBufferPool(), flusher, request), new ByteBufferQueuedHttpInput());
|
||||
HttpChannelOverFCGI existing = channels.putIfAbsent(request, channel);
|
||||
|
|
Loading…
Reference in New Issue