< prev index next >

src/java.net.http/share/classes/jdk/internal/net/http/PullPublisher.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 101,123 **** subscriber.onError(t); return; } while (demand.tryDecrement() && !cancelled) { ! T next; ! try { ! if (!iter.hasNext()) { ! break; ! } ! next = iter.next(); ! } catch (Throwable t1) { ! completed = true; ! pullScheduler.stop(); ! subscriber.onError(t1); ! return; } - subscriber.onNext(next); } if (!iter.hasNext() && !cancelled) { completed = true; pullScheduler.stop(); subscriber.onComplete(); --- 101,115 ---- subscriber.onError(t); return; } while (demand.tryDecrement() && !cancelled) { ! if (!iter.hasNext()) { ! break; ! } else { ! subscriber.onNext(iter.next()); } } if (!iter.hasNext() && !cancelled) { completed = true; pullScheduler.stop(); subscriber.onComplete();
*** 129,139 **** public void request(long n) { if (cancelled) return; // no-op if (n <= 0) { ! error = new IllegalArgumentException("non-positive subscription request: " + n); } else { demand.increase(n); } pullScheduler.runOrSchedule(); } --- 121,131 ---- public void request(long n) { if (cancelled) return; // no-op if (n <= 0) { ! error = new IllegalArgumentException("illegal non-positive request:" + n); } else { demand.increase(n); } pullScheduler.runOrSchedule(); }
< prev index next >