|
|
|
@ -111,9 +111,10 @@ bool CreateMetadataArray(Handle<Object> metadata, grpc_metadata_array *array, |
|
|
|
|
NanAssignPersistent(*handle, value); |
|
|
|
|
resources->handles.push_back(unique_ptr<PersistentHolder>( |
|
|
|
|
new PersistentHolder(handle))); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (value->IsString()) { |
|
|
|
|
Handle<String> string_value = value->ToString(); |
|
|
|
|
NanUtf8String *utf8_value = new NanUtf8String(string_value); |
|
|
|
@ -123,6 +124,7 @@ bool CreateMetadataArray(Handle<Object> metadata, grpc_metadata_array *array, |
|
|
|
|
} else { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
array->count += 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -156,8 +158,7 @@ Handle<Value> ParseMetadata(const grpc_metadata_array *metadata_array) { |
|
|
|
|
} |
|
|
|
|
if (EndsWith(elem->key, "-bin")) { |
|
|
|
|
array->Set(index_map[elem->key], |
|
|
|
|
MakeFastBuffer( |
|
|
|
|
NanNewBufferHandle(elem->value, elem->value_length))); |
|
|
|
|
NanNewBufferHandle(elem->value, elem->value_length)); |
|
|
|
|
} else { |
|
|
|
|
array->Set(index_map[elem->key], NanNew(elem->value)); |
|
|
|
|
} |
|
|
|
|