ok2c commented on code in PR #617:
URL: 
https://github.com/apache/httpcomponents-core/pull/617#discussion_r2812067656


##########
httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractH2StreamMultiplexer.java:
##########
@@ -1029,9 +1029,13 @@ private void consumeFrame(final RawFrame frame) throws 
HttpException, IOExceptio
                 } else {
                     field = "";
                 }
-                final PriorityValue pv = 
PriorityParamsParser.parse(field).toValueWithDefaults();
-                priorities.put(prioritizedId, pv);
-                requestSessionOutput();
+                final PriorityValue pv = parsePriorityValue(field);
+                if (pv != null) {
+                    final H2Stream prioritizedStream = 
streams.lookup(prioritizedId);

Review Comment:
   @arturobernalg Why are we ignoring `prioritizedId` that produce no match? 
Should we at least reject ids that have never been seen?



##########
httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractH2StreamMultiplexer.java:
##########
@@ -1378,19 +1382,43 @@ H2Stream createStream(final H2StreamChannel channel, 
final H2StreamHandler strea
         return stream;
     }
 
-    private void recordPriorityFromHeaders(final int streamId, final List<? 
extends Header> headers) {
+    private void recordPriorityFromHeaders(final H2Stream stream, final List<? 
extends Header> headers) {
         if (headers == null || headers.isEmpty()) {
             return;
         }
         for (final Header h : headers) {
             if (HttpHeaders.PRIORITY.equalsIgnoreCase(h.getName())) {
-                final PriorityValue pv = 
PriorityParamsParser.parse(h.getValue()).toValueWithDefaults();
-                priorities.put(streamId, pv);
+                final PriorityValue pv = parsePriorityValue(h);
+                if (pv != null) {
+                    stream.setPriorityValue(pv);
+                }
                 break;
             }
         }
     }
 
+    private PriorityValue parsePriorityValue(final Header header) {
+        if (header == null) {
+            return null;
+        }
+        try {
+            return PriorityParamsParser.parse(header).toValueWithDefaults();
+        } catch (final IllegalArgumentException ignore) {

Review Comment:
   @arturobernalg Does the parser throw `IllegalArgumentException`, like, ever?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to