16 Commits

Author SHA1 Message Date
f815d7005c Merge b281e6f717 into 23241717bf 2024-03-10 04:19:01 -06:00
23241717bf fix(docs): link to included LTN documents (#426) 2024-03-05 23:18:24 +03:00
98be8d9fc1 chore(http): Correct typos in error message and code comments (#423) 2024-02-12 11:28:01 +03:00
fa69770e52 fix(http): Use the right protocol for proxies (#386) 2023-11-23 08:01:29 +03:00
13f2b3c663 fix(http): Correct receiveheaders() handling of folded values (#420) 2023-11-13 23:33:26 +03:00
453a5207ed style(docs): Trim trailing whitespace in HTML docs
Many editors remove these automatically anyway which makes opening and
editng the docs cause a bunch of noise. This is just to get the noise
out of the way in a style commit so it doesn't leak into other PRs
2023-11-11 08:07:38 +03:00
de359ea408 chore(core): Update version markers to last released version
Closes #401
2023-11-11 00:48:02 +03:00
c93f9154e1 feat(rockspec): Ship mbox parser with LuaRocks, already packaged in some distros
Closes #324
2023-11-11 00:44:22 +03:00
b281e6f717 docs: Remove params documentation 2023-11-09 14:40:15 +03:00
784b0631e1 test(url): Update URL parsing expectations for params removal 2023-11-09 14:40:15 +03:00
a1b5d3abd1 chore(url)!: Remove params parsing, part of deprecated URL schema 2023-11-09 14:40:15 +03:00
8a5368b659 Merge pull request #418 from alerque/url-empty-path 2023-11-09 14:11:33 +03:00
22b8202d70 fix(wsocket): Properly report CONNRESET (#81) 2023-11-09 14:00:09 +03:00
3a817a56eb fix(url): Avoid fragment being part of authority, allows parsing empty paths 2023-11-08 23:27:58 +03:00
7eaf648056 fix(url): Avoid query string being part of authority, allows parsing empty paths 2023-11-08 14:50:43 +03:00
bef62aeb50 fix(inet): Return port as number in getsockname (#392) 2023-11-08 14:29:06 +03:00
16 changed files with 148 additions and 170 deletions

View File

@ -1,11 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> "http://www.w3.org/TR/html4/strict.dtd">
<html> <html>
<head> <head>
<meta name="description" content="LuaSocket: Introduction to the core"> <meta name="description" content="LuaSocket: Introduction to the core">
<meta name="keywords" content="Lua, LuaSocket, TCP, UDP, Network, Support, <meta name="keywords" content="Lua, LuaSocket, TCP, UDP, Network, Support,
Installation"> Installation">
<title>LuaSocket: Installation</title> <title>LuaSocket: Installation</title>
<link rel="stylesheet" href="reference.css" type="text/css"> <link rel="stylesheet" href="reference.css" type="text/css">
</head> </head>
@ -29,7 +29,7 @@ Installation">
<a href="index.html#download">download</a> &middot; <a href="index.html#download">download</a> &middot;
<a href="installation.html">installation</a> &middot; <a href="installation.html">installation</a> &middot;
<a href="introduction.html">introduction</a> &middot; <a href="introduction.html">introduction</a> &middot;
<a href="reference.html">reference</a> <a href="reference.html">reference</a>
</p> </p>
</center> </center>
<hr> <hr>
@ -48,8 +48,8 @@ will likely already have been answered. </p>
<p> On Unix systems, the standard distribution uses two base <p> On Unix systems, the standard distribution uses two base
directories, one for system dependent files, and another for system directories, one for system dependent files, and another for system
independent files. Let's call these directories <tt>&lt;CDIR&gt;</tt> independent files. Let's call these directories <tt>&lt;CDIR&gt;</tt>
and <tt>&lt;LDIR&gt;</tt>, respectively. and <tt>&lt;LDIR&gt;</tt>, respectively.
For example, in my laptp, Lua&nbsp;5.1 is configured to For example, in my laptp, Lua&nbsp;5.1 is configured to
use '<tt>/usr/local/lib/lua/5.1</tt>' for use '<tt>/usr/local/lib/lua/5.1</tt>' for
<tt>&lt;CDIR&gt;</tt> and '<tt>/usr/local/share/lua/5.1</tt>' for <tt>&lt;CDIR&gt;</tt> and '<tt>/usr/local/share/lua/5.1</tt>' for
@ -57,9 +57,9 @@ use '<tt>/usr/local/lib/lua/5.1</tt>' for
usually points to the directory where the Lua executable is usually points to the directory where the Lua executable is
found, and <tt>&lt;LDIR&gt;</tt> points to a found, and <tt>&lt;LDIR&gt;</tt> points to a
<tt>lua/</tt> directory inside <tt>&lt;CDIR&gt;</tt>. (These <tt>lua/</tt> directory inside <tt>&lt;CDIR&gt;</tt>. (These
settings can be overridden by environment variables settings can be overridden by environment variables
<tt>LUA_PATH</tt> and <tt>LUA_CPATH</tt>. See the Lua <tt>LUA_PATH</tt> and <tt>LUA_CPATH</tt>. See the Lua
documentation for details.) Here is the standard LuaSocket documentation for details.) Here is the standard LuaSocket
distribution directory structure:</p> distribution directory structure:</p>
<pre class=example> <pre class=example>
@ -76,7 +76,7 @@ distribution directory structure:</p>
</pre> </pre>
<p> Naturally, on Unix systems, <tt>core.dll</tt> <p> Naturally, on Unix systems, <tt>core.dll</tt>
would be replaced by <tt>core.so</tt>. would be replaced by <tt>core.so</tt>.
</p> </p>
<h3>Using LuaSocket</h3> <h3>Using LuaSocket</h3>
@ -89,7 +89,7 @@ it should be easy to use LuaSocket. Just fire the interpreter and use the
Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio
&gt; socket = require("socket") &gt; socket = require("socket")
&gt; print(socket._VERSION) &gt; print(socket._VERSION)
--&gt; LuaSocket 3.0.0 --&gt; LuaSocket 3.1.0
</pre> </pre>
<p> Each module loads their dependencies automatically, so you only need to <p> Each module loads their dependencies automatically, so you only need to

View File

@ -1,11 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> "http://www.w3.org/TR/html4/strict.dtd">
<html> <html>
<head> <head>
<meta name="description" content="LuaSocket: Introduction to the core"> <meta name="description" content="LuaSocket: Introduction to the core">
<meta name="keywords" content="Lua, LuaSocket, TCP, UDP, Network, <meta name="keywords" content="Lua, LuaSocket, TCP, UDP, Network,
Library, Support"> Library, Support">
<title>LuaSocket: Introduction to the core</title> <title>LuaSocket: Introduction to the core</title>
<link rel="stylesheet" href="reference.css" type="text/css"> <link rel="stylesheet" href="reference.css" type="text/css">
</head> </head>
@ -29,7 +29,7 @@ Library, Support">
<a href="index.html#download">download</a> &middot; <a href="index.html#download">download</a> &middot;
<a href="installation.html">installation</a> &middot; <a href="installation.html">installation</a> &middot;
<a href="introduction.html">introduction</a> &middot; <a href="introduction.html">introduction</a> &middot;
<a href="reference.html">reference</a> <a href="reference.html">reference</a>
</p> </p>
</center> </center>
<hr> <hr>
@ -61,23 +61,23 @@ interface to I/O across different domains and operating systems.
The API design had two goals in mind. First, users The API design had two goals in mind. First, users
experienced with the C API to sockets should feel comfortable using LuaSocket. experienced with the C API to sockets should feel comfortable using LuaSocket.
Second, the simplicity and the feel of the Lua language should be Second, the simplicity and the feel of the Lua language should be
preserved. To achieve these goals, the LuaSocket API keeps the function names and semantics the C API whenever possible, but their usage in Lua has been greatly simplified. preserved. To achieve these goals, the LuaSocket API keeps the function names and semantics the C API whenever possible, but their usage in Lua has been greatly simplified.
</p> </p>
<p> <p>
One of the simplifications is the receive pattern capability. One of the simplifications is the receive pattern capability.
Applications can read data from stream domains (such as TCP) Applications can read data from stream domains (such as TCP)
line by line, block by block, or until the connection is closed. line by line, block by block, or until the connection is closed.
All I/O reads are buffered and the performance differences between All I/O reads are buffered and the performance differences between
different receive patterns are negligible. different receive patterns are negligible.
</p> </p>
<p> <p>
Another advantage is the flexible timeout control Another advantage is the flexible timeout control
mechanism. As in C, all I/O operations are blocking by default. For mechanism. As in C, all I/O operations are blocking by default. For
example, the <a href=tcp.html#send><tt>send</tt></a>, example, the <a href=tcp.html#send><tt>send</tt></a>,
<a href=tcp.html#receive><tt>receive</tt></a> and <a href=tcp.html#receive><tt>receive</tt></a> and
<a href=tcp.html#accept><tt>accept</tt></a> methods <a href=tcp.html#accept><tt>accept</tt></a> methods
of the TCP domain will block the caller application until of the TCP domain will block the caller application until
the operation is completed (if ever!). However, with a call to the the operation is completed (if ever!). However, with a call to the
@ -87,7 +87,7 @@ the time it can be blocked by LuaSocket (the "<tt>total</tt>" timeout), on
the time LuaSocket can internally be blocked by any OS call (the the time LuaSocket can internally be blocked by any OS call (the
"<tt>block</tt>" timeout) or a combination of the two. Each LuaSocket "<tt>block</tt>" timeout) or a combination of the two. Each LuaSocket
call might perform several OS calls, so that the two timeout values are call might perform several OS calls, so that the two timeout values are
<em>not</em> equivalent. <em>not</em> equivalent.
</p> </p>
<p> <p>
@ -95,10 +95,10 @@ Finally, the host name resolution is transparent, meaning that most
functions and methods accept both IP addresses and host names. In case a functions and methods accept both IP addresses and host names. In case a
host name is given, the library queries the system's resolver and host name is given, the library queries the system's resolver and
tries the main IP address returned. Note that direct use of IP addresses tries the main IP address returned. Note that direct use of IP addresses
is more efficient, of course. The is more efficient, of course. The
<a href=dns.html#toip><tt>toip</tt></a> <a href=dns.html#toip><tt>toip</tt></a>
and <a href=dns.html#tohostname><tt>tohostname</tt></a> and <a href=dns.html#tohostname><tt>tohostname</tt></a>
functions from the DNS module are provided to convert between host names and IP addresses. functions from the DNS module are provided to convert between host names and IP addresses.
</p> </p>
<p> <p>
@ -118,47 +118,47 @@ reassembled transparently on the other end. There are no boundaries in
the data transfers. The library allows users to read data from the the data transfers. The library allows users to read data from the
sockets in several different granularities: patterns are available for sockets in several different granularities: patterns are available for
lines, arbitrary sized blocks or "read up to connection closed", all with lines, arbitrary sized blocks or "read up to connection closed", all with
good performance. good performance.
</p> </p>
<p> <p>
The library distinguishes three types of TCP sockets: <em>master</em>, The library distinguishes three types of TCP sockets: <em>master</em>,
<em>client</em> and <em>server</em> sockets. <em>client</em> and <em>server</em> sockets.
</p> </p>
<p> <p>
Master sockets are newly created TCP sockets returned by the function Master sockets are newly created TCP sockets returned by the function
<a href=tcp.html#tcp><tt>socket.tcp</tt></a>. A master socket is <a href=tcp.html#tcp><tt>socket.tcp</tt></a>. A master socket is
transformed into a server socket transformed into a server socket
after it is associated with a <em>local</em> address by a call to the after it is associated with a <em>local</em> address by a call to the
<a href=tcp.html#bind><tt>bind</tt></a> method followed by a call to the <a href=tcp.html#bind><tt>bind</tt></a> method followed by a call to the
<a href=tcp.html#listen><tt>listen</tt></a>. Conversely, a master socket <a href=tcp.html#listen><tt>listen</tt></a>. Conversely, a master socket
can be changed into a client socket with the method can be changed into a client socket with the method
<a href=tcp.html#connect><tt>connect</tt></a>, <a href=tcp.html#connect><tt>connect</tt></a>,
which associates it with a <em>remote</em> address. which associates it with a <em>remote</em> address.
</p> </p>
<p> <p>
On server sockets, applications can use the On server sockets, applications can use the
<a href=tcp.html#accept><tt>accept</tt></a> method <a href=tcp.html#accept><tt>accept</tt></a> method
to wait for a client connection. Once a connection is established, a to wait for a client connection. Once a connection is established, a
client socket object is returned representing this connection. The client socket object is returned representing this connection. The
other methods available for server socket objects are other methods available for server socket objects are
<a href=tcp.html#getsockname><tt>getsockname</tt></a>, <a href=tcp.html#getsockname><tt>getsockname</tt></a>,
<a href=tcp.html#setoption><tt>setoption</tt></a>, <a href=tcp.html#setoption><tt>setoption</tt></a>,
<a href=tcp.html#settimeout><tt>settimeout</tt></a>, and <a href=tcp.html#settimeout><tt>settimeout</tt></a>, and
<a href=tcp.html#close><tt>close</tt></a>. <a href=tcp.html#close><tt>close</tt></a>.
</p> </p>
<p> <p>
Client sockets are used to exchange data between two applications over Client sockets are used to exchange data between two applications over
the Internet. Applications can call the methods the Internet. Applications can call the methods
<a href=tcp.html#send><tt>send</tt></a> and <a href=tcp.html#send><tt>send</tt></a> and
<a href=tcp.html#receive><tt>receive</tt></a> <a href=tcp.html#receive><tt>receive</tt></a>
to send and receive data. The other methods to send and receive data. The other methods
available for client socket objects are available for client socket objects are
<a href=tcp.html#getsockname><tt>getsockname</tt></a>, <a href=tcp.html#getsockname><tt>getsockname</tt></a>,
<a href=tcp.html#getpeername><tt>getpeername</tt></a>, <a href=tcp.html#getpeername><tt>getpeername</tt></a>,
<a href=tcp.html#setoption><tt>setoption</tt></a>, <a href=tcp.html#setoption><tt>setoption</tt></a>,
<a href=tcp.html#settimeout><tt>settimeout</tt></a>, <a href=tcp.html#settimeout><tt>settimeout</tt></a>,
<a href=tcp.html#shutdown><tt>shutdown</tt></a>, and <a href=tcp.html#shutdown><tt>shutdown</tt></a>, and
@ -175,7 +175,7 @@ port (one that is chosen by the operating system) on the local host and
awaits client connections on that port. When a connection is established, awaits client connections on that port. When a connection is established,
the program reads a line from the remote end and sends it back, closing the program reads a line from the remote end and sends it back, closing
the connection immediately. You can test it using the telnet the connection immediately. You can test it using the telnet
program. program.
</p> </p>
<pre class=example> <pre class=example>
@ -217,68 +217,68 @@ error free. Data transfers are atomic, one datagram at a time. Reading
only part of a datagram discards the rest, so that the following read only part of a datagram discards the rest, so that the following read
operation will act on the next datagram. The advantages are in operation will act on the next datagram. The advantages are in
simplicity (no connection setup) and performance (no error checking or simplicity (no connection setup) and performance (no error checking or
error correction). error correction).
</p> </p>
<p> <p>
Note that although no guarantees are made, these days Note that although no guarantees are made, these days
networks are so good that, under normal circumstances, few errors networks are so good that, under normal circumstances, few errors
happen in practice. happen in practice.
</p> </p>
<p> <p>
An UDP socket object is created by the An UDP socket object is created by the
<a href=udp.html#udp><tt>socket.udp</tt></a> function. UDP <a href=udp.html#udp><tt>socket.udp</tt></a> function. UDP
sockets do not need to be connected before use. The method sockets do not need to be connected before use. The method
<a href=udp.html#sendto><tt>sendto</tt></a> <a href=udp.html#sendto><tt>sendto</tt></a>
can be used immediately after creation to can be used immediately after creation to
send a datagram to IP address and port. Host names are not allowed send a datagram to IP address and port. Host names are not allowed
because performing name resolution for each packet would be forbiddingly because performing name resolution for each packet would be forbiddingly
slow. Methods slow. Methods
<a href=udp.html#receive><tt>receive</tt></a> and <a href=udp.html#receive><tt>receive</tt></a> and
<a href=udp.html#receivefrom><tt>receivefrom</tt></a> <a href=udp.html#receivefrom><tt>receivefrom</tt></a>
can be used to retrieve datagrams, the latter returning the IP and port of can be used to retrieve datagrams, the latter returning the IP and port of
the sender as extra return values (thus being slightly less the sender as extra return values (thus being slightly less
efficient). efficient).
</p> </p>
<p> <p>
When communication is performed repeatedly with a single peer, an When communication is performed repeatedly with a single peer, an
application should call the application should call the
<a href=udp.html#setpeername><tt>setpeername</tt></a> method to specify a <a href=udp.html#setpeername><tt>setpeername</tt></a> method to specify a
permanent partner. Methods permanent partner. Methods
<a href=udp.html#sendto><tt>sendto</tt></a> and <a href=udp.html#sendto><tt>sendto</tt></a> and
<a href=udp.html#receivefrom><tt>receivefrom</tt></a> <a href=udp.html#receivefrom><tt>receivefrom</tt></a>
can no longer be used, but the method can no longer be used, but the method
<a href=udp.html#send><tt>send</tt></a> can be used to send data <a href=udp.html#send><tt>send</tt></a> can be used to send data
directly to the peer, and the method directly to the peer, and the method
<a href=udp.html#receive><tt>receive</tt></a> <a href=udp.html#receive><tt>receive</tt></a>
will only return datagrams originating will only return datagrams originating
from that peer. There is about 30% performance gain due to this practice. from that peer. There is about 30% performance gain due to this practice.
</p> </p>
<p> <p>
To associate an UDP socket with a local address, an application calls the To associate an UDP socket with a local address, an application calls the
<a href=udp.html#setsockname><tt>setsockname</tt></a> <a href=udp.html#setsockname><tt>setsockname</tt></a>
method <em>before</em> sending any datagrams. Otherwise, the socket is method <em>before</em> sending any datagrams. Otherwise, the socket is
automatically bound to an ephemeral address before the first data automatically bound to an ephemeral address before the first data
transmission and once bound the local address cannot be changed. transmission and once bound the local address cannot be changed.
The other methods available for UDP sockets are The other methods available for UDP sockets are
<a href=udp.html#getpeername><tt>getpeername</tt></a>, <a href=udp.html#getpeername><tt>getpeername</tt></a>,
<a href=udp.html#getsockname><tt>getsockname</tt></a>, <a href=udp.html#getsockname><tt>getsockname</tt></a>,
<a href=udp.html#settimeout><tt>settimeout</tt></a>, <a href=udp.html#settimeout><tt>settimeout</tt></a>,
<a href=udp.html#setoption><tt>setoption</tt></a> and <a href=udp.html#setoption><tt>setoption</tt></a> and
<a href=udp.html#close><tt>close</tt></a>. <a href=udp.html#close><tt>close</tt></a>.
</p> </p>
<p> <p>
Example: Example:
</p> </p>
<blockquote> <blockquote>
<p> <p>
A simple daytime client, using LuaSocket. The program connects to a remote A simple daytime client, using LuaSocket. The program connects to a remote
server and tries to retrieve the daytime, printing the answer it got or an server and tries to retrieve the daytime, printing the answer it got or an
error message. error message.
</p> </p>
<pre class=example> <pre class=example>
@ -301,11 +301,11 @@ io.write(assert(udp:receive()))
<h3 id=more>Support modules</h3> <h3 id=more>Support modules</h3>
<p> Although not covered in the introduction, LuaSocket offers <p> Although not covered in the introduction, LuaSocket offers
much more than TCP and UDP functionality. As the library much more than TCP and UDP functionality. As the library
evolved, support for <a href=http.html>HTTP</a>, <a href=ftp.html>FTP</a>, evolved, support for <a href=http.html>HTTP</a>, <a href=ftp.html>FTP</a>,
and <a href=smtp.html>SMTP</a> were built on top of these. These modules and <a href=smtp.html>SMTP</a> were built on top of these. These modules
and many others are covered by the <a href=reference.html>reference manual</a>. and many others are covered by the <a href=reference.html>reference manual</a>.
</p> </p>
<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

View File

@ -40,7 +40,7 @@ Pump, Support, Library">
<h2 id="ltn12">LTN12</h2> <h2 id="ltn12">LTN12</h2>
<p> The <tt>ltn12</tt> namespace implements the ideas described in <p> The <tt>ltn12</tt> namespace implements the ideas described in
<a href="http://lua-users.org/wiki/FiltersSourcesAndSinks"> <a href="https://github.com/lunarmodules/luasocket/blob/master/ltn012.md">
LTN012, Filters sources and sinks</a>. This manual simply describes the LTN012, Filters sources and sinks</a>. This manual simply describes the
functions. Please refer to the LTN for a deeper explanation of the functions. Please refer to the LTN for a deeper explanation of the
functionality provided by this module. functionality provided by this module.

View File

@ -164,6 +164,9 @@ Creates and returns a <em>clean</em>
<a href="#try"><tt>try</tt></a> <a href="#try"><tt>try</tt></a>
function that allows for cleanup before the exception function that allows for cleanup before the exception
is raised. is raised.
This implements the ideas described in
<a href="https://github.com/lunarmodules/luasocket/blob/master/ltn013.md">
LTN012, Using finalized exceptions</a>.
</p> </p>
<p class="parameters"> <p class="parameters">
@ -207,6 +210,9 @@ Converts a function that throws exceptions into a safe function. This
function only catches exceptions thrown by the <a href="#try"><tt>try</tt></a> function only catches exceptions thrown by the <a href="#try"><tt>try</tt></a>
and <a href="#newtry"><tt>newtry</tt></a> functions. It does not catch normal and <a href="#newtry"><tt>newtry</tt></a> functions. It does not catch normal
Lua errors. Lua errors.
This implements the ideas described in
<a href="https://github.com/lunarmodules/luasocket/blob/master/ltn013.md">
LTN012, Using finalized exceptions</a>.
</p> </p>
<p class="parameters"> <p class="parameters">
@ -425,6 +431,9 @@ socket.<b>try(</b>ret<sub>1</sub> [, ret<sub>2</sub> ... ret<sub>N</sub>]<b>)</b
Throws an exception in case <tt>ret<sub>1</sub></tt> is falsy, using Throws an exception in case <tt>ret<sub>1</sub></tt> is falsy, using
<tt>ret<sub>2</sub></tt> as the error message. The exception is supposed to be caught <tt>ret<sub>2</sub></tt> as the error message. The exception is supposed to be caught
by a <a href="#protect"><tt>protect</tt></a>ed function only. by a <a href="#protect"><tt>protect</tt></a>ed function only.
This implements the ideas described in
<a href="https://github.com/lunarmodules/luasocket/blob/master/ltn013.md">
LTN012, Using finalized exceptions</a>.
</p> </p>
<p class="parameters"> <p class="parameters">

View File

@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> "http://www.w3.org/TR/html4/strict.dtd">
<html> <html>
<head> <head>
<meta name="description" content="LuaSocket: URL manipulation"> <meta name="description" content="LuaSocket: URL manipulation">
<meta name="keywords" content="Lua, LuaSocket, URL, Library, Link, Network, Support"> <meta name="keywords" content="Lua, LuaSocket, URL, Library, Link, Network, Support">
<title>LuaSocket: URL support</title> <title>LuaSocket: URL support</title>
<link rel="stylesheet" href="reference.css" type="text/css"> <link rel="stylesheet" href="reference.css" type="text/css">
</head> </head>
@ -28,7 +28,7 @@
<a href="index.html#download">download</a> &middot; <a href="index.html#download">download</a> &middot;
<a href="installation.html">installation</a> &middot; <a href="installation.html">installation</a> &middot;
<a href="introduction.html">introduction</a> &middot; <a href="introduction.html">introduction</a> &middot;
<a href="reference.html">reference</a> <a href="reference.html">reference</a>
</p> </p>
</center> </center>
<hr> <hr>
@ -36,21 +36,21 @@
<!-- url ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- url ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<h2 id="url">URL</h2> <h2 id="url">URL</h2>
<p> <p>
The <tt>url</tt> namespace provides functions to parse, protect, The <tt>url</tt> namespace provides functions to parse, protect,
and build URLs, as well as functions to compose absolute URLs and build URLs, as well as functions to compose absolute URLs
from base and relative URLs, according to from base and relative URLs, according to
<a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>. <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>.
</p> </p>
<p> <p>
To obtain the <tt>url</tt> namespace, run: To obtain the <tt>url</tt> namespace, run:
</p> </p>
<pre class=example> <pre class=example>
-- loads the URL module -- loads the URL module
local url = require("socket.url") local url = require("socket.url")
</pre> </pre>
@ -60,7 +60,7 @@ An URL is defined by the following grammar:
<blockquote> <blockquote>
<tt> <tt>
&lt;url&gt; ::= [&lt;scheme&gt;:][//&lt;authority&gt;][/&lt;path&gt;][;&lt;params&gt;][?&lt;query&gt;][#&lt;fragment&gt;]<br> &lt;url&gt; ::= [&lt;scheme&gt;:][//&lt;authority&gt;][/&lt;path&gt;][?&lt;query&gt;][#&lt;fragment&gt;]<br>
&lt;authority&gt; ::= [&lt;userinfo&gt;@]&lt;host&gt;[:&lt;port&gt;]<br> &lt;authority&gt; ::= [&lt;userinfo&gt;@]&lt;host&gt;[:&lt;port&gt;]<br>
&lt;userinfo&gt; ::= &lt;user&gt;[:&lt;password&gt;]<br> &lt;userinfo&gt; ::= &lt;user&gt;[:&lt;password&gt;]<br>
&lt;path&gt; ::= {&lt;segment&gt;/}&lt;segment&gt;<br> &lt;path&gt; ::= {&lt;segment&gt;/}&lt;segment&gt;<br>
@ -74,7 +74,7 @@ url.<b>absolute(</b>base, relative<b>)</b>
</p> </p>
<p class=description> <p class=description>
Builds an absolute URL from a base URL and a relative URL. Builds an absolute URL from a base URL and a relative URL.
</p> </p>
<p class=parameters> <p class=parameters>
@ -130,14 +130,14 @@ url.<b>build(</b>parsed_url<b>)</b>
</p> </p>
<p class=description> <p class=description>
Rebuilds an URL from its parts. Rebuilds an URL from its parts.
</p> </p>
<p class=parameters> <p class=parameters>
<tt>Parsed_url</tt> is a table with same components returned by <tt>Parsed_url</tt> is a table with same components returned by
<a href="#parse"><tt>parse</tt></a>. <a href="#parse"><tt>parse</tt></a>.
Lower level components, if specified, Lower level components, if specified,
take precedence over high level components of the URL grammar. take precedence over high level components of the URL grammar.
</p> </p>
<p class=return> <p class=return>
@ -152,10 +152,10 @@ url.<b>build_path(</b>segments, unsafe<b>)</b>
<p class=description> <p class=description>
Builds a <tt>&lt;path&gt;</tt> component from a list of Builds a <tt>&lt;path&gt;</tt> component from a list of
<tt>&lt;segment&gt;</tt> parts. <tt>&lt;segment&gt;</tt> parts.
Before composition, any reserved characters found in a segment are escaped into Before composition, any reserved characters found in a segment are escaped into
their protected form, so that the resulting path is a valid URL path their protected form, so that the resulting path is a valid URL path
component. component.
</p> </p>
<p class=parameters> <p class=parameters>
@ -165,8 +165,8 @@ characters are left untouched.
</p> </p>
<p class=return> <p class=return>
The function returns a string with the The function returns a string with the
built <tt>&lt;path&gt;</tt> component. built <tt>&lt;path&gt;</tt> component.
</p> </p>
<!-- escape +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- escape +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@ -178,7 +178,7 @@ url.<b>escape(</b>content<b>)</b>
<p class=description> <p class=description>
Applies the URL escaping content coding to a string Applies the URL escaping content coding to a string
Each byte is encoded as a percent character followed Each byte is encoded as a percent character followed
by the two byte hexadecimal representation of its integer by the two byte hexadecimal representation of its integer
value. value.
</p> </p>
@ -225,7 +225,6 @@ parsed_url = {<br>
&nbsp;&nbsp;scheme = <i>string</i>,<br> &nbsp;&nbsp;scheme = <i>string</i>,<br>
&nbsp;&nbsp;authority = <i>string</i>,<br> &nbsp;&nbsp;authority = <i>string</i>,<br>
&nbsp;&nbsp;path = <i>string</i>,<br> &nbsp;&nbsp;path = <i>string</i>,<br>
&nbsp;&nbsp;params = <i>string</i>,<br>
&nbsp;&nbsp;query = <i>string</i>,<br> &nbsp;&nbsp;query = <i>string</i>,<br>
&nbsp;&nbsp;fragment = <i>string</i>,<br> &nbsp;&nbsp;fragment = <i>string</i>,<br>
&nbsp;&nbsp;userinfo = <i>string</i>,<br> &nbsp;&nbsp;userinfo = <i>string</i>,<br>
@ -255,7 +254,6 @@ parsed_url = url.parse("ftp://root:passwd@unsafe.org/pub/virus.exe;type=i")
-- scheme = "ftp", -- scheme = "ftp",
-- authority = "root:passwd@unsafe.org", -- authority = "root:passwd@unsafe.org",
-- path = "/pub/virus.exe", -- path = "/pub/virus.exe",
-- params = "type=i",
-- userinfo = "root:passwd", -- userinfo = "root:passwd",
-- host = "unsafe.org", -- host = "unsafe.org",
-- user = "root", -- user = "root",
@ -270,8 +268,8 @@ url.<b>parse_path(</b>path<b>)</b>
</p> </p>
<p class=description> <p class=description>
Breaks a <tt>&lt;path&gt;</tt> URL component into all its Breaks a <tt>&lt;path&gt;</tt> URL component into all its
<tt>&lt;segment&gt;</tt> parts. <tt>&lt;segment&gt;</tt> parts.
</p> </p>
<p class=description> <p class=description>
@ -282,7 +280,7 @@ Breaks a <tt>&lt;path&gt;</tt> URL component into all its
Since some characters are reserved in URLs, they must be escaped Since some characters are reserved in URLs, they must be escaped
whenever present in a <tt>&lt;path&gt;</tt> component. Therefore, before whenever present in a <tt>&lt;path&gt;</tt> component. Therefore, before
returning a list with all the parsed segments, the function removes returning a list with all the parsed segments, the function removes
escaping from all of them. escaping from all of them.
</p> </p>
<!-- unescape +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- unescape +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
@ -300,7 +298,7 @@ Removes the URL escaping content coding from a string.
</p> </p>
<p class=return> <p class=return>
The function returns the decoded string. The function returns the decoded string.
</p> </p>
<!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> <!-- footer +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

View File

@ -69,6 +69,7 @@ local function make_plat(plat)
["socket.smtp"] = "src/smtp.lua", ["socket.smtp"] = "src/smtp.lua",
ltn12 = "src/ltn12.lua", ltn12 = "src/ltn12.lua",
socket = "src/socket.lua", socket = "src/socket.lua",
mbox = "src/mbox.lua",
mime = "src/mime.lua" mime = "src/mime.lua"
} }
if plat == "unix" if plat == "unix"

View File

@ -1,7 +1,7 @@
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Distribution makefile # Distribution makefile
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
DIST = luasocket-3.0.0 DIST = luasocket-3.1.0
TEST = \ TEST = \
test/README \ test/README \

View File

@ -54,7 +54,7 @@ local function receiveheaders(sock, headers)
while line ~= "" do while line ~= "" do
-- get field-name and value -- get field-name and value
name, value = socket.skip(2, string.find(line, "^(.-):%s*(.*)")) name, value = socket.skip(2, string.find(line, "^(.-):%s*(.*)"))
if not (name and value) then return nil, "malformed reponse headers" end if not (name and value) then return nil, "malformed response headers" end
name = string.lower(name) name = string.lower(name)
-- get next line (value might be folded) -- get next line (value might be folded)
line, err = sock:receive() line, err = sock:receive()
@ -62,7 +62,7 @@ local function receiveheaders(sock, headers)
-- unfold any folded values -- unfold any folded values
while string.find(line, "^%s") do while string.find(line, "^%s") do
value = value .. line value = value .. line
line = sock:receive() line, err = sock:receive()
if err then return nil, err end if err then return nil, err end
end end
-- save pair in table -- save pair in table
@ -81,7 +81,7 @@ socket.sourcet["http-chunked"] = function(sock, headers)
dirty = function() return sock:dirty() end dirty = function() return sock:dirty() end
}, { }, {
__call = function() __call = function()
-- get chunk size, skip extention -- get chunk size, skip extension
local line, err = sock:receive() local line, err = sock:receive()
if err then return nil, err end if err then return nil, err end
local size = base.tonumber(string.gsub(line, ";.*", ""), 16) local size = base.tonumber(string.gsub(line, ";.*", ""), 16)
@ -207,7 +207,6 @@ local function adjusturi(reqt)
if not reqt.proxy and not _M.PROXY then if not reqt.proxy and not _M.PROXY then
u = { u = {
path = socket.try(reqt.path, "invalid path 'nil'"), path = socket.try(reqt.path, "invalid path 'nil'"),
params = reqt.params,
query = reqt.query, query = reqt.query,
fragment = reqt.fragment fragment = reqt.fragment
} }
@ -219,9 +218,11 @@ local function adjustproxy(reqt)
local proxy = reqt.proxy or _M.PROXY local proxy = reqt.proxy or _M.PROXY
if proxy then if proxy then
proxy = url.parse(proxy) proxy = url.parse(proxy)
return proxy.host, proxy.port or 3128 proxy.port = proxy.port or 3128
proxy.create = SCHEMES[proxy.scheme].create(reqt)
return proxy.host, proxy.port, proxy.create
else else
return reqt.host, reqt.port return reqt.host, reqt.port, reqt.create
end end
end end
@ -279,7 +280,7 @@ local function adjustrequest(reqt)
if not (host and host ~= "") then if not (host and host ~= "") then
socket.try(nil, "invalid host '" .. base.tostring(nreqt.host) .. "'") socket.try(nil, "invalid host '" .. base.tostring(nreqt.host) .. "'")
end end
-- compute uri if user hasn't overriden -- compute uri if user hasn't overridden
nreqt.uri = reqt.uri or adjusturi(nreqt) nreqt.uri = reqt.uri or adjusturi(nreqt)
-- adjust headers in request -- adjust headers in request
nreqt.headers = adjustheaders(nreqt) nreqt.headers = adjustheaders(nreqt)
@ -291,7 +292,10 @@ local function adjustrequest(reqt)
end end
-- ajust host and port if there is a proxy -- ajust host and port if there is a proxy
nreqt.host, nreqt.port = adjustproxy(nreqt) local proxy_create
nreqt.host, nreqt.port, proxy_create = adjustproxy(nreqt)
if not reqt.create then nreqt.create = proxy_create end
return nreqt return nreqt
end end

View File

@ -290,7 +290,7 @@ int inet_meth_getsockname(lua_State *L, p_socket ps, int family)
return 2; return 2;
} }
lua_pushstring(L, name); lua_pushstring(L, name);
lua_pushstring(L, port); lua_pushinteger(L, (int) strtol(port, (char **) NULL, 10));
switch (family) { switch (family) {
case AF_INET: lua_pushliteral(L, "inet"); break; case AF_INET: lua_pushliteral(L, "inet"); break;
case AF_INET6: lua_pushliteral(L, "inet6"); break; case AF_INET6: lua_pushliteral(L, "inet6"); break;

View File

@ -10,7 +10,7 @@
/*-------------------------------------------------------------------------* \ /*-------------------------------------------------------------------------* \
* Current socket library version * Current socket library version
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
#define LUASOCKET_VERSION "LuaSocket 3.0.0" #define LUASOCKET_VERSION "LuaSocket 3.1.0"
#define LUASOCKET_COPYRIGHT "Copyright (C) 1999-2013 Diego Nehab" #define LUASOCKET_COPYRIGHT "Copyright (C) 1999-2013 Diego Nehab"
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\

View File

@ -1,6 +1,6 @@
# luasocket src/makefile # luasocket src/makefile
# #
# Definitions in this section can be overriden on the command line or in the # Definitions in this section can be overridden on the command line or in the
# environment. # environment.
# #
# These are equivalent: # These are equivalent:
@ -272,7 +272,7 @@ SOCKET_win64=wsocket.obj
# #
SO=$(SO_$(PLAT)) SO=$(SO_$(PLAT))
O=$(O_$(PLAT)) O=$(O_$(PLAT))
SOCKET_V=3.0.0 SOCKET_V=3.1.0
MIME_V=1.0.3 MIME_V=1.0.3
SOCKET_SO=socket-$(SOCKET_V).$(SO) SOCKET_SO=socket-$(SOCKET_V).$(SO)
MIME_SO=mime-$(MIME_V).$(SO) MIME_SO=mime-$(MIME_V).$(SO)

View File

@ -12,7 +12,7 @@
#define PIE_CONNREFUSED "connection refused" #define PIE_CONNREFUSED "connection refused"
#define PIE_CONNABORTED "closed" #define PIE_CONNABORTED "closed"
#define PIE_CONNRESET "closed" #define PIE_CONNRESET "closed"
#define PIE_TIMEDOUT "connection timeout" #define PIE_TIMEDOUT "timeout"
#define PIE_AGAIN "temporary failure in name resolution" #define PIE_AGAIN "temporary failure in name resolution"
#define PIE_BADFLAGS "invalid value for ai_flags" #define PIE_BADFLAGS "invalid value for ai_flags"
#define PIE_BADHINTS "invalid value for hints" #define PIE_BADHINTS "invalid value for hints"

View File

@ -225,7 +225,7 @@ local function adjust_headers(mesgt)
lower["date"] = lower["date"] or lower["date"] = lower["date"] or
os.date("!%a, %d %b %Y %H:%M:%S ") .. (mesgt.zone or _M.ZONE) os.date("!%a, %d %b %Y %H:%M:%S ") .. (mesgt.zone or _M.ZONE)
lower["x-mailer"] = lower["x-mailer"] or socket._VERSION lower["x-mailer"] = lower["x-mailer"] or socket._VERSION
-- this can't be overriden -- this can't be overridden
lower["mime-version"] = "1.0" lower["mime-version"] = "1.0"
return lower return lower
end end
@ -253,4 +253,4 @@ _M.send = socket.protect(function(mailt)
return s:close() return s:close()
end) end)
return _M return _M

View File

@ -125,7 +125,7 @@ end
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- Parses a url and returns a table with all its parts according to RFC 2396 -- Parses a url and returns a table with all its parts according to RFC 2396
-- The following grammar describes the names given to the URL parts -- The following grammar describes the names given to the URL parts
-- <url> ::= <scheme>://<authority>/<path>;<params>?<query>#<fragment> -- <url> ::= <scheme>://<authority>/<path>?<query>#<fragment>
-- <authority> ::= <userinfo>@<host>:<port> -- <authority> ::= <userinfo>@<host>:<port>
-- <userinfo> ::= <user>[:<password>] -- <userinfo> ::= <user>[:<password>]
-- <path> :: = {<segment>/}<segment> -- <path> :: = {<segment>/}<segment>
@ -136,7 +136,7 @@ end
-- table with the following fields, where RFC naming conventions have -- table with the following fields, where RFC naming conventions have
-- been preserved: -- been preserved:
-- scheme, authority, userinfo, user, password, host, port, -- scheme, authority, userinfo, user, password, host, port,
-- path, params, query, fragment -- path, query, fragment
-- Obs: -- Obs:
-- the leading '/' in {/<path>} is considered part of <path> -- the leading '/' in {/<path>} is considered part of <path>
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
@ -152,7 +152,7 @@ function _M.parse(url, default)
url = string.gsub(url, "^([%w][%w%+%-%.]*)%:", url = string.gsub(url, "^([%w][%w%+%-%.]*)%:",
function(s) parsed.scheme = s; return "" end) function(s) parsed.scheme = s; return "" end)
-- get authority -- get authority
url = string.gsub(url, "^//([^/]*)", function(n) url = string.gsub(url, "^//([^/%?#]*)", function(n)
parsed.authority = n parsed.authority = n
return "" return ""
end) end)
@ -166,11 +166,6 @@ function _M.parse(url, default)
parsed.query = q parsed.query = q
return "" return ""
end) end)
-- get params
url = string.gsub(url, "%;(.*)", function(p)
parsed.params = p
return ""
end)
-- path is whatever was left -- path is whatever was left
if url ~= "" then parsed.path = url end if url ~= "" then parsed.path = url end
local authority = parsed.authority local authority = parsed.authority
@ -203,7 +198,6 @@ function _M.build(parsed)
--local ppath = _M.parse_path(parsed.path or "") --local ppath = _M.parse_path(parsed.path or "")
--local url = _M.build_path(ppath) --local url = _M.build_path(ppath)
local url = parsed.path or "" local url = parsed.path or ""
if parsed.params then url = url .. ";" .. parsed.params end
if parsed.query then url = url .. "?" .. parsed.query end if parsed.query then url = url .. "?" .. parsed.query end
local authority = parsed.authority local authority = parsed.authority
if parsed.host then if parsed.host then
@ -258,11 +252,8 @@ function _M.absolute(base_url, relative_url)
relative_parsed.authority = base_parsed.authority relative_parsed.authority = base_parsed.authority
if not relative_parsed.path then if not relative_parsed.path then
relative_parsed.path = base_parsed.path relative_parsed.path = base_parsed.path
if not relative_parsed.params then if not relative_parsed.query then
relative_parsed.params = base_parsed.params relative_parsed.query = base_parsed.query
if not relative_parsed.query then
relative_parsed.query = base_parsed.query
end
end end
else else
relative_parsed.path = absolute_path(base_parsed.path or "", relative_parsed.path = absolute_path(base_parsed.path or "",

View File

@ -262,6 +262,7 @@ int socket_recv(p_socket ps, char *data, size_t count, size_t *got,
if (err != WSAEWOULDBLOCK) { if (err != WSAEWOULDBLOCK) {
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err; if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
prev = err; prev = err;
continue;
} }
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err; if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
} }
@ -291,6 +292,7 @@ int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got,
if (err != WSAEWOULDBLOCK) { if (err != WSAEWOULDBLOCK) {
if (err != WSAECONNRESET || prev == WSAECONNRESET) return err; if (err != WSAECONNRESET || prev == WSAECONNRESET) return err;
prev = err; prev = err;
continue;
} }
if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err; if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;
} }

View File

@ -99,8 +99,7 @@ check_parse_url{
userinfo = "user:pass$%?#wd", userinfo = "user:pass$%?#wd",
password = "pass$%?#wd", password = "pass$%?#wd",
user = "user", user = "user",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -113,8 +112,7 @@ check_parse_url{
userinfo = "user:pass?#wd", userinfo = "user:pass?#wd",
password = "pass?#wd", password = "pass?#wd",
user = "user", user = "user",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -127,8 +125,7 @@ check_parse_url{
userinfo = "user:pass-wd", userinfo = "user:pass-wd",
password = "pass-wd", password = "pass-wd",
user = "user", user = "user",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -141,8 +138,7 @@ check_parse_url{
userinfo = "user:pass#wd", userinfo = "user:pass#wd",
password = "pass#wd", password = "pass#wd",
user = "user", user = "user",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -155,8 +151,7 @@ check_parse_url{
userinfo = "user:pass#wd", userinfo = "user:pass#wd",
password = "pass#wd", password = "pass#wd",
user = "user", user = "user",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
} }
check_parse_url{ check_parse_url{
@ -167,8 +162,7 @@ check_parse_url{
port = "port", port = "port",
userinfo = "userinfo", userinfo = "userinfo",
user = "userinfo", user = "userinfo",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -182,8 +176,7 @@ check_parse_url{
userinfo = "user:password", userinfo = "user:password",
user = "user", user = "user",
password = "password", password = "password",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment", fragment = "fragment",
} }
@ -196,8 +189,7 @@ check_parse_url{
port = "port", port = "port",
userinfo = "userinfo", userinfo = "userinfo",
user = "userinfo", user = "userinfo",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "" fragment = ""
} }
@ -210,8 +202,7 @@ check_parse_url{
port = "port", port = "port",
userinfo = "userinfo", userinfo = "userinfo",
user = "userinfo", user = "userinfo",
path = "/path", path = "/path;params",
params = "params",
query = "", query = "",
fragment = "fragment" fragment = "fragment"
} }
@ -224,8 +215,7 @@ check_parse_url{
port = "port", port = "port",
userinfo = "userinfo", userinfo = "userinfo",
user = "userinfo", user = "userinfo",
path = "/path", path = "/path;params",
params = "params",
fragment = "fragment" fragment = "fragment"
} }
@ -237,8 +227,7 @@ check_parse_url{
port = "port", port = "port",
userinfo = "userinfo", userinfo = "userinfo",
user = "userinfo", user = "userinfo",
path = "/path", path = "/path;",
params = "",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -264,8 +253,7 @@ check_parse_url{
port = "port", port = "port",
userinfo = "userinfo", userinfo = "userinfo",
user = "userinfo", user = "userinfo",
path = "/", path = "/;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -287,8 +275,7 @@ check_parse_url{
port = "port", port = "port",
userinfo = "userinfo", userinfo = "userinfo",
user = "userinfo", user = "userinfo",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -438,8 +425,7 @@ check_parse_url{
port = "port", port = "port",
userinfo = "userinfo", userinfo = "userinfo",
user = "userinfo", user = "userinfo",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -453,8 +439,7 @@ check_parse_url{
userinfo = "user:password", userinfo = "user:password",
user = "user", user = "user",
password = "password", password = "password",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -467,8 +452,7 @@ check_build_url {
port = "port", port = "port",
user = "user", user = "user",
password = "password", password = "password",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -478,8 +462,7 @@ check_build_url{
host = "::FFFF:129.144.52.38", host = "::FFFF:129.144.52.38",
port = "port", port = "port",
user = "userinfo", user = "userinfo",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -491,8 +474,7 @@ check_build_url{
port = "port", port = "port",
user = "user", user = "user",
password = "password", password = "password",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -503,8 +485,7 @@ check_build_url {
host = "host", host = "host",
user = "user", user = "user",
password = "password", password = "password",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -514,8 +495,7 @@ check_build_url {
scheme = "scheme", scheme = "scheme",
host = "host", host = "host",
user = "user", user = "user",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -524,8 +504,7 @@ check_build_url {
url = "scheme://host/path;params?query#fragment", url = "scheme://host/path;params?query#fragment",
scheme = "scheme", scheme = "scheme",
host = "host", host = "host",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -534,8 +513,7 @@ check_build_url {
url = "scheme://host/path;params#fragment", url = "scheme://host/path;params#fragment",
scheme = "scheme", scheme = "scheme",
host = "host", host = "host",
path = "/path", path = "/path;params",
params = "params",
fragment = "fragment" fragment = "fragment"
} }
@ -573,9 +551,7 @@ check_build_url {
user = "user", user = "user",
userinfo = "not used", userinfo = "not used",
password = "password", password = "password",
path = "/path", path = "/path;params",
params = "params",
query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -588,8 +564,7 @@ check_build_url {
userinfo = "not used", userinfo = "not used",
authority = "not used", authority = "not used",
password = "password", password = "password",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -601,8 +576,7 @@ check_build_url {
port = "port", port = "port",
userinfo = "user:password", userinfo = "user:password",
authority = "not used", authority = "not used",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }
@ -611,8 +585,7 @@ check_build_url {
url = "scheme://user:password@host:port/path;params?query#fragment", url = "scheme://user:password@host:port/path;params?query#fragment",
scheme = "scheme", scheme = "scheme",
authority = "user:password@host:port", authority = "user:password@host:port",
path = "/path", path = "/path;params",
params = "params",
query = "query", query = "query",
fragment = "fragment" fragment = "fragment"
} }