Age | Commit message (Collapse) | Author |
|
This removes the injected broken code which made the race condition
reproducible.
|
|
This should make the race appear reliable if a second connection attempt
is made. It is important to have a reliable error to fix it reliably.
|
|
LimoX does not care about these XML tokens at least for now. The issued
error messages on other levels.
Dropping those tokens on the encoderDecoder level asserts that the rest
of the xmpp code has only `clean` XML content to process.
|
|
The prefix has now more visual contrast to the XML content due to its
own bracket style.
Furthermore the indent for the TX stream was disabled. Indent is a nice
thing but it just makes sense if both streams are indented identically.
Since the RX stream received from the current development server has no
indent and also no newlines it is better to turn it of completely.
This might change in the future with structured logging (with the new
slog package) or command line flags to toggle this behaviour.
Re-encoding of the RX stream could also be an option but should stay one
because it alters the RX stream and might hide errors during debugging.
|
|
The prefix is re-implemented with this commit to distinguish between RX
and TX XML. Furthermore the logging is now based on the log module to
have the same (e.g. timestamp) prefix as other log messages.
|
|
This commit uses an io.TeeReader to achieve the same goal for RX like in
the previous commit for TX.
|
|
Using an io.MultiWriter it is trivially possible to write encoded tokens
to the TCP channel aswell as to stdout.
The disadvantage is that it is not possible to inject prefix data like
the so far used `C: ` only for stdout and not for the TCP channel. Such
a prefix is not wanted in the TCP channel and thus not wanted for both.
The solution to get a nice log is to implement a transparent logging
middleware which gets the raw TX stream and inserts a prefix at each
line before sending to stdout.
|
|
This completes the connection process.
|
|
|
|
This handler is just a placeholder for a more extensive IQ handling but
already writes to the log so that it is obvious what is happening.
|
|
This is the first step of resource binding which is a mandatory part of
establishing an XMPP connection.
|
|
This allows to trigger resource binding if the stream supports it.
|
|
|
|
Writing to the log is still better than doing nothing ...
|
|
The new structure allows to check for different stream features and act
according to them or - if nothing matches - do nothing apart from an
error message to the log.
|
|
If SASL authentication is successful a new stream has to be opened by
the client. This is implemented with this commit.
|
|
|
|
|
|
It is nearly useless to route a XML element to an appropriate handler
function if the latter has no idea how to send responses to the server
or the GUI. Passing a pointer to the session solves this issue.
|
|
|
|
|
|
This is needed to respond with a SASL auth attempt.
|
|
This is the first step to handle stream features correctly with the new
routing infrastructure.
|
|
|
|
This implements a routing function for XML elements received by an XML
stream.
|
|
The behaviour is ok for now but should be improved in the future to make
it more robust.
|
|
This makes it easier to add further test data in case there are further
corner cases which should be tested in the future.
|
|
|
|
This tests if the indent level is correctly detected. This basic test
can be extended to support invalid XML elements which should be refused
to add to the element buffer.
|
|
This is needed to buffer XML elements of a stream until they are
complete and can be given to an element handler.
|
|
|
|
This should ensure that the incoming and outgoing XML streams are in
sync.
|
|
The new source file should contain the complete stream logic.
|
|
This prepares the switch to stream pairs.
|
|
|
|
This reduces the risk of using those channels wrong.
|
|
This explains implicitly why the value is returned.
|
|
|
|
This is part of the refactoring. Details of the old implementation
should be looked up by older commits.
|
|
This allows the goroutine which fetches all tokens from the server to
forward them to the main goroutine of the session.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Minimal step towards session-based XMPP architecture.
|
|
The second unit test detected a bug - they are worth the effort!
|
|
|
|
|