When using the socket to simulate the HTTP POST upload data, we encounter the following problems
Exception information:
07-31 16:05:49.165:w/system.err (16351): java.net.SocketException:sendto failed:epipe (broken pipe)
07-31 16:05:49.165:w/system.err (16351): at Libcore.io.IoBridge.maybeThrowAfterSendto (iobridge.java:499)
07-31 16:05:49.165:w/system.err (16351): at Libcore.io.IoBridge.sendto (iobridge.java:468)
07-31 16:05:49.165:w/system.err (16351): at Java.net.PlainSocketImpl.write (plainsocketimpl.java:507)
07-31 16:05:49.165:w/system.err (16351): at java.net.plainsocketimpl.access$100 (plainsocketimpl.java:46)
07-31 16:05:49.165:w/system.err (16351): at Java.net.plainsocketimpl$plainsocketoutputstream.write ( plainsocketimpl.java:269)
07-31 16:05:49.165:w/system.err (16351): at Java.io.BufferedOutputStream.write (bufferedoutputstream.java:131)
07-31 16:05:49.165:w/system.err (16351): at Java.io.OutputStream.write (outputstream.java:82)
07-31 16:05:49.168:w/system.err (16351): caused by:libcore.io.ErrnoException:sendto failed:epipe (broken pipe)
07-31 16:05:49.168:w/system.err (16351): At Libcore.io.Posix.sendtoBytes (Native method)
07-31 16:05:49.172:w/system.err (16351): at Libcore.io.Posix.sendto (posix.java:147)
07-31 16:05:49.172:w/system.err (16351): at Libcore.io.BlockGuardOs.sendto (blockguardos.java:177)
07-31 16:05:49.172:w/system.err (16351): at Libcore.io.IoBridge.sendto (iobridge.java:466)
The problem is that the client sees the connection established, but the actual connection channel is closed, the client is not aware, and the exception is generated when the data is sent again.
The request header was found to be problematic and not spec-induced.