summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-03-10 17:19:07 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-03-10 17:19:07 +0100
commit95c2deec1ab7f98291c24443b1f1ceb1a2233f96 (patch)
treee31605b8a83e8daf4421147e807af5c02ac7ed6f
parent5c1d499770f659854752e390e0c1e70579a3efb3 (diff)
downloadecon-95c2deec1ab7f98291c24443b1f1ceb1a2233f96.tar.gz
econ-95c2deec1ab7f98291c24443b1f1ceb1a2233f96.tar.bz2
econ-95c2deec1ab7f98291c24443b1f1ceb1a2233f96.zip
econproxy: Move update request into own function
To be reusable..
-rw-r--r--econproxy.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/econproxy.c b/econproxy.c
index 84281f1..38f86a2 100644
--- a/econproxy.c
+++ b/econproxy.c
@@ -404,6 +404,24 @@ create_beamer_sockets(struct ep *ep, const char *beamer)
return 0;
}
+static int
+rfb_framebuffer_update_request(struct ep *ep, int incremental)
+{
+ struct {
+ uint8_t cmd;
+ uint8_t incremental;
+ uint16_t x, y, w, h;
+ } framebuffer_update_request = {
+ 3, 0,
+ htons(0), htons(0), htons(1024), htons(768)
+ };
+
+ framebuffer_update_request.incremental = incremental;
+
+ return write(ep->vnc_fd, &framebuffer_update_request,
+ sizeof framebuffer_update_request);
+}
+
int
main(int argc, char *argv[])
{
@@ -506,16 +524,7 @@ main(int argc, char *argv[])
write(ep.vnc_fd, &cmd_set_encodings, sizeof cmd_set_encodings);
- struct {
- uint8_t cmd;
- uint8_t incremental;
- uint16_t x, y, w, h;
- } framebuffer_update_request = {
- 3, 0,
- htons(0), htons(0), htons(1024), htons(768)
- };
- write(ep.vnc_fd, &framebuffer_update_request,
- sizeof framebuffer_update_request);
+ rfb_framebuffer_update_request(&ep, 0);
struct rect {
uint16_t x, y, w, h;