@Override
	public void offer(HttpContent chunk) {
		if (this.channel.isClosed())
			return;		// TODO somehow connect the cancel back to netsession 
		if (chunk.content().readableBytes() > this.max) {
			this.channel.abort();		// TODO somehow connect the cancel back to netsession
			return;
		}
		ByteBuf bb = chunk.content();
		bb.retain();		// we will use it in upcoming send
		System.out.println("ref count a: " + bb.refCnt());
		StreamMessage b = new StreamMessage("Block", bb);
		b.setField("Sequence", this.seq);
		OperationResult or = this.channel.send(b);
		// bb should now be back to 1
		System.out.println("ref count b: " + bb.refCnt());
		if (or.hasErrors()) {
			this.channel.close();
			return;
		}
		this.seq++;
		// TODO track progress if possible
		// final only if not canceled
		if (chunk instanceof LastHttpContent)
			this.channel.send(MessageUtil.streamFinal());
	}
@Override
	public void offer(HttpContent chunk) {
		if (this.channel.isClosed())
			return;	
		if (chunk.content().readableBytes() > this.max) {
			this.channel.abort();	
			return;
		}
		ByteBuf bb = chunk.content();
		bb.retain();	
		System.out.println("ref count a: " + bb.refCnt());
		StreamMessage b = new StreamMessage("Block", bb);
		b.setField("Sequence", this.seq);
		OperationResult or = this.channel.send(b);
	
		System.out.println("ref count b: " + bb.refCnt());
		if (or.hasErrors()) {
			this.channel.close();
			return;
		}
		this.seq++;
	
	
		if (chunk instanceof LastHttpContent)
			this.channel.send(MessageUtil.streamFinal());
	}
@override public void offer(httpcontent chunk) { if (this.channel.isclosed()) return; if (chunk.content().readablebytes() > this.max) { this.channel.abort(); return; } bytebuf bb = chunk.content(); bb.retain(); system.out.println("ref count a: " + bb.refcnt()); streammessage b = new streammessage("block", bb); b.setfield("sequence", this.seq); operationresult or = this.channel.send(b); system.out.println("ref count b: " + bb.refcnt()); if (or.haserrors()) { this.channel.close(); return; } this.seq++; if (chunk instanceof lasthttpcontent) this.channel.send(messageutil.streamfinal()); }