[SERVER-148] when getting message header, handle case where get <4 bytes Created: 11/Jul/09  Updated: 15/Jan/16  Resolved: 15/Jan/16

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Eliot Horowitz (Inactive) Assignee: Adam Midvidy
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Comments   
Comment by Andrew Morrow (Inactive) [ 15/Jan/16 ]

Sounds like you can resolve it.

Comment by Adam Midvidy [ 15/Jan/16 ]

nothing exciting, just see a typical "end connection" message in the mongod log.

Comment by Andrew Morrow (Inactive) [ 15/Jan/16 ]

What happens if you terminate the connection after two bytes?

Comment by Adam Midvidy [ 15/Jan/16 ]

So basically, not sure there is any work to do here at the moment.

Comment by Adam Midvidy [ 15/Jan/16 ]

I think we will just block until enough bytes are read, from my reading of Socket::recv.

I tried it out for fun.

➜  mongo git:(master) ✗ ./mongod
.... startup ...
2016-01-15T13:19:02.390-0500 I NETWORK  [initandlisten] waiting for connections on port 27017

then in another shell

➜  mongo git:(master) ✗ telnet localhost 27017
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
F

The server accepts the connection, but the accepting thread just blocks.

2016-01-15T13:19:36.957-0500 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:52412 #1 (1 connection now open)
(nothing printed after)

If i type in a few more characters in telnet I eventually get an error:

2016-01-15T13:20:28.413-0500 I NETWORK  [conn1] AssertionException handling request, closing client connection: 17132 SSL handshake received but server is started without SSL support

Doing it again with ssl enabled

2016-01-15T13:22:00.668-0500 E NETWORK  [conn1] SSL: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol

Generated at Thu Feb 08 02:53:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.