Skip to content

Commit 2e9665d

Browse files
committed
Change build filename & fix large file installing by changing heartbeat
runner
1 parent a9f97b7 commit 2e9665d

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
*.o
22
*.a
33
/AltServer
4+
/AltServerNet
5+
/AltServerUPnP
46

57
.vscode/**
68
.ccls-cache/**

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
PROGRAM := AltServer
1+
ifdef NO_USBMUXD_STUB
2+
PROGRAM := AltServer
3+
else
4+
ifdef NO_UPNP_STUB
5+
PROGRAM := AltServerNet
6+
else
7+
PROGRAM := AltServerUPnP
8+
endif
9+
endif
10+
211

312
%.c.o : %.c
413
$(CC) $(CFLAGS) $(EXTRA_FLAGS) -o $@ -c $<

src/AltServerMain.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ std::vector<unsigned char> readFile(const char* filename)
6969
}
7070

7171
#include <boost/asio.hpp>
72+
#include <boost/asio/steady_timer.hpp>
7273

7374
boost::asio::io_service io_service;
74-
boost::posix_time::seconds interval(15); // 1 second
75-
std::shared_ptr<boost::asio::deadline_timer> timer;
75+
std::shared_ptr<boost::asio::steady_timer> timer;
7676
void *hbclient;
7777

7878
void heartbeat_tick(const boost::system::error_code& /*e*/) {
@@ -81,19 +81,25 @@ void heartbeat_tick(const boost::system::error_code& /*e*/) {
8181
if (!intervalSec) {
8282
return;
8383
}
84-
interval = boost::posix_time::seconds(intervalSec);
8584
// Reschedule the timer for 1 second in the future:
86-
timer->expires_at(timer->expires_at() + interval);
85+
//timer->expires_from_now(boost::posix_time::seconds(4));
8786
// Posts the timer event
88-
timer->async_wait(heartbeat_tick);
87+
//timer->async_wait(heartbeat_tick);
88+
89+
auto &ioService = crossplat::threadpool::shared_instance().service();
90+
boost::asio::steady_timer t(ioService, std::chrono::seconds(4));
91+
t.async_wait(heartbeat_tick);
8992
}
9093

9194
int setupHeartbeatTimer() {
9295
auto &ioService = crossplat::threadpool::shared_instance().service();
9396

94-
timer = std::make_shared<boost::asio::deadline_timer>(ioService);
95-
timer->expires_from_now(boost::posix_time::seconds(1));
96-
timer->async_wait(heartbeat_tick);
97+
// timer = std::make_shared<boost::asio::steady_timer>(ioService);
98+
// timer->expires_from_now(boost::posix_time::seconds(1));
99+
// timer->async_wait(heartbeat_tick);
100+
101+
boost::system::error_code err;
102+
heartbeat_tick(err);
97103
return 1;
98104
}
99105

0 commit comments

Comments
 (0)