Skip to content

Commit

Permalink
Fixes payara#327 and GLASSFISH-21007
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Millidge committed Aug 8, 2015
1 parent 630cfec commit f8aa282
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ protected Object initialValue() {
return f;
}
};

protected SimpleDateFormat formats[];
// END OF SJSAS 6231069
/**
Expand Down Expand Up @@ -589,6 +590,11 @@ protected synchronized Object initialValue() {
private boolean isDefaultContext = false;
// END GlassFish 1024
private String requestURI = null;


// FIX GLASSFISH-21007
private boolean handlerInitialised = false;

/**
* Coyote request.
*/
Expand Down Expand Up @@ -3170,6 +3176,14 @@ public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass)
coyoteRequest.getResponse().suspend();
return handler;
}

public void initialiseHttpUpgradeHandler(WebConnection wc) {
// ensure the handler is only initialised once
if (!handlerInitialised && httpUpgradeHandler != null) {
httpUpgradeHandler.init(wc);
handlerInitialised = true;
}
}

public WebConnection getWebConnection() {
return webConnection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,14 +774,14 @@ private void doInvoke(Request request, Response response, boolean chaining)
Context context = req.getContext();
try {
context.fireContainerEvent(ContainerEvent.BEFORE_UPGRADE_HANDLER_INITIALIZED, handler);
handler.init(wc);
req.initialiseHttpUpgradeHandler(wc);
} finally {
context.fireContainerEvent(ContainerEvent.AFTER_UPGRADE_HANDLER_INITIALIZED, handler);
}
} else {
log.log(Level.SEVERE, PROTOCOL_HANDLER_REQUIRED_EXCEPTION);
}
req.setUpgrade(false);
//req.setUpgrade(false);
}
}
}
Expand Down

0 comments on commit f8aa282

Please sign in to comment.