diff --git a/NEWS b/NEWS index 0b30f75..262dcd6 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ libmpdclient 2.20 (not yet released) - albumart * support tags "ComposerSort", "Ensemble", "Movement", "MovementNumber", "Location" +* configurable buffer size, increase default from 4096 to 8192 libmpdclient 2.19 (2020/07/03) * fix off-by-one bug in MPD_HOST parser diff --git a/meson.build b/meson.build index 2390f6d..f54e271 100644 --- a/meson.build +++ b/meson.build @@ -21,6 +21,8 @@ conf.set('DEFAULT_PORT', get_option('default_port')) conf.set('HAVE_STRNDUP', cc.has_function('strndup', prefix: '#define _GNU_SOURCE\n#include ')) +conf.set('BUFFER_SIZE', get_option('buffer_size')) + platform_deps = [] if host_machine.system() == 'haiku' platform_deps = [cc.find_library('network')] diff --git a/meson_options.txt b/meson_options.txt index f2f2ec5..5e3ea00 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -21,3 +21,7 @@ option('documentation', type: 'boolean', option('test', type: 'boolean', value: false, description: 'Enable unit tests') + +option('buffer_size', type: 'string', + value: '8192', + description: 'response buffer size') diff --git a/src/buffer.h b/src/buffer.h index cd4a6a5..f5f7974 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -29,6 +29,8 @@ #ifndef MPD_BUFFER_H #define MPD_BUFFER_H +#include "config.h" + #include #include #include @@ -45,7 +47,7 @@ struct mpd_buffer { unsigned read; /** the actual buffer */ - unsigned char data[4096]; + unsigned char data[BUFFER_SIZE]; }; /**