]> code.delx.au - pulseaudio/blobdiff - polyp/module-protocol-stub.c
Merge Pierre's changes
[pulseaudio] / polyp / module-protocol-stub.c
index 93e576af762352c267b733549d24d036d46023e6..141eadd390f8a047b8afc770c16ddfb8902e5359 100644 (file)
 #include <errno.h>
 #include <stdio.h>
 #include <assert.h>
-#include <arpa/inet.h>
 #include <unistd.h>
+#include <limits.h>
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+
+#include "winsock.h"
 
 #include "module.h"
 #include "socket-server.h"
   #endif
   PA_MODULE_DESCRIPTION("Command line interface protocol "SOCKET_DESCRIPTION)
   PA_MODULE_USAGE(SOCKET_USAGE)
+#elif defined(USE_PROTOCOL_HTTP)
+  #include "protocol-http.h" 
+  #define protocol_new pa_protocol_http_new
+  #define protocol_free pa_protocol_http_free
+  #define TCPWRAP_SERVICE "polypaudio-http"
+  #define IPV4_PORT 4714
+  #define UNIX_SOCKET "http"
+  #define MODULE_ARGUMENTS 
+  #ifdef USE_TCP_SOCKETS
+    #include "module-http-protocol-tcp-symdef.h"
+  #elif defined(USE_TCP6_SOCKETS)
+    #include "module-http-protocol-tcp6-symdef.h"
+  #else
+    #include "module-http-protocol-unix-symdef.h"
+  #endif
+  PA_MODULE_DESCRIPTION("HTTP "SOCKET_DESCRIPTION)
+  PA_MODULE_USAGE(SOCKET_USAGE)
 #elif defined(USE_PROTOCOL_NATIVE)
   #include "protocol-native.h"
   #define protocol_new pa_protocol_native_new
@@ -223,5 +251,12 @@ finish:
 void pa__done(struct pa_core *c, struct pa_module*m) {
     assert(c && m);
 
+#if defined(USE_PROTOCOL_ESOUND)
+       if (remove (ESD_UNIX_SOCKET_NAME) != 0)
+               pa_log("%s: Failed to remove %s : %s.\n", __FILE__, ESD_UNIX_SOCKET_NAME, strerror (errno));
+       if (remove (ESD_UNIX_SOCKET_DIR) != 0)
+               pa_log("%s: Failed to remove %s : %s.\n", __FILE__, ESD_UNIX_SOCKET_DIR, strerror (errno));
+#endif
+
     protocol_free(m->userdata);
 }