drdynvc: Change channel processing to use streams

The channel processor in xrdp_channel.c for dynamic streams uses
a data pointer and a length for passing PDUs or PDU fragments. We
replace this with a standard stream pointer, so that the usual
facilities can be used for checking length violcations.
This commit is contained in:
matt335672
2026-08-07 11:43:19 +01:00
parent e4b0621229
commit f745c9152d
5 changed files with 46 additions and 58 deletions
+3 -3
View File
@@ -146,9 +146,9 @@ struct xrdp_drdynvc
int (*open_response)(struct xrdp_process *id, int chan_id,
int creation_status);
int (*close_response)(struct xrdp_process *id, int chan_id);
int (*data_first)(struct xrdp_process *id, int chan_id, char *data,
int bytes, int total_bytes);
int (*data)(struct xrdp_process *id, int chan_id, char *data, int bytes);
int (*data_first)(struct xrdp_process *id, int chan_id, struct stream *s,
int total_bytes);
int (*data)(struct xrdp_process *id, int chan_id, struct stream *s);
};
struct vc_dechunker; // Forward declaration
+3 -3
View File
@@ -91,9 +91,9 @@ struct xrdp_drdynvc_procs
int (*open_response)(struct xrdp_process *id, int chan_id,
int creation_status);
int (*close_response)(struct xrdp_process *id, int chan_id);
int (*data_first)(struct xrdp_process *id, int chan_id,
char *data, int bytes, int total_bytes);
int (*data)(struct xrdp_process *id, int chan_id, char *data, int bytes);
int (*data_first)(struct xrdp_process *id, int chan_id, struct stream *s,
int total_bytes);
int (*data)(struct xrdp_process *id, int chan_id, struct stream *s);
};
/* Defined in xrdp_client_info.h */
+2 -3
View File
@@ -488,8 +488,7 @@ drdynvc_process_data_first(struct xrdp_channel *self,
drdynvc = self->drdynvcs + chan_id;
if (drdynvc->data_first != NULL)
{
return drdynvc->data_first(session->id, chan_id, s->p,
bytes, total_bytes);
return drdynvc->data_first(session->id, chan_id, s, total_bytes);
}
LOG_DEVEL(LOG_LEVEL_WARNING, "Dynamic Virtual Channel %s (%d): "
"callback 'data_first' is NULL",
@@ -530,7 +529,7 @@ drdynvc_process_data(struct xrdp_channel *self,
drdynvc = self->drdynvcs + chan_id;
if (drdynvc->data != NULL)
{
return drdynvc->data(session->id, chan_id, s->p, bytes);
return drdynvc->data(session->id, chan_id, s);
}
LOG_DEVEL(LOG_LEVEL_WARNING, "Dynamic Virtual Channel %s (%d): "
"callback 'data' is NULL",