Adds writer test case for RCU
[folly.git] / folly / io / async / AsyncPipe.cpp
index 94f73b7d031aac541901bc2a3d937f428c4f83c7..13581f4b4e2191c845051f0690a4390b4f7912dd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2014-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.
@@ -108,10 +108,10 @@ void AsyncPipeReader::handlerReady(uint16_t events) noexcept {
 
     if (bytesRead > 0) {
       if (movable) {
-        ioBuf->append(bytesRead);
+        ioBuf->append(uint64_t(bytesRead));
         readCallback_->readBufferAvailable(std::move(ioBuf));
       } else {
-        readCallback_->readDataAvailable(bytesRead);
+        readCallback_->readDataAvailable(size_t(bytesRead));
       }
       // Fall through and continue around the loop if the read
       // completely filled the available buffer.
@@ -247,7 +247,7 @@ void AsyncPipeWriter::handleWrite() {
       registerHandler(EventHandler::WRITE);
       return;
     }
-    curQueue.trimStart(rc);
+    curQueue.trimStart(size_t(rc));
     if (curQueue.empty()) {
       auto cb = front.second;
       queue_.pop_front();
@@ -266,4 +266,4 @@ void AsyncPipeWriter::handleWrite() {
   }
 }
 
-} // folly
+} // namespace folly