New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API to offload io operations to external implementation #6324
base: master
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
A general comment: I'd rather like that there would be no difference between the current transport and the external one from the core freerdp point of view. All these |
probably i am lacking knowledge of libfreerdp internals, more detailed suggestions are welcome. |
Well it would be much more elegant, if FreeRDP core would just use a "transport", without knowing if it's the one that is set by default by FreeRDP, or one that has been set externally. So the code in FreeRDP core would be clean and nice without |
to achieve this, design must be changed. current behaviour is : correct me if i wrong. |
as for write, it is more simple, write can just be switchable and i guess no significant design/logic changes required. |
Write polling is also needed especially for server-side. |
in current implementation it is not used, i am not able to find any polling implementation for write in current code, if it is already used, can you please tell me where it is ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I´d suggest changing the API the following way:
- Add a functon registration function
freerdp_set_transport_callbacks
or similar that allows setting read and write functions for the transport layer - Initialize these with the currently implemented read/write functions (or wrap them so that this is possible) at creation time
- Applications that want to use a different layer can then implement their own read/write functions externally and simply call
freerdp_set_transport_callbacks
right after context creation
This way the changes to FreeRDP
should stay minimal and for your use case you should have all degrees of freedom required to do what ever you like
libfreerdp/core/peer.c
Outdated
@@ -811,6 +811,7 @@ BOOL freerdp_peer_context_new(freerdp_peer* client) | |||
client->autodetect->context = context; | |||
update_register_server_callbacks(client->update); | |||
autodetect_register_server_callbacks(client->autodetect); | |||
update_register_io_callbacks(rdp->update); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be necessary with the new API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why ?, is it not same initialization sequence as for client ?
i have one more question. |
ah, looks like i also need to make switchable rdp_client_connect, rdp_client_disconnect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API wise this looks good now.
I´d suggest rebasing to current master, squashing the commits (and removing changed blank lines, ...) and then fixing the remaining issues (most notably the timeout you just removed)
71c8be4
to
eab26b6
Compare
rebased on master, squashed |
or maybe just completely avoid usage of this, but i guess i need at least to handle disconnect initiated by freerdp somehow... |
looks like my changes does not work properly with some servers, investigating... crashing like this:
|
let's look at it with little asan )
|
it was my logic error, fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall.
Some details (marked below) must be resolved before we can continue here.
@freerdp-bot test |
Refer to this link for build results (access rights to CI server needed): |
@freerdp-bot test |
Refer to this link for build results (access rights to CI server needed): |
if i properly understand, server side api already switchable and defined in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. Still need to test a bit more though.
@freerdp-bot test |
Refer to this link for build results (access rights to CI server needed): |
i am still not sure what this is enough to implement everything we need, |
@freerdp-bot test |
Refer to this link for build results (access rights to CI server needed): |
@freerdp-bot test |
Refer to this link for build results (access rights to CI server needed): |
@freerdp-bot test |
Refer to this link for build results (access rights to CI server needed): |
@sss123next ok, did some connection testing and in depth review.
so, long story short it is currently unusable as most connections abort due to invalid data (size) read |
can you provide more details about events ? |
@sss123next have not found the source yet. Problem is that the data decoded does not start/end where it is supposed to and the connection aborts quite fast (client wise) with a protocol error (parsing something invalid) |
still not get it, sorry, but i will appreciate if you provide even more details... existence of this event handles look strange for me, still do not get this part of design...
yes it is implemented just to be able to completely disable freerdp internal related code. |
@sss123next is this pr still relevant? |
we still missing few features from this, but you said you do not want to alter internal logic this much, also i have not finished my implementation in our project yet (new api from master still not completely tested), api from master looks ok, i just not tested it yet ( |
No description provided.