mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +01:00
gsocks5proxy, gsocks4aproxy: simplify some error messages
There's no need to include the exact max length in the error messages, and it makes it look like the strings need to use ngettext() if you do. https://bugzilla.gnome.org/show_bug.cgi?id=658206
This commit is contained in:
parent
feafdad228
commit
eb45a590fa
@ -135,9 +135,8 @@ set_connect_msg (guint8 *msg,
|
||||
|
||||
if (user_len > SOCKS4_MAX_LEN)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
|
||||
_("SOCKSv4 implementation limits username to %i characters"),
|
||||
SOCKS4_MAX_LEN);
|
||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
|
||||
_("Username is too long for SOCKSv4 protocol"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -154,8 +153,8 @@ set_connect_msg (guint8 *msg,
|
||||
if (host_len > SOCKS4_MAX_LEN)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
|
||||
_("SOCKSv4a implementation limits hostname to %i characters"),
|
||||
SOCKS4_MAX_LEN);
|
||||
_("Hostname '%s' is too long for SOCKSv4 protocol"),
|
||||
hostname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -204,10 +204,9 @@ set_auth_msg (guint8 *msg,
|
||||
|
||||
if (ulen > SOCKS5_MAX_LEN || plen > SOCKS5_MAX_LEN)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
|
||||
_("Username or password is too long for SOCKSv5 "
|
||||
"protocol (max. is %i)."),
|
||||
SOCKS5_MAX_LEN);
|
||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
|
||||
_("Username or password is too long for SOCKSv5 "
|
||||
"protocol)."));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -286,9 +285,8 @@ set_connect_msg (guint8 *msg,
|
||||
if (host_len > SOCKS5_MAX_LEN)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
|
||||
_("Hostname '%s' too long for SOCKSv5 protocol "
|
||||
"(maximum is %i bytes)"),
|
||||
hostname, SOCKS5_MAX_LEN);
|
||||
_("Hostname '%s' is too long for SOCKSv5 protocol"),
|
||||
hostname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user