small debug changed

This commit is contained in:
Joseph Henry
2016-06-29 17:47:15 -07:00
parent 419c31e1a0
commit 3915ed031a
5 changed files with 19 additions and 32 deletions

View File

@@ -14,19 +14,19 @@ For more support on these integrations, or if you'd like help creating a new int
***
## Build flags
`SDK_DEBUG` - Turns on SDK activity/warning/error output. Levels of verbosity can be adjusted in `src/SDK_Debug.h`
- `SDK_DEBUG` - Turns on SDK activity/warning/error output. Levels of verbosity can be adjusted in `src/SDK_Debug.h`
`SDK_DEBUG_LOGFILE` - Used in conjunction with `SDK_DEBUG`, this will write all SDK debug chatter to a log file. To use this, set `make SDK_DEBUG_LOGFILE=1` then `export ZT_SDK_LOGFILE=debug.log`.
- `SDK_DEBUG_LOGFILE` - Used in conjunction with `SDK_DEBUG`, this will write all SDK debug chatter to a log file. To use this, set `make SDK_DEBUG_LOGFILE=1` then `export ZT_SDK_LOGFILE=debug.log`.
`SDK_LWIP_DEBUG` - Turns on debug output for the lwIP library.
- `SDK_LWIP_DEBUG` - Turns on debug output for the lwIP library.
`SDK_BUNDLED` - Builds the SDK as a single target including an API shim, the lwIP library, and the ZeroTier service.
- `SDK_BUNDLED` - Builds the SDK as a single target including an API shim, the lwIP library, and the ZeroTier service.
`SDK_SERVICE`
- `SDK_SERVICE`
`SDK_SOCKS_PROXY` - Enables the SOCK5 Proxy.
- `SDK_SOCKS_PROXY` - Enables the SOCK5 Proxy.
`SDK_UNITY_3D` - For use when building a target for a native plugin for Unity3D.
- `SDK_UNITY_3D` - For use when building a target for a native plugin for Unity3D.
***

View File

@@ -78,6 +78,7 @@ void dwr(int level, const char *fmt, ... )
}
if(debug_logfile) {
FILE *file = fopen(debug_logfile,"a");
fprintf(file, "%s [tid=%7d] ", timestring, tid);
vfprintf(file, fmt, ap);
fclose(file);
va_end(ap);

View File

@@ -527,7 +527,7 @@ char *api_netpath;
if(!check_intercept_enabled_for_thread()) {
return realclose(fd);
}
zt_close(fd);
return zt_close(fd);
}
// ------------------------------------------------------------------------------
@@ -550,7 +550,6 @@ char *api_netpath;
return zt_getsockname(sockfd, addr, addrlen);
}
// ------------------------------------------------------------------------------
// ------------------------------------ syscall() -------------------------------
// ------------------------------------------------------------------------------

View File

@@ -14,10 +14,7 @@ int main(int argc, char * argv[])
printf("usage: udp_client <port>\n");
return 0;
}
int port = atoi(argv[1]);
printf("cpp_udp_socket_client_test():\n");
ssize_t n_sent;
int sock = -1;
struct sockaddr_in server;
@@ -29,7 +26,7 @@ int main(int argc, char * argv[])
return 1;
}
}
server.sin_addr.s_addr = inet_addr("10.5.5.2");
server.sin_addr.s_addr = inet_addr("10.5.5.47");
server.sin_family = AF_INET;
server.sin_port = htons(port);
@@ -41,9 +38,7 @@ int main(int argc, char * argv[])
return 1;
}
//return 1;
// Send multiple UDP datagrams to server
// TX
char data[1024];
memset(data, 0, sizeof(data));
int count = 0;

View File

@@ -1,17 +1,13 @@
// UDP Server test program
#include <stdio.h> /* standard C i/o facilities */
#include <stdlib.h> /* needed for atoi() */
#include <unistd.h> /* defines STDIN_FILENO, system calls,etc */
#include <sys/types.h> /* system data type definitions */
#include <sys/socket.h> /* socket specific definitions */
#include <netinet/in.h> /* INET constants and stuff */
#include <arpa/inet.h> /* IP address conversion stuff */
#include <netdb.h> /* gethostbyname */
/* this routine echos any messages (UDP datagrams) received */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#define MAXBUF 1024*1024
@@ -19,10 +15,6 @@ void echo( int sd ) {
int len,n;
char bufin[MAXBUF];
struct sockaddr_in remote;
/* need to know how big address struct is, len must be set before the
call to recvfrom!!! */
len = sizeof(remote);
long count = 0;