Skip to content

Commit

Permalink
Debug prints :p
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLorenz committed Dec 3, 2023
1 parent 02989c6 commit 0db6ab4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ lo_server lo_server_new_with_proto_internal(const char *group,
free(s);
return 0;
}

puts("1");
s->sockets[0].fd = -1;
s->max_msg_size = LO_DEFAULT_MAX_MSG_SIZE;

Expand Down Expand Up @@ -556,7 +556,7 @@ lo_server lo_server_new_with_proto_internal(const char *group,

return NULL;
}

puts("2");
#ifdef ENABLE_IPV6
/* Determine the address family based on provided IP string or
multicast group, if available, otherwise let the operating
Expand All @@ -577,6 +577,7 @@ lo_server lo_server_new_with_proto_internal(const char *group,
service = port;
}
do {
puts("3");
int ret;
if (!port) {
/* not a good way to get random numbers, but its not critical */
Expand Down Expand Up @@ -604,7 +605,7 @@ lo_server lo_server_new_with_proto_internal(const char *group,
for (it = ai; it && s->sockets[0].fd == -1; it = it->ai_next) {
used = it;
s->sockets[0].fd = socket(it->ai_family, hints.ai_socktype, 0);

puts("4");
if (s->sockets[0].fd != -1
&& it->ai_family == AF_INET
&& hints.ai_socktype == SOCK_DGRAM)
Expand All @@ -624,7 +625,7 @@ lo_server lo_server_new_with_proto_internal(const char *group,
lo_server_free(s);
return NULL;
}

puts("5");
#ifdef ENABLE_IPV6
unsigned int v6only_off = 0;
if (setsockopt(s->sockets[0].fd, IPPROTO_IPV6, IPV6_V6ONLY,
Expand Down Expand Up @@ -675,7 +676,7 @@ lo_server lo_server_new_with_proto_internal(const char *group,
}
#endif
}}

puts("6");
if ((used != NULL) &&
(bind(s->sockets[0].fd, used->ai_addr, used->ai_addrlen) <
0)) {
Expand All @@ -695,7 +696,7 @@ lo_server lo_server_new_with_proto_internal(const char *group,
return NULL;
}
} while (!used && tries++ < 16);

puts("7");
if (!used) {
lo_throw(s, LO_NOPORT, "cannot find free port", NULL);

Expand Down Expand Up @@ -732,7 +733,7 @@ lo_server lo_server_new_with_proto_internal(const char *group,
lo_throw(s, LO_UNKNOWNPROTO, "unknown protocol family", NULL);
s->port = atoi(port);
}

puts("8");
return s;
}

Expand Down

0 comments on commit 0db6ab4

Please sign in to comment.