diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2016-04-27 21:02:42 +0200 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2016-04-28 11:17:16 +0300 |
commit | 20e1eff0c9afeab494a1c24265a4a2d28058d9dd (patch) | |
tree | 0b2a61dc46824eacd71e3903afe3ebee15498741 /accel-pppd/cli/cli.c | |
parent | 72b21d0537b49f23254bdf63ad9a3d1a61b3bbbe (diff) | |
download | accel-ppp-20e1eff0c9afeab494a1c24265a4a2d28058d9dd.tar.gz accel-ppp-20e1eff0c9afeab494a1c24265a4a2d28058d9dd.zip |
cli: flush pending data before disconnecting
The telnet and tcp servers disconnect as soon as they receive the
'exit' command or see a disconnection from the client. In this case,
all data queued for transmission are lost. This can lead to truncated
output when big amount of data is being sent.
For example, on a moderately loaded server with a few thouthands
connections, the output of the 'accel-cmd show sessions' command can be
truncated.
The problem is that accel-cmd sends the 'show sessions' command,
followed by 'exit'. It does so because it has to stop running once all
data has been received from the server. But it never knows whether more
data are going to arrive. Disconnection must then come from the server,
hence the use of 'exit' (although the same effect could be achieved
with shutdown(SHUT_WR)).
The telnet and tcp modules behave very similarly and are modified in
the same way:
* For a soft disconnection, cln_read() doesn't call disconnect()
anymore if there are data queued for transmission. Instead it
sets the 'disconnect' flag and stops listening to its peer (no
need to process further messages).
* cln_write() checks the 'disconnect' flag once it has sent all
pending data and actually performs the disconnection if necessary.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/cli/cli.c')
0 files changed, 0 insertions, 0 deletions