#include <seastar/core/shared_ptr.hh>
#include <seastar/core/queue.hh>
#include <seastar/core/semaphore.hh>
-#include <seastar/core/print.hh>
#include <seastar/core/byteorder.hh>
#include <seastar/core/metrics.hh>
#include <seastar/net/net.hh>
namespace net {
-class tcp_hdr;
+struct tcp_hdr;
inline auto tcp_error(int err) {
return std::system_error(err, std::system_category());
void output() {
if (!_poll_active) {
_poll_active = true;
- _tcp.poll_tcb(_foreign_ip, this->shared_from_this()).then_wrapped([this] (auto&& f) {
+ // FIXME: future is discarded
+ (void)_tcp.poll_tcb(_foreign_ip, this->shared_from_this()).then_wrapped([this] (auto&& f) {
try {
f.get();
} catch(arp_queue_full_error& ex) {
semaphore _queue_space = {212992};
metrics::metric_groups _metrics;
public:
+ const inet_type& inet() const {
+ return _inet;
+ }
class connection {
lw_shared_ptr<tcb> _tcb;
public:
bool full() { return _pending + _q.size() >= _q.max_size(); }
void inc_pending() { _pending++; }
void dec_pending() { _pending--; }
+
+ const tcp& get_tcp() const {
+ return _tcp;
+ }
+ uint16_t port() const {
+ return _port;
+ }
friend class tcp;
};
public:
template <typename InetTraits>
void tcp<InetTraits>::send_packet_without_tcb(ipaddr from, ipaddr to, packet p) {
if (_queue_space.try_wait(p.len())) { // drop packets that do not fit the queue
- _inet.get_l2_dst_address(to).then([this, to, p = std::move(p)] (ethernet_address e_dst) mutable {
+ // FIXME: future is discarded
+ (void)_inet.get_l2_dst_address(to).then([this, to, p = std::move(p)] (ethernet_address e_dst) mutable {
_packetq.emplace_back(ipv4_traits::l4packet{to, std::move(p), e_dst, ip_protocol_num::tcp});
});
}
return;
}
// TODO: We should return a future to upper layer
- wait_for_all_data_acked().then([this, zis = this->shared_from_this()] () mutable {
+ (void)wait_for_all_data_acked().then([this, zis = this->shared_from_this()] () mutable {
_snd.closed = true;
tcp_debug("close: unsent_len=%d\n", _snd.unsent_len);
if (in_state(CLOSE_WAIT)) {
// Finally - we can't send more until window is opened again.
output();
}
- return std::move(p);
+ return SEASTAR_COPY_ELISION(p);
}
template <typename InetTraits>