@@ -164,22 +164,6 @@ boolean isTerse(Class<?> t) {
164164 */
165165 public static final ByteBuffer HEADER = ByteBuffer .wrap ("hrpc" .getBytes ());
166166
167- /**
168- * Serialization type for ConnectionContext and RpcRequestHeader
169- */
170- public enum IpcSerializationType {
171- // Add new serialization type to the end without affecting the enum order
172- PROTOBUF ;
173-
174- void write (DataOutput out ) throws IOException {
175- out .writeByte (this .ordinal ());
176- }
177-
178- static IpcSerializationType fromByte (byte b ) {
179- return IpcSerializationType .values ()[b ];
180- }
181- }
182-
183167 /**
184168 * If the user accidentally sends an HTTP GET to an IPC port, we detect this
185169 * and send back a nicer response.
@@ -1322,7 +1306,7 @@ public int readAndProcess() throws IOException, InterruptedException {
13221306 if (!connectionHeaderRead ) {
13231307 //Every connection is expected to send the header.
13241308 if (connectionHeaderBuf == null ) {
1325- connectionHeaderBuf = ByteBuffer .allocate (4 );
1309+ connectionHeaderBuf = ByteBuffer .allocate (3 );
13261310 }
13271311 count = channelRead (channel , connectionHeaderBuf );
13281312 if (count < 0 || connectionHeaderBuf .remaining () > 0 ) {
@@ -1355,13 +1339,6 @@ public int readAndProcess() throws IOException, InterruptedException {
13551339 return -1 ;
13561340 }
13571341
1358- IpcSerializationType serializationType = IpcSerializationType
1359- .fromByte (connectionHeaderBuf .get (3 ));
1360- if (serializationType != IpcSerializationType .PROTOBUF ) {
1361- respondUnsupportedSerialization (serializationType );
1362- return -1 ;
1363- }
1364-
13651342 dataLengthBuffer .clear ();
13661343 if (authMethod == null ) {
13671344 throw new IOException ("Unable to read authentication method" );
@@ -1554,18 +1531,6 @@ private void setupBadVersionResponse(int clientVersion) throws IOException {
15541531 }
15551532 }
15561533
1557- private void respondUnsupportedSerialization (IpcSerializationType st ) throws IOException {
1558- String errMsg = "Server IPC version " + CURRENT_VERSION
1559- + " do not support serilization " + st .toString ();
1560- ByteArrayOutputStream buffer = new ByteArrayOutputStream ();
1561-
1562- Call fakeCall = new Call (-1 , null , this );
1563- setupResponse (buffer , fakeCall ,
1564- RpcStatusProto .FATAL , RpcErrorCodeProto .FATAL_UNSUPPORTED_SERIALIZATION ,
1565- null , IpcException .class .getName (), errMsg );
1566- responder .doRespond (fakeCall );
1567- }
1568-
15691534 private void setupHttpRequestOnIpcPortResponse () throws IOException {
15701535 Call fakeCall = new Call (0 , null , this );
15711536 fakeCall .setResponse (ByteBuffer .wrap (
0 commit comments