Skip to content

Commit

Permalink
luasocket src files
Browse files Browse the repository at this point in the history
  • Loading branch information
Mormert committed Feb 29, 2024
1 parent aca4634 commit 7f2ca46
Show file tree
Hide file tree
Showing 163 changed files with 29,039 additions and 0 deletions.
23 changes: 23 additions & 0 deletions engine/3rdparty/luasocket/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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
50 changes: 50 additions & 0 deletions engine/3rdparty/luasocket/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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
34 changes: 34 additions & 0 deletions engine/3rdparty/luasocket/.github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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 }}
13 changes: 13 additions & 0 deletions engine/3rdparty/luasocket/.github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
15 changes: 15 additions & 0 deletions engine/3rdparty/luasocket/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.o
*.so
*.so.*
*.obj
*.lib
*.dll*
*.user
*.sdf
Debug
Release
*.manifest
*.swp
*.suo
x64

29 changes: 29 additions & 0 deletions engine/3rdparty/luasocket/.luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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",
}

65 changes: 65 additions & 0 deletions engine/3rdparty/luasocket/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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
19 changes: 19 additions & 0 deletions engine/3rdparty/luasocket/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (C) 2004-2022 Diego Nehab

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
49 changes: 49 additions & 0 deletions engine/3rdparty/luasocket/Lua.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Condition="'$(Platform)'=='x64'" Label="LuaPlat">
<LUAPLAT>$(Platform)/$(Configuration)</LUAPLAT>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='Win32'" Label="LuaPlat">
<LUAPLAT>$(Configuration)</LUAPLAT>
</PropertyGroup>
<PropertyGroup Label="UserMacros">
<LUAV>5.3</LUAV>
<LUAPREFIX>z:\data\build\vc14\</LUAPREFIX>
<LUALIB>$(LUAPREFIX)\lib\lua\$(LUAV)\$(LUAPLAT)</LUALIB>
<LUACDIR>$(LUAPREFIX)\bin\lua\$(LUAV)\$(LUAPLAT)</LUACDIR>
<LUALDIR>$(LUAPREFIX)\bin\lua\$(LUAV)\$(LUAPLAT)\lua</LUALDIR>
<LUAINC>$(LUAPREFIX)\include\lua\$(LUAV);$(LUAPREFIX)\include\lua$(LUAV)</LUAINC>
<LUALIBNAME>lua$(LUAV.Replace('.', '')).lib</LUALIBNAME>
</PropertyGroup>
<PropertyGroup>
<_PropertySheetDisplayName>Lua</_PropertySheetDisplayName>
</PropertyGroup>
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="LUAPLAT">
<Value>$(LUAPLAT)</Value>
</BuildMacro>
<BuildMacro Include="LUAPREFIX">
<Value>$(LUAPREFIX)</Value>
</BuildMacro>
<BuildMacro Include="LUAV">
<Value>$(LUAV)</Value>
</BuildMacro>
<BuildMacro Include="LUALIB">
<Value>$(LUALIB)</Value>
</BuildMacro>
<BuildMacro Include="LUAINC">
<Value>$(LUAINC)</Value>
</BuildMacro>
<BuildMacro Include="LUACDIR">
<Value>$(LUACDIR)</Value>
</BuildMacro>
<BuildMacro Include="LUALDIR">
<Value>$(LUALDIR)</Value>
</BuildMacro>
<BuildMacro Include="LUALIBNAME">
<Value>$(LUALIBNAME)</Value>
</BuildMacro>
</ItemGroup>
</Project>
12 changes: 12 additions & 0 deletions engine/3rdparty/luasocket/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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.
Loading

0 comments on commit 7f2ca46

Please sign in to comment.