8000 safety first: turn off sync/async mixing for HTTPS in general · soualid/arangodb@036e28b · GitHub
[go: up one dir, main page]

Skip to content

Commit 036e28b

Browse files
committed
safety first: turn off sync/async mixing for HTTPS in general
1 parent d64af1f commit 036e28b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

arangod/GeneralServer/HttpCommTask.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ HttpCommTask::HttpCommTask(Scheduler* scheduler, GeneralServer* server,
7070
ConnectionStatistics::SET_HTTP(_connectionStatistics);
7171
}
7272

73+
// whether or not this task can mix sync and async I/O
74+
bool HttpCommTask::canUseMixedIO() const {
75+
// in case SSL is used, we cannot use a combination of sync and async I/O
76+
// because that will make TLS fall apart
77+
return !_peer->isEncrypted();
78+
}
79+
7380
/// @brief send error response including response body
7481
void HttpCommTask::addSimpleResponse(rest::ResponseCode code, rest::ContentType respType,
7582
uint64_t /*messageId*/, velocypack::Buffer<uint8_t>&& buffer) {

arangod/GeneralServer/HttpCommTask.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ class HttpCommTask final : public GeneralCommTask {
2525
}
2626

2727
// whether or not this task can mix sync and async I/O
28-
// this is always true for the HTTPCommTask, because we are not
29-
// multiplexing I/O
30-
bool canUseMixedIO() const override { return true; }
28+
bool canUseMixedIO() const override;
3129

3230
private:
3331
bool processRead(double startTime) override;

0 commit comments

Comments
 (0)
0