CORBA_boolean
forb_iop_prepare_request(forb_request_t *req,
- char *iface,
- unsigned method_ind,
+ unsigned *index,
CORBA_Environment *env)
{
CORBA_boolean ret;
forb_iop_request_header rh;
rh.request_id = req->request_id;
- rh.iface = iface;
+ rh.iface = req->interface;
rh.objkey = forb_object_to_key(req->obj);
- rh.method_index = method_ind;
+ rh.method_index = req->method_ind;
rh.source = forb_object_to_forb(req->obj)->server_id;
ret = forb_iop_request_header_serialize(&req->cdr_request, &rh);
if (ret) {
char str[50];
ul_logdeb("preparing request: id=%d dest=%s iface=%s method=%d\n", req->request_id,
forb_server_id_to_string(str, &req->obj->server, sizeof(str)),
- iface, method_ind);
+ rh.iface, rh.method_index);
}
+ *index = req->cdr_request.wptr;
return ret;
}
exec_req = forb_malloc(sizeof(*exec_req));
if (exec_req) {
memset(exec_req, 0, sizeof(exec_req));
+ exec_req->request_type = FORB_EXEC_REQ_REMOTE;
exec_req->request_id = request_header.request_id;
exec_req->source = request_header.source;
exec_req->obj = obj;
* @param env Environment for returning exceptions
*/
void
-forb_request_send(forb_request_t *req, CORBA_Environment *env)
+forb_request_send(forb_request_t *req, unsigned index, CORBA_Environment *env)
{
CORBA_boolean ret;
forb_peer_t *peer;
size_t len;
fosa_abs_time_t timeout;
forb_t *forb = forb_object_to_forb(req->obj);
+ forb_exec_req_t *exec_req;
if (!forb) {
env->major = FORB_EX_INTERNAL;
return;
}
+ /* Local invocation case, destination of a message is only
+ * a different executor thread */
+ if (forb_object_is_local(req->obj)) {
+ exec_req = forb_malloc(sizeof(*exec_req));
+ memset(exec_req, 0, sizeof(exec_req));
+ exec_req->request_type = FORB_EXEC_REQ_LOCAL;
+ exec_req->input_request = req;
+ 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;
+ exec_req->codec = req->cdr_request;
+ req->cdr_request.release_buffer = CORBA_FALSE;
+ exec_req->request_id = req->request_id;
+ forb_exec_req_ins_tail(forb_object_get_executor(exec_req->obj), exec_req);
+ return;
+ }
+
ret = forb_iop_prepend_message_header(&req->cdr_request, forb_iop_REQUEST);
if (!ret) {
/* This should never happen */