-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New signer token RPC & Initial signer connection without token. #2096
Conversation
General question around functionality -
|
Yes, so the second signer should ask for authorization token, which can be generated:
|
@@ -43,10 +44,11 @@ pub fn read_block(lines: &mut Lines, all: bool) -> String { | |||
|
|||
pub fn request(address: &SocketAddr, request: &str) -> Response { | |||
let mut req = TcpStream::connect(address).unwrap(); | |||
req.set_read_timeout(Some(Duration::from_secs(1))).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there an indication that this is in fact enough time for all requests to be handled? Spurious test failures caused by a too-short timeout would be annoying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there are no requests that are doing any heavy stuff, but of course there is no guarantee that all of them will be handled.
Unfortunatelly it's necessary for some other requests that are not closing the connection after replying with a handshake (i.e. websocket upgrade requests).
I didn't have any other idea how to handle those - read
without timeout blocks idefinitely, setting non-blocking
mode returns WouldBlock
on every try, tbh I have no idea why I cannot just read a handshake and then close the connection (Same thing happens if http server is trying to keep the connection alive (i.e. Connection: close
header is missing))
I'm open to any ideas.
[ci:skip]
[ci:skip]
personal_generateAuthorizationToken
RPC method available only over Signer's WebSocket connection.initial
.Closes #1999