@@ -134,7 +134,9 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
134134
135135 while (client -> buffered < n ) {
136136 int i ;
137- if (client -> tlsSession )
137+ if (client -> ReadFromSocket )
138+ i = client -> ReadFromSocket (client , client -> buf + client -> buffered , RFB_BUF_SIZE - client -> buffered );
139+ else if (client -> tlsSession )
138140 i = ReadFromTLS (client , client -> buf + client -> buffered , RFB_BUF_SIZE - client -> buffered );
139141 else
140142#ifdef LIBVNCSERVER_HAVE_SASL
@@ -186,7 +188,9 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
186188
187189 while (n > 0 ) {
188190 int i ;
189- if (client -> tlsSession )
191+ if (client -> ReadFromSocket )
192+ i = client -> ReadFromSocket (client , out , n );
193+ else if (client -> tlsSession )
190194 i = ReadFromTLS (client , out , n );
191195 else
192196#ifdef LIBVNCSERVER_HAVE_SASL
@@ -262,6 +266,12 @@ WriteToRFBServer(rfbClient* client, const char *buf, unsigned int n)
262266 if (client -> serverPort == -1 )
263267 return TRUE; /* vncrec playing */
264268
269+ if (client -> WriteToSocket ) {
270+ i = client -> WriteToSocket (client , buf , n );
271+ if (i <= 0 ) return FALSE;
272+
273+ return TRUE;
274+ }
265275 if (client -> tlsSession ) {
266276 /* WriteToTLS() will guarantee either everything is written, or error/eof returns */
267277 i = WriteToTLS (client , buf , n );
0 commit comments