Skip to content

Commit 90e7338

Browse files
committed
upgrade msgpack headers
1 parent 9aa1522 commit 90e7338

19 files changed

+1392
-1023
lines changed

msgpack.c

+5
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ PS_SERIALIZER_DECODE_FUNC(msgpack) /* {{{ */ {
167167
ZVAL_UNDEF(&tmp);
168168
mp.user.retval = &tmp;
169169
mp.user.var_hash = &var_hash;
170+
mp.user.eof = val + vallen;
170171

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

227228
mp.user.retval = return_value;
228229
mp.user.var_hash = &var_hash;
230+
mp.user.eof = str + str_len;
229231

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

232234
switch (ret) {
235+
case MSGPACK_UNPACK_NOMEM_ERROR:
236+
MSGPACK_WARNING("[msgpack] (%s) Memory error", __FUNCTION__);
237+
break;
233238
case MSGPACK_UNPACK_PARSE_ERROR:
234239
MSGPACK_WARNING("[msgpack] (%s) Parse error", __FUNCTION__);
235240
break;

msgpack/pack_define.h

+5-13
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,12 @@
33
*
44
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
55
*
6-
* Licensed under the Apache License, Version 2.0 (the "License");
7-
* you may not use this file except in compliance with the License.
8-
* You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing, software
13-
* distributed under the License is distributed on an "AS IS" BASIS,
14-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
* See the License for the specific language governing permissions and
16-
* limitations under the License.
6+
* Distributed under the Boost Software License, Version 1.0.
7+
* (See accompanying file LICENSE_1_0.txt or copy at
8+
* http://www.boost.org/LICENSE_1_0.txt)
179
*/
18-
#ifndef MSGPACK_PACK_DEFINE_H__
19-
#define MSGPACK_PACK_DEFINE_H__
10+
#ifndef MSGPACK_PACK_DEFINE_H
11+
#define MSGPACK_PACK_DEFINE_H
2012

2113
#include "msgpack/sysdep.h"
2214
#include <limits.h>

0 commit comments

Comments
 (0)