IOBuf::getIov
[folly.git] / folly / io / IOBufQueue.cpp
index 35751e03822835df33240869f03f8b870b788c0d..27c5420ae50a13d0377bf7c085a4675099462b9d 100644 (file)
@@ -285,4 +285,16 @@ void IOBufQueue::trimEnd(size_t amount) {
   }
 }
 
+std::unique_ptr<folly::IOBuf> IOBufQueue::pop_front() {
+  if (!head_) {
+    return nullptr;
+  }
+  if (options_.cacheChainLength) {
+    chainLength_ -= head_->length();
+  }
+  std::unique_ptr<folly::IOBuf> retBuf = std::move(head_);
+  head_ = retBuf->pop();
+  return retBuf;
+}
+
 } // folly