ldmud/mudlib/deprecated/set_buffer_size.c
Alexander Motzkau ddf06a06af Corrected handling of missing interactives in replacement sefuns
The replacement simul-efun implementations for set_buffer_size,
set_combine_charset, get_combine_charset, set_connection_charset and
get_connection_charset threw errors when there was no current
interactive object. The original efun implementation ignored
that quietly. So correcting the simul-efun implementations.
(Fixes #855)
2018-02-04 00:08:39 +01:00

25 lines
504 B
C

/* This sefun is to provide a replacement for the efun set_buffer_size().
* Feel free to add it to your mudlibs, if you have much code relying on that.
*/
#if ! __EFUN_DEFINED__(set_buffer_size)
#include <configuration.h>
int set_buffer_size(int size)
{
object ob = efun::this_interactive();
if (!ob)
return -1;
int oldsize = efun::interactive_info(ob, IC_SOCKET_BUFFER_SIZE);
efun::configure_interactive(ob, IC_SOCKET_BUFFER_SIZE, size);
return oldsize;
}
#endif