Skip to content

Commit

Permalink
Merge branch 'jetty-9.4.x' into jetty-10.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
olamy committed Mar 24, 2020
2 parents dfc2568 + e913ed2 commit b7a4fb7
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<Set name="hazelcastInstanceName" property="jetty.session.hazelcast.hazelcastInstanceName"/>
<Set name="scavengeZombies" property="jetty.session.hazelcast.scavengeZombies"/>
<Set name="gracePeriodSec"><Property name="jetty.session.gracePeriod.seconds" default="3600" /></Set>
<Set name="savePeriodSec" property="jetty.session.savePeriod.seconds"/>
<Set name="savePeriodSec"><Property name="jetty.session.savePeriod.seconds" default="0" /></Set>
<Set name="configurationLocation"><Property name="jetty.session.hazelcast.configurationLocation" default="" /></Set>
</New>
</Arg>
</Call>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<Set name="addresses">
<Property name="jetty.session.hazelcast.addresses" default="" />
</Set>
<Set name="configurationLocation">
<Property name="jetty.session.hazelcast.configurationLocation" default="" />
</Set>
</New>
</Arg>
</Call>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ jetty.session.hazelcast.hazelcastInstanceName=JETTY_DISTRIBUTED_SESSION_INSTANCE
jetty.session.hazelcast.scavengeZombies=false
jetty.session.gracePeriod.seconds=3600
jetty.session.savePeriod.seconds=0
#jetty.session.hazelcast.configurationLocation
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ jetty.session.hazelcast.onlyClient=true
jetty.session.hazelcast.scavengeZombies=false
jetty.session.gracePeriod.seconds=3600
jetty.session.savePeriod.seconds=0
#jetty.session.hazelcast.configurationLocation
#jetty.session.hazelcast.addresses=
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.eclipse.jetty.server.session.SessionDataStore;
import org.eclipse.jetty.server.session.SessionDataStoreFactory;
import org.eclipse.jetty.server.session.SessionHandler;
import org.eclipse.jetty.util.StringUtil;

/**
* Factory to construct {@link HazelcastSessionDataStore}
Expand Down Expand Up @@ -82,7 +83,7 @@ public SessionDataStore getSessionDataStore(SessionHandler handler)
{
if (onlyClient)
{
if (configurationLocation == null)
if (StringUtil.isEmpty(configurationLocation))
{
ClientConfig config = new ClientConfig();

Expand All @@ -106,7 +107,7 @@ public SessionDataStore getSessionDataStore(SessionHandler handler)
else
{
Config config;
if (configurationLocation == null)
if (StringUtil.isEmpty(configurationLocation))
{

SerializerConfig sc = new SerializerConfig()
Expand Down
17 changes: 14 additions & 3 deletions jetty-server/src/main/java/org/eclipse/jetty/server/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ public void sendRedirect(int code, String location) throws IOException
resetBuffer();
setHeader(HttpHeader.LOCATION, location);
setStatus(code);
completeOutput();
closeOutput();
}

@Override
Expand Down Expand Up @@ -849,7 +849,7 @@ public void setContentLength(int len)
{
try
{
completeOutput();
closeOutput();
}
catch (IOException e)
{
Expand Down Expand Up @@ -887,14 +887,25 @@ public boolean isContentComplete(long written)
return (_contentLength < 0 || written >= _contentLength);
}

public void completeOutput() throws IOException
public void closeOutput() throws IOException
{
if (_outputType == OutputType.WRITER)
_writer.close();
else
_out.close();
}

/**
* close the output
*
* @deprecated Use {@link #closeOutput()}
*/
@Deprecated
public void completeOutput() throws IOException
{
closeOutput();
}

public void completeOutput(Callback callback)
{
if (_outputType == OutputType.WRITER)
Expand Down

0 comments on commit b7a4fb7

Please sign in to comment.