The tests were still expecting the output to appear at level INFO.
They also didn't properly flush the (now) buffered stdout logging.
Added a test which check for this particular feature.
Actually found by unit test. The recently introduced check for a valid
digit before unit characters was also applied to + and should have.
Also added a test case for an invalid unit character without digit.
When running command line arguments in dbus server, it is necessary
to pass environment variables in the command line environment.
The temporary solution is just to collect possible used environment
variables to dbus server. To support it, a new argument of dbus
method 'Session.execute' is added to pass the map of environment
variables.
When we declare X-EVOLUTION-UI-SLOT as parameter in our DevInf, then
the N85 doesn't send telephone and email addresses to us. It seems to
get confused about what this unknown parameter is and then disables
the properties it is declared for.
As a workaround, do not "show" the parameter (per-parameter Synthesis
config option), but keep using it. The implication of that change is
minimal. The X-EVOLUTION-UI-SLOT value is used to preserve the order
of entries in the Evolution GUI. Declaring that our client supports
the value is only relevant when not sending it (because then a server
knows that it can drop its own value), but because we always send it,
we don't need to declare it.
In theory, a peer might avoid sending this value to us if we don't
declare it. In practice, peers are not that sophisticated, for good
reasons (like peers not declaring all of their properties). Synthesis
itself definitely still encodes the value even if not declared by
its peer.
The version of default dbus-glib package is 0.80 on Ubuntu 9.10.
This version has bugs of specialized types which prevents sync ui
using specialized types. So the fix is to define our used types
instead of predefined specialized types of dbus-glib.
If there is any error during executing command line arguments in
dbus server, it should catch the exception and set the error code
in the Status. Thus command line can judge the error code and
return the correct value to system.
When user didn't provide password, sync ui sends a hash without
'password' key-value pair in the response. Abort the current sync
process under this situation.
Going to configuration view and back without selecting any
configuration would set "sync now" button sensitive. Clicking
the button would crash the ui.
This commit fixes both issues.
Only apply conversion of alarm time to UTC time when server is
Mobical.net. The way is to define a global flag and set the flag
when 'remoterule' of 'Mobical' is matched.
The global flag is declared as a context variable and the script
reads it via built-in function 'SESSIONVAR'.
Mobical.net syncML server only accepts 'trigger' time
of alarms as 'UTC' time. If 'trigger' time is a duration,
it ignores that.
To prevent this, when the outgoing format is 'vCalendar1.0',
convert the duration time into 'UTC' time.
These extensions are useful when acting as server for a Synthesis iPhone
client, because then the server can preserve them.
But they are also confusing Evolution when vCards are imported with
these extensions are set. For example, an
ADR;TYPE=X-Synthesis-Ref0;TYPE=HOME is not shown as home address in
the GUI.
The correct solution would be to disable the extensions only when
writing into Evolution. We cannot do that due to technical limitations
("rule" parameter only works on properties).
So as a short term solution, choose the lesser evil and comment
out the extensions. Making Evolution work right is more important
than incremental enhancements of the server.
The issue is to access an invalid memory. The reason is that:
DBusClientCall creates a CallbackData for each dbus call. The
CallbackData itself references the DBusClientCall object. This
object is used to get returned value once the dbus call returns.
However, the typical usage is that DBusClientCall object
is a local variable allocated on the stack. So it is invalid after
existing the stack frame. If using this object in the dbus call
handler, cause a severe problem of reading invalid memory.
The solution is to store an always alive connection object in the
CallbackData instead of DBusClientCall object.
Currently the signature of argument 'handler' of 'InfoRequest'
is 's' on dbus server and sync ui. However, in the dbus api document,
its signature is still 'o'. Change it.
The reason for using a string and not an object path is that
when sending the initial request, the parameter has to be
empty. "" for a string is valid, but seems to be problematic
for an object path.
When passwords in the config are not set, the daemon asks them from
clients like command line. Command line should react and let
user input passwords and then send responses to the daemon.
Command line listens to 'Server.InfoRequest' signal and only handles
password requests from sessions created for command line in the daemon.
If command line dies in the process of inputting passwords, the daemon
always waits for it so expand current timeout mechanism into this
process. Otherwise, the daemon waits permanently.
There is a regression caused by a string exception
"basic_string::_S_construct NULL not valid". This is because
I push back a non-existing string into vector when collecting
converted command line arguments.
The criteria for not invoking Cmdline::run() was a bit too broad.
For "--template ?", "--help", "--version", "?", "--print-servers" no
output was produced in --daemon mode.
Perhaps the whole m_dontrun logic should be updated. In order to
minimize changes, this patch only duplicates the Cmdline::run()
logic.
argv[0] is skipped by Cmdline::parse(), therefore wasn't added to
the updated argument list for the D-Bus, which then basically
ignored the first command line parameter.
Convert relative paths into absolute paths before passing arguments
to dbus server because command line and dbus may have different working
directory.
Leave this kind of task in Command line for it knows the meaning of
parameters and convert them if necessary.
Add a new function 'relToAbs' to convert a relative path to a
canonicalized absolute path.
Previously it is supposed the arguments passed to d-bus are valid.
This seems not good as there are always some unpredictable issues.
Throw exceptions when parsing them encoutering errors.
When getting config of a template in a context, configs in the
context are applied in the returned configs except 'type' property
of sources. 'type' property should be preserved from the template.
It's a special case.
A client which wants to create a new config in a non-default context should
always use
config = GetConfig("<template>@context", true)
<make changes>
SetConfig(config)
to ensure that shared properties in that context are preserved.
A client shouldn't have to check whether that context exists. If it doesn't,
the server should simply ignore the context and use the default values from the
template.
This patch adds a test for this, based on the "type" property. The expectation
in the test that the "type" is preserved literally is wrong. "type" currently
must not be preserved, because different templates may have to set
different data formats (MB #10443).
Things like "--sync-property ?" are handled by Cmdline::parse(), producing
output as the parameters are parsed. In this case, running the command line
again in the D-Bus server duplicates the output (once locally, once in the
server).
This patch adds a check for it, similar to the one in Cmdline::run() itself.
When using streams, the caller of process() expects that once
the function returns, the streams were read until their end,
so that waitpid() will return eventually without deadlocking.
When an error occurs, this is not guaranteed, so we should
better return via an exception. Execute() was already
prepared for that.
As mentioned in the previous commit, SOCK_DGRAM does not allow us
to detect that the write has closed its ends of the socket pair.
This patch switches to using SOCK_STREAM, which gives us that
feature.
pipe() would also have worked, but with SOCK_DGRAM less code needs to
be changed and it is possible to switch back to SOCK_DGRAM (for
experiments) via a define.
The logic of processing data is different when in "streaming" mode:
process() always fills the chunk of default size 1024 with as much
data as possible, then processes it. For stdout this works well,
because line breaks are preserved before feeding into the logging
system.
With stderr there's an increased risk that lines a split, but right
now no code uses streaming mode for stderr, so that doesn't matter
at all.
LogRedirect is intentionally written around lossy UDP communication:
when system() starts a command that produces lot of output, the kernel
drops data instead of deadlocking us (system() command blocked in write,
our process blocked waiting for command).
When we know that a command might produce much output *and* we redirect
output, we need a more intelligent replacement for system(). This patch
introduces Execute() for that purpose.
It reuses much of LogRedirect code. LogRedirect has a new constructor
which creates the pipes and then handles the output like it normally
would, except that the pipes are Unix domain datagram sockets and the
instance itself doesn't modify the global state of the parent (doesn't
register itself as logger, doesn't touch FDs 1 and 2).
Unix domain datagram sockets seemed like a combination of a lossless
connection with data boundaries, which has the advantage that the
existing process() code can be reused. When experimenting with
LogRedirect originally, it was observed that domain sockets did
deadlock when writing more than reading.
The problem with this patch is that Unix domain sockets do not flag
that there is no writer anymore. Therefore LogRedirect::process()
cannot detect when it should return.
syncevo-dbus-server is the first usage of LogRedirect which also
redirects stdout. In turn, the main usage is catching of "synccompare"
output. It turns out that the assumption for stderr so far that writes
are atomic doesn't hold for stdout of synccompare. Lines often are
interrupted in the middle.
In addition, SE_LOG(SHOW) always inserts a newline.
This patch deals with this by treating data received for stdout as a
data stream. It buffers incomplete lines and appends the rest of the
line when the next chunk comes in.
This delays printing such an incomplete line. flush() is introduced
to get that last, incomplete line logged.
For stderr, keeping text in memory instead of printing it as soon
as received is considered undesirable, therefore that code path
is not changed.
Redirection of stdout was not activated and thus output of
synccompare was not sent via LogOutput messages.
Activating it shows that more work is necessary, although
it works in principle. Problems: line breaks are inserted
into long synccompare output and lines are swallowed.
Also, cout should not be used by the server itself. Instead
use the logging facilities.
The recent patch which moves setTransportCallback() into
createTransportAgent() as incomplete, it didn't adapt
DBusSync::createTransportAgent().
As a reminder, this patch also updates the createTransportAgent()
comments.
Previously, plain strings were used. With DBusObject instead
the C++ bridge code recognizes the special meaning of those
and correctly sends them over D-Bus as object paths.
Add a 'DBusWatch' to watch daemon and exit the process when the
daemon has gone.
Also find that current 'DBusClientCall' related classes are not
efficient and the code is reduntant. Re-design and implement the
inheritance.
When incoming data type is 'vCalendar1.0', alarms are converted
into VALARM without 'ACTION' field. This makes Evolution report
'unknown action to be performed'. Add 'DISPLAY' as the 'ACTION'
value if it has not.
requestStart time was used to detect transport timeout, which was only
set inside send(), however it is also possible that the transport
timeout during connect phase (sending a 'Connect' cmd but no response).
The original creating the transport and remembering to set the callback approach:
1) For ObexTransport, the callback need to be set inside
createTransportAgent, because the 'connect' process might timeout.
2) It is error prone to remember setting the callback after
creating each transport.
Now setTransportCallback is integrated inside createTransportAgent.
"MmMmMm" was interpreted as "0M0m0M0m" = 0 seconds. This is not
entirely unreasonable, but perhaps a bit too technical interpretation
of valid input. QA considered it invalid.
So let's be a bit more strict, which has the advantage that more user
typos are found. Now at least one digit must come before each unit
character.
This gets rid of MuxWindow (and the related icon code and images)
for good: Now a specially named GtkToolbar and buttons inside it get
a special treatment from meego gtk theme engine, and end up looking
like Mx window title bar
The meego build will look a bit odd with other gtk themes, though
When the configuration widget is built:
* start a session
* set temporary config
* run CheckSources, show all sources that are usable
This should fix
MB #9961: memo not disabled by default on meego
MB #9303: User can set Memo-URI in First server settings
The move to D-Bus changed the error code for "timezone cannot be
retrieved because it doesn't exist" from
E_CALENDAR_STATUS_OBJECT_NOT_FOUND to
E_CALENDAR_STATUS_INVALID_OBJECT. That latter error code was not
recognized by the code and caused e_cal_check_timezones() to fail with
that error ("Could not retrieve calendar time zone").
This patch fixes the problem by recognizing both the old and the new
error code.
There was an intentional delay of 5 seconds in open() of both calendar
and contacts, followed by a retry of opening the database. This was
meant for the cases where a new database was created ("file://"
prefix) and couldn't be opened just yet, as seen in some older
Evolution releases (and perhaps still relevant today).
This delay hurts the sync-ui when it calls CheckSource() on the
defined, but non-existant "memo" database on MeeGo. This patch
avoids the delay and retry in that case.