X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=blob.c;h=a6ae1acf61237aaa31b18035739acefd80c52fc1;hp=1b02b378c87c0faba2f602e62c5a981832af1a58;hb=277ed4a605f68118aff9e671f16c0ac6edb1d55a;hpb=fdb9d26edf7ef38c4213e23b6bf1ee89d287cb9e diff --git a/blob.c b/blob.c index 1b02b378..a6ae1acf 100644 --- a/blob.c +++ b/blob.c @@ -414,7 +414,7 @@ static int fd2buf(struct stream_cipher_context *scc, struct osl_object *obj) /* * Read data from a file descriptor, and send it to the afs process. * - * \param scc crypt context containing the file descriptor to read data from. + * \param cc Contains the file descriptor to read data from. * \param arg_obj Pointer to the arguments to \a f. * \param f The callback function. * \param result_handler See \ref send_callback_request. @@ -422,7 +422,7 @@ static int fd2buf(struct stream_cipher_context *scc, struct osl_object *obj) * * This function is used by the addblob commands that instruct para_server to * store arbitrary data in a blob table. Input data is read and decrypted from - * the file descriptor given by \a scc. This data is concatenated with the + * the file descriptor given by \a cc. This data is concatenated with the * buffer given by \a arg_obj, and the combined buffer is made available to the * afs process via the callback method. See \ref send_callback_request for * details. @@ -437,10 +437,7 @@ static int stdin_command(struct command_context *cc, struct osl_object *arg_obj, struct osl_object query, stdin_obj; int ret; - if (cc->use_sideband) - ret = send_sb(&cc->scc, NULL, 0, SBD_AWAITING_DATA, false); - else - ret = sc_send_buffer(&cc->scc, AWAITING_DATA_MSG); + ret = send_sb(&cc->scc, NULL, 0, SBD_AWAITING_DATA, false); if (ret < 0) return ret; ret = fd2buf(&cc->scc, &stdin_obj); @@ -449,7 +446,9 @@ static int stdin_command(struct command_context *cc, struct osl_object *arg_obj, query.size = arg_obj->size + stdin_obj.size; query.data = para_malloc(query.size); memcpy(query.data, arg_obj->data, arg_obj->size); - memcpy((char *)query.data + arg_obj->size, stdin_obj.data, stdin_obj.size); + if (stdin_obj.size > 0) + memcpy((char *)query.data + arg_obj->size, stdin_obj.data, + stdin_obj.size); free(stdin_obj.data); ret = send_callback_request(f, &query, result_handler, private_result_data); free(query.data);