/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2012-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <condition_variable>
#include <iostream>
#include <list>
+#include <memory>
namespace folly {
}
};
-#ifdef MSG_ERRQUEUE
+#ifdef FOLLY_HAVE_MSG_ERRQUEUE
/* copied from include/uapi/linux/net_tstamp.h */
/* SO_TIMESTAMPING gets an integer bit field comprised of these values */
enum SOF_TIMESTAMPING {
bool gotTimestamp_{false};
bool gotByteSeq_{false};
};
-#endif // MSG_ERRQUEUE
+#endif // FOLLY_HAVE_MSG_ERRQUEUE
class ReadCallbackBase :
public AsyncTransportWrapper::ReadCallback {
bufLen_(2500),
iovCount_(2000) {
// Fill buf_
- buf_.reset(new uint8_t[bufLen_]);
+ buf_ = std::make_unique<uint8_t[]>(bufLen_);
for (uint32_t n = 0; n < sizeof(buf_); ++n) {
buf_[n] = n % 0xff;
}
// Initialize iov_
- iov_.reset(new struct iovec[iovCount_]);
+ iov_ = std::make_unique<struct iovec[]>(iovCount_);
for (uint32_t n = 0; n < iovCount_; ++n) {
iov_[n].iov_base = buf_.get() + n;
if (n & 0x1) {
: socket_(std::move(socket)),
bufSize_(2500 * 2000),
bytesRead_(0) {
- buf_.reset(new uint8_t[bufSize_]);
+ buf_ = std::make_unique<uint8_t[]>(bufSize_);
socket_->sslAccept(this, std::chrono::milliseconds(100));
}
EventBase* eventBase_;
};
-}
+} // namespace folly