diff --git a/guacamole/proxy/Makefile b/guacamole/proxy/Makefile index 021ba5b9f..fd76f74ac 100644 --- a/guacamole/proxy/Makefile +++ b/guacamole/proxy/Makefile @@ -3,14 +3,14 @@ all: guacd -guacd: daemon.o proxy.o base64.o - $(CC) daemon.o proxy.o base64.o -l png -o guacd +guacd: daemon.o proxy.o guacio.o + $(CC) daemon.o proxy.o guacio.o -l png -o guacd -proxy.o: proxy.c proxy.h base64.h +proxy.o: proxy.c proxy.h guacio.h $(CC) -c -ansi -pedantic proxy.c -base64.o: base64.c base64.h - $(CC) -c -ansi -pedantic base64.c +guacio.o: guacio.c guacio.h + $(CC) -c -ansi -pedantic guacio.c daemon.o: daemon.c proxy.h $(CC) -c -ansi -pedantic daemon.c diff --git a/guacamole/proxy/base64.c b/guacamole/proxy/guacio.c similarity index 91% rename from guacamole/proxy/base64.c rename to guacamole/proxy/guacio.c index 7be69ad81..b711832a9 100644 --- a/guacamole/proxy/base64.c +++ b/guacamole/proxy/guacio.c @@ -2,6 +2,8 @@ #include #include +#include "guacio.h" + char characters[64] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', @@ -79,15 +81,16 @@ ssize_t __write_base64_byte(int fd, char buf) { return 1; } -ssize_t write_base64(int fd, const char* buf, size_t count) { +ssize_t write_base64(int fd, const void* buf, size_t count) { int retval; - const char* end = buf + count; + const char* char_buf = (const char*) buf; + const char* end = char_buf + count; - while (buf < end) { + while (char_buf < end) { - retval = __write_base64_byte(fd, *(buf++)); + retval = __write_base64_byte(fd, *(char_buf++)); if (retval < 0) return retval; diff --git a/guacamole/proxy/base64.h b/guacamole/proxy/guacio.h similarity index 71% rename from guacamole/proxy/base64.h rename to guacamole/proxy/guacio.h index 0f23461c0..802df56f7 100644 --- a/guacamole/proxy/base64.h +++ b/guacamole/proxy/guacio.h @@ -1,6 +1,11 @@ +#ifndef _GUACIO_H +#define _GUACIO_H + #include ssize_t write_base64(int fd, const void* buf, size_t count); ssize_t flush_base64(int fd); +#endif + diff --git a/guacamole/proxy/proxy.c b/guacamole/proxy/proxy.c index ba98b53d9..5ad7b8d3f 100644 --- a/guacamole/proxy/proxy.c +++ b/guacamole/proxy/proxy.c @@ -3,7 +3,7 @@ #include #include -#include "base64.h" +#include "guacio.h" #include "proxy.h" struct guac_write_info { @@ -61,7 +61,7 @@ void proxy(int client_fd) { write(client_fd, "name:hello;size:1024,768;", 25); - for (y=0; y<20; y++) { + for (y=0; y<200; y++) { /* Write image */