| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,7 @@ set(NGHTTP2_SOURCES | |||
| 14 | 14 | nghttp2_stream.c nghttp2_outbound_item.c | |
| 15 | 15 | nghttp2_session.c nghttp2_submit.c | |
| 16 | 16 | nghttp2_helper.c | |
| 17 | - nghttp2_npn.c | ||
| 17 | + nghttp2_alpn.c | ||
| 18 | 18 | nghttp2_hd.c nghttp2_hd_huffman.c nghttp2_hd_huffman_data.c | |
| 19 | 19 | nghttp2_version.c | |
| 20 | 20 | nghttp2_priority_spec.c | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,7 @@ OBJECTS = nghttp2_pq.c nghttp2_map.c nghttp2_queue.c \ | |||
| 41 | 41 | nghttp2_stream.c nghttp2_outbound_item.c \ | |
| 42 | 42 | nghttp2_session.c nghttp2_submit.c \ | |
| 43 | 43 | nghttp2_helper.c \ | |
| 44 | - nghttp2_npn.c \ | ||
| 44 | + nghttp2_alpn.c \ | ||
| 45 | 45 | nghttp2_hd.c nghttp2_hd_huffman.c nghttp2_hd_huffman_data.c \ | |
| 46 | 46 | nghttp2_version.c \ | |
| 47 | 47 | nghttp2_priority_spec.c \ | |
@@ -60,7 +60,7 @@ HFILES = nghttp2_pq.h nghttp2_int.h nghttp2_map.h nghttp2_queue.h \ | |||
| 60 | 60 | nghttp2_frame.h \ | |
| 61 | 61 | nghttp2_buf.h \ | |
| 62 | 62 | nghttp2_session.h nghttp2_helper.h nghttp2_stream.h nghttp2_int.h \ | |
| 63 | - nghttp2_npn.h \ | ||
| 63 | + nghttp2_alpn.h \ | ||
| 64 | 64 | nghttp2_submit.h nghttp2_outbound_item.h \ | |
| 65 | 65 | nghttp2_net.h \ | |
| 66 | 66 | nghttp2_hd.h nghttp2_hd_huffman.h \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -153,7 +153,7 @@ am__objects_1 = | |||
| 153 | 153 | am__objects_2 = nghttp2_pq.lo nghttp2_map.lo nghttp2_queue.lo \ | |
| 154 | 154 | nghttp2_frame.lo nghttp2_buf.lo nghttp2_stream.lo \ | |
| 155 | 155 | nghttp2_outbound_item.lo nghttp2_session.lo nghttp2_submit.lo \ | |
| 156 | - nghttp2_helper.lo nghttp2_npn.lo nghttp2_hd.lo \ | ||
| 156 | + nghttp2_helper.lo nghttp2_alpn.lo nghttp2_hd.lo \ | ||
| 157 | 157 | nghttp2_hd_huffman.lo nghttp2_hd_huffman_data.lo \ | |
| 158 | 158 | nghttp2_version.lo nghttp2_priority_spec.lo nghttp2_option.lo \ | |
| 159 | 159 | nghttp2_callbacks.lo nghttp2_mem.lo nghttp2_http.lo \ | |
@@ -183,15 +183,15 @@ am__v_at_1 = | |||
| 183 | 183 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | |
| 184 | 184 | depcomp = $(SHELL) $(top_srcdir)/depcomp | |
| 185 | 185 | am__maybe_remake_depfiles = depfiles | |
| 186 | - am__depfiles_remade = ./$(DEPDIR)/nghttp2_buf.Plo \ | ||
| 187 | - ./$(DEPDIR)/nghttp2_callbacks.Plo \ | ||
| 186 | + am__depfiles_remade = ./$(DEPDIR)/nghttp2_alpn.Plo \ | ||
| 187 | + ./$(DEPDIR)/nghttp2_buf.Plo ./$(DEPDIR)/nghttp2_callbacks.Plo \ | ||
| 188 | 188 | ./$(DEPDIR)/nghttp2_debug.Plo ./$(DEPDIR)/nghttp2_extpri.Plo \ | |
| 189 | 189 | ./$(DEPDIR)/nghttp2_frame.Plo ./$(DEPDIR)/nghttp2_hd.Plo \ | |
| 190 | 190 | ./$(DEPDIR)/nghttp2_hd_huffman.Plo \ | |
| 191 | 191 | ./$(DEPDIR)/nghttp2_hd_huffman_data.Plo \ | |
| 192 | 192 | ./$(DEPDIR)/nghttp2_helper.Plo ./$(DEPDIR)/nghttp2_http.Plo \ | |
| 193 | 193 | ./$(DEPDIR)/nghttp2_map.Plo ./$(DEPDIR)/nghttp2_mem.Plo \ | |
| 194 | - ./$(DEPDIR)/nghttp2_npn.Plo ./$(DEPDIR)/nghttp2_option.Plo \ | ||
| 194 | + ./$(DEPDIR)/nghttp2_option.Plo \ | ||
| 195 | 195 | ./$(DEPDIR)/nghttp2_outbound_item.Plo \ | |
| 196 | 196 | ./$(DEPDIR)/nghttp2_pq.Plo \ | |
| 197 | 197 | ./$(DEPDIR)/nghttp2_priority_spec.Plo \ | |
@@ -502,7 +502,7 @@ OBJECTS = nghttp2_pq.c nghttp2_map.c nghttp2_queue.c \ | |||
| 502 | 502 | nghttp2_stream.c nghttp2_outbound_item.c \ | |
| 503 | 503 | nghttp2_session.c nghttp2_submit.c \ | |
| 504 | 504 | nghttp2_helper.c \ | |
| 505 | - nghttp2_npn.c \ | ||
| 505 | + nghttp2_alpn.c \ | ||
| 506 | 506 | nghttp2_hd.c nghttp2_hd_huffman.c nghttp2_hd_huffman_data.c \ | |
| 507 | 507 | nghttp2_version.c \ | |
| 508 | 508 | nghttp2_priority_spec.c \ | |
@@ -521,7 +521,7 @@ HFILES = nghttp2_pq.h nghttp2_int.h nghttp2_map.h nghttp2_queue.h \ | |||
| 521 | 521 | nghttp2_frame.h \ | |
| 522 | 522 | nghttp2_buf.h \ | |
| 523 | 523 | nghttp2_session.h nghttp2_helper.h nghttp2_stream.h nghttp2_int.h \ | |
| 524 | - nghttp2_npn.h \ | ||
| 524 | + nghttp2_alpn.h \ | ||
| 525 | 525 | nghttp2_submit.h nghttp2_outbound_item.h \ | |
| 526 | 526 | nghttp2_net.h \ | |
| 527 | 527 | nghttp2_hd.h nghttp2_hd_huffman.h \ | |
@@ -621,6 +621,7 @@ mostlyclean-compile: | |||
| 621 | 621 | distclean-compile: | |
| 622 | 622 | -rm -f *.tab.c | |
| 623 | 623 | ||
| 624 | + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_alpn.Plo@am__quote@ # am--include-marker | ||
| 624 | 625 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_buf.Plo@am__quote@ # am--include-marker | |
| 625 | 626 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_callbacks.Plo@am__quote@ # am--include-marker | |
| 626 | 627 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_debug.Plo@am__quote@ # am--include-marker | |
@@ -633,7 +634,6 @@ distclean-compile: | |||
| 633 | 634 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_http.Plo@am__quote@ # am--include-marker | |
| 634 | 635 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_map.Plo@am__quote@ # am--include-marker | |
| 635 | 636 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_mem.Plo@am__quote@ # am--include-marker | |
| 636 | - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_npn.Plo@am__quote@ # am--include-marker | ||
| 637 | 637 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_option.Plo@am__quote@ # am--include-marker | |
| 638 | 638 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_outbound_item.Plo@am__quote@ # am--include-marker | |
| 639 | 639 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nghttp2_pq.Plo@am__quote@ # am--include-marker | |
@@ -906,7 +906,8 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ | |||
| 906 | 906 | mostlyclean-am | |
| 907 | 907 | ||
| 908 | 908 | distclean: distclean-recursive | |
| 909 | - -rm -f ./$(DEPDIR)/nghttp2_buf.Plo | ||
| 909 | + -rm -f ./$(DEPDIR)/nghttp2_alpn.Plo | ||
| 910 | + -rm -f ./$(DEPDIR)/nghttp2_buf.Plo | ||
| 910 | 911 | -rm -f ./$(DEPDIR)/nghttp2_callbacks.Plo | |
| 911 | 912 | -rm -f ./$(DEPDIR)/nghttp2_debug.Plo | |
| 912 | 913 | -rm -f ./$(DEPDIR)/nghttp2_extpri.Plo | |
@@ -918,7 +919,6 @@ distclean: distclean-recursive | |||
| 918 | 919 | -rm -f ./$(DEPDIR)/nghttp2_http.Plo | |
| 919 | 920 | -rm -f ./$(DEPDIR)/nghttp2_map.Plo | |
| 920 | 921 | -rm -f ./$(DEPDIR)/nghttp2_mem.Plo | |
| 921 | - -rm -f ./$(DEPDIR)/nghttp2_npn.Plo | ||
| 922 | 922 | -rm -f ./$(DEPDIR)/nghttp2_option.Plo | |
| 923 | 923 | -rm -f ./$(DEPDIR)/nghttp2_outbound_item.Plo | |
| 924 | 924 | -rm -f ./$(DEPDIR)/nghttp2_pq.Plo | |
@@ -977,7 +977,8 @@ install-ps-am: | |||
| 977 | 977 | installcheck-am: | |
| 978 | 978 | ||
| 979 | 979 | maintainer-clean: maintainer-clean-recursive | |
| 980 | - -rm -f ./$(DEPDIR)/nghttp2_buf.Plo | ||
| 980 | + -rm -f ./$(DEPDIR)/nghttp2_alpn.Plo | ||
| 981 | + -rm -f ./$(DEPDIR)/nghttp2_buf.Plo | ||
| 981 | 982 | -rm -f ./$(DEPDIR)/nghttp2_callbacks.Plo | |
| 982 | 983 | -rm -f ./$(DEPDIR)/nghttp2_debug.Plo | |
| 983 | 984 | -rm -f ./$(DEPDIR)/nghttp2_extpri.Plo | |
@@ -989,7 +990,6 @@ maintainer-clean: maintainer-clean-recursive | |||
| 989 | 990 | -rm -f ./$(DEPDIR)/nghttp2_http.Plo | |
| 990 | 991 | -rm -f ./$(DEPDIR)/nghttp2_map.Plo | |
| 991 | 992 | -rm -f ./$(DEPDIR)/nghttp2_mem.Plo | |
| 992 | - -rm -f ./$(DEPDIR)/nghttp2_npn.Plo | ||
| 993 | 993 | -rm -f ./$(DEPDIR)/nghttp2_option.Plo | |
| 994 | 994 | -rm -f ./$(DEPDIR)/nghttp2_outbound_item.Plo | |
| 995 | 995 | -rm -f ./$(DEPDIR)/nghttp2_pq.Plo | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -74,7 +74,7 @@ NGHTTP2_SRC := nghttp2_pq.c \ | |||
| 74 | 74 | nghttp2_session.c \ | |
| 75 | 75 | nghttp2_submit.c \ | |
| 76 | 76 | nghttp2_helper.c \ | |
| 77 | - nghttp2_npn.c \ | ||
| 77 | + nghttp2_alpn.c \ | ||
| 78 | 78 | nghttp2_hd.c \ | |
| 79 | 79 | nghttp2_hd_huffman.c \ | |
| 80 | 80 | nghttp2_hd_huffman_data.c \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1997,7 +1997,7 @@ typedef int (*nghttp2_on_extension_chunk_recv_callback)( | |||
| 1997 | 1997 | * ``NULL``. The |*payload| is available as ``frame->ext.payload`` in | |
| 1998 | 1998 | * :type:`nghttp2_on_frame_recv_callback`. Therefore if application | |
| 1999 | 1999 | * can free that memory inside :type:`nghttp2_on_frame_recv_callback` | |
| 2000 | - * callback. Of course, application has a liberty not ot use | ||
| 2000 | + * callback. Of course, application has a liberty not to use | ||
| 2001 | 2001 | * |*payload|, and do its own mechanism to process extension frames. | |
| 2002 | 2002 | * | |
| 2003 | 2003 | * To abort processing this extension frame, return | |
@@ -4958,6 +4958,55 @@ NGHTTP2_EXTERN int nghttp2_session_change_extpri_stream_priority( | |||
| 4958 | 4958 | nghttp2_session *session, int32_t stream_id, const nghttp2_extpri *extpri, | |
| 4959 | 4959 | int ignore_client_signal); | |
| 4960 | 4960 | ||
| 4961 | + /** | ||
| 4962 | + * @function | ||
| 4963 | + * | ||
| 4964 | + * Stores the stream priority of the existing stream denoted by | ||
| 4965 | + * |stream_id| in the object pointed by |extpri|. This function is | ||
| 4966 | + * meant to be used by server for :rfc:`9218` extensible | ||
| 4967 | + * prioritization scheme. | ||
| 4968 | + * | ||
| 4969 | + * If |session| is initialized as client, this function returns | ||
| 4970 | + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`. | ||
| 4971 | + * | ||
| 4972 | + * If | ||
| 4973 | + * :enum:`nghttp2_settings_id.NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES` | ||
| 4974 | + * of value of 1 is not submitted via `nghttp2_submit_settings()`, | ||
| 4975 | + * this function does nothing and returns 0. | ||
| 4976 | + * | ||
| 4977 | + * This function returns 0 if it succeeds, or one of the following | ||
| 4978 | + * negative error codes: | ||
| 4979 | + * | ||
| 4980 | + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` | ||
| 4981 | + * The |session| is initialized as client. | ||
| 4982 | + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` | ||
| 4983 | + * |stream_id| is zero; or a stream denoted by |stream_id| is not | ||
| 4984 | + * found. | ||
| 4985 | + */ | ||
| 4986 | + NGHTTP2_EXTERN int nghttp2_session_get_extpri_stream_priority( | ||
| 4987 | + nghttp2_session *session, nghttp2_extpri *extpri, int32_t stream_id); | ||
| 4988 | + | ||
| 4989 | + /** | ||
| 4990 | + * @function | ||
| 4991 | + * | ||
| 4992 | + * Parses Priority header field value pointed by |value| of length | ||
| 4993 | + * |len|, and stores the result in the object pointed by |extpri|. | ||
| 4994 | + * Priority header field is defined in :rfc:`9218`. | ||
| 4995 | + * | ||
| 4996 | + * This function does not initialize the object pointed by |extpri| | ||
| 4997 | + * before storing the result. It only assigns the values that the | ||
| 4998 | + * parser correctly extracted to fields. | ||
| 4999 | + * | ||
| 5000 | + * This function returns 0 if it succeeds, or one of the following | ||
| 5001 | + * negative error codes: | ||
| 5002 | + * | ||
| 5003 | + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` | ||
| 5004 | + * Failed to parse the header field value. | ||
| 5005 | + */ | ||
| 5006 | + NGHTTP2_EXTERN int nghttp2_extpri_parse_priority(nghttp2_extpri *extpri, | ||
| 5007 | + const uint8_t *value, | ||
| 5008 | + size_t len); | ||
| 5009 | + | ||
| 4961 | 5010 | /** | |
| 4962 | 5011 | * @function | |
| 4963 | 5012 | * | |
@@ -4973,11 +5022,14 @@ NGHTTP2_EXTERN int nghttp2_nv_compare_name(const nghttp2_nv *lhs, | |||
| 4973 | 5022 | /** | |
| 4974 | 5023 | * @function | |
| 4975 | 5024 | * | |
| 4976 | - * A helper function for dealing with NPN in client side or ALPN in | ||
| 4977 | - * server side. The |in| contains peer's protocol list in preferable | ||
| 4978 | - * order. The format of |in| is length-prefixed and not | ||
| 4979 | - * null-terminated. For example, ``h2`` and | ||
| 4980 | - * ``http/1.1`` stored in |in| like this:: | ||
| 5025 | + * .. warning:: | ||
| 5026 | + * | ||
| 5027 | + * Deprecated. Use `nghttp2_select_alpn` instead. | ||
| 5028 | + * | ||
| 5029 | + * A helper function for dealing with ALPN in server side. The |in| | ||
| 5030 | + * contains peer's protocol list in preferable order. The format of | ||
| 5031 | + * |in| is length-prefixed and not null-terminated. For example, | ||
| 5032 | + * ``h2`` and ``http/1.1`` stored in |in| like this:: | ||
| 4981 | 5033 | * | |
| 4982 | 5034 | * in[0] = 2 | |
| 4983 | 5035 | * in[1..2] = "h2" | |
@@ -5002,20 +5054,18 @@ NGHTTP2_EXTERN int nghttp2_nv_compare_name(const nghttp2_nv *lhs, | |||
| 5002 | 5054 | * | |
| 5003 | 5055 | * For ALPN, refer to https://tools.ietf.org/html/rfc7301 | |
| 5004 | 5056 | * | |
| 5005 | - * See http://technotes.googlecode.com/git/nextprotoneg.html for more | ||
| 5006 | - * details about NPN. | ||
| 5007 | - * | ||
| 5008 | - * For NPN, to use this method you should do something like:: | ||
| 5057 | + * To use this method you should do something like:: | ||
| 5009 | 5058 | * | |
| 5010 | - * static int select_next_proto_cb(SSL* ssl, | ||
| 5011 | - * unsigned char **out, | ||
| 5059 | + * static int alpn_select_proto_cb(SSL* ssl, | ||
| 5060 | + * const unsigned char **out, | ||
| 5012 | 5061 | * unsigned char *outlen, | |
| 5013 | 5062 | * const unsigned char *in, | |
| 5014 | 5063 | * unsigned int inlen, | |
| 5015 | 5064 | * void *arg) | |
| 5016 | 5065 | * { | |
| 5017 | 5066 | * int rv; | |
| 5018 | - * rv = nghttp2_select_next_protocol(out, outlen, in, inlen); | ||
| 5067 | + * rv = nghttp2_select_next_protocol((unsigned char**)out, outlen, | ||
| 5068 | + * in, inlen); | ||
| 5019 | 5069 | * if (rv == -1) { | |
| 5020 | 5070 | * return SSL_TLSEXT_ERR_NOACK; | |
| 5021 | 5071 | * } | |
@@ -5025,14 +5075,73 @@ NGHTTP2_EXTERN int nghttp2_nv_compare_name(const nghttp2_nv *lhs, | |||
| 5025 | 5075 | * return SSL_TLSEXT_ERR_OK; | |
| 5026 | 5076 | * } | |
| 5027 | 5077 | * ... | |
| 5028 | - * SSL_CTX_set_next_proto_select_cb(ssl_ctx, select_next_proto_cb, my_obj); | ||
| 5078 | + * SSL_CTX_set_alpn_select_cb(ssl_ctx, alpn_select_proto_cb, my_obj); | ||
| 5029 | 5079 | * | |
| 5030 | 5080 | */ | |
| 5031 | 5081 | NGHTTP2_EXTERN int nghttp2_select_next_protocol(unsigned char **out, | |
| 5032 | 5082 | unsigned char *outlen, | |
| 5033 | 5083 | const unsigned char *in, | |
| 5034 | 5084 | unsigned int inlen); | |
| 5035 | 5085 | ||
| 5086 | + /** | ||
| 5087 | + * @function | ||
| 5088 | + * | ||
| 5089 | + * A helper function for dealing with ALPN in server side. The |in| | ||
| 5090 | + * contains peer's protocol list in preferable order. The format of | ||
| 5091 | + * |in| is length-prefixed and not null-terminated. For example, | ||
| 5092 | + * ``h2`` and ``http/1.1`` stored in |in| like this:: | ||
| 5093 | + * | ||
| 5094 | + * in[0] = 2 | ||
| 5095 | + * in[1..2] = "h2" | ||
| 5096 | + * in[3] = 8 | ||
| 5097 | + * in[4..11] = "http/1.1" | ||
| 5098 | + * inlen = 12 | ||
| 5099 | + * | ||
| 5100 | + * The selection algorithm is as follows: | ||
| 5101 | + * | ||
| 5102 | + * 1. If peer's list contains HTTP/2 protocol the library supports, | ||
| 5103 | + * it is selected and returns 1. The following step is not taken. | ||
| 5104 | + * | ||
| 5105 | + * 2. If peer's list contains ``http/1.1``, this function selects | ||
| 5106 | + * ``http/1.1`` and returns 0. The following step is not taken. | ||
| 5107 | + * | ||
| 5108 | + * 3. This function selects nothing and returns -1 (So called | ||
| 5109 | + * non-overlap case). In this case, |out| and |outlen| are left | ||
| 5110 | + * untouched. | ||
| 5111 | + * | ||
| 5112 | + * Selecting ``h2`` means that ``h2`` is written into |*out| and its | ||
| 5113 | + * length (which is 2) is assigned to |*outlen|. | ||
| 5114 | + * | ||
| 5115 | + * For ALPN, refer to https://tools.ietf.org/html/rfc7301 | ||
| 5116 | + * | ||
| 5117 | + * To use this method you should do something like:: | ||
| 5118 | + * | ||
| 5119 | + * static int alpn_select_proto_cb(SSL* ssl, | ||
| 5120 | + * const unsigned char **out, | ||
| 5121 | + * unsigned char *outlen, | ||
| 5122 | + * const unsigned char *in, | ||
| 5123 | + * unsigned int inlen, | ||
| 5124 | + * void *arg) | ||
| 5125 | + * { | ||
| 5126 | + * int rv; | ||
| 5127 | + * rv = nghttp2_select_alpn(out, outlen, in, inlen); | ||
| 5128 | + * if (rv == -1) { | ||
| 5129 | + * return SSL_TLSEXT_ERR_NOACK; | ||
| 5130 | + * } | ||
| 5131 | + * if (rv == 1) { | ||
| 5132 | + * ((MyType*)arg)->http2_selected = 1; | ||
| 5133 | + * } | ||
| 5134 | + * return SSL_TLSEXT_ERR_OK; | ||
| 5135 | + * } | ||
| 5136 | + * ... | ||
| 5137 | + * SSL_CTX_set_alpn_select_cb(ssl_ctx, alpn_select_proto_cb, my_obj); | ||
| 5138 | + * | ||
| 5139 | + */ | ||
| 5140 | + NGHTTP2_EXTERN int nghttp2_select_alpn(const unsigned char **out, | ||
| 5141 | + unsigned char *outlen, | ||
| 5142 | + const unsigned char *in, | ||
| 5143 | + unsigned int inlen); | ||
| 5144 | + | ||
| 5036 | 5145 | /** | |
| 5037 | 5146 | * @function | |
| 5038 | 5147 | * | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,14 +29,14 @@ | |||
| 29 | 29 | * @macro | |
| 30 | 30 | * Version number of the nghttp2 library release | |
| 31 | 31 | */ | |
| 32 | - #define NGHTTP2_VERSION "1.58.0" | ||
| 32 | + #define NGHTTP2_VERSION "1.59.0" | ||
| 33 | 33 | ||
| 34 | 34 | /** | |
| 35 | 35 | * @macro | |
| 36 | 36 | * Numerical representation of the version number of the nghttp2 library | |
| 37 | 37 | * release. This is a 24 bit number with 8 bits for major number, 8 bits | |
| 38 | 38 | * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. | |
| 39 | 39 | */ | |
| 40 | - #define NGHTTP2_VERSION_NUM 0x013a00 | ||
| 40 | + #define NGHTTP2_VERSION_NUM 0x013b00 | ||
| 41 | 41 | ||
| 42 | 42 | #endif /* NGHTTP2VER_H */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,13 +22,13 @@ | |||
| 22 | 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
| 23 | 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 24 | 24 | */ | |
| 25 | - #include "nghttp2_npn.h" | ||
| 25 | + #include "nghttp2_alpn.h" | ||
| 26 | 26 | ||
| 27 | 27 | #include <string.h> | |
| 28 | 28 | ||
| 29 | - static int select_next_protocol(unsigned char **out, unsigned char *outlen, | ||
| 30 | - const unsigned char *in, unsigned int inlen, | ||
| 31 | - const char *key, unsigned int keylen) { | ||
| 29 | + static int select_alpn(const unsigned char **out, unsigned char *outlen, | ||
| 30 | + const unsigned char *in, unsigned int inlen, | ||
| 31 | + const char *key, unsigned int keylen) { | ||
| 32 | 32 | unsigned int i; | |
| 33 | 33 | for (i = 0; i + keylen <= inlen; i += (unsigned int)(in[i] + 1)) { | |
| 34 | 34 | if (memcmp(&in[i], key, keylen) == 0) { | |
@@ -45,12 +45,25 @@ static int select_next_protocol(unsigned char **out, unsigned char *outlen, | |||
| 45 | 45 | ||
| 46 | 46 | int nghttp2_select_next_protocol(unsigned char **out, unsigned char *outlen, | |
| 47 | 47 | const unsigned char *in, unsigned int inlen) { | |
| 48 | - if (select_next_protocol(out, outlen, in, inlen, NGHTTP2_PROTO_ALPN, | ||
| 49 | - NGHTTP2_PROTO_ALPN_LEN) == 0) { | ||
| 48 | + if (select_alpn((const unsigned char **)out, outlen, in, inlen, | ||
| 49 | + NGHTTP2_PROTO_ALPN, NGHTTP2_PROTO_ALPN_LEN) == 0) { | ||
| 50 | 50 | return 1; | |
| 51 | 51 | } | |
| 52 | - if (select_next_protocol(out, outlen, in, inlen, NGHTTP2_HTTP_1_1_ALPN, | ||
| 53 | - NGHTTP2_HTTP_1_1_ALPN_LEN) == 0) { | ||
| 52 | + if (select_alpn((const unsigned char **)out, outlen, in, inlen, | ||
| 53 | + NGHTTP2_HTTP_1_1_ALPN, NGHTTP2_HTTP_1_1_ALPN_LEN) == 0) { | ||
| 54 | + return 0; | ||
| 55 | + } | ||
| 56 | + return -1; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + int nghttp2_select_alpn(const unsigned char **out, unsigned char *outlen, | ||
| 60 | + const unsigned char *in, unsigned int inlen) { | ||
| 61 | + if (select_alpn(out, outlen, in, inlen, NGHTTP2_PROTO_ALPN, | ||
| 62 | + NGHTTP2_PROTO_ALPN_LEN) == 0) { | ||
| 63 | + return 1; | ||
| 64 | + } | ||
| 65 | + if (select_alpn(out, outlen, in, inlen, NGHTTP2_HTTP_1_1_ALPN, | ||
| 66 | + NGHTTP2_HTTP_1_1_ALPN_LEN) == 0) { | ||
| 54 | 67 | return 0; | |
| 55 | 68 | } | |
| 56 | 69 | return -1; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments