mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-11-08 09:14:10 +01:00
Add /api/send_full_frame
This commit is contained in:
parent
61f08d4986
commit
8b71ea3cd9
@ -45,6 +45,7 @@ int ssl_initialized = 0;
|
|||||||
int pipe_error = 0;
|
int pipe_error = 0;
|
||||||
settings_t settings;
|
settings_t settings;
|
||||||
|
|
||||||
|
extern int wakeuppipe[2];
|
||||||
|
|
||||||
void traffic(const char * token) {
|
void traffic(const char * token) {
|
||||||
/*if ((settings.verbose) && (! settings.daemon)) {
|
/*if ((settings.verbose) && (! settings.daemon)) {
|
||||||
@ -1566,6 +1567,20 @@ static uint8_t ownerapi(ws_ctx_t *ws_ctx, const char *in, const char * const use
|
|||||||
weblog(200, wsthread_handler_id, 0, origip, ip, user, 1, origpath, strlen(buf) + strlen(statbuf));
|
weblog(200, wsthread_handler_id, 0, origip, ip, user, 1, origpath, strlen(buf) + strlen(statbuf));
|
||||||
|
|
||||||
handler_msg("Sent frame stats to API caller\n");
|
handler_msg("Sent frame stats to API caller\n");
|
||||||
|
ret = 1;
|
||||||
|
} else entry("/api/send_full_frame") {
|
||||||
|
write(wakeuppipe[1], "", 1);
|
||||||
|
|
||||||
|
sprintf(buf, "HTTP/1.1 200 OK\r\n"
|
||||||
|
"Server: KasmVNC/4.0\r\n"
|
||||||
|
"Connection: close\r\n"
|
||||||
|
"Content-type: text/plain\r\n"
|
||||||
|
"Content-length: 6\r\n"
|
||||||
|
"\r\n"
|
||||||
|
"200 OK");
|
||||||
|
ws_send(ws_ctx, buf, strlen(buf));
|
||||||
|
weblog(200, wsthread_handler_id, 0, origip, ip, user, 1, origpath, strlen(buf));
|
||||||
|
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1181,3 +1181,13 @@ void VNCServerST::handleClipboardAnnounceBinary(VNCSConnectionST* client,
|
|||||||
clipboardClient = client;
|
clipboardClient = client;
|
||||||
desktop->handleClipboardAnnounceBinary(num, mimes);
|
desktop->handleClipboardAnnounceBinary(num, mimes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VNCServerST::refreshClients()
|
||||||
|
{
|
||||||
|
add_changed(pb->getRect());
|
||||||
|
|
||||||
|
std::list<VNCSConnectionST*>::iterator i;
|
||||||
|
for (i = clients.begin(); i != clients.end(); i++) {
|
||||||
|
(*i)->add_changed_all();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -198,6 +198,8 @@ namespace rfb {
|
|||||||
void handleClipboardAnnounceBinary(VNCSConnectionST* client, const unsigned num,
|
void handleClipboardAnnounceBinary(VNCSConnectionST* client, const unsigned num,
|
||||||
const char mimes[][32]);
|
const char mimes[][32]);
|
||||||
|
|
||||||
|
void refreshClients();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
friend class VNCSConnectionST;
|
friend class VNCSConnectionST;
|
||||||
|
@ -49,6 +49,8 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void vncSetGlueContext(int screenIndex);
|
void vncSetGlueContext(int screenIndex);
|
||||||
|
|
||||||
|
extern int wakeuppipe[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace rfb;
|
using namespace rfb;
|
||||||
@ -307,6 +309,15 @@ void XserverDesktop::handleSocketEvent(int fd, bool read, bool write)
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (read) {
|
if (read) {
|
||||||
|
|
||||||
|
if (fd == wakeuppipe[0]) {
|
||||||
|
unsigned char buf;
|
||||||
|
while (::read(fd, &buf, 1) > 0);
|
||||||
|
|
||||||
|
server->refreshClients();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (handleListenerEvent(fd, &listeners, server))
|
if (handleListenerEvent(fd, &listeners, server))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,10 @@
|
|||||||
* USA.
|
* USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
@ -49,6 +51,8 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void vncSetGlueContext(int screenIndex);
|
void vncSetGlueContext(int screenIndex);
|
||||||
|
|
||||||
|
int wakeuppipe[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace rfb;
|
using namespace rfb;
|
||||||
@ -225,6 +229,11 @@ void vncExtensionInit(void)
|
|||||||
dummyY < 16)
|
dummyY < 16)
|
||||||
vncFatalError("Invalid value to %s", Server::maxVideoResolution.getName());
|
vncFatalError("Invalid value to %s", Server::maxVideoResolution.getName());
|
||||||
|
|
||||||
|
pipe(wakeuppipe);
|
||||||
|
const int flags = fcntl(wakeuppipe[0], F_GETFL, 0);
|
||||||
|
fcntl(wakeuppipe[0], F_SETFL, flags | O_NONBLOCK);
|
||||||
|
vncSetNotifyFd(wakeuppipe[0], 0, true, false);
|
||||||
|
|
||||||
initialised = true;
|
initialised = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user