proxy -> client (renamed)

This commit is contained in:
Michael Jumper
2010-09-07 20:23:46 -07:00
parent a8fac57159
commit 51f71d40ba
4 changed files with 15 additions and 15 deletions

View File

@@ -6,11 +6,11 @@ LDFLAGS=-lpng -lvncclient
all: guacd all: guacd
guacd: daemon.o proxy.o guacio.o protocol.o guacd: daemon.o client.o guacio.o protocol.o
$(CC) $(CFLAGS) $(LDFLAGS) daemon.o proxy.o protocol.o guacio.o -o guacd $(CC) $(CFLAGS) $(LDFLAGS) daemon.o client.o protocol.o guacio.o -o guacd
proxy.o: proxy.c proxy.h guacio.h client.o: client.c client.h guacio.h
$(CC) $(CFLAGS) -c proxy.c $(CC) $(CFLAGS) -c client.c
protocol.o: protocol.c protocol.h guacio.h protocol.o: protocol.c protocol.h guacio.h
$(CC) $(CFLAGS) -c protocol.c $(CC) $(CFLAGS) -c protocol.c
@@ -18,7 +18,7 @@ protocol.o: protocol.c protocol.h guacio.h
guacio.o: guacio.c guacio.h guacio.o: guacio.c guacio.h
$(CC) $(CFLAGS) -c guacio.c $(CC) $(CFLAGS) -c guacio.c
daemon.o: daemon.c proxy.h daemon.o: daemon.c client.h
$(CC) $(CFLAGS) -c daemon.c $(CC) $(CFLAGS) -c daemon.c
clean: clean:

View File

@@ -7,7 +7,7 @@
#include "guacio.h" #include "guacio.h"
#include "protocol.h" #include "protocol.h"
#include "proxy.h" #include "client.h"
char __guac_password[] = "potato"; 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; char* hostname;
int wait_result; int wait_result;

View File

@@ -1,6 +1,6 @@
#ifndef _PROXY_H_ #ifndef _PROXY_H_
#define _PROXY_H #define _PROXY_H
void proxy(int client_fd); void client(int client_fd);
#endif #endif

View File

@@ -6,7 +6,7 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include "proxy.h" #include "client.h"
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
@@ -18,7 +18,7 @@ int main(int argc, char* argv[]) {
struct sockaddr_in client_addr; struct sockaddr_in client_addr;
unsigned int client_addr_len; unsigned int client_addr_len;
int connected_socket_fd; int connected_socket_fd;
pid_t proxy_pid ; pid_t client_pid ;
/* Get binding address */ /* Get binding address */
memset(&server_addr, 0, sizeof(server_addr)); /* Zero struct */ memset(&server_addr, 0, sizeof(server_addr)); /* Zero struct */
@@ -59,15 +59,15 @@ int main(int argc, char* argv[]) {
return 3; return 3;
} }
/* Fork proxy */ /* Fork client */
proxy_pid = fork(); client_pid = fork();
if (proxy_pid < 0) { if (client_pid < 0) {
perror("Could not fork child"); perror("Could not fork child");
} }
/* In child ... */ /* In child ... */
else if (proxy_pid == 0) { else if (client_pid == 0) {
proxy(connected_socket_fd); client(connected_socket_fd);
/* Close socket */ /* Close socket */
if (close(connected_socket_fd) < 0) { if (close(connected_socket_fd) < 0) {