On 02/12/2013 03:14 PM, Michal Toman wrote:
+ safe_waitpid(xz_child, &status, 0);
+ if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
+ {
+ error_msg_and_die(_("Can't create temporary file in /tmp"));
+ }
^^^ I can see some inconsistency here - on many places you put
the curly braces around a single function and on many you don't.
+ err:
+ alert_server_error(NULL);
+ /* Show bad header to the user */
+ char *sanitized = sanitize_utf8(message, (SANITIZE_ALL &
~SANITIZE_TAB));
Do we really need to sanitize? IIRC HTTP headers are never UTF-8. Either
they are valid (ASCII) or totally broken and should probably not be
displayed.
-void alert_server_error();
-void alert_connection_error();
+void alert_server_error(const char *peer_name);
+void alert_connection_error(const char *peer_name);
You use 'peer_name' in the header and 'name' in the implementation.
On 11.02.2013 19:39, Denys Vlasenko wrote:
Open questions:
(1)
alert_connection_error(URL);
error_msg_and_die("Something horrible happened at '%s'", URL);
looks redundant. It looks like we _want_ error_msg_and_die
to also perform the duty of alert_connection_error.
alert_* stuff is meant for non-technical GUI (GNOME) users, who do not
care about the actual error. error_msg_and_die prints the useful message
to log. I don't insist on this approach if we can find a better solution
(I actually agree that it's weird).
(2) alert() needs to be made variadic a-la printf.
Didn't seem necessary so far, but may be extended.
(3) I have a nagging desire to nuke all trailing periods in messages...
Whatever, I have no strong opinion.
- don't forgot to update the translation if you touch some strings
$ tx push -s
--J
M.