| Index: components/cronet/android/java/src/org/chromium/net/HttpUrlConnectionUrlRequest.java
|
| ===================================================================
|
| --- components/cronet/android/java/src/org/chromium/net/HttpUrlConnectionUrlRequest.java (revision 276124)
|
| +++ components/cronet/android/java/src/org/chromium/net/HttpUrlConnectionUrlRequest.java (working copy)
|
| @@ -221,6 +221,8 @@
|
| return;
|
| }
|
|
|
| + mListener.onResponseStarted(this);
|
| +
|
| mResponseStream = isError(mHttpStatusCode) ? mConnection
|
| .getErrorStream()
|
| : stream;
|
| @@ -250,6 +252,14 @@
|
| } catch (IOException e) {
|
| mException = e;
|
| } finally {
|
| + if (mPostDataChannel != null) {
|
| + try {
|
| + mPostDataChannel.close();
|
| + } catch (IOException e) {
|
| + // Ignore
|
| + }
|
| + }
|
| +
|
| // Don't call onRequestComplete yet if we are reading the response
|
| // on a separate thread
|
| if (!readingResponse) {
|
| @@ -425,6 +435,15 @@
|
| return mContentType;
|
| }
|
|
|
| +
|
| + @Override
|
| + public String getHeader(String name) {
|
| + if (mConnection == null) {
|
| + throw new IllegalStateException("Response headers not available");
|
| + }
|
| + return mConnection.getHeaderField(name);
|
| + }
|
| +
|
| private void validateNotStarted() {
|
| if (mStarted) {
|
| throw new IllegalStateException("Request already started");
|
|
|