diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/unixdgram.c | 1 | ||||
-rw-r--r-- | src/url.lua | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/unixdgram.c b/src/unixdgram.c index c07cbd5..4645892 100644 --- a/src/unixdgram.c +++ b/src/unixdgram.c | |||
@@ -206,6 +206,7 @@ static int meth_receivefrom(lua_State *L) { | |||
206 | lua_pushliteral(L, "out of memory"); | 206 | lua_pushliteral(L, "out of memory"); |
207 | return 2; | 207 | return 2; |
208 | } | 208 | } |
209 | addr.sun_path[0] = '\0'; | ||
209 | err = socket_recvfrom(&un->sock, dgram, wanted, &got, (SA *) &addr, | 210 | err = socket_recvfrom(&un->sock, dgram, wanted, &got, (SA *) &addr, |
210 | &addr_len, tm); | 211 | &addr_len, tm); |
211 | /* Unlike STREAM, recv() of zero is not closed, but a zero-length packet. */ | 212 | /* Unlike STREAM, recv() of zero is not closed, but a zero-length packet. */ |
diff --git a/src/url.lua b/src/url.lua index fb333b1..d61111e 100644 --- a/src/url.lua +++ b/src/url.lua | |||
@@ -183,8 +183,9 @@ end | |||
183 | -- a stringing with the corresponding URL | 183 | -- a stringing with the corresponding URL |
184 | ----------------------------------------------------------------------------- | 184 | ----------------------------------------------------------------------------- |
185 | function _M.build(parsed) | 185 | function _M.build(parsed) |
186 | local ppath = _M.parse_path(parsed.path or "") | 186 | --local ppath = _M.parse_path(parsed.path or "") |
187 | local url = _M.build_path(ppath) | 187 | --local url = _M.build_path(ppath) |
188 | local url = parsed.path or "" | ||
188 | if parsed.params then url = url .. ";" .. parsed.params end | 189 | if parsed.params then url = url .. ";" .. parsed.params end |
189 | if parsed.query then url = url .. "?" .. parsed.query end | 190 | if parsed.query then url = url .. "?" .. parsed.query end |
190 | local authority = parsed.authority | 191 | local authority = parsed.authority |
@@ -193,7 +194,7 @@ function _M.build(parsed) | |||
193 | if string.find(authority, ":") then -- IPv6? | 194 | if string.find(authority, ":") then -- IPv6? |
194 | authority = "[" .. authority .. "]" | 195 | authority = "[" .. authority .. "]" |
195 | end | 196 | end |
196 | if parsed.port then authority = authority .. ":" .. parsed.port end | 197 | if parsed.port then authority = authority .. ":" .. base.tostring(parsed.port) end |
197 | local userinfo = parsed.userinfo | 198 | local userinfo = parsed.userinfo |
198 | if parsed.user then | 199 | if parsed.user then |
199 | userinfo = parsed.user | 200 | userinfo = parsed.user |