Skip to content

Commit

Permalink
Code cleanups and updating todo list
Browse files Browse the repository at this point in the history
  • Loading branch information
wwiv committed Jun 29, 2018
1 parent 840abe6 commit 2c85d7f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# We'll use defaults from the LLVM style, but with 4 columns indentation.
# We'll use defaults from the LLVM style, but with 2 columns indentation.
BasedOnStyle: LLVM
IndentWidth: 2
---
Expand Down
2 changes: 1 addition & 1 deletion bbs/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void Application::tleft(bool check_for_timeout) {

auto min_left = nsln / SECONDS_PER_MINUTE;
auto secs_left = nsln % SECONDS_PER_MINUTE;
string tleft_display = wwiv::strings::StringPrintf("T-%4ldm %2lds", min_left, secs_left);
auto tleft_display = wwiv::strings::StringPrintf("T-%4ldm %2lds", min_left, secs_left);
switch (topdata) {
case LocalIO::topdataSystem: {
if (IsUserOnline()) {
Expand Down
7 changes: 6 additions & 1 deletion bbs/todo.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
==============================================================================
WWIV BBS TODO List
Copyright 2002-2017, WWIV Software Services
Copyright 2002-2018, WWIV Software Services
==============================================================================

FTN
Expand Down Expand Up @@ -33,6 +33,11 @@ Infrastructure Cleanup
part of Output class.
* Create a SDK QScan class to wrap interacting with the WWIV qscan
variables and also load/save user.qsc
* Move to LibSSH on all platforms
* Run various asan/tsan's regularly with gcc via CMake
* Drop Debian8
* Get GCC 8 compiles working.


Networking Cleanup
==================
Expand Down
4 changes: 3 additions & 1 deletion network1/network1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static bool handle_file(const BbsListNet& b, const net_networks_rec& net, const
}
}

int main(int argc, char** argv) {
int network1_main(int argc, char** argv) {
Logger::Init(argc, argv);
try {
ScopeExit at_exit(Logger::ExitLogger);
Expand Down Expand Up @@ -189,3 +189,5 @@ int main(int argc, char** argv) {
}
return 2;
}

int main(int argc, char** argv) { return network1_main(argc, argv); }
11 changes: 5 additions & 6 deletions network2/subs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ static bool send_sub_add_drop_resp(Context& context,
text.append(StrCat(context.config.config()->sysopname, " #1\r\n"));
text.append(StrCat(daten_to_wwivnet_time(daten_t_now()), "\r\n\r\n"));

// TODO: Add SA or SR + subtype + .net file text
// Add the text that probably came from a SA or SR + subtype + .net file.
text.append(response_file_text);

nh.length = text.size(); // should be subtype.size() + 2
const string pendfile = create_pend(context.net.dir, false, '2');
const auto pendfile = create_pend(context.net.dir, false, '2');
Packet packet(nh, {}, std::move(text));
return write_wwivnet_packet(pendfile, context.net, packet);
}
Expand All @@ -204,7 +204,7 @@ bool handle_sub_add_req(Context& context, Packet& p) {
const string subtype = SubTypeFromText(p.text);
auto resp = [&](int code) -> bool {
string base = (code == sub_adddrop_ok) ? "sa" : "sr";
string response_file = StrCat(base, subtype, ".net");
auto response_file = StrCat(base, subtype, ".net");
string text;
LOG(INFO) << "Candidate sa file: " << FilePath(context.net.dir, response_file);
if (File::Exists(context.net.dir, response_file)) {
Expand All @@ -220,7 +220,7 @@ bool handle_sub_add_req(Context& context, Packet& p) {
if (!IsHostedHere(context, subtype)) {
return resp(sub_adddrop_not_host);
}
string filename = StrCat("n", subtype, ".net");
auto filename = StrCat("n", subtype, ".net");
std::set<uint16_t> subscribers;
if (!ReadSubcriberFile(context.net.dir, filename, subscribers)) {
LOG(INFO) << "Unable to read subscribers file.";
Expand Down Expand Up @@ -251,7 +251,7 @@ bool handle_sub_drop_req(Context& context, Packet& p) {
if (!IsHostedHere(context, subtype)) {
return resp(sub_adddrop_not_host);
}
string filename = StrCat("n", subtype, ".net");
auto filename = StrCat("n", subtype, ".net");
std::set<uint16_t> subscribers;
if (!ReadSubcriberFile(context.net.dir, filename, subscribers)) {
LOG(INFO) << "Unable to read subscribers file.";
Expand All @@ -271,7 +271,6 @@ bool handle_sub_drop_req(Context& context, Packet& p) {
return resp(sub_adddrop_ok);
}


static string SubAddDropResponseMessage(uint8_t code) {
switch (code) {
case sub_adddrop_already_there: return "You are already there";
Expand Down

0 comments on commit 2c85d7f

Please sign in to comment.