]> git.sesse.net Git - vlc/commitdiff
Lua: disable net.(poll|read|write) on Windows and document
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 7 Jul 2013 17:25:41 +0000 (20:25 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 7 Jul 2013 17:27:50 +0000 (20:27 +0300)
These functions assume that sockets are file descriptors, never worked
properly on Windows. See also 3841c0859053d29058682650e87bf085632eea54.

modules/lua/libs/net.c
share/lua/README.txt

index 0f6b3939d6cf2b0b01d70627fc437ebd97200a81..dd0719c2b02c31fd8de45cf37248ce59cdb7392a 100644 (file)
@@ -189,6 +189,7 @@ static int vlclua_net_recv( lua_State *L )
     return 1;
 }
 
+#ifndef _WIN32
 /*****************************************************************************
  *
  *****************************************************************************/
@@ -277,6 +278,7 @@ static int vlclua_fd_read( lua_State *L )
         lua_pushnil( L );
     return 1;
 }
+#endif
 
 /*****************************************************************************
  *
@@ -366,9 +368,11 @@ static const luaL_Reg vlclua_net_reg[] = {
     { "close", vlclua_net_close },
     { "send", vlclua_net_send },
     { "recv", vlclua_net_recv },
+#ifndef _WIN32
     { "poll", vlclua_net_poll },
     { "read", vlclua_fd_read },
     { "write", vlclua_fd_write },
+#endif
     { "stat", vlclua_stat }, /* Not really "net" */
     { "opendir", vlclua_opendir }, /* Not really "net" */
     { NULL, NULL }
index 9c9c8ac8a84aed1182200b3954d751d0e539cfe6..dc506afbdc0b36cf83c05703125584d1c98192f1 100644 (file)
@@ -185,10 +185,13 @@ net.send( fd, string, [length] ): Send data on fd.
 net.recv( fd, [max length] ): Receive data from fd.
 net.poll( { fd = events } ): Implement poll function.
   Returns the numbers of file descriptors with a non 0 revent. The function
-  modifies the input table to { fd = revents }. See "man poll".
+  modifies the input table to { fd = revents }. See "man poll". This function
+  is not available on Windows.
 net.POLLIN/POLLPRI/POLLOUT/POLLRDHUP/POLLERR/POLLHUP/POLLNVAL: poll event flags
-net.read( fd, [max length] ): Read data from fd.
-net.write( fd, string, [length] ): Write data to fd.
+net.read( fd, [max length] ): Read data from fd. This function is not
+  available on Windows.
+net.write( fd, string, [length] ): Write data to fd. This function is not
+  available on Windows.
 net.stat( path ): Stat a file. Returns a table with the following fields:
     .type
     .mode