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:
Dan Winship 2011-09-18 10:49:58 -04:00
parent feafdad228
commit eb45a590fa
2 changed files with 9 additions and 12 deletions

View File

@ -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;
}

View File

@ -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;
}