diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 56ad87d..0000000 --- a/.editorconfig +++ /dev/null @@ -1,23 +0,0 @@ -root = true - -[*] -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -charset = utf-8 - -[{*.lua,*.rockspec,.luacheckrc}] -indent_style = space -indent_size = 4 - -[Makefile] -indent_style = tab -indent_size = 4 - -[*.html] -indent_style = space -indent_size = 4 - -[*.{c,h}] -indent_style = space -indent_size = 4 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 49c2c73..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Build - -on: - push: - branches: - - master - pull_request: - -jobs: - build: - name: Test ${{ matrix.luaVersion }} on ${{ matrix.platform }} - strategy: - fail-fast: false - matrix: - luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ] - platform: [ "ubuntu-22.04", "macos-11", "windows-2022" ] - runs-on: ${{ matrix.platform }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup ’msvc’ - if: ${{ startsWith(matrix.platform, 'windows') && !startsWith(matrix.luaVersion, 'luajit') }} - uses: ilammy/msvc-dev-cmd@v1 - - name: Setup ‘lua’ - uses: leso-kn/gh-actions-lua@v11-staging - with: - luaVersion: ${{ matrix.luaVersion }} - - name: Setup ‘luarocks’ - uses: hishamhm/gh-actions-luarocks@master - - name: Make and install - run: | - luarocks make -- luasocket-scm-3.rockspec - env: - DEBUG: DEBUG - - name: Run regression tests - shell: bash - run: | - cd test - lua hello.lua - lua testsrvr.lua > /dev/null & - lua testclnt.lua - lua stufftest.lua - lua excepttest.lua - lua test_bind.lua - lua test_getaddrinfo.lua - lua ltn12test.lua - lua mimetest.lua - lua urltest.lua - lua test_socket_error.lua - kill %1 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index acd66ea..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Deploy - -on: [ push, workflow_dispatch ] - -jobs: - - affected: - uses: lunarmodules/.github/.github/workflows/list_affected_rockspecs.yml@main - - build: - needs: affected - if: ${{ needs.affected.outputs.rockspecs }} - uses: lunarmodules/.github/.github/workflows/test_build_rock.yml@main - with: - rockspecs: ${{ needs.affected.outputs.rockspecs }} - - upload: - needs: [ affected, build ] - # Only run upload if: - # 1. We are on the canonical repository (no uploads from forks) - # 2. The current commit is either tagged or on the default branch (the workflow will upload dev/scm rockspecs any - # time they are touched, tagged ones whenever the edited rockspec and tag match) - # 3. Some rockspecs were changed — this implies the commit changing the rockspec is the same one that gets tagged - if: >- - ${{ - github.repository == 'lunarmodules/luasocket' && - ( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') ) && - needs.affected.outputs.rockspecs - }} - uses: lunarmodules/.github/.github/workflows/upload_to_luarocks.yml@main - with: - rockspecs: ${{ needs.affected.outputs.rockspecs }} - secrets: - apikey: ${{ secrets.LUAROCKS_APIKEY }} diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml deleted file mode 100644 index 9cb784c..0000000 --- a/.github/workflows/luacheck.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Luacheck - -on: [push, pull_request] - -jobs: - - luacheck: - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Luacheck - uses: lunarmodules/luacheck@v1 diff --git a/.gitignore b/.gitignore index 207b3ad..9ed661c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,31 +13,3 @@ Release *.suo x64 -## Personal - -# A listing of all the files included in the project -*.files - -# Include directories -*.includes - -# Project configuration settings like predefined Macros -*.config - -# Qt Creator settings -*.creator - -# User project settings -*.creator.user* - -# Qt Creator backups -*.autosave - -# Flags for Clang Code Model -*.cxxflags -*.cflags - - -.cache/ -.vscode/ -.qtc_clangd/ diff --git a/.luacheckrc b/.luacheckrc deleted file mode 100644 index a3b4f63..0000000 --- a/.luacheckrc +++ /dev/null @@ -1,29 +0,0 @@ -unused_args = false -redefined = false -max_line_length = false - -not_globals = { - "string.len", - "table.getn", -} - -include_files = { - "**/*.lua", - "**/*.rockspec", - ".busted", - ".luacheckrc", -} - -exclude_files = { - "test/*.lua", - "test/**/*.lua", - "samples/*.lua", - "samples/**/*.lua", - "gem/*.lua", - "gem/**/*.lua", - -- GH Actions Lua Environment - ".lua", - ".luarocks", - ".install", -} - diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fce8a96 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,54 @@ +language: erlang + +env: + global: + - LUAROCKS_BASE=luarocks-2.0.13 + matrix: + - LUA=lua5.1 LUA_DEV=liblua5.1-dev LUA_VER=5.1 LUA_SFX=5.1 LUA_INCDIR=/usr/include/lua5.1 + - LUA=lua5.2 LUA_DEV=liblua5.2-dev LUA_VER=5.2 LUA_SFX=5.2 LUA_INCDIR=/usr/include/lua5.2 + - LUA=luajit LUA_DEV=libluajit-5.1-dev LUA_VER=5.1 LUA_SFX=jit LUA_INCDIR=/usr/include/luajit-2.0 + +branches: + only: + - master + +before_install: + - if [ $LUA = "luajit" ]; then + sudo add-apt-repository ppa:mwild1/ppa -y && sudo apt-get update -y; + fi + - sudo apt-get install $LUA + - sudo apt-get install $LUA_DEV + - lua$LUA_SFX -v + # Install a recent luarocks release + - wget http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz + - tar zxvpf $LUAROCKS_BASE.tar.gz + - cd $LUAROCKS_BASE + - ./configure + --lua-version=$LUA_VER --lua-suffix=$LUA_SFX --with-lua-include="$LUA_INCDIR" + - sudo make + - sudo make install + - cd $TRAVIS_BUILD_DIR + + +install: + - export DEBUG=DEBUG + - sudo -E luarocks make luasocket-scm-0.rockspec + +script: + - cd test + - lua$LUA_SFX hello.lua + - lua$LUA_SFX testsrvr.lua > /dev/null & + - lua$LUA_SFX testclnt.lua + - lua$LUA_SFX stufftest.lua + - lua$LUA_SFX excepttest.lua + - lua$LUA_SFX test_bind.lua + - lua$LUA_SFX test_getaddrinfo.lua + - lua$LUA_SFX ltn12test.lua + - lua$LUA_SFX mimetest.lua + - lua$LUA_SFX urltest.lua + - lua$LUA_SFX test_socket_error.lua + +notifications: + email: + on_success: change + on_failure: always diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 3a25186..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -# Changelog - -## [v3.1.0](https://github.com/lunarmodules/luasocket/releases/v3.1.0) — 2022-07-27 - -* Add support for TCP Defer Accept – @Zash -* Add support for TCP Fast Open – @Zash -* Fix Windows (mingw32) builds – @goldenstein64 -* Avoid build warnings on 64-bit Windows – @rpatters1 - -## [v3.0.0](https://github.com/lunarmodules/luasocket/releases/v3.0.0) — 2022-03-25 - -The last time LuaSocket had a stable release tag was 14 years ago when 2.0.2 was tagged. -A v3 release candidate was tagged 9 years ago. -Since then it has been downloaded over 3 million times. -Additionally the Git repository regularly gets several hundred clones a day. -But 9 years is a long time and even the release candidate has grown a bit long in the tooth. -Many Linux distros have packaged the current Git HEAD or some specific tested point as dated or otherwise labeled releases. -256 commits later and having been migrated to the @lunarmodules org namespace on GitHub, please welcome v3. - -This release is a "safe-harbor" tag that represents a minimal amount of changes to get a release tagged. -Beyond some CI tooling, very little code has changed since migration to @lunarmodules ([5b18e47..e47d98f](https://github.com/lunarmodules/luasocket/compare/5b18e47..e47d98f?w=1)): - -* Lua 5.4.3+ support – @pkulchenko, @Zash -* Cleanup minor issues to get a code linter to pass – @Tieske, @jyoui, @alerque -* Update Visual Studio build rules for Lua 5.1 – @ewestbrook -* Set http transfer-encoding even without content-length – @tokenrove - -Prior to migration to @lunarmodules ([v3.0-rc1..5b18e47](https://github.com/lunarmodules/luasocket/compare/v3.0-rc1..5b18e47?w=1)) many things happened of which the author of this changelog is not fully apprised. -Your best bet if it affects your project somehow is to read the commit log & diffs yourself. - -## [v3.0-rc1](https://github.com/lunarmodules/luasocket/releases/v3.0-rc1) — 2013-06-14 - -Main changes for LuaSocket 3.0-rc1 are IPv6 support and Lua 5.2 compatibility. - -* Added: Compatible with Lua 5.2 - - Note that unless you define LUA_COMPAT_MODULE, package tables will not be exported as globals! -* Added: IPv6 support; - - Socket.connect and socket.bind support IPv6 addresses; - - Getpeername and getsockname support IPv6 addresses, and return the socket family as a third value; - - URL module updated to support IPv6 host names; - - New socket.tcp6 and socket.udp6 functions; - - New socket.dns.getaddrinfo and socket.dns.getnameinfo functions; -* Added: getoption method; -* Fixed: url.unescape was returning additional values; -* Fixed: mime.qp, mime.unqp, mime.b64, and mime.unb64 could mistaking their own stack slots for functions arguments; -* Fixed: Receiving zero-length datagram is now possible; -* Improved: Hidden all internal library symbols; -* Improved: Better error messages; -* Improved: Better documentation of socket options. -* Fixed: manual sample of HTTP authentication now uses correct "authorization" header (Alexandre Ittner); -* Fixed: failure on bind() was destroying the socket (Sam Roberts); -* Fixed: receive() returns immediatelly if prefix can satisfy bytes requested (M Joonas Pihlaja); -* Fixed: multicast didn't work on Windows, or anywhere else for that matter (Herbert Leuwer, Adrian Sietsma); -* Fixed: select() now reports an error when called with more sockets than FD_SETSIZE (Lorenzo Leonini); -* Fixed: manual links to home.html changed to index.html (Robert Hahn); -* Fixed: mime.unb64() would return an empty string on results that started with a null character (Robert Raschke); -* Fixed: HTTP now automatically redirects on 303 and 307 (Jonathan Gray); -* Fixed: calling sleep() with negative numbers could block forever, wasting CPU. Now it returns immediately (MPB); -* Improved: FTP commands are now sent in upper case to help buggy servers (Anders Eurenius); -* Improved: known headers now sent in canonic capitalization to help buggy servers (Joseph Stewart); -* Improved: Clarified tcp:receive() in the manual (MPB); -* Improved: Decent makefiles (LHF). -* Fixed: RFC links in documentation now point to IETF (Cosmin Apreutesei). - -## [v2.0.2](https://github.com/lunarmodules/luasocket/releases/v2.0.2) — 2007-09-11 diff --git a/FIX b/FIX new file mode 100644 index 0000000..40f30a1 --- /dev/null +++ b/FIX @@ -0,0 +1,28 @@ + + + + + + +http was preserving old host header during redirects +fix smtp.send hang on source error +add create field to FTP and SMTP and fix HTTP ugliness +clean timeout argument to open functions in SMTP, HTTP and FTP +eliminate globals from namespaces created by module(). +url.absolute was not working when base_url was already parsed +http.request was redirecting even when the location header was empty +tcp{client}:shutdown() was checking for group instead of class. +tcp{client}:send() now returns i+sent-1... +get rid of a = socket.try() in the manual, except for protected cases. replace it with assert. +get rid of "base." kludge in package.loaded +check all "require("http")" etc in the manual. +make sure sock_gethostname.* only return success if the hp is not null! +change 'l' prefix in C libraries to 'c' to avoid clash with LHF libraries + don't forget the declarations in luasocket.h and mime.h!!! +setpeername was using udp{unconnected} +fixed a bug in http.lua that caused some requests to fail (Florian Berger) +fixed a bug in select.c that prevented sockets with descriptor 0 from working (Renato Maia) +fixed a "bug" that caused dns.toip to crash under uLinux +fixed a "bug" that caused a crash in gethostbyname under VMS +DEBUG and VERSION became _DEBUG and _VERSION +send returns the right value if input is "". Alexander Marinov diff --git a/LICENSE b/LICENSE index a8ed03e..b635451 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ -Copyright (C) 2004-2022 Diego Nehab +LuaSocket 3.0 license +Copyright © 2004-2013 Diego Nehab Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/Lua.props b/Lua.props new file mode 100755 index 0000000..d748448 --- /dev/null +++ b/Lua.props @@ -0,0 +1,49 @@ + + + + + $(Platform)/$(Configuration) + + + $(Configuration) + + + 5.3 + z:\data\build\vc14\ + $(LUAPREFIX)\lib\lua\$(LUAV)\$(LUAPLAT) + $(LUAPREFIX)\bin\lua\$(LUAV)\$(LUAPLAT) + $(LUAPREFIX)\bin\lua\$(LUAV)\$(LUAPLAT)\lua + $(LUAPREFIX)\include\lua\$(LUAV);$(LUAPREFIX)\include\lua$(LUAV) + lua$(LUAV.Replace('.', '')).lib + + + <_PropertySheetDisplayName>Lua + + + + + $(LUAPLAT) + + + $(LUAPREFIX) + + + $(LUAV) + + + $(LUALIB) + + + $(LUAINC) + + + $(LUACDIR) + + + $(LUALDIR) + + + $(LUALIBNAME) + + + diff --git a/NEW b/NEW new file mode 100644 index 0000000..0bff64c --- /dev/null +++ b/NEW @@ -0,0 +1,44 @@ +What's New + +Main changes for LuaSocket 3.0-rc1 are IPv6 support and Lua 5.2 compatibility. + + * Added: Compatible with Lua 5.2 + - Note that unless you define LUA_COMPAT_MODULE, package + tables will not be exported as globals! + * Added: IPv6 support; + - Socket.connect and socket.bind support IPv6 addresses; + - Getpeername and getsockname support IPv6 addresses, and + return the socket family as a third value; + - URL module updated to support IPv6 host names; + - New socket.tcp6 and socket.udp6 functions; + - New socket.dns.getaddrinfo and socket.dns.getnameinfo functions; + * Added: getoption method; + * Fixed: url.unescape was returning additional values; + * Fixed: mime.qp, mime.unqp, mime.b64, and mime.unb64 could + mistaking their own stack slots for functions arguments; + * Fixed: Receiving zero-length datagram is now possible; + * Improved: Hidden all internal library symbols; + * Improved: Better error messages; + * Improved: Better documentation of socket options. + * Fixed: manual sample of HTTP authentication now uses correct + "authorization" header (Alexandre Ittner); + * Fixed: failure on bind() was destroying the socket (Sam Roberts); + * Fixed: receive() returns immediatelly if prefix can satisfy + bytes requested (M Joonas Pihlaja); + * Fixed: multicast didn't work on Windows, or anywhere + else for that matter (Herbert Leuwer, Adrian Sietsma); + * Fixed: select() now reports an error when called with more + sockets than FD_SETSIZE (Lorenzo Leonini); + * Fixed: manual links to home.html changed to index.html (Robert Hahn); + * Fixed: mime.unb64() would return an empty string on results that started + with a null character (Robert Raschke); + * Fixed: HTTP now automatically redirects on 303 and 307 (Jonathan Gray); + * Fixed: calling sleep() with negative numbers could + block forever, wasting CPU. Now it returns immediately (MPB); + * Improved: FTP commands are now sent in upper case to + help buggy servers (Anders Eurenius); + * Improved: known headers now sent in canonic + capitalization to help buggy servers (Joseph Stewart); + * Improved: Clarified tcp:receive() in the manual (MPB); + * Improved: Decent makefiles (LHF). + * Fixed: RFC links in documentation now point to IETF (Cosmin Apreutesei). diff --git a/README b/README new file mode 100644 index 0000000..cd8ee59 --- /dev/null +++ b/README @@ -0,0 +1,11 @@ +This is the LuaSocket 3.0-rc1. It has been tested on Windows 7, Mac OS X, +and Linux. + +Please use the project page at GitHub + + https://github.com/diegonehab/luasocket + +to file bug reports or propose changes. + +Have fun, +Diego Nehab. diff --git a/README.md b/README.md deleted file mode 100644 index 6f5657c..0000000 --- a/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# LuaSocket - - -[![Build](https://img.shields.io/github/actions/workflow/status/lunarmodules/luasocket/build.yml?branch=master&label=Build&logo=Lua)](https://github.com/lunarmodules/luasocket/actions?workflow=Build) -[![Luacheck](https://img.shields.io/github/actions/workflow/status/lunarmodules/luasocket/luacheck.yml?branch=master&label=Luacheck&logo=Lua)](https://github.com/lunarmodules/luasocket/actions?workflow=Luacheck) -[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/lunarmodules/luasocket?label=Tag&logo=GitHub)](https://github.com/lunarmodules/luasocket/releases) -[![Luarocks](https://img.shields.io/luarocks/v/lunarmodules/luasocket?label=Luarocks&logo=Lua)](https://luarocks.org/modules/lunarmodules/luasocket) - -LuaSocket is a Lua extension library composed of two parts: - -1. a set of C modules that provide support for the TCP and UDP transport layers, and -2. a set of Lua modules that provide functions commonly needed by applications that deal with the Internet. diff --git a/TODO b/TODO new file mode 100644 index 0000000..a838fc0 --- /dev/null +++ b/TODO @@ -0,0 +1,81 @@ +- bizarre default values for getnameinfo should throw error instead! + +> It's just too bad it can't talk to gmail - +> reason 1: they absolutely want TLS +> reason 2: unlike all the other SMTP implementations, they +> don't +> tolerate missing < > around adresses + +- document the new bind and connect behavior. +- shouldn't we instead make the code compatible to Lua 5.2 + without any compat stuff, and use a compatibility layer to + make it work on 5.1? +- add what's new to manual +- should there be an equivalent to tohostname for IPv6? +- should we add service name resolution as well to getaddrinfo? +- Maybe the sockaddr to presentation conversion should be done with getnameinfo()? + +- add http POST sample to manual + people keep asking stupid questions +- documentation of dirty/getfd/setfd is problematic because of portability + same for unix and serial. + what to do about this? add a stronger disclaimer? +- fix makefile with decent defaults? + +Done: + +- added IPv6 support to getsockname +- simplified getpeername implementation +- added family to return of getsockname and getpeername + and added modification to the manual to describe + +- connect and bind try all adresses returned by getaddrinfo +- document headers.lua? +- update copyright date everywhere? +- remove RCSID from files? +- move version to 2.1 rather than 2.1.1? +- fixed url package to support ipv6 hosts +- changed domain to family +- implement getfamily methods. + +- remove references to Lua 5.0 from documentation, add 5.2? +- update lua and luasocket version in samples in documentation +- document ipv5_v6only default option being set? +- document tcp6 and udp6 +- document dns.getaddrinfo +- documented zero-sized datagram change? + no. +- document unix socket and serial socket? add raw support? + no. +- document getoption +- merge luaL_typeerror into auxiliar to avoid using luaL prefix? + + + + + + + + + + +replace \r\n with \0xD\0xA in everything +New mime support + +ftp send should return server replies? +make sure there are no object files in the distribution tarball +http handling of 100-continue, see DB patch +DB ftp.lua bug. +test unix.c to return just a function and works with require"unix" +get rid of setmetatable(, nil) since packages don't need this anymore in 5.1 +compat-5.1 novo +ajeitar pra lua-5.1 + +adicionar exemplos de expansão: pipe, local, named pipe +testar os options! + + +- Thread-unsafe functions to protect + gethostbyname(), gethostbyaddr(), gethostent(), +inet_ntoa(), strerror(), + diff --git a/TODO.md b/TODO.md deleted file mode 100644 index d265694..0000000 --- a/TODO.md +++ /dev/null @@ -1,135 +0,0 @@ -## FIX - -http was preserving old host header during redirects -fix smtp.send hang on source error -add create field to FTP and SMTP and fix HTTP ugliness -clean timeout argument to open functions in SMTP, HTTP and FTP -eliminate globals from namespaces created by module(). -url.absolute was not working when base_url was already parsed -http.request was redirecting even when the location header was empty -tcp{client}:shutdown() was checking for group instead of class. -tcp{client}:send() now returns i+sent-1... -get rid of a = socket.try() in the manual, except for protected cases. replace it with assert. -get rid of "base." kludge in package.loaded -check all "require("http")" etc in the manual. -make sure sock_gethostname.* only return success if the hp is not null! -change 'l' prefix in C libraries to 'c' to avoid clash with LHF libraries - don't forget the declarations in luasocket.h and mime.h!!! -setpeername was using udp{unconnected} -fixed a bug in http.lua that caused some requests to fail (Florian Berger) -fixed a bug in select.c that prevented sockets with descriptor 0 from working (Renato Maia) -fixed a "bug" that caused dns.toip to crash under uLinux -fixed a "bug" that caused a crash in gethostbyname under VMS -DEBUG and VERSION became _DEBUG and _VERSION -send returns the right value if input is "". Alexander Marinov - - -## WISH - -... as an l-value to get all results of a function call? -at least ...[i] and #... -extend to full tuples? - -__and __or __not metamethods - -lua_tostring, lua_tonumber, lua_touseradta etc push values in stack -__tostring,__tonumber, __touserdata metamethods are checked -and expected to push an object of correct type on stack - -lua_rawtostring, lua_rawtonumber, lua_rawtouserdata don't -push anything on stack, return data of appropriate type, -skip metamethods and throw error if object not of exact type - -package.findfile exported -module not polluting the global namespace - -coxpcall with a coroutine pool for efficiency (reusing coroutines) - -exception mechanism formalized? just like the package system was. - -a nice bitlib in the core - - -## TODO - -- bizarre default values for getnameinfo should throw error instead! - -> It's just too bad it can't talk to gmail - -> reason 1: they absolutely want TLS -> reason 2: unlike all the other SMTP implementations, they -> don't -> tolerate missing < > around adresses - -- document the new bind and connect behavior. -- shouldn't we instead make the code compatible to Lua 5.2 - without any compat stuff, and use a compatibility layer to - make it work on 5.1? -- add what's new to manual -- should there be an equivalent to tohostname for IPv6? -- should we add service name resolution as well to getaddrinfo? -- Maybe the sockaddr to presentation conversion should be done with getnameinfo()? - -- add http POST sample to manual - people keep asking stupid questions -- documentation of dirty/getfd/setfd is problematic because of portability - same for unix and serial. - what to do about this? add a stronger disclaimer? -- fix makefile with decent defaults? - -## Done: - -- added IPv6 support to getsockname -- simplified getpeername implementation -- added family to return of getsockname and getpeername - and added modification to the manual to describe - -- connect and bind try all adresses returned by getaddrinfo -- document headers.lua? -- update copyright date everywhere? -- remove RCSID from files? -- move version to 2.1 rather than 2.1.1? -- fixed url package to support ipv6 hosts -- changed domain to family -- implement getfamily methods. - -- remove references to Lua 5.0 from documentation, add 5.2? -- update lua and luasocket version in samples in documentation -- document ipv5_v6only default option being set? -- document tcp6 and udp6 -- document dns.getaddrinfo -- documented zero-sized datagram change? - no. -- document unix socket and serial socket? add raw support? - no. -- document getoption -- merge luaL_typeerror into auxiliar to avoid using luaL prefix? - - - - - - - - - - -replace \r\n with \0xD\0xA in everything -New mime support - -ftp send should return server replies? -make sure there are no object files in the distribution tarball -http handling of 100-continue, see DB patch -DB ftp.lua bug. -test unix.c to return just a function and works with require"unix" -get rid of setmetatable(, nil) since packages don't need this anymore in 5.1 -compat-5.1 novo -ajeitar pra lua-5.1 - -adicionar exemplos de expans�o: pipe, local, named pipe -testar os options! - - -- Thread-unsafe functions to protect - gethostbyname(), gethostbyaddr(), gethostent(), -inet_ntoa(), strerror(), - diff --git a/WISH b/WISH new file mode 100644 index 0000000..e7e9c07 --- /dev/null +++ b/WISH @@ -0,0 +1,22 @@ +... as an l-value to get all results of a function call? +at least ...[i] and #... +extend to full tuples? + +__and __or __not metamethods + +lua_tostring, lua_tonumber, lua_touseradta etc push values in stack +__tostring,__tonumber, __touserdata metamethods are checked +and expected to push an object of correct type on stack + +lua_rawtostring, lua_rawtonumber, lua_rawtouserdata don't +push anything on stack, return data of appropriate type, +skip metamethods and throw error if object not of exact type + +package.findfile exported +module not polluting the global namespace + +coxpcall with a coroutine pool for efficiency (reusing coroutines) + +exception mechanism formalized? just like the package system was. + +a nice bitlib in the core diff --git a/compile_commands.json b/compile_commands.json deleted file mode 100644 index a956c2d..0000000 --- a/compile_commands.json +++ /dev/null @@ -1,398 +0,0 @@ -[ - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "io.o", - "io.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/io.c", - "output": "/home/benjamin/Project/luasocket/src/io.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "luasocket.o", - "luasocket.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/luasocket.c", - "output": "/home/benjamin/Project/luasocket/src/luasocket.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "timeout.o", - "timeout.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/timeout.c", - "output": "/home/benjamin/Project/luasocket/src/timeout.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "buffer.o", - "buffer.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/buffer.c", - "output": "/home/benjamin/Project/luasocket/src/buffer.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "options.o", - "options.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/options.c", - "output": "/home/benjamin/Project/luasocket/src/options.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "inet.o", - "inet.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/inet.c", - "output": "/home/benjamin/Project/luasocket/src/inet.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "auxiliar.o", - "auxiliar.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/auxiliar.c", - "output": "/home/benjamin/Project/luasocket/src/auxiliar.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "compat.o", - "compat.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/compat.c", - "output": "/home/benjamin/Project/luasocket/src/compat.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "usocket.o", - "usocket.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/usocket.c", - "output": "/home/benjamin/Project/luasocket/src/usocket.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "except.o", - "except.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/except.c", - "output": "/home/benjamin/Project/luasocket/src/except.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "select.o", - "select.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/select.c", - "output": "/home/benjamin/Project/luasocket/src/select.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "tcp.o", - "tcp.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/tcp.c", - "output": "/home/benjamin/Project/luasocket/src/tcp.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "udp.o", - "udp.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/udp.c", - "output": "/home/benjamin/Project/luasocket/src/udp.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "mime.o", - "mime.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/mime.c", - "output": "/home/benjamin/Project/luasocket/src/mime.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "unixstream.o", - "unixstream.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/unixstream.c", - "output": "/home/benjamin/Project/luasocket/src/unixstream.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "unixdgram.o", - "unixdgram.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/unixdgram.c", - "output": "/home/benjamin/Project/luasocket/src/unixdgram.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "unix.o", - "unix.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/unix.c", - "output": "/home/benjamin/Project/luasocket/src/unix.o" - }, - { - "arguments": [ - "/usr/bin/gcc", - "-I/usr/include/lua/5.4", - "-I/usr/include/lua5.4", - "-DLUASOCKET_NODEBUG", - "-Wall", - "-Wshadow", - "-Wextra", - "-Wimplicit", - "-O2", - "-ggdb3", - "-fpic", - "-c", - "-o", - "serial.o", - "serial.c" - ], - "directory": "/home/benjamin/Project/luasocket/src", - "file": "/home/benjamin/Project/luasocket/src/serial.c", - "output": "/home/benjamin/Project/luasocket/src/serial.o" - } -] diff --git a/compile_flags.txt b/compile_flags.txt deleted file mode 100644 index 47f6ec8..0000000 --- a/compile_flags.txt +++ /dev/null @@ -1 +0,0 @@ --I/usr/include/lua5.4 diff --git a/docs/dns.html b/doc/dns.html similarity index 70% rename from docs/dns.html rename to doc/dns.html index 56ce3ba..c4a0472 100644 --- a/docs/dns.html +++ b/doc/dns.html @@ -1,4 +1,4 @@ - @@ -13,22 +13,22 @@ -
+

- -
-LuaSocket +
+LuaSocket
Network support for the Lua language +
Network support for the Lua language
-

+

home · download · installation · introduction · -reference +reference


@@ -36,14 +36,14 @@ -

DNS

+

DNS

-IPv4 name resolution functions -dns.toip +IPv4 name resolution functions +dns.toip and -dns.tohostname -return all information obtained from +dns.tohostname +return all information obtained from the resolver in a table of the form:

@@ -60,10 +60,10 @@ Note that the alias list can be empty.

-The more general name resolution function -dns.getaddrinfo, which +The more general name resolution function +dns.getaddrinfo, which supports both IPv6 and IPv4, -returns all information obtained from +returns all information obtained from the resolver in a table of the form:

@@ -88,82 +88,82 @@ addresses, and "inet6" for IPv6 addresses. -

+

socket.dns.getaddrinfo(address)

-

-Converts from host name to address. +

+Converts from host name to address.

-

-Address can be an IPv4 or IPv6 address or host name. +

+Address can be an IPv4 or IPv6 address or host name.

-

+

The function returns a table with all information returned by the resolver. In case of error, the function returns nil -followed by an error message. +followed by an error message.

-

+

socket.dns.gethostname()

-

-Returns the standard host name for the machine as a string. +

+Returns the standard host name for the machine as a string.

-

+

socket.dns.tohostname(address)

-

+

Converts from IPv4 address to host name.

-

-Address can be an IP address or host name. +

+Address can be an IP address or host name.

-

+

The function returns a string with the canonic host name of the given address, followed by a table with all information returned by the resolver. In case of error, the function returns nil -followed by an error message. +followed by an error message.

-

+

socket.dns.toip(address)

-

+

Converts from host name to IPv4 address.

-

-Address can be an IP address or host name. +

+Address can be an IP address or host name.

-

+

Returns a string with the first IP address found for address, followed by a table with all information returned by the resolver. In case of error, the function returns nil followed by an error -message. +message.

-