OSDN Git Service

Don't explode if flush() is called when an HTTP upload stream is closed.
authorJesse Wilson <jessewilson@google.com>
Thu, 30 Sep 2010 21:51:31 +0000 (14:51 -0700)
committerJesse Wilson <jessewilson@google.com>
Thu, 30 Sep 2010 21:54:23 +0000 (14:54 -0700)
commitf29ad8a60254345d1943d1b3836482395a7c916f
tree83ae26cc09342b29fa3986f13f0876d31f75cb91
parentdd07d5401392873c17a6a44d7fba72b60c689d12
Don't explode if flush() is called when an HTTP upload stream is closed.

Streams like BufferedOutputStream always call flush() even if it is
a no-op. These flushes must be permitted for compatibility with apps
that don't call close() until after the response has been retrieved.

Change-Id: Ic5c86ab6050c6c4d166c44ae5b4fc7a1688e7e45
http://b/3038470
luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/ChunkedOutputStream.java
luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/FixedLengthOutputStream.java
luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/RetryableOutputStream.java
luni/src/test/java/libcore/java/net/URLConnectionTest.java