Coder Social home page Coder Social logo

luajit-msgpack-pure's People

Contributors

catwell avatar fperrad avatar kengonakajima avatar lupus avatar tversteeg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

luajit-msgpack-pure's Issues

luajit-msgpack-pure.lua:433: unimplemented

2018/03/02 19:13:45 [error] 31794#0: *287 lua entry thread aborted: runtime error: /data/web/openresty-websocket/resty/luajit-msgpack-pure.lua:433: unimplemented
stack traceback:
coroutine 0:
[C]: in function 'error'
/data/web/openresty-websocket/resty/luajit-msgpack-pure.lua:433: in function 'dynamic'
/data/web/openresty-websocket/resty/luajit-msgpack-pure.lua:567: in function 'unpack'
/data/web/openresty-websocket/libs/pushs.lua:77: in function 'unpack'
/data/web/openresty-websocket/websocket.lua:180: in function 'run'
content_by_lua(nginx.conf:106):3: in function <content_by_lua(nginx.conf:106):1>, client: 116.115.11.21, server: ngx.p.qc.com, request: "GET /?order=ccf8f35a2bff&user=2d7zsk&ver=372&reconnect=1&ingame=0 HTTP/1.1", host: "api2.qc.com:4396"
`

nginx_error. log a lot of errors. What should I do?

Compat with msgpack-js

I maintain a pure javascript implementation of msgpack for node.js and the browser. I've extended the msgpack format to allow the js type undefined as well as binary blobs (since js strings are unicode and can't hold arbitrary binary data).

I noticed that you extended the format to support nan, inf, and -inf. Since JavaScript also has these values, (and I want to use your library for my luvit project) I propose we merge our extensions to become compatible.

What do you think?

Pack arrays with holes as maps

Otherwise packing this would be disastrous:

{
  [0] = 1,
  [1000000] = 1,
}

The heuristic should be: integer keys are continuous and start at one.
Moreover current code is probably broken for arrays that start at 0 or negative numbers.

luaffi

I don't know if this would work with luaffi -> try it someday.

access to buffers

A patch for convenient reuse of a buffer, and concatenating msgs without .. on many strings.

--packer functions
local pack_meta
pack_meta.__index = pack_meta
-- pack more stuff to the buffer
function p:pack(data)
    buffer = self
    packers.dynamic(data)
end
-- reuse the buffer for a new set of batched msg
function p:reset()
    self.size = 0
end

local function get_pack_buffer()
    local tbl = {}
    sbuffer_init(tbl)
    ffi.gc(tbl.data, ffi.C.free)
    return setmetatable(tbl,pack_meta)
end

return {
    pack_many = get_pack_buffer,
    pack = ljp_pack,
    unpack = ljp_unpack,
    set_fp_type = set_fp_type,
    set_table_classifier = set_table_classifier,
    packers = packers,
    unpackers = unpackers,
}

Can't decode str8 string

msgpack ruby gem was not using str 8 at all up to version 0.5, but since 0.6 it has started to use it. New users will get a failure.

msgpack 0.6:

2.1.2 :004 > MessagePack.pack(' ' * 255)
=> "\xD9\xFF "
msgpack 0.5.11:

2.1.2 :002 > MessagePack.pack(' ' * 255)
=> "\xDA\x00\xFF

numbers as floats

Currently numbers are serialized as doubles. There should be an option to serialize them as floats to save memory at the expense of precision.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.