Home / Function/ SpdySynStreamFrame() — netty Function Reference

SpdySynStreamFrame() — netty Function Reference

Architecture documentation for the SpdySynStreamFrame() function in SpdyHttpEncoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9e19a607_95cc_5b52_189e_a5072a72aa56["SpdySynStreamFrame()"]
  18ed3381_f0b5_3753_fac7_fb58d0f9ddbb["SpdyHttpEncoder"]
  9e19a607_95cc_5b52_189e_a5072a72aa56 -->|defined in| 18ed3381_f0b5_3753_fac7_fb58d0f9ddbb
  4b3a9241_a033_6042_cea3_ac272e0a6928["isLast()"]
  9e19a607_95cc_5b52_189e_a5072a72aa56 -->|calls| 4b3a9241_a033_6042_cea3_ac272e0a6928
  style 9e19a607_95cc_5b52_189e_a5072a72aa56 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpEncoder.java lines 218–274

    @SuppressWarnings("deprecation")
    private SpdySynStreamFrame createSynStreamFrame(HttpRequest httpRequest) throws Exception {
        // Get the Stream-ID, Associated-To-Stream-ID, Priority, and scheme from the headers
        final HttpHeaders httpHeaders = httpRequest.headers();
        int streamId = httpHeaders.getInt(SpdyHttpHeaders.Names.STREAM_ID);
        int associatedToStreamId = httpHeaders.getInt(SpdyHttpHeaders.Names.ASSOCIATED_TO_STREAM_ID, 0);
        byte priority = (byte) httpHeaders.getInt(SpdyHttpHeaders.Names.PRIORITY, 0);
        CharSequence scheme = httpHeaders.get(SpdyHttpHeaders.Names.SCHEME);
        httpHeaders.remove(SpdyHttpHeaders.Names.STREAM_ID);
        httpHeaders.remove(SpdyHttpHeaders.Names.ASSOCIATED_TO_STREAM_ID);
        httpHeaders.remove(SpdyHttpHeaders.Names.PRIORITY);
        httpHeaders.remove(SpdyHttpHeaders.Names.SCHEME);

        // The Connection, Keep-Alive, Proxy-Connection, and Transfer-Encoding
        // headers are not valid and MUST not be sent.
        httpHeaders.remove(HttpHeaderNames.CONNECTION);
        httpHeaders.remove("Keep-Alive");
        httpHeaders.remove("Proxy-Connection");
        httpHeaders.remove(HttpHeaderNames.TRANSFER_ENCODING);

        SpdySynStreamFrame spdySynStreamFrame =
                new DefaultSpdySynStreamFrame(streamId, associatedToStreamId, priority, validateHeaders);

        // Unfold the first line of the message into name/value pairs
        SpdyHeaders frameHeaders = spdySynStreamFrame.headers();
        frameHeaders.set(SpdyHeaders.HttpNames.METHOD, httpRequest.method().name());
        frameHeaders.set(SpdyHeaders.HttpNames.PATH, httpRequest.uri());
        frameHeaders.set(SpdyHeaders.HttpNames.VERSION, httpRequest.protocolVersion().text());

        // Replace the HTTP host header with the SPDY host header
        CharSequence host = httpHeaders.get(HttpHeaderNames.HOST);
        httpHeaders.remove(HttpHeaderNames.HOST);
        frameHeaders.set(SpdyHeaders.HttpNames.HOST, host);

        // Set the SPDY scheme header
        if (scheme == null) {
            scheme = "https";
        }
        frameHeaders.set(SpdyHeaders.HttpNames.SCHEME, scheme);

        // Transfer the remaining HTTP headers
        Iterator<Entry<CharSequence, CharSequence>> itr = httpHeaders.iteratorCharSequence();
        while (itr.hasNext()) {
            Map.Entry<CharSequence, CharSequence> entry = itr.next();
            final CharSequence headerName =
                    headersToLowerCase ? AsciiString.of(entry.getKey()).toLowerCase() : entry.getKey();
            frameHeaders.add(headerName, entry.getValue());
        }
        currentStreamId = spdySynStreamFrame.streamId();
        if (associatedToStreamId == 0) {
            spdySynStreamFrame.setLast(isLast(httpRequest));
        } else {
            spdySynStreamFrame.setUnidirectional(true);
        }

        return spdySynStreamFrame;
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does SpdySynStreamFrame() do?
SpdySynStreamFrame() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpEncoder.java.
Where is SpdySynStreamFrame() defined?
SpdySynStreamFrame() is defined in codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpEncoder.java at line 218.
What does SpdySynStreamFrame() call?
SpdySynStreamFrame() calls 1 function(s): isLast.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free