blob object constructor should use the static null_blob when blob length = 0 #3

Open
opened 2017-05-09 17:38:11 +00:00 by geoff · 0 comments
geoff commented 2017-05-09 17:38:11 +00:00 (Migrated from code.uplex.de)

Currently the blob constructor creates a BLOB whose priv pointer is NULL when the encoding is the empty string:

new empty = blobcode.blob(encoded="");

An empty BLOB is a legitimate object, but priv==NULL does not play well with other VMODs expecting a BLOB.

The static null_blob, whose priv pointer points to the static constant empty string, was created for this purpose, and is returned by the decode function when the encoding is the empty string. The constructor should use it as well.

Currently the blob constructor creates a BLOB whose priv pointer is NULL when the encoding is the empty string: ``` new empty = blobcode.blob(encoded=""); ``` An empty BLOB is a legitimate object, but priv==NULL does not play well with other VMODs expecting a BLOB. The static `null_blob`, whose priv pointer points to the static constant empty string, was created for this purpose, and is returned by the `decode` function when the encoding is the empty string. The constructor should use it as well.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
uplex-varnish/libvmod-blobcode#3
No description provided.