]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add apr stub to get the real OS socket
authorMichael Jerris <mike@jerris.com>
Thu, 9 Aug 2012 16:56:29 +0000 (11:56 -0500)
committerMichael Jerris <mike@jerris.com>
Thu, 9 Aug 2012 16:56:29 +0000 (11:56 -0500)
src/include/switch_apr.h
src/include/switch_types.h
src/switch_apr.c

index e7a41d03d942ff7c971005fead1297492d211416..bd19353991ff65107f36eb7ebea04f9518f26247 100644 (file)
@@ -1443,6 +1443,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_create_pollset(switch_pollfd_t **
 */
 SWITCH_DECLARE(switch_status_t) switch_socket_create_pollfd(switch_pollfd_t **pollfd, switch_socket_t *sock, int16_t flags, void *client_data, switch_memory_pool_t *pool);
 SWITCH_DECLARE(switch_status_t) switch_match_glob(const char *pattern, switch_array_header_t ** result, switch_memory_pool_t *p);
+SWITCH_DECLARE(switch_status_t) switch_os_sock_get(switch_os_socket_t *thesock, switch_socket_t *sock);
 SWITCH_DECLARE(switch_status_t) switch_socket_addr_get(switch_sockaddr_t ** sa, switch_bool_t remote, switch_socket_t *sock);
 
 /**
index b4ec3680210e984ac49d3b75e1c103f4a81ad81f..696078a06e6bef85b48a98dec880e93356456580 100644 (file)
@@ -1784,6 +1784,14 @@ typedef enum {
        SSH_FLAG_STICKY = (1 << 0)
 } switch_state_handler_flag_t;
 
+#ifdef WIN32
+typedef SOCKET apr_os_sock_t;
+#else
+typedef int apr_os_sock_t;
+#endif
+
+typedef apr_os_sock_t switch_os_socket_t;
+
 typedef struct apr_pool_t switch_memory_pool_t;
 typedef uint16_t switch_port_t;
 typedef uint8_t switch_payload_t;
index 5936c7223ea842e975c6a75551468123bb692242..c854c9761720e3c8a022b12520f1c5933f7822e4 100644 (file)
@@ -665,6 +665,11 @@ SWITCH_DECLARE(switch_status_t) switch_thread_create(switch_thread_t ** new_thre
 
 /* socket stubs */
 
+SWITCH_DECLARE(switch_status_t) switch_os_sock_get(switch_os_socket_t *thesock, switch_socket_t *sock)
+{
+       return apr_os_sock_get(thesock, sock);
+}
+
 SWITCH_DECLARE(switch_status_t) switch_socket_addr_get(switch_sockaddr_t ** sa, switch_bool_t remote, switch_socket_t *sock)
 {
        return apr_socket_addr_get(sa, (apr_interface_e) remote, sock);