From: <dg...@su...> - 2009-01-28 13:37:43
|
Author: bellmich Date: Wed Jan 28 14:36:11 2009 New Revision: 900 URL: http://libsyncml.opensync.org/changeset/900 Log: - never display a password in traces - a disconnect of a server can fail if the client was faster Modified: trunk/libsyncml/sml_transport.c Modified: trunk/libsyncml/sml_transport.c ============================================================================== --- trunk/libsyncml/sml_transport.c Tue Jan 27 16:39:11 2009 (r899) +++ trunk/libsyncml/sml_transport.c Wed Jan 28 14:36:11 2009 (r900) @@ -433,10 +433,21 @@ if (link && !link->link_data) { - smlErrorSet(error, SML_ERROR_GENERIC, - "A server connection should be closed " \ - "but the connection is already closed."); - goto error; + /* If there is a very fast or aggressive client + * then it can happen that the client closes + * the connection and the server registers this + * event before the disconnect function was + * called. + * + * If this happens then the link_data is perhaps + * already empty and the disconnect event was + * already triggered. + */ + smlTrace(TRACE_EXIT, + "%s: A server connection should be closed " \ + "but the connection is already closed.", + __func__); + return TRUE; } if (!link && smlTransportIsServer(tsp) && tsp->connections) @@ -854,7 +865,7 @@ const char *value, SmlError **error) { - smlTrace(TRACE_ENTRY, "%s(%p, %s, %s, %p)", __func__, tsp, VA_STRING(name), VA_STRING(value), error); + smlTrace(TRACE_ENTRY, "%s(%p, %s, %s, %p)", __func__, tsp, VA_STRING(name), strcmp(name, "PASSWORD") ? VA_STRING(value) : "***sensitive***", error); /* Do not change the assertion to simple return FALSE stuff * because to many developers incl. me ignore returned FALSE * if it is only configuration. |