Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 05 Mar 2020 22:47:05 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 244618] [PATCH] net-im/prosody: fix http files download
Message-ID:  <bug-244618-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D244618

            Bug ID: 244618
           Summary: [PATCH] net-im/prosody: fix http files download
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: lx@FreeBSD.org
          Reporter: rozhuk.im@gmail.com
          Assignee: lx@FreeBSD.org
             Flags: maintainer-feedback?(lx@FreeBSD.org)

Created attachment 212169
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D212169&action=
=3Dedit
patch

http.server                          error      Traceback[httpserver]:
/usr/local/lib/prosody/modules/mod_http_files.lua:115: bad argument #1 to
'format' (not a non-negative number in proper range)
stack traceback:
        [C]: in function 'format'
        /usr/local/lib/prosody/modules/mod_http_files.lua:115: in function
</usr/local/lib/prosody/modules/mod_http_files.lua:96>
        (...tail calls...)
        /usr/local/lib/prosody/util/events.lua:79: in function
</usr/local/lib/prosody/util/events.lua:75>
        (...tail calls...)
        /usr/local/lib/prosody/net/http/server.lua:248: in function
</usr/local/lib/prosody/net/http/server.lua:176>
        [C]: in function 'xpcall'
        /usr/local/lib/prosody/net/http/server.lua:108: in function
'process_next'
        /usr/local/lib/prosody/net/http/server.lua:124: in function
'success_cb'
        /usr/local/lib/prosody/net/http/parser.lua:177: in function 'feed'
        /usr/local/lib/prosody/net/http/server.lua:155: in function
</usr/local/lib/prosody/net/http/server.lua:154>
        (...tail calls...)
        /usr/local/lib/prosody/net/server_select.lua:915: in function
</usr/local/lib/prosody/net/server_select.lua:899>
        [C]: in function 'xpcall'
        /usr/local/lib/prosody/../../bin/prosody:80: in function 'loop'
        /usr/local/lib/prosody/../../bin/prosody:90: in main chunk
        [C]: in ?
(a bit older release)

Actual code base: https://hg.prosody.im/trunk/file/tip/net/http/files.lua#l=
83
local etag =3D ('"%02x-%x-%x-%x"'):format(attr.dev or 0, attr.ino or 0, att=
r.size
or 0, attr.modification or 0);

On FreeBSD stat.dev is uint64_t and looks like it is converted to int32_t
somewhere in lua or prosody and result is negative.

Quick fix:
local etag =3D ('"%02x-%x-%x-%x"'):format(math.abs(attr.dev or 0), attr.ino=
 or 0,
attr.size or 0, attr.modification or 0);

produces ETag: "78ff00ff-12f9c-2b4548-5e6103f3"

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-244618-7788>