mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
add wrapper code to fully encapsulate apr, apr-utils, pcre, and sqlite. fully use switch_ namespace in modules, create our own format and type defines. follow up commit for unix autotools coming soon after this. PLEASE NOTE: you will NEED to do a make megaclean and run configure again after this update (and the following commit) or it will not build.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4494 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -100,7 +100,7 @@ SWITCH_DECLARE(void) switch_stun_random_string(char *buf, uint16_t len, char *se
|
||||
|
||||
max = (int)strlen(set);
|
||||
|
||||
srand((unsigned int)apr_time_now());
|
||||
srand((unsigned int)switch_time_now());
|
||||
|
||||
for(x = 0; x < len; x++) {
|
||||
int j = (int)(max*1.0*rand()/(RAND_MAX+1.0));
|
||||
@@ -313,7 +313,7 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup (char **ip,
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
switch_socket_opt_set(sock, APR_SO_NONBLOCK, TRUE);
|
||||
switch_socket_opt_set(sock, SWITCH_SO_NONBLOCK, TRUE);
|
||||
packet = switch_stun_packet_build_header(SWITCH_STUN_BINDING_REQUEST, NULL, buf);
|
||||
switch_stun_random_string(username, 32, NULL);
|
||||
switch_stun_packet_attribute_add_username(packet, username, 32);
|
||||
@@ -333,7 +333,7 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup (char **ip,
|
||||
|
||||
if ((elapsed = (unsigned int)((switch_time_now() - started) / 1000)) > 5000) {
|
||||
*err = "Timeout";
|
||||
switch_socket_shutdown(sock, APR_SHUTDOWN_READWRITE);
|
||||
switch_socket_shutdown(sock, SWITCH_SHUTDOWN_READWRITE);
|
||||
switch_socket_close(sock);
|
||||
return SWITCH_STATUS_TIMEOUT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user