mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=4156
This commit is contained in:
parent
aaefb03ba9
commit
0b8db98a17
|
@ -411,6 +411,8 @@ int GUI_RPC_CONN::handle_rpc() {
|
|||
handle_get_run_mode(request_msg, mf);
|
||||
} else if (match_tag(request_msg, "<set_network_mode>")) {
|
||||
handle_set_network_mode(request_msg, mf);
|
||||
} else if (match_tag(request_msg, "<get_network_mode>")) {
|
||||
handle_get_network_mode(request_msg, mf);
|
||||
} else if (match_tag(request_msg, "<run_benchmarks")) {
|
||||
handle_run_benchmarks(request_msg, mf);
|
||||
} else if (match_tag(request_msg, "<set_proxy_settings>")) {
|
||||
|
|
|
@ -407,11 +407,13 @@ int RPC_CLIENT::get_run_mode(int& mode) {
|
|||
MIOFILE fin;
|
||||
fin.init_buf(mbuf);
|
||||
|
||||
mode = -1;
|
||||
while (fin.fgets(buf, 256)) {
|
||||
if (match_tag(buf, mode_name(RUN_MODE_ALWAYS))) return RUN_MODE_ALWAYS;
|
||||
if (match_tag(buf, mode_name(RUN_MODE_NEVER))) return RUN_MODE_NEVER;
|
||||
if (match_tag(buf, mode_name(RUN_MODE_AUTO))) return RUN_MODE_AUTO;
|
||||
if (match_tag(buf, mode_name(RUN_MODE_ALWAYS))) mode = RUN_MODE_ALWAYS;
|
||||
if (match_tag(buf, mode_name(RUN_MODE_NEVER))) mode = RUN_MODE_NEVER;
|
||||
if (match_tag(buf, mode_name(RUN_MODE_AUTO))) mode = RUN_MODE_AUTO;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::set_network_mode(int mode) {
|
||||
|
@ -433,6 +435,27 @@ int RPC_CLIENT::set_network_mode(int mode) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::get_network_mode(int& mode) {
|
||||
char buf[256];
|
||||
char* mbuf=0;
|
||||
int retval;
|
||||
|
||||
retval = send_request("<get_network_mode/>\n");
|
||||
if (retval) return retval;
|
||||
retval = get_reply(mbuf);
|
||||
if (retval) return retval;
|
||||
MIOFILE fin;
|
||||
fin.init_buf(mbuf);
|
||||
|
||||
mode = -1;
|
||||
while (fin.fgets(buf, 256)) {
|
||||
if (match_tag(buf, mode_name(RUN_MODE_ALWAYS))) mode = RUN_MODE_ALWAYS;
|
||||
if (match_tag(buf, mode_name(RUN_MODE_NEVER))) mode = RUN_MODE_NEVER;
|
||||
if (match_tag(buf, mode_name(RUN_MODE_AUTO))) mode = RUN_MODE_AUTO;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::run_benchmarks() {
|
||||
char buf[256];
|
||||
char* mbuf=0;
|
||||
|
|
|
@ -201,6 +201,7 @@ public:
|
|||
int set_run_mode(int mode);
|
||||
int get_run_mode(int& mode);
|
||||
int set_network_mode(int mode);
|
||||
int get_network_mode(int& mode);
|
||||
int run_benchmarks();
|
||||
int set_proxy_settings(PROXY_INFO&);
|
||||
int get_messages(int nmessages, int seqno, std::vector<MESSAGE_DESC>&);
|
||||
|
|
Loading…
Reference in New Issue