- query.data = (char *)query_shm + sizeof(*cq);
- query.size = cq->query_size;
- cq->handler(fd, &query);
- return shm_detach(query_shm);
+ aca.query.data = (char *)query_shm + sizeof(*cq);
+ aca.query.size = cq->query_size;
+ aca.pbout.max_size = shm_get_shmmax();
+ aca.pbout.max_size_handler = afs_max_size_handler;
+ aca.pbout.private_data = &(struct afs_max_size_handler_data) {
+ .fd = fd,
+ .band = SBD_OUTPUT
+ };
+ ret = cq->handler(&aca);
+ ret2 = shm_detach(query_shm);
+ if (ret2 < 0) {
+ if (ret < 0) /* ignore (but log) detach error */
+ PARA_ERROR_LOG("could not detach sma: %s\n",
+ para_strerror(-ret2));
+ else
+ ret = ret2;
+ }
+ flush_and_free_pb(&aca.pbout);
+ if (ret < 0) {
+ ret2 = pass_buffer_as_shm(fd, SBD_AFS_CB_FAILURE,
+ (const char *)&ret, sizeof(ret));
+ if (ret2 < 0)
+ PARA_ERROR_LOG("could not pass cb failure packet: %s\n",
+ para_strerror(-ret));
+ }
+ return ret;