Skip to content

Commit 2a9aaf8

Browse files
committed
Further progress on cmake build for Linux.
1 parent 082f54b commit 2a9aaf8

File tree

6 files changed

+25
-6
lines changed

6 files changed

+25
-6
lines changed

apib/apib_io_basic.cc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ limitations under the License.
2828

2929
#include "apib/apib_iothread.h"
3030

31+
#if EV_VERSION_MAJOR > 4 || EV_VERSION_MINOR > 32
32+
#define HAS_IO_MODIFY 1
33+
#endif
34+
3135
namespace apib {
3236

3337
int ConnectionState::Connect() {
@@ -92,7 +96,11 @@ void ConnectionState::completeShutdown(struct ev_loop* loop, ev_io* w,
9296
io_Verbose(c, "Close needs read\n");
9397
if (c->backwardsIo_) {
9498
ev_io_stop(loop, &(c->io_));
99+
#ifdef HAS_IO_MODIFY
95100
ev_io_modify(&(c->io_), EV_READ);
101+
#else
102+
ev_io_set(&(c->io_), c->socket_->fd(), EV_READ);
103+
#endif
96104
c->backwardsIo_ = false;
97105
ev_io_start(loop, &(c->io_));
98106
}
@@ -101,7 +109,11 @@ void ConnectionState::completeShutdown(struct ev_loop* loop, ev_io* w,
101109
io_Verbose(c, "Close needs write\n");
102110
if (!c->backwardsIo_) {
103111
ev_io_stop(loop, &(c->io_));
112+
#ifdef HAS_IO_MODIFY
104113
ev_io_modify(&(c->io_), EV_WRITE);
114+
#else
115+
ev_io_set(&(c->io_), c->socket_->fd(), EV_WRITE);
116+
#endif
105117
c->backwardsIo_ = true;
106118
ev_io_start(loop, &(c->io_));
107119
}
@@ -293,7 +305,11 @@ int ConnectionState::singleRead(struct ev_loop* loop, ev_io* w, int revents) {
293305
io_Verbose(this, "Restoring I/O direction\n");
294306
backwardsIo_ = 0;
295307
ev_io_stop(loop, &io_);
308+
#ifdef HAS_IO_MODIFY
296309
ev_io_modify(&io_, EV_READ);
310+
#else
311+
ev_io_set(&io_, socket_->fd(), EV_READ);
312+
#endif
297313
ev_io_start(loop, &io_);
298314
}
299315
return 0;
@@ -305,7 +321,11 @@ int ConnectionState::singleRead(struct ev_loop* loop, ev_io* w, int revents) {
305321
io_Verbose(this, "Switching I/O direction\n");
306322
backwardsIo_ = 1;
307323
ev_io_stop(loop, &io_);
324+
#ifdef HAS_IO_MODIFY
308325
ev_io_modify(&io_, EV_WRITE);
326+
#else
327+
ev_io_set(&io_, socket_->fd(), EV_WRITE);
328+
#endif
309329
ev_io_start(loop, &io_);
310330
}
311331
return 0;

apib/apib_iothread.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ limitations under the License.
3434
#include "apib/socket.h"
3535
#include "apib/tlssocket.h"
3636
#include "ev.h"
37-
#include "http_parser.h"
37+
#include "third_party/http_parser/http_parser.h"
3838

3939
namespace apib {
4040

@@ -232,4 +232,4 @@ typedef std::vector<std::unique_ptr<IOThread>> ThreadList;
232232

233233
} // namespace apib
234234

235-
#endif // APIB_IOTHREAD_H
235+
#endif // APIB_IOTHREAD_H

apib/apib_main.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ limitations under the License.
3737
#include "apib/apib_util.h"
3838
#include "third_party/base64/base64.h"
3939

40-
static const std::string kApibVersion = "1.2";
40+
static const std::string kApibVersion = "1.2.1";
4141

4242
using apib::eqcase;
4343
using apib::IOThread;

apib/apib_url.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ limitations under the License.
3030
#include "absl/strings/str_cat.h"
3131
#include "apib/apib_lines.h"
3232
#include "apib/apib_util.h"
33-
#include "http_parser.h"
33+
#include "third_party/http_parser/http_parser.h"
3434

3535
#define URL_BUF_LEN 8192
3636
#define INITIAL_URLS 16

test/test_server.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ limitations under the License.
3737
#include "apib/addresses.h"
3838
#include "apib/apib_lines.h"
3939
#include "apib/apib_util.h"
40-
#include "http_parser.h"
4140

4241
using std::cerr;
4342
using std::cout;

test/test_server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ limitations under the License.
3030

3131
#include "absl/strings/string_view.h"
3232
#include "ev.h"
33-
#include "http_parser.h"
33+
#include "third_party/http_parser/http_parser.h"
3434

3535
namespace apib {
3636

0 commit comments

Comments
 (0)