equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
427 if (Log.requests()) { |
427 if (Log.requests()) { |
428 Log.logRequest("PUSH_PROMISE: " + pushRequest.toString()); |
428 Log.logRequest("PUSH_PROMISE: " + pushRequest.toString()); |
429 } |
429 } |
430 PushGroup<T> pushGroup = exchange.getPushGroup(); |
430 PushGroup<T> pushGroup = exchange.getPushGroup(); |
431 if (pushGroup == null) { |
431 if (pushGroup == null) { |
432 // no push handler set by the user code, i.e. cancel / reject |
432 Log.logTrace("Rejecting push promise stream " + streamid); |
433 IOException ex = new IOException("Stream " + streamid + " cancelled by users handler"); |
433 connection.resetStream(pushStream.streamid, ResetFrame.REFUSED_STREAM); |
434 pushStream.cancelImpl(ex); |
434 pushStream.close(); |
435 return; |
|
436 } |
|
437 |
|
438 if (pushGroup.noMorePushes()) { |
|
439 cancelImpl(new IllegalStateException("unexpected push promise" |
|
440 + " on stream " + streamid)); |
|
441 return; |
435 return; |
442 } |
436 } |
443 |
437 |
444 PushGroup.Acceptor<T> acceptor = pushGroup.acceptPushRequest(pushRequest); |
438 PushGroup.Acceptor<T> acceptor = pushGroup.acceptPushRequest(pushRequest); |
445 CompletableFuture<HttpResponse<T>> pushResponseCF = acceptor.cf(); |
439 CompletableFuture<HttpResponse<T>> pushResponseCF = acceptor.cf(); |