ucb/source/ucp/webdav-neon/NeonSession.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit 5769851b4cbf1985004ab35bafd5ee69773b8db1 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Apr 9 18:31:36 2020 +0100 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Apr 9 21:04:37 2020 +0200 Error strings are not guaranteed to be ASCII E.g., it happened to be this string with Cyrillic characters in my testing: SSL handshake failed: Удаленный хост принудительно разорвал существующее подключение. Change-Id: I4721560412ab6543206cd13c8729dc8cc851eefd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91905 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx index 46a60b4d179e..c178c1e90238 100644 --- a/ucb/source/ucp/webdav-neon/NeonSession.cxx +++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx @@ -32,6 +32,7 @@ #include <string.h> #include <sal/log.hxx> #include <osl/diagnose.h> +#include <osl/thread.h> #include <osl/time.h> #include <ne_socket.h> #include <ne_auth.h> @@ -1826,8 +1827,8 @@ void NeonSession::HandleError( int nError, case NE_ERROR: // Generic error { - OUString aText = OUString::createFromAscii( - ne_get_error( m_pHttpSession ) ); + const char* sErr = ne_get_error(m_pHttpSession); + OUString aText(sErr, strlen(sErr), osl_getThreadTextEncoding()); sal_uInt16 code = makeStatusCode( aText ); @@ -1987,9 +1988,9 @@ void NeonSession::HandleError( int nError, default: { SAL_WARN( "ucb.ucp.webdav", "Unknown Neon error code!" ); + const char* sErr = ne_get_error(m_pHttpSession); throw DAVException( DAVException::DAV_HTTP_ERROR, - OUString::createFromAscii( - ne_get_error( m_pHttpSession ) ) ); + OUString(sErr, strlen(sErr), osl_getThreadTextEncoding()) ); } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits