mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=4272
This commit is contained in:
parent
41a92be355
commit
35b8b74001
|
@ -17889,9 +17889,25 @@ David 30 Sept 2004
|
|||
mail_passwd.php
|
||||
|
||||
David 30 Sept 2004
|
||||
- got clientgui to work on Linux!!
|
||||
- got clientgui working on Linux!!
|
||||
|
||||
clientgui/
|
||||
MainDocument.cpp
|
||||
Makefile (new)
|
||||
ValidateURL.cpp
|
||||
|
||||
David 30 Sept 2004
|
||||
- changed the semantics of the GUI RPC get_messages() call.
|
||||
- It no longer takes an "nmessages" arg.
|
||||
- it returns messages in order of increasing seqno
|
||||
- changed message_descs from a std::list to a std::deque
|
||||
|
||||
client/
|
||||
client_msgs.C,h
|
||||
gui_rpc_server.C
|
||||
lib/
|
||||
boinc_win.h
|
||||
gui_rpc_client.C,h
|
||||
gui_test.C
|
||||
win_build/
|
||||
boinc_guirpc_test.vcproj
|
||||
|
|
|
@ -22,14 +22,14 @@
|
|||
#endif
|
||||
#ifndef _WIN32
|
||||
#include <cstdarg>
|
||||
#include <list>
|
||||
#include <deque>
|
||||
#endif
|
||||
|
||||
using std::deque;
|
||||
|
||||
#include "log_flags.h"
|
||||
#include "client_msgs.h"
|
||||
|
||||
using std::list;
|
||||
|
||||
#define MAX_SAVED_MESSAGES 1000
|
||||
|
||||
CLIENT_MSG_LOG log_messages;
|
||||
|
@ -68,7 +68,10 @@ bool CLIENT_MSG_LOG::v_message_wanted(int kind) const {
|
|||
}
|
||||
}
|
||||
|
||||
list<MESSAGE_DESC*> message_descs;
|
||||
// a dequeue of up to MAX_SAVED_MESSAGES most recent messages,
|
||||
// stored in newest-first order
|
||||
//
|
||||
deque<MESSAGE_DESC*> message_descs;
|
||||
|
||||
// Takes a printf style formatted string, inserts the proper values,
|
||||
// and passes it to show_message
|
||||
|
|
|
@ -59,7 +59,7 @@ struct MESSAGE_DESC {
|
|||
std::string message;
|
||||
};
|
||||
|
||||
extern std::list<MESSAGE_DESC*> message_descs;
|
||||
extern std::deque<MESSAGE_DESC*> message_descs;
|
||||
extern void record_message(class PROJECT *p, int priority, int now, char* msg);
|
||||
|
||||
extern void show_message(class PROJECT *p, char* message, int priority);
|
||||
|
|
|
@ -264,30 +264,30 @@ static void handle_get_proxy_settings(char* , MIOFILE& fout) {
|
|||
}
|
||||
|
||||
// params:
|
||||
// <nmessages>x</nmessages>
|
||||
// return at most this many messages
|
||||
// <offset>n</offset>
|
||||
// start at message n.
|
||||
// if no offset is given, return last n messages
|
||||
// [ <seqno>n</seqno> ]
|
||||
// start at message seqno n; if absent or zero, return all
|
||||
//
|
||||
void handle_get_messages(char* buf, MIOFILE& fout) {
|
||||
int nmessages=-1, seqno=-1, j;
|
||||
int seqno=0, j;
|
||||
unsigned int i;
|
||||
MESSAGE_DESC* mdp;
|
||||
bool found=false;
|
||||
|
||||
parse_int(buf, "<nmessages>", nmessages);
|
||||
parse_int(buf, "<seqno>", seqno);
|
||||
if (nmessages < 0) {
|
||||
fout.printf("<error>No nmessages given</error>\n");
|
||||
return;
|
||||
|
||||
j = message_descs.size()-1;
|
||||
for (i=0; i<message_descs.size(); i++) {
|
||||
mdp = message_descs[i];
|
||||
if (mdp->seqno <= seqno) {
|
||||
found = true;
|
||||
j = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fout.printf("<msgs>\n");
|
||||
list<MESSAGE_DESC*>::const_iterator iter;
|
||||
for (iter=message_descs.begin(), j=0;
|
||||
iter != message_descs.end() && j<nmessages;
|
||||
iter++, j++
|
||||
) {
|
||||
MESSAGE_DESC* mdp = *iter;
|
||||
if (mdp->seqno <= seqno) break;
|
||||
for (i=j; i>=0; i--) {
|
||||
mdp = message_descs[i];
|
||||
fout.printf(
|
||||
"<msg>\n"
|
||||
" <pri>%d</pri>\n"
|
||||
|
|
|
@ -106,6 +106,7 @@
|
|||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <list>
|
||||
#include <locale>
|
||||
|
||||
|
|
|
@ -1104,17 +1104,16 @@ int RPC_CLIENT::set_proxy_settings(PROXY_INFO& pi) {
|
|||
return rpc.do_rpc(buf);
|
||||
}
|
||||
|
||||
int RPC_CLIENT::get_messages( int nmessages, int seqno, MESSAGES& msgs) {
|
||||
int RPC_CLIENT::get_messages(int seqno, MESSAGES& msgs) {
|
||||
char buf[4096];
|
||||
RPC rpc(this);
|
||||
int retval;
|
||||
|
||||
sprintf(buf,
|
||||
"<get_messages>\n"
|
||||
" <nmessages>%d</nmessages>\n"
|
||||
" <seqno>%d</seqno>\n"
|
||||
"</get_messages>\n",
|
||||
nmessages, seqno
|
||||
seqno
|
||||
);
|
||||
retval = rpc.do_rpc(buf);
|
||||
if (retval) return retval;
|
||||
|
|
|
@ -304,7 +304,7 @@ public:
|
|||
int run_benchmarks();
|
||||
int set_proxy_settings(PROXY_INFO&);
|
||||
int get_proxy_settings(PROXY_INFO&);
|
||||
int get_messages(int nmessages, int seqno, MESSAGES&);
|
||||
int get_messages(int seqno, MESSAGES&);
|
||||
int file_transfer_op(FILE_TRANSFER&, char*);
|
||||
int result_op(RESULT&, char*);
|
||||
char* mode_name(int mode);
|
||||
|
|
|
@ -94,10 +94,9 @@ int main(int argc, char** argv) {
|
|||
FILE_TRANSFERS ft;
|
||||
retval = rpc.get_file_transfers(ft);
|
||||
} else if (!strcmp(argv[i], "-get_messages")) {
|
||||
if (i != argc-3) usage();
|
||||
int nmsgs = atoi(argv[++i]);
|
||||
if (i != argc-2) usage();
|
||||
int seqno = atoi(argv[++i]);
|
||||
retval = rpc.get_messages(nmsgs, seqno, messages);
|
||||
retval = rpc.get_messages(seqno, messages);
|
||||
if (!retval) {
|
||||
for (i=0; i<messages.messages.size(); i++) {
|
||||
MESSAGE& md = *messages.messages[i];
|
||||
|
|
|
@ -165,10 +165,10 @@
|
|||
RelativePath="..\lib\filesys.C">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\client\gui_rpc_client.C">
|
||||
RelativePath="..\lib\gui_rpc_client.C">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\client\gui_test.C">
|
||||
RelativePath="..\lib\gui_test.C">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\mfile.C">
|
||||
|
@ -213,7 +213,7 @@
|
|||
RelativePath="..\lib\filesys.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\client\gui_rpc_client.h">
|
||||
RelativePath="..\lib\gui_rpc_client.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\mfile.h">
|
||||
|
|
Loading…
Reference in New Issue