MCPcopy
hub / github.com/NanoHttpd/nanohttpd / HTTPSession

Class HTTPSession

core/src/main/java/fi/iki/elonen/NanoHTTPD.java:603–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601 }
602
603 protected class HTTPSession implements IHTTPSession {
604
605 private static final int REQUEST_BUFFER_LEN = 512;
606
607 private static final int MEMORY_STORE_LIMIT = 1024;
608
609 public static final int BUFSIZE = 8192;
610
611 public static final int MAX_HEADER_SIZE = 1024;
612
613 private final TempFileManager tempFileManager;
614
615 private final OutputStream outputStream;
616
617 private final BufferedInputStream inputStream;
618
619 private int splitbyte;
620
621 private int rlen;
622
623 private String uri;
624
625 private Method method;
626
627 private Map<String, List<String>> parms;
628
629 private Map<String, String> headers;
630
631 private CookieHandler cookies;
632
633 private String queryParameterString;
634
635 private String remoteIp;
636
637 private String remoteHostname;
638
639 private String protocolVersion;
640
641 public HTTPSession(TempFileManager tempFileManager, InputStream inputStream, OutputStream outputStream) {
642 this.tempFileManager = tempFileManager;
643 this.inputStream = new BufferedInputStream(inputStream, HTTPSession.BUFSIZE);
644 this.outputStream = outputStream;
645 }
646
647 public HTTPSession(TempFileManager tempFileManager, InputStream inputStream, OutputStream outputStream, InetAddress inetAddress) {
648 this.tempFileManager = tempFileManager;
649 this.inputStream = new BufferedInputStream(inputStream, HTTPSession.BUFSIZE);
650 this.outputStream = outputStream;
651 this.remoteIp = inetAddress.isLoopbackAddress() || inetAddress.isAnyLocalAddress() ? "127.0.0.1" : inetAddress.getHostAddress().toString();
652 this.remoteHostname = inetAddress.isLoopbackAddress() || inetAddress.isAnyLocalAddress() ? "localhost" : inetAddress.getHostName().toString();
653 this.headers = new HashMap<String, String>();
654 }
655
656 /**
657 * Decodes the sent headers and loads the data into Key/value pairs
658 */
659 private void decodeHeader(BufferedReader in, Map<String, String> pre, Map<String, List<String>> parms, Map<String, String> headers) throws ResponseException {
660 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…