]> andersk Git - moira.git/blame - lib/mr_call.c
oops. put :s in RCS $Id strings so RCS notices them and DTRT
[moira.git] / lib / mr_call.c
CommitLineData
fa59b86f 1/* $Id$
ca401c43 2 *
7ac48069 3 * Pass an mr_params off to the Moira server and get a reply
4 *
5 * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology
6 * For copying and distribution information, please see the file
7 * <mit-copyright.h>.
ca401c43 8 */
9
babbc197 10#include <mit-copyright.h>
7ac48069 11#include <moira.h>
8defc06b 12#include "mr_private.h"
ca401c43 13
7ac48069 14RCSID("$Header$");
15
5eaef520 16int mr_do_call(struct mr_params *params, struct mr_params **reply)
ca401c43 17{
5eaef520 18 CHECK_CONNECTED;
19
20 if (!_mr_send_op)
21 _mr_send_op = create_operation();
22
23 if (!_mr_recv_op)
24 _mr_recv_op = create_operation();
25
26 initialize_operation(_mr_send_op, mr_start_send, (char *)params, NULL);
27 queue_operation(_mr_conn, CON_OUTPUT, _mr_send_op);
28
29 initialize_operation(_mr_recv_op, mr_start_recv, (char *)reply, NULL);
30 queue_operation(_mr_conn, CON_INPUT, _mr_recv_op);
31
32 /* Block until operation done. */
7ac48069 33 complete_operation(_mr_send_op);
34 complete_operation(_mr_recv_op);
5eaef520 35 /* Look at results */
36 if ((OP_STATUS(_mr_send_op) != OP_COMPLETE) ||
37 (OP_STATUS(_mr_recv_op) != OP_COMPLETE))
38 {
39 mr_disconnect();
40 return MR_ABORTED;
83e80378 41 }
5eaef520 42 return 0;
ca401c43 43}
This page took 0.097745 seconds and 5 git commands to generate.