fprintf(of, " } else {\n");
fprintf(of, " /* remote object */\n"
- " forb_request_t req;\n"
- " unsigned index; //buffer position of parameters\n");
+ " forb_request_t req;\n");
fprintf(of, " ex_on_fail(forb_request_init(&req, _obj, \"%s\", FORB_METHOD_INDEX(%s)) == 0, FORB_EX_INTERNAL);\n",
iface_id, opname);
- fprintf(of, " forb_iop_prepare_request(&req, &index, ev);\n");
+ fprintf(of, " forb_iop_prepare_request(&req, ev);\n");
fprintf(of, " if (forb_exception_occurred(ev)) goto exception;\n");
for (sub = IDL_OP_DCL (tree).parameter_dcls; sub; sub = IDL_LIST (sub).next) {
IDL_tree parm = IDL_LIST (sub).data;
n == 0 ? "&":"", name);
}
}
- fprintf(of, " forb_request_send(&req, index, ev);\n");
+ fprintf(of, " forb_request_send(&req, ev);\n");
fprintf(of, " if (forb_exception_occurred(ev)) goto exception;\n");
fprintf(of, " forb_request_wait_for_reply(&req);\n");
fprintf(of, " if (forb_exception_occurred(ev)) goto exception;\n");
CORBA_boolean
forb_iop_prepare_request(forb_request_t *req,
- unsigned *index,
CORBA_Environment *env)
{
CORBA_boolean ret;
forb_server_id_to_string(str, &req->obj->server, sizeof(str)),
rh.iface, rh.method_index);
}
- *index = req->cdr_request.wptr;
+ req->end_of_header_index = req->cdr_request.wptr;
return ret;
}
* @param env Environment for returning exceptions
*/
void
-forb_request_send(forb_request_t *req, unsigned index, CORBA_Environment *env)
+forb_request_send(forb_request_t *req, CORBA_Environment *env)
{
CORBA_boolean ret;
forb_peer_t *peer;
exec_req->obj = forb_object_duplicate(req->obj);
exec_req->method_index = req->method_ind;
exec_req->interface = req->interface;
- req->cdr_request.rptr = index;
+ req->cdr_request.rptr = req->end_of_header_index;
exec_req->codec = req->cdr_request;
req->cdr_request.release_buffer = CORBA_FALSE;
exec_req->request_id = req->request_id;
CORBA_boolean
forb_iop_prepare_request(forb_request_t *req,
- unsigned *index,
CORBA_Environment *env);
bool
/* TODO: rename to forb_iop_send_request */
void
-forb_request_send(forb_request_t *req, unsigned index, CORBA_Environment *env);
+forb_request_send(forb_request_t *req, CORBA_Environment *env);
int
forb_iop_send_hello_to(forb_peer_t *peer);
struct forb_env *env; /**< Where to store exception returned in reply */
forb_syncobj_t reply_ready; /**< Synchronization object for waiting for reply */
forb_syncobj_t *reply_processed; /**< Synchronization object for receiver thread to wait for stub. */
+ unsigned end_of_header_index; /**< Index indicating the end of header of a codec buffer. */
};
typedef struct forb_request forb_request_t;
_forb_retval = _myinterface_impl(_obj)->add(_obj, a, b, ev);
} else {
/* remote object - the same as before */
- unsigned index;
forb_request_t req;
ex_on_fail(forb_request_init(&req, _obj, "myinterface", FORB_METHOD_INDEX(myinterface_add)) == 0, FORB_EX_INTERNAL);
- forb_iop_prepare_request(&req, &index, ev);
+ forb_iop_prepare_request(&req, ev);
if (forb_exception_occurred(ev)) goto exception;
ex_on_fail(CORBA_long_serialize(&req.cdr_request, &a), FORB_EX_IMP_LIMIT);
ex_on_fail(CORBA_long_serialize(&req.cdr_request, &b), FORB_EX_IMP_LIMIT);
- forb_request_send(&req, index, ev);
+ forb_request_send(&req, ev);
if (forb_exception_occurred(ev)) goto exception;
forb_request_wait_for_reply(&req);
if (forb_exception_occurred(ev)) goto exception;