X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=blob.c;h=b396ef792c1ecc6bec8d03b5b88885ea1f7f0bac;hb=4c2a8737d3867f7ec8ee4d858e981c1b62e29759;hp=c6b05b2b803d597de1f5294ba2c54f2790b1ceb6;hpb=ab6cab06766f86086b53f2720d566f7ddf70db4c;p=paraslash.git diff --git a/blob.c b/blob.c index c6b05b2b..b396ef79 100644 --- a/blob.c +++ b/blob.c @@ -163,6 +163,7 @@ static int com_catblob_callback(struct osl_table *table, memcpy(output->data, obj.data, obj.size); return osl_close_disk_object(&obj); } + static int com_catblob(callback_function *f, int fd, int argc, char * const * const argv) { @@ -174,8 +175,8 @@ static int com_catblob(callback_function *f, int fd, int argc, if (!*argv[1]) /* empty name is reserved of the dummy row */ return -E_BLOB_SYNTAX; ret = send_standard_callback_request(1, argv + 1, f, &cat_output); - if (ret >= 0 && cat_output.data) - ret = send_buffer(fd, (char *)cat_output.data); + if (ret > 0) + ret = send_bin_buffer(fd, (char *)cat_output.data, cat_output.size); free(cat_output.data); return ret; @@ -232,7 +233,7 @@ static int com_addblob_callback(struct osl_table *table, return osl_add_row(table, objs); } -static int com_addblob(callback_function *f, __a_unused int fd, int argc, +static int com_addblob(callback_function *f, int fd, int argc, char * const * const argv) { struct osl_object arg_obj; @@ -244,7 +245,7 @@ static int com_addblob(callback_function *f, __a_unused int fd, int argc, PARA_NOTICE_LOG("argv[1]: %s\n", argv[1]); arg_obj.size = strlen(argv[1]) + 1; arg_obj.data = (char *)argv[1]; - return stdin_command(&arg_obj, f, 10 * 1024 * 1024, NULL); + return stdin_command(fd, &arg_obj, f, 10 * 1024 * 1024, NULL); } static int com_rmblob_callback(struct osl_table *table,