From: Travis Cross Date: Sun, 28 Dec 2014 00:36:06 +0000 (+0000) Subject: Allow streaming binary data from mod_memcache X-Git-Tag: v1.4.15^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=750b1dd807bf5ca4e3b752fdf7ba48d8b10b5366;p=thirdparty%2Ffreeswitch.git Allow streaming binary data from mod_memcache Previously data returned from `memcache get` would be truncated at the first NULL byte. By using raw_write_function here to stream the returned memcache value, we allow mod_memcache to be used for audio and other arbitrary binary data. Dave has a format module planned that relies on this. Thanks-to: Dave Olszewski FS-7114 #resolve --- diff --git a/src/mod/applications/mod_memcache/mod_memcache.c b/src/mod/applications/mod_memcache/mod_memcache.c index 81c509719a..a5a5324e93 100644 --- a/src/mod/applications/mod_memcache/mod_memcache.c +++ b/src/mod/applications/mod_memcache/mod_memcache.c @@ -283,7 +283,7 @@ SWITCH_STANDARD_API(memcache_function) val = memcached_get(memcached, key, strlen(key), &string_length, &flags, &rc); if (rc == MEMCACHED_SUCCESS) { - stream->write_function(stream, "%.*s", (int) string_length, val); + stream->raw_write_function(stream, (uint8_t*)val, (int)string_length); } else { switch_safe_free(val); switch_goto_status(SWITCH_STATUS_SUCCESS, mcache_error);