@@ -89,6 +89,8 @@ static size_t buf_filled=0;
89
89
* httpInitSockets sets up the TCP socket to listen for HTTP connections.
90
90
*/
91
91
92
+ static rfbClientRec cl ;
93
+
92
94
void
93
95
rfbHttpInitSockets (rfbScreenInfoPtr rfbScreen )
94
96
{
@@ -125,6 +127,9 @@ rfbHttpInitSockets(rfbScreenInfoPtr rfbScreen)
125
127
rfbLog ("Listening for HTTP connections on TCP6 port %d\n" , rfbScreen -> http6Port );
126
128
rfbLog (" URL http://%s:%d\n" ,rfbScreen -> thisHost ,rfbScreen -> http6Port );
127
129
#endif
130
+ INIT_MUTEX (cl .outputMutex );
131
+ INIT_MUTEX (cl .refCountMutex );
132
+ INIT_MUTEX (cl .sendMutex );
128
133
}
129
134
130
135
void rfbHttpShutdownSockets (rfbScreenInfoPtr rfbScreen ) {
@@ -145,6 +150,17 @@ void rfbHttpShutdownSockets(rfbScreenInfoPtr rfbScreen) {
145
150
rfbCloseSocket (rfbScreen -> httpListen6Sock );
146
151
rfbScreen -> httpListen6Sock = RFB_INVALID_SOCKET ;
147
152
}
153
+ LOCK (cl .outputMutex );
154
+ UNLOCK (cl .outputMutex );
155
+ TINI_MUTEX (cl .outputMutex );
156
+
157
+ LOCK (cl .sendMutex );
158
+ UNLOCK (cl .sendMutex );
159
+ TINI_MUTEX (cl .sendMutex );
160
+
161
+ LOCK (cl .refCountMutex );
162
+ UNLOCK (cl .refCountMutex );
163
+ TINI_MUTEX (cl .refCountMutex );
148
164
}
149
165
150
166
/*
@@ -257,8 +273,6 @@ httpCloseSock(rfbScreenInfoPtr rfbScreen)
257
273
buf_filled = 0 ;
258
274
}
259
275
260
- static rfbClientRec cl ;
261
-
262
276
/*
263
277
* httpProcessInput is called when input is received on the HTTP socket.
264
278
*/
0 commit comments