From: Sergey Vlasov <vsu@altlinux.ru>
To: community@lists.altlinux.org
Subject: Re: [Comm] [p6] тестирование новых freerdp и remmina
Date: Sun, 26 Feb 2012 12:40:27 +0400
Message-ID: <20120226084027.GA6389@atlas.home> (raw)
In-Reply-To: <CAMBdDKpp5QW7jGK3TTa0TG3QyMt-+V_cwov8HUYzZMz7DF8Gpw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2190 bytes --]
On Sat, Feb 25, 2012 at 10:36:49PM +0100, vx8400 wrote:
> Собранный из trunk вываливается с той же ошибкой.
> Причина в том, что при завершении сессии сервер нештатно разрывает
> соединение.
> xfreerdp видит, что сокет потерян (Failed to check FreeRDP file descriptor),
> но все равно вызывает freerdp_disconnect() -> transport_disconnect() ->
> -> tls_disconnect() -> SSL_shutdown(tls->ssl) -> ...
> ... -> write(дохлый сокет ...) -> SIGPIPE
>
> Eсли не вызывать SSL_shutdown() при отвалившемся соединении, то
> xfreerdp завершается нормально. Патч для проверки в прицепе.
Кстати, при пробросе порта 3389 через ssh эта ошибка у меня не
воспроизводится (с сервером 2008 R2, где TLS, похоже, по умолчанию
всегда используется и выдаёт хотя бы самоподписанный сертификат).
> Ошибка в remmina с разрывом соединения, возможно, не связана:
Да, там дело явно не в TLS (кстати, в опциях соединения там тоже можно
отключить TLS) - remmina валится даже в том случае, если поддержка TLS
на серверной стороне отключена.
> --- a/libfreerdp-core/tls.c 2012-02-10 03:01:42.000000000 +0100
> +++ b/libfreerdp-core/tls.c 2012-02-25 21:32:00.381001657 +0100
> @@ -22,6 +22,9 @@
>
> #include "tls.h"
>
> +#include <errno.h>
> +#include <unistd.h>
> +
> boolean tls_connect(rdpTls* tls)
> {
> int connection_status;
> @@ -120,9 +123,18 @@
> return true;
> }
>
> +char _buf_[8];
> +
> boolean tls_disconnect(rdpTls* tls)
> {
> - SSL_shutdown(tls->ssl);
> + int n = read(tls->ssl->wbio->num,_buf_,0);
> + if (errno) {
Вообще вызов read() нулевой длины не обязан проверять что-либо на
ошибки, а имеет право просто возвращать 0, ничего больше не проверяя.
Ещё нужна проверка (n == -1), поскольку в errno может лежать код
ошибки от предыдущих операций (либо перед вызовом read() нужно
самостоятельно сделать errno = 0).
Хотя в любом случае всё это не поможет, поскольку закрытие соединения
со стороны сервера может произойти после проверки, но перед вызовом
SSL_shutdown(). Единственный надёжный способ борьбы с проблемой -
игнорировать сигнал SIGPIPE и обрабатывать ошибку EPIPE от write();
странно, почему xfreerdp этого не делает.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2012-02-26 8:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-21 13:33 Андрей Черепанов
2012-02-21 20:04 ` Sergey Vlasov
2012-02-21 20:13 ` vx8400
2012-02-22 9:03 ` Андрей Черепанов
2012-02-21 20:17 ` Sergey Vlasov
2012-02-22 9:01 ` Андрей Черепанов
2012-02-22 9:19 ` Alexey Borisenkov
2012-02-24 19:31 ` vx8400
2012-02-24 22:39 ` Dubrovskiy Viacheslav
2012-02-25 15:28 ` vx8400
2012-02-25 15:42 ` vx8400
2012-02-25 17:37 ` Dubrovskiy Viacheslav
2012-02-25 21:36 ` vx8400
2012-02-26 8:40 ` Sergey Vlasov [this message]
2012-02-26 13:21 ` vx8400
2012-02-26 15:58 ` Sergey Vlasov
2012-02-26 17:53 ` vx8400
2012-02-26 20:38 ` Sergey Vlasov
2012-02-22 12:13 ` Sergey Vlasov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120226084027.GA6389@atlas.home \
--to=vsu@altlinux.ru \
--cc=community@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git