We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a711028 commit 2ed841cCopy full SHA for 2ed841c
1 file changed
src/vmem/vmem_server.c
@@ -90,6 +90,7 @@ void vmem_server_handler(csp_conn_t * conn)
90
uint64_t length;
91
uint64_t address;
92
uint16_t mtu = VMEM_SERVER_MTU;
93
+ const uint16_t mtu_max = CSP_BUFFER_SIZE - sizeof(csp_crc32_t) - 5; /* 5 bytes for RDP header */
94
95
if (request->version == 3) {
96
address = be64toh(request->data3.address);
@@ -108,6 +109,10 @@ void vmem_server_handler(csp_conn_t * conn)
108
109
length = be32toh(request->data.length);
110
}
111
112
+ if (mtu > mtu_max) {
113
+ mtu = mtu_max;
114
+ }
115
+
116
//printf("Download from:");
117
//printf(" Addr %"PRIx64"\n", address);
118
//printf(" Length %"PRIu32"\n", length);
0 commit comments