/* * Copyright 2001-2022 The OpenSSL Project Authors. All Rights Reserved. * Copyright Siemens AG 2018-2020 * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */#include"internal/e_os.h"#include<stdio.h>#include<stdlib.h>#include"crypto/ctype.h"#include<string.h>#include<openssl/asn1.h>#include<openssl/evp.h>#include<openssl/err.h>#include<openssl/httperr.h>#include<openssl/cmperr.h>#include<openssl/buffer.h>#include<openssl/http.h>#include<openssl/trace.h>#include"internal/sockets.h"#include"internal/common.h" /* for ossl_assert() */#define HTTP_PREFIX "HTTP/"#define HTTP_VERSION_PATT "1." /* allow 1.x */#define HTTP_VERSION_STR_LEN sizeof(HTTP_VERSION_PATT) /* == strlen("1.0") */#define HTTP_PREFIX_VERSION HTTP_PREFIX""HTTP_VERSION_PATT#define HTTP_1_0 HTTP_PREFIX_VERSION"0" /* "HTTP/1.0" */#define HTTP_LINE1_MINLEN (sizeof(HTTP_PREFIX_VERSION "x 200\n") - 1)#define HTTP_VERSION_MAX_REDIRECTIONS 50#define HTTP_STATUS_CODE_OK 200#define HTTP_STATUS_CODE_MOVED_PERMANENTLY 301#define HTTP_STATUS_CODE_FOUND 302/* Stateful HTTP request code, supporting blocking and non-blocking I/O *//* Opaque HTTP request status structure */structossl_http_req_ctx_st