Skip to content

Commit

Permalink
Pull up sendAck()
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1650272 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jan 8, 2015
1 parent 6881e17 commit c8635d8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 48 deletions.
10 changes: 9 additions & 1 deletion java/org/apache/coyote/http11/AbstractOutputBuffer.java
Expand Up @@ -378,7 +378,15 @@ public void init(SocketWrapperBase<S> socketWrapper) {
} }




public abstract void sendAck() throws IOException; public void sendAck() throws IOException {
if (!committed) {
addToBB(Constants.ACK_BYTES, 0, Constants.ACK_BYTES.length);
if (flushBuffer(true)) {
throw new IOException(sm.getString("iob.failedwrite.ack"));
}
}
}



/** /**
* Commit the response. * Commit the response.
Expand Down
16 changes: 0 additions & 16 deletions java/org/apache/coyote/http11/InternalAprOutputBuffer.java
Expand Up @@ -87,22 +87,6 @@ public void recycle() {
} }




// ------------------------------------------------ HTTP/1.1 Output Methods

/**
* Send an acknowledgment.
*/
@Override
public void sendAck() throws IOException {
if (!committed) {
addToBB(Constants.ACK_BYTES, 0, Constants.ACK_BYTES.length);
if (flushBuffer(true)) {
throw new IOException(sm.getString("iob.failedwrite.ack"));
}
}
}


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


@Override @Override
Expand Down
12 changes: 0 additions & 12 deletions java/org/apache/coyote/http11/InternalNio2OutputBuffer.java
Expand Up @@ -223,18 +223,6 @@ public void nextRequest() {
writeBufferFlipped = false; writeBufferFlipped = false;
} }


// ------------------------------------------------ HTTP/1.1 Output Methods

/**
* Send an acknowledgment.
*/
@Override
public void sendAck() throws IOException {
if (!committed) {
addToBB(Constants.ACK_BYTES, 0, Constants.ACK_BYTES.length);
flushBuffer(true);
}
}


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


Expand Down
19 changes: 0 additions & 19 deletions java/org/apache/coyote/http11/InternalNioOutputBuffer.java
Expand Up @@ -63,22 +63,6 @@ public void recycle() {
} }




// ------------------------------------------------ HTTP/1.1 Output Methods

/**
* Send an acknowledgment.
*/
@Override
public void sendAck() throws IOException {
if (!committed) {
addToBB(Constants.ACK_BYTES, 0, Constants.ACK_BYTES.length);
if (flushBuffer(true)) {
throw new IOException(sm.getString("iob.failedwrite.ack"));
}
}
}


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


@Override @Override
Expand All @@ -87,9 +71,6 @@ protected synchronized void addToBB(byte[] buf, int offset, int length) throws I
} }




/**
* Callback to write data from the buffer.
*/
@Override @Override
protected boolean flushBuffer(boolean block) throws IOException { protected boolean flushBuffer(boolean block) throws IOException {
return socketWrapper.flush(block); return socketWrapper.flush(block);
Expand Down

0 comments on commit c8635d8

Please sign in to comment.