summaryrefslogtreecommitdiffstats
path: root/tests/gtcp_proxy
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gtcp_proxy')
-rwxr-xr-xtests/gtcp_proxy/gtcp-proxybin25665 -> 0 bytes
-rw-r--r--tests/gtcp_proxy/gtcp-proxy.c6
-rw-r--r--tests/gtcp_proxy/gtcp.c36
3 files changed, 10 insertions, 32 deletions
diff --git a/tests/gtcp_proxy/gtcp-proxy b/tests/gtcp_proxy/gtcp-proxy
deleted file mode 100755
index 6896b437..00000000
--- a/tests/gtcp_proxy/gtcp-proxy
+++ /dev/null
Binary files differ
diff --git a/tests/gtcp_proxy/gtcp-proxy.c b/tests/gtcp_proxy/gtcp-proxy.c
index 39555c76..b9efd5d4 100644
--- a/tests/gtcp_proxy/gtcp-proxy.c
+++ b/tests/gtcp_proxy/gtcp-proxy.c
@@ -223,7 +223,7 @@ int main(int argc, char **argv)
}
/**
- * Start listening on specifed local socket; when we get a connection,
+ * Start listening on specified local socket; when we get a connection,
* connect to specified remote server and transfer data between local
* and remote server
*****************************************************************************/
@@ -611,7 +611,7 @@ static gboolean on_delete_event(GtkWidget *widget, GdkEvent *ev, gpointer data)
static void on_destroy(GtkWidget *widget, gpointer data)
{
- /* this will destory all windows and return control to gtk_main() */
+ /* this will destroy all windows and return control to gtk_main() */
gtk_main_quit();
}
@@ -673,6 +673,6 @@ static void on_clear_clicked(GtkWidget *widget, gpointer data)
static void on_quit_clicked(GtkWidget *widget, gpointer data)
{
- /* this will destory all windows and return control to gtk_main() */
+ /* this will destroy all windows and return control to gtk_main() */
gtk_main_quit();
}
diff --git a/tests/gtcp_proxy/gtcp.c b/tests/gtcp_proxy/gtcp.c
index 9f0fcf88..a27f2ea6 100644
--- a/tests/gtcp_proxy/gtcp.c
+++ b/tests/gtcp_proxy/gtcp.c
@@ -26,14 +26,9 @@ int tcp_socket_create(void)
{
int rv;
int option_value;
+ socklen_t option_len;
-#if defined(_WIN32)
- int option_len;
-#else
- unsigned int option_len;
-#endif
-
- /* in win32 a socket is an unsigned int, in linux, its an int */
+ /* in win32 a socket is an unsigned int, in linux, it's an int */
if ((rv = (int) socket(PF_INET, SOCK_STREAM, 0)) < 0)
return -1;
@@ -69,7 +64,7 @@ int tcp_socket_create(void)
}
/**
- * Place specifed socket in non blocking mode
+ * Place specified socket in non blocking mode
*****************************************************************************/
void tcp_set_non_blocking(int skt)
@@ -133,12 +128,7 @@ int tcp_accept(int skt)
int ret ;
char ipAddr[256] ;
struct sockaddr_in s;
-
-#if defined(_WIN32)
- int i;
-#else
- unsigned int i;
-#endif
+ socklen_t i;
i = sizeof(struct sockaddr_in);
memset(&s, 0, i);
@@ -186,14 +176,9 @@ int tcp_socket(void)
{
int rv;
int option_value;
+ socklen_t option_len;
-#if defined(_WIN32)
- int option_len;
-#else
- unsigned int option_len;
-#endif
-
- /* in win32 a socket is an unsigned int, in linux, its an int */
+ /* in win32 a socket is an unsigned int, in linux, it's an int */
if ((rv = (int) socket(PF_INET, SOCK_STREAM, 0)) < 0)
return -1;
@@ -305,14 +290,7 @@ int tcp_can_send(int skt, int millis)
int tcp_socket_ok(int skt)
{
int opt;
-
-#if defined(_WIN32)
- int opt_len;
-#else
- unsigned int opt_len;
-#endif
-
- opt_len = sizeof(opt);
+ socklen_t opt_len = sizeof(opt);
if (getsockopt(skt, SOL_SOCKET, SO_ERROR, (char *) (&opt), &opt_len) == 0)
{