You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "zrlw (via GitHub)" <gi...@apache.org> on 2025/06/07 02:44:15 UTC

Re: [PR] [3.3] Wait for connection preface from http2 server [dubbo]

zrlw commented on PR #15368:
URL: https://github.com/apache/dubbo/pull/15368#issuecomment-2951511953

   refer to okhttp:
   ```
   Http2.java
     static final ByteString CONNECTION_PREFACE
         = ByteString.encodeUtf8("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n");
   
   Http2Reader.java
     public void readConnectionPreface(Handler handler) throws IOException {
       if (client) {
         // The client reads the initial SETTINGS frame.
         if (!nextFrame(true, handler)) {
           throw ioException("Required SETTINGS preface not received");
         }
       } else {
         // The server reads the CONNECTION_PREFACE byte string.
         ByteString connectionPreface = source.readByteString(CONNECTION_PREFACE.size());
         if (logger.isLoggable(FINE)) logger.fine(format("<< CONNECTION %s", connectionPreface.hex()));
         if (!CONNECTION_PREFACE.equals(connectionPreface)) {
           throw ioException("Expected a connection header but was %s", connectionPreface.utf8());
         }
       }
     }
   ```


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org