Skip to content

Backport !3272 “gdbus: Never buffer reads during server authentication” to glib-2-74

Otherwise, the content of the buffer is thrown away when switching from reading via a GDataInputStream to unbuffered reads when waiting for the "BEGIN" line.

(The code already tried to protect against over-reading like this by using unbuffered reads for the last few lines of the auth protocol, but it might already be too late at that point. The buffer of the GDataInputStream might already contain the "BEGIN" line for example.)

This matters when connecting a sd-bus client directly to a GDBus client. A sd-bus client optimistically sends the whole auth conversation in one go without waiting for intermediate replies. This is done to improve performance for the many short-lived connections that are typically made.


Trivial backport of !3272 (merged) to glib-2-74.

Merge request reports