Skip to content

Commit

Permalink
[linux] Move all fcgi dependent stdio functions to the separate 'boin…
Browse files Browse the repository at this point in the history
…c_stdio.h' header only file

Signed-off-by: Vitalii Koshura <[email protected]>
  • Loading branch information
AenBleidd committed Feb 12, 2023
1 parent 9f70285 commit 92a9b34
Show file tree
Hide file tree
Showing 72 changed files with 817 additions and 1,130 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
jobs:
build:
name: ${{ matrix.type }}-build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
type: [libs, client, apps, libs-vcpkg, client-vcpkg, apps-vcpkg, libs-cmake, libs-arm64, apps-arm64, manager-with-webview-vcpkg, server, manager-with-webview, manager-without-webview, unit-test, integration-test]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ tools/dir_hier_move
tools/dir_hier_path
tools/remote_submit_test
tools/sign_executable
tools/stage_file_native
vda/ssim
vda/vda
vda/vdad
Expand Down
40 changes: 18 additions & 22 deletions db/boinc_db.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2019 University of California
// Copyright (C) 2023 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -35,10 +35,6 @@
#include "error_numbers.h"
#include "boinc_db.h"

#ifdef _USING_FCGI_
#include "fcgi_stdio.h"
#endif

using std::string;

extern "C" {
Expand Down Expand Up @@ -449,7 +445,7 @@ void DB_USER_DELETED::db_print(char* buf){
"public_cross_project_id=%s, create_time=%.15e",
public_cross_project_id, create_time
);
}
}

void DB_USER_DELETED::db_parse(MYSQL_ROW &r) {
int i=0;
Expand Down Expand Up @@ -1564,16 +1560,16 @@ void DB_STATE_COUNTS::db_print(char* buf) {
"workunit_file_delete_state_1=%d, "
"workunit_file_delete_state_2=%d, ",
appid,
last_update_time,
result_server_state_2,
result_server_state_4,
result_file_delete_state_1,
result_file_delete_state_2,
result_server_state_5_and_file_delete_state_0,
workunit_need_validate_1,
last_update_time,
result_server_state_2,
result_server_state_4,
result_file_delete_state_1,
result_file_delete_state_2,
result_server_state_5_and_file_delete_state_0,
workunit_need_validate_1,
workunit_assimilate_state_1,
workunit_file_delete_state_1,
workunit_file_delete_state_2
workunit_file_delete_state_1,
workunit_file_delete_state_2
);
}

Expand All @@ -1582,14 +1578,14 @@ void DB_STATE_COUNTS::db_parse(MYSQL_ROW& r) {
clear();
appid = atoi(r[i++]);
last_update_time = atoi(r[i++]);
result_server_state_2 = atoi(r[i++]);
result_server_state_4 = atoi(r[i++]);
result_file_delete_state_1 = atoi(r[i++]);
result_file_delete_state_2 = atoi(r[i++]);
result_server_state_5_and_file_delete_state_0 = atoi(r[i++]);
workunit_need_validate_1 = atoi(r[i++]);
result_server_state_2 = atoi(r[i++]);
result_server_state_4 = atoi(r[i++]);
result_file_delete_state_1 = atoi(r[i++]);
result_file_delete_state_2 = atoi(r[i++]);
result_server_state_5_and_file_delete_state_0 = atoi(r[i++]);
workunit_need_validate_1 = atoi(r[i++]);
workunit_assimilate_state_1 = atoi(r[i++]);
workunit_file_delete_state_1 = atoi(r[i++]);
workunit_file_delete_state_1 = atoi(r[i++]);
workunit_file_delete_state_2 = atoi(r[i++]);
}

Expand Down
4 changes: 2 additions & 2 deletions db/boinc_db_types.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2012 University of California
// Copyright (C) 2023 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -277,7 +277,7 @@ struct HOST {

// all remaining items are assigned by the client
int timezone; // local STANDARD time at host - UTC time
// (in seconds)
// (in seconds)
char domain_name[256];
char serialnum[256]; // textual description of coprocessors
char last_ip_addr[256]; // internal IP address as of last RPC
Expand Down
13 changes: 5 additions & 8 deletions db/db_base.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2019 University of California
// Copyright (C) 2023 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand All @@ -26,10 +26,7 @@
#include "str_replace.h"
#include "db_base.h"

#ifdef _USING_FCGI_
#include "fcgi_stdio.h"
#include "sched_msgs.h"
#endif

bool g_print_queries = false;

Expand Down Expand Up @@ -89,7 +86,7 @@ int DB_CONN::open(
mysql, host, db_user, dbpassword, db_name, port, 0, CLIENT_FOUND_ROWS
);
if (mysql2 == 0) {
fprintf(stderr, "mysql_real_connect(): %d: %s\n", mysql_errno(mysql), mysql_error(mysql));
boinc::fprintf(stderr, "mysql_real_connect(): %d: %s\n", mysql_errno(mysql), mysql_error(mysql));
return ERR_DB_CANT_CONNECT;
}
mysql = mysql2;
Expand Down Expand Up @@ -140,7 +137,7 @@ int DB_CONN::do_query(const char* p) {
}
retval = mysql_query(mysql, p);
if (retval) {
fprintf(stderr, "Database error: %s\nquery=%s\n", error_string(), p);
boinc::fprintf(stderr, "Database error: %s\nquery=%s\n", error_string(), p);
}
return retval;
}
Expand Down Expand Up @@ -168,7 +165,7 @@ DB_ID_TYPE DB_CONN::insert_id() {
}

void DB_CONN::print_error(const char* p) {
fprintf(stderr, "%s: Database error: %s\n", p, error_string());
boinc::fprintf(stderr, "%s: Database error: %s\n", p, error_string());
}

const char* DB_CONN::error_string() {
Expand Down Expand Up @@ -488,7 +485,7 @@ void escape_string(char* field, int len) {
//
while (*p && q < buf+len-3) {
if (*p == '\'') {
// this does ' to \' transformation
// this does ' to \' transformation
//
*q++ = '\\';
*q++ = '\'';
Expand Down
2 changes: 1 addition & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ elseif(WIN32)
)
elseif(UNIX)
execute_process(COMMAND ./configure --disable-server --disable-client --disable-manager)

file(COPY ${BOINC_DIR}/config.h DESTINATION ${BOINC_DIR}/config-h)


Expand Down
3 changes: 1 addition & 2 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ endif
if ENABLE_LIBRARIES

libfcgi_sources = \
boinc_fcgi.cpp \
coproc.cpp \
filesys.cpp \
hostinfo.cpp \
Expand Down Expand Up @@ -140,7 +139,7 @@ pkginclude_HEADERS = \
app_ipc.h \
average.h \
base64.h \
boinc_fcgi.h \
boinc_stdio.h \
cal_boinc.h \
cc_config.h \
cert_sig.h \
Expand Down
7 changes: 2 additions & 5 deletions lib/base64.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
// Copyright (C) 2023 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand All @@ -21,10 +21,7 @@
#include "config.h"
#endif

#ifdef _USING_FCGI_
#include "boinc_fcgi.h"
#endif

#include "boinc_stdio.h"
#include "base64.h"

using std::string;
Expand Down
100 changes: 0 additions & 100 deletions lib/boinc_fcgi.cpp

This file was deleted.

Loading

0 comments on commit 92a9b34

Please sign in to comment.