Skip to content

Commit

Permalink
LDEV-1545 Added BIF IsFlushed()
Browse files Browse the repository at this point in the history
  • Loading branch information
isapir committed Mar 10, 2024
1 parent 9b7d7c5 commit 77b033b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
33 changes: 33 additions & 0 deletions core/src/main/java/lucee/runtime/functions/other/IsFlushed.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright (c) 2015, Lucee Assosication Switzerland
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/

package lucee.runtime.functions.other;

import lucee.runtime.PageContext;
import lucee.runtime.ext.function.Function;

/**
* implements built in function isFlushed() which returns true if the response stream is committed
*/
public final class IsFlushed implements Function {

public static boolean call(PageContext pc) {

return pc.getHttpServletResponse().isCommitted();
}

}
9 changes: 9 additions & 0 deletions core/src/main/java/resource/fld/core-base.fld
Original file line number Diff line number Diff line change
Expand Up @@ -7373,6 +7373,15 @@ The following things are considered to be empty:
</return>
</function>

<function>
<name>IsFlushed</name>
<class>lucee.runtime.functions.other.IsFlushed</class>
<description>returns true if the response stream was already flushed.</description>
<return>
<type>boolean</type>
</return>
</function>

<!-- IsIPInRange -->
<function>
<name>IsIPInRange</name>
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project default="core" basedir="." name="Lucee"
xmlns:resolver="antlib:org.apache.maven.resolver.ant">

<property name="version" value="6.0.1.79-SNAPSHOT"/>
<property name="version" value="6.0.1.80-SNAPSHOT"/>

<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
<classpath>
Expand Down
2 changes: 1 addition & 1 deletion loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.lucee</groupId>
<artifactId>lucee</artifactId>
<version>6.0.1.79-SNAPSHOT</version>
<version>6.0.1.80-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down

0 comments on commit 77b033b

Please sign in to comment.