mirror of
https://github.com/Netflix/dial-reference.git
synced 2026-06-08 10:59:59 +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:
@@ -800,7 +800,9 @@ static void worker_thread(struct mg_context *ctx) {
|
||||
// required in the DIAL specification.
|
||||
int buf_size = MAX_REQUEST_SIZE;
|
||||
|
||||
#ifndef __APPLE__
|
||||
pthread_setname_np( pthread_self(), __func__);
|
||||
#endif
|
||||
conn = (struct mg_connection *) calloc(1, sizeof(*conn) + buf_size);
|
||||
conn->buf_size = buf_size;
|
||||
conn->buf = (char *) (conn + 1);
|
||||
@@ -860,7 +862,9 @@ static void produce_socket(struct mg_context *ctx, const struct socket *sp) {
|
||||
static void master_thread(struct mg_context *ctx) {
|
||||
struct socket accepted;
|
||||
|
||||
#ifndef __APPLE__
|
||||
pthread_setname_np( pthread_self(), __func__);
|
||||
#endif
|
||||
socklen_t sock_len = sizeof(accepted.local_addr);
|
||||
memcpy(&accepted.local_addr, &ctx->local_address, sock_len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user