[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Server API: How to communicate connection failures to client
[Thread Prev] | [Thread Next]
- Subject: Re: Server API: How to communicate connection failures to client
- From: Andreas Schneider <asn@xxxxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Thu, 21 Feb 2019 13:57:14 +0100
- To: libssh@xxxxxxxxxx
- Cc: g4-lisz@xxxxxxxxxxxx
On Monday, February 11, 2019 8:56:49 AM CET g4-lisz@xxxxxxxxxxxx wrote: > On 06.02.19 17:41, g4-lisz@xxxxxxxxxxxx wrote: > > Hi there, > > > > My server implementation accepts direct-tcpip requests. > > > > In the message CB function, after receiving a message of type > > SSH_REQUEST_CHANNEL_OPEN, subtype SSH_CHANNEL_DIRECT_TCPIP, we try to > > open a local socket. If this is successful, a new channel with > > ssh_message_channel_request_open_reply_accept(message) is attached. > > > > But if opening of the local socket fails, how should the message be > > treated? Is there a way to signalize to the client that the connection > > failed, without opening a new channel? > > > > Or do I have to accept the request and open a channel in any case? And > > then close the channel again when the local socket operation failed? > > > > Right now I'm reading the OpenSSH server code to find out. But maybe > > someone could give me the answer and tell me what libssh functions > > should be used? > > No one? > > Maybe my mail had too much text ;-)) > > Short version: When writing a server, how do should it signal to the > client when the destination for the direct-tcpip request can not be > reached (or resolved)? > > - The API only let me send a channel EOF or close > - Should it accept the request at all (i.e. open a new channel) _before_ > the local (server side) connection could been made? > - Does it make sense (if it opened the channel) to send something on the > channel stderr? Any words in the RFC about it? -- Andreas Schneider asn@xxxxxxxxxxxxxx GPG-ID: 8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D
Re: Server API: How to communicate connection failures to client | Stef Bon <stefbon@xxxxxxxxx> |
Server API: How to communicate connection failures to client | g4-lisz@xxxxxxxxxxxx |
Re: Server API: How to communicate connection failures to client | g4-lisz@xxxxxxxxxxxx |