Skip to content

Commit

Permalink
Pull up commit()
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1648904 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jan 1, 2015
1 parent f3c7dba commit 1d0b1c2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 62 deletions.
16 changes: 15 additions & 1 deletion java/org/apache/coyote/http11/AbstractOutputBuffer.java
Expand Up @@ -373,7 +373,21 @@ public abstract void init(SocketWrapperBase<S> socketWrapper,


public abstract void sendAck() throws IOException; public abstract void sendAck() throws IOException;


protected abstract void commit() throws IOException; /**
* Commit the response.
*
* @throws IOException an underlying I/O error occurred
*/
protected void commit() throws IOException {
// The response is now committed
committed = true;
response.setCommitted(true);

if (pos > 0) {
// Sending the response header buffer
addToBB(headerBuffer, 0, pos);
}
}




/** /**
Expand Down
21 changes: 0 additions & 21 deletions java/org/apache/coyote/http11/InternalAprOutputBuffer.java
Expand Up @@ -113,27 +113,6 @@ public void sendAck() throws IOException {


// ------------------------------------------------------ Protected Methods // ------------------------------------------------------ Protected Methods



/**
* Commit the response.
*
* @throws IOException an underlying I/O error occurred
*/
@Override
protected void commit() throws IOException {

// The response is now committed
committed = true;
response.setCommitted(true);

if (pos > 0) {
// Sending the response header buffer
socketWriteBuffer.put(headerBuffer, 0, pos);
}

}


@Override @Override
protected synchronized void addToBB(byte[] buf, int offset, int length) protected synchronized void addToBB(byte[] buf, int offset, int length)
throws IOException { throws IOException {
Expand Down
21 changes: 1 addition & 20 deletions java/org/apache/coyote/http11/InternalNio2OutputBuffer.java
Expand Up @@ -248,25 +248,6 @@ public void sendAck() throws IOException {


// ------------------------------------------------------ Protected Methods // ------------------------------------------------------ Protected Methods


/**
* Commit the response.
*
* @throws IOException an underlying I/O error occurred
*/
@Override
protected void commit() throws IOException {

// The response is now committed
committed = true;
response.setCommitted(true);

if (pos > 0) {
// Sending the response header buffer
addToBB(headerBuffer, 0, pos);
}

}

private static boolean arrayHasData(ByteBuffer[] byteBuffers) { private static boolean arrayHasData(ByteBuffer[] byteBuffers) {
for (ByteBuffer byteBuffer : byteBuffers) { for (ByteBuffer byteBuffer : byteBuffers) {
if (byteBuffer.hasRemaining()) { if (byteBuffer.hasRemaining()) {
Expand Down Expand Up @@ -451,7 +432,7 @@ protected boolean hasBufferedData() {
} }


@Override @Override
public void registerWriteInterest() { protected void registerWriteInterest() {
synchronized (completionHandler) { synchronized (completionHandler) {
if (writePending.availablePermits() == 0) { if (writePending.availablePermits() == 0) {
interest = true; interest = true;
Expand Down
20 changes: 0 additions & 20 deletions java/org/apache/coyote/http11/InternalNioOutputBuffer.java
Expand Up @@ -147,26 +147,6 @@ private synchronized int writeToSocket(ByteBuffer bytebuffer, boolean block, boo


// ------------------------------------------------------ Protected Methods // ------------------------------------------------------ Protected Methods


/**
* Commit the response.
*
* @throws IOException an underlying I/O error occurred
*/
@Override
protected void commit() throws IOException {

// The response is now committed
committed = true;
response.setCommitted(true);

if (pos > 0) {
// Sending the response header buffer
addToBB(headerBuffer, 0, pos);
}

}


@Override @Override
protected synchronized void addToBB(byte[] buf, int offset, int length) protected synchronized void addToBB(byte[] buf, int offset, int length)
throws IOException { throws IOException {
Expand Down

0 comments on commit 1d0b1c2

Please sign in to comment.