<commit_before>
using System;
using System.IO;


namespace HttpParser {

	public class HttpParser {

		private ParserType type;

		private int http_major;
		private int http_minor;
		private int status_code;
		private HttpMethod method;

		/* true  = Upgrade header was present and the parser has exited because of that.
		 * false = No upgrade header present.
		 * Should be checked when http_parser_execute() returns in addition to
		 * error checking.
		 */
		protected bool upgrade; 

		public HttpParser () : this (ParserType.HTTP_BOTH)
		{
		}

		public HttpParser (ParserType type)
		{
			this.type = type;

			switch (type) {
			case ParserType.HTTP_REQUEST:
				this.state = State.start_req;
				break;
			case ParserType.HTTP_RESPONSE:
				this.state = State.start_res;
				break;
			case ParserType.HTTP_BOTH:
				this.state = State.start_res_or_res;
				break;
			default:
				throw new HttpException ("can't happen, invalid ParserType enum");
			}
		}

		public int Major {
			get { return http_major; }
		}

		public int Minor {
			get { return http_minor; }
		}

		public int StatusCode {
			get { return status_code; }
		}

		public HttpMethod HttpMethod {
			get { return method; }
		}<commit_msg>Add an accessor for the strict flag.<commit_after>
using System;
using System.IO;


namespace HttpParser {

	public class HttpParser {

		private ParserType type;

		private int http_major;
		private int http_minor;
		private int status_code;
		private HttpMethod method;

		/* true  = Upgrade header was present and the parser has exited because of that.
		 * false = No upgrade header present.
		 * Should be checked when http_parser_execute() returns in addition to
		 * error checking.
		 */
		protected bool upgrade; 

		public HttpParser () : this (ParserType.HTTP_BOTH)
		{
		}

		public HttpParser (ParserType type)
		{
			this.type = type;

			switch (type) {
			case ParserType.HTTP_REQUEST:
				this.state = State.start_req;
				break;
			case ParserType.HTTP_RESPONSE:
				this.state = State.start_res;
				break;
			case ParserType.HTTP_BOTH:
				this.state = State.start_res_or_res;
				break;
			default:
				throw new HttpException ("can't happen, invalid ParserType enum");
			}
		}

		public bool Strict {
			get { return strict; }
			set { strict = value; }
		}

		public int Major {
			get { return http_major; }
		}

		public int Minor {
			get { return http_minor; }
		}

		public int StatusCode {
			get { return status_code; }
		}

		public HttpMethod HttpMethod {
			get { return method; }
		}
{'fraction_non_alphanumeric': 0.07977883096366509, 'fraction_numerical': 0.0, 'mean_word_length': 2.976452119309262, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2461879', 'n_tokens_mistral': 968, 'n_tokens_neox': 779, 'n_words': 249}