diff --git a/checkin_notes b/checkin_notes index f036bf10ca..4e6f6aedcb 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5095,3 +5095,20 @@ Rom 30 July 2012 clientgui/ sg_BoincSimpleFrame.cpp + +David 1 Aug 2012 + - web: after post to a thread, show thread in user's chosen order + instead of newest first. + + db/ + db_base.cpp,h + html/ + inc/ + forum.inc + user/ + forum_reply.php + vda/ + vda_lib.cpp + vdad.cpp + sched_vda.cpp + vda_lib2.cpp diff --git a/db/db_base.cpp b/db/db_base.cpp index 5a9ccd730f..23f4b24a87 100644 --- a/db/db_base.cpp +++ b/db/db_base.cpp @@ -348,7 +348,7 @@ int DB_BASE::lookup(const char* clause) { return 0; } -int DB_BASE::update_fields_noid(char* set_clause, char* where_clause) { +int DB_BASE::update_fields_noid(const char* set_clause, const char* where_clause) { char query[MAX_QUERY_LEN]; sprintf(query, "update %s set %s where %s", diff --git a/db/db_base.h b/db/db_base.h index db895ad4ed..44f745da41 100644 --- a/db/db_base.h +++ b/db/db_base.h @@ -96,7 +96,7 @@ public: int insert_batch(std::string&); int update(); int update_field(const char*, const char* where_clause=NULL); - int update_fields_noid(char* set_clause, char* where_clause); + int update_fields_noid(const char* set_clause, const char* where_clause); int delete_from_db(); int delete_from_db_multi(const char* where_clause); int get_field_ints(const char*, int, int*); diff --git a/doc/projects.inc b/doc/projects.inc index 59a08e8139..8c57e6a1d1 100644 --- a/doc/projects.inc +++ b/doc/projects.inc @@ -28,11 +28,11 @@ $biomed = array( array( array( "FightMalaria@Home", - "http://boinc.ucd.ie/fmah", + "http://boinc.ucd.ie/fmah/", tra("University College Dublin"), tra("Antimalarial drug discovery"), tra("The parasite that causes malaria continues to evolve resistance to available medication. We therefore urgently need to discover new drugs to replace existing drugs. Importantly, these new drugs need to target NEW proteins in the parasite. The FightMalaria@Home project is aimed at finding these new targets."), - "fmah_banner3.png" + "FMAH_banner3_wt.png" ), array( "POEM@HOME", diff --git a/html/inc/forum.inc b/html/inc/forum.inc index 986c9d9fbf..78cb281c31 100644 --- a/html/inc/forum.inc +++ b/html/inc/forum.inc @@ -807,6 +807,7 @@ function create_post($content, $parent_id, $user, $forum, $thread, $signature) { $user->prefs->update("posts=posts+1"); $thread->update("replies=replies+1, timestamp=$now"); $forum->update("posts=posts+1, timestamp=$now"); + return $id; } // call this when hide or delete a post; diff --git a/html/user/forum_reply.php b/html/user/forum_reply.php index 2ab45c44c3..d6fbfdb0d0 100644 --- a/html/user/forum_reply.php +++ b/html/user/forum_reply.php @@ -73,11 +73,15 @@ if ($content && (!$preview)){ $warning = tra("Your post has been flagged as spam by the Akismet anti-spam system. Please modify your text and try again."); $preview = tra("Preview"); } else { - create_post( + $post_id = create_post( $content, $parent_post_id, $logged_in_user, $forum, $thread, $add_signature ); - header("Location: forum_thread.php?id=$thread->id&temp_sort_style=".CREATE_TIME_NEW); + if ($post_id) { + header("Location: forum_thread.php?id=$thread->id&postid=$post_id"); + } else { + error_page("Can't create post."); + } } } diff --git a/vda/sched_vda.cpp b/vda/sched_vda.cpp index 2cd7bcefc0..71474f09fb 100644 --- a/vda/sched_vda.cpp +++ b/vda/sched_vda.cpp @@ -132,7 +132,7 @@ static int get_chunk_md5(char* chunk_dir, char* md5_buf) { // delete from upload dir // static int process_completed_upload(char* chunk_name, CHUNK_LIST& chunks) { - char path[1024], client_filename[1024], dir[1024]; + char path[1024], client_filename[1024], dir[1024], buf[256]; int retval; physical_file_name(g_reply->host.id, chunk_name, client_filename); @@ -171,7 +171,11 @@ static int process_completed_upload(char* chunk_name, CHUNK_LIST& chunks) { } else { retval = vf.update_field("need_update=1"); if (retval) return retval; - retval = ch.update_field("transfer_in_progress=0"); + sprintf(buf, "host_id=%d and physical_file_name='%s'", + ch.host_id, + ch.physical_file_name + ); + retval = ch.update_fields_noid("transfer_in_progress=0", buf); if (retval) return retval; } } @@ -241,7 +245,14 @@ static void process_present_file(FILE_INFO& fi, CHUNK_LIST& chunks) { chp->transfer_in_progress = false; chp->transfer_wait = false; chp->present_on_host = true; - chp->update(); + sprintf(buf, + "host_id=%d and physical_file_name='%s'", + chp->host_id, chp->physical_file_name + ); + chp->update_fields_noid( + "transfer_in_progress=0, transfer_wait=0, present_on_host=1", + buf + ); } mark_for_update(vf.id); } diff --git a/vda/vda_lib.cpp b/vda/vda_lib.cpp index c15e14d544..13cbc3a282 100644 --- a/vda/vda_lib.cpp +++ b/vda/vda_lib.cpp @@ -194,14 +194,14 @@ int META_CHUNK::recovery_action(double now) { status = PRESENT; } #ifdef DEBUG_RECOVERY - printf("meta chunk action %s state %s unrec children %d\n", + printf(" meta chunk %s: state %s unrec children %d\n", name, status_str(status), have_unrecoverable_children ); #endif for (i=0; iname, status_str(c->status), c->in_recovery_set ); #endif @@ -439,7 +439,7 @@ int CHUNK::recovery_plan() { min_failures = 0; } #ifdef DEBUG_RECOVERY - printf("chunk plan %s: status %s\n", name, status_str(status)); + printf(" chunk %s: status %s\n", name, status_str(status)); #endif return 0; } @@ -475,7 +475,7 @@ int CHUNK::recovery_action(double now) { data_needed = true; } #ifdef DEBUG_RECOVERY - printf("chunk action: %s data_needed %d present_on_server %d\n", + printf(" chunk %s: data_needed %d present_on_server %d\n", name, data_needed, present_on_server ); #endif @@ -489,7 +489,7 @@ int CHUNK::recovery_action(double now) { present_on_server = false; status = RECOVERABLE; min_failures = fp->policy.replication; - sprintf(buf, "%s replicated, removing from server\n", name); + sprintf(buf, " chunk %s: replicated, removing from server\n", name); show_msg(buf); parent->dfile->disk_usage.sample_inc( -size, diff --git a/vda/vda_lib2.cpp b/vda/vda_lib2.cpp index 4f4df9cfa4..655d537731 100644 --- a/vda/vda_lib2.cpp +++ b/vda/vda_lib2.cpp @@ -291,6 +291,9 @@ int CHUNK::assign() { log_messages.printf(MSG_CRITICAL, "ch.insert() failed\n"); return retval; } + log_messages.printf(MSG_NORMAL, + " assigning chunk %s to host %d\n", name, host_id + ); return 0; } @@ -437,8 +440,6 @@ int VDA_FILE_AUX::choose_host() { int retval; DB_HOST host; - return 467; - // replenish cache if needed // if (!available_hosts.size()) { @@ -463,6 +464,11 @@ int VDA_FILE_AUX::choose_host() { host_alive_clause(), rand_id, 100-nhosts_scanned ); } + + // debugging + // + strcpy(buf, "where id=467 or id=166"); + while (1) { retval = host.enumerate(buf); if (retval == ERR_DB_NOT_FOUND) break; diff --git a/vda/vdad.cpp b/vda/vdad.cpp index ec4c4ffa6c..1f1977fcae 100644 --- a/vda/vdad.cpp +++ b/vda/vdad.cpp @@ -61,12 +61,14 @@ int handle_file(VDA_FILE_AUX& vf, DB_VDA_FILE& dvf) { return retval; } if (vf.initialized) { + log_messages.printf(MSG_NORMAL, "Getting state\n"); retval = vf.get_state(); if (retval) { log_messages.printf(MSG_CRITICAL, "vf.get_state failed %d\n", retval); return retval; } } else { + log_messages.printf(MSG_NORMAL, "Initializing\n"); retval = vf.init(); if (retval) { log_messages.printf(MSG_CRITICAL, "vf.init failed %d\n", retval); @@ -75,11 +77,13 @@ int handle_file(VDA_FILE_AUX& vf, DB_VDA_FILE& dvf) { sprintf(buf, "initialized=1, chunk_size=%.0f", vf.policy.chunk_size()); dvf.update_field(buf); } + log_messages.printf(MSG_NORMAL, "Recovery plan:\n"); retval = vf.meta_chunk->recovery_plan(); if (retval) { log_messages.printf(MSG_CRITICAL, "vf.recovery_plan failed %d\n", retval); return retval; } + log_messages.printf(MSG_NORMAL, "Recovery action:\n"); retval = vf.meta_chunk->recovery_action(dtime()); if (retval) { log_messages.printf(MSG_CRITICAL, "vf.recovery_action failed %d\n", retval);