Skip to content

Commit

Permalink
upgrade msgpack headers
Browse files Browse the repository at this point in the history
  • Loading branch information
m6w6 committed Nov 20, 2019
1 parent 9aa1522 commit 90e7338
Show file tree
Hide file tree
Showing 19 changed files with 1,392 additions and 1,023 deletions.
5 changes: 5 additions & 0 deletions msgpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ PS_SERIALIZER_DECODE_FUNC(msgpack) /* {{{ */ {
ZVAL_UNDEF(&tmp);
mp.user.retval = &tmp;
mp.user.var_hash = &var_hash;
mp.user.eof = val + vallen;

ret = template_execute(&mp, val, vallen, &off);
if (Z_TYPE_P(mp.user.retval) == IS_REFERENCE) {
Expand Down Expand Up @@ -226,10 +227,14 @@ PHP_MSGPACK_API int php_msgpack_unserialize(zval *return_value, char *str, size_

mp.user.retval = return_value;
mp.user.var_hash = &var_hash;
mp.user.eof = str + str_len;

ret = template_execute(&mp, str, (size_t)str_len, &off);

switch (ret) {
case MSGPACK_UNPACK_NOMEM_ERROR:
MSGPACK_WARNING("[msgpack] (%s) Memory error", __FUNCTION__);
break;
case MSGPACK_UNPACK_PARSE_ERROR:
MSGPACK_WARNING("[msgpack] (%s) Parse error", __FUNCTION__);
break;
Expand Down
18 changes: 5 additions & 13 deletions msgpack/pack_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@
*
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef MSGPACK_PACK_DEFINE_H__
#define MSGPACK_PACK_DEFINE_H__
#ifndef MSGPACK_PACK_DEFINE_H
#define MSGPACK_PACK_DEFINE_H

#include "msgpack/sysdep.h"
#include <limits.h>
Expand Down
Loading

0 comments on commit 90e7338

Please sign in to comment.