sni / mod_gearman

Distribute Naemon Host/Service Checks & Eventhandler with Gearman Queues. Host/Servicegroups affinity included.
http://www.mod-gearman.org
GNU General Public License v3.0
122 stars 42 forks source link

update for GEARMAN_FUNCTION_MAX_SIZE #103

Closed hedenface closed 7 years ago

hedenface commented 7 years ago

GEARMAN_FUNCTION_MAX_SIZE is defined in libgearman/limits.h as 512, not 64

If you follow the code in gearmand:

(client.cc) gearman_client_addtask[level]_background -> (client.cc) add_task_ptr -> (add.cc) gearman_sting_t function = { gearman_string_param_cstr(function_name) }; [ which saves the string and the len into function, definition for gearman_string_param_cstr in libgearman/string.h ] add_task -> (add.cc) if gearman_size(function) > GEARMAN_FUNCTION_MAX_SIZE

I subtracted 1 much like the 1 subtracted from GEARMAN_MAX_UNIQUE_SIZE

sni commented 7 years ago

You are right, no idea why i took 64 as set. Anyway, we should just use GEARMAN_FUNCTION_MAX_SIZE-1 then. And could you also the adjust the test case.

hedenface commented 7 years ago

Bump?

sni commented 7 years ago

thanks. i just merged it.