mirror of
https://github.com/Netflix/dial-reference.git
synced 2026-06-08 02:49:58 +00:00
Compile DIAL client and server for macOS.
Changes: * Added method to get mac and ip address for OSX. Current Linux method of query via SIOCGIFCONF doesn't work. Added code to read via getifaddrs() API. * Put non OSX specific code under #ifdef flags. * Removed few linker libraries which are not required (lcares and lrt). * Fixed many warnings. Tested on: OSX 10.12
This commit is contained in:
@@ -65,7 +65,6 @@ public:
|
||||
string &outputFile );
|
||||
private:
|
||||
DialConformance();
|
||||
DialServer* _pServer;
|
||||
static DialConformance* sConformance;
|
||||
DialClientInput _input;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "DialServer.h"
|
||||
#include <map>
|
||||
#include <pthread.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -82,9 +83,6 @@ private:
|
||||
void cleanServerList();
|
||||
void resetDiscovery();
|
||||
|
||||
pthread_t _mcastThread;
|
||||
pthread_t _responseThread;
|
||||
|
||||
typedef map<string, DialServer*> ServerMap;
|
||||
ServerMap mServerMap;
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ int DialServer::getStatus(
|
||||
|
||||
if (!status) return 0;
|
||||
ATRACE("Body: %s\n", responseBody.c_str());
|
||||
unsigned found = responseBody.find("href=");
|
||||
size_t found = responseBody.find("href=");
|
||||
if( found != string::npos )
|
||||
{
|
||||
// The start of href is after href= and the quote
|
||||
|
||||
@@ -136,7 +136,7 @@ static void runConformance()
|
||||
else
|
||||
{
|
||||
printf("DIAL server not found\n");
|
||||
printf("%Zu available server(s): \n", list.size());
|
||||
printf("%zu available server(s): \n", list.size());
|
||||
printServerList(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ OBJS := main.cpp DialServer.cpp DialDiscovery.cpp DialConformance.cpp DialClient
|
||||
|
||||
# You may not need all these libraries. This example uses a build of curl that needs crypto, ssl, cares, and zlib
|
||||
dialclient: $(OBJS) ${includes}
|
||||
$(CC) -Wall -Werror -g $(OBJS) $(INCLUDES) $(LDFLAGS) -ldl -lpthread -lcurl -lz -lcrypto -lssl -lcares -o dialclient
|
||||
$(CC) -Wall -Werror -g $(OBJS) $(INCLUDES) $(LDFLAGS) -ldl -lpthread -lcurl -lz -lcrypto -lssl -o dialclient
|
||||
|
||||
dialclient_debug: $(OBJS) ${includes}
|
||||
$(CC) -DDEBUG -Wall -Werror -g $(OBJS) $(INCLUDES) $(LDFLAGS) -ldl -lpthread -lcurl -lz -lcrypto -lssl -lcares -o dialclient_debug
|
||||
|
||||
Reference in New Issue
Block a user