mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
proxy -> client (renamed)
This commit is contained in:
@@ -6,11 +6,11 @@ LDFLAGS=-lpng -lvncclient
|
||||
|
||||
all: guacd
|
||||
|
||||
guacd: daemon.o proxy.o guacio.o protocol.o
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) daemon.o proxy.o protocol.o guacio.o -o guacd
|
||||
guacd: daemon.o client.o guacio.o protocol.o
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) daemon.o client.o protocol.o guacio.o -o guacd
|
||||
|
||||
proxy.o: proxy.c proxy.h guacio.h
|
||||
$(CC) $(CFLAGS) -c proxy.c
|
||||
client.o: client.c client.h guacio.h
|
||||
$(CC) $(CFLAGS) -c client.c
|
||||
|
||||
protocol.o: protocol.c protocol.h guacio.h
|
||||
$(CC) $(CFLAGS) -c protocol.c
|
||||
@@ -18,7 +18,7 @@ protocol.o: protocol.c protocol.h guacio.h
|
||||
guacio.o: guacio.c guacio.h
|
||||
$(CC) $(CFLAGS) -c guacio.c
|
||||
|
||||
daemon.o: daemon.c proxy.h
|
||||
daemon.o: daemon.c client.h
|
||||
$(CC) $(CFLAGS) -c daemon.c
|
||||
|
||||
clean:
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "guacio.h"
|
||||
#include "protocol.h"
|
||||
#include "proxy.h"
|
||||
#include "client.h"
|
||||
|
||||
char __guac_password[] = "potato";
|
||||
|
||||
@@ -175,7 +175,7 @@ void guac_free_png_buffer(png_byte** png_buffer, int h) {
|
||||
|
||||
}
|
||||
|
||||
void proxy(int client_fd) {
|
||||
void client(int client_fd) {
|
||||
|
||||
char* hostname;
|
||||
int wait_result;
|
@@ -1,6 +1,6 @@
|
||||
#ifndef _PROXY_H_
|
||||
#define _PROXY_H
|
||||
|
||||
void proxy(int client_fd);
|
||||
void client(int client_fd);
|
||||
|
||||
#endif
|
@@ -6,7 +6,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include "proxy.h"
|
||||
#include "client.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
|
||||
@@ -18,7 +18,7 @@ int main(int argc, char* argv[]) {
|
||||
struct sockaddr_in client_addr;
|
||||
unsigned int client_addr_len;
|
||||
int connected_socket_fd;
|
||||
pid_t proxy_pid ;
|
||||
pid_t client_pid ;
|
||||
|
||||
/* Get binding address */
|
||||
memset(&server_addr, 0, sizeof(server_addr)); /* Zero struct */
|
||||
@@ -59,15 +59,15 @@ int main(int argc, char* argv[]) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
/* Fork proxy */
|
||||
proxy_pid = fork();
|
||||
if (proxy_pid < 0) {
|
||||
/* Fork client */
|
||||
client_pid = fork();
|
||||
if (client_pid < 0) {
|
||||
perror("Could not fork child");
|
||||
}
|
||||
|
||||
/* In child ... */
|
||||
else if (proxy_pid == 0) {
|
||||
proxy(connected_socket_fd);
|
||||
else if (client_pid == 0) {
|
||||
client(connected_socket_fd);
|
||||
|
||||
/* Close socket */
|
||||
if (close(connected_socket_fd) < 0) {
|
||||
|
Reference in New Issue
Block a user