Compare commits

..

No commits in common. "rawhide" and "f15" have entirely different histories.
rawhide ... f15

7 changed files with 221 additions and 273 deletions

14
.gitignore vendored
View File

@ -1,15 +1 @@
/http-parser.tar.gz
/ry-http-parser-v1.0-0-g32c0e11.tar.gz
/joyent-http-parser-v2.0-0-g3fb4e06.tar.gz
/joyent-http-parser-v2.0-5-g245f6f0.tar.gz
/joyent-http-parser-v2.0-7-gcd01361.tar.gz
/v2.6.0.tar.gz
/v2.7.1.tar.gz
/http-parser-2.7.1.tar.gz
/http-parser-2.8.0.tar.gz
/http-parser-2.8.1.tar.gz
/http-parser-2.9.0.tar.gz
/http-parser-2.9.1.tar.gz
/http-parser-2.9.2.tar.gz
/http-parser-2.9.3.tar.gz
/http-parser-2.9.4.tar.gz

View File

@ -0,0 +1,106 @@
From d56a0700d0d9ccad427995e3da88856a96d2a455 Mon Sep 17 00:00:00 2001
From: Nathan Rajlich <nathan@tootallnate.net>
Date: Tue, 12 Oct 2010 11:23:22 -0700
Subject: [PATCH 1/2] Add support for "M-SEARCH" and "NOTIFY" request methods.
Allow a request path of "*" (for SSDP requests).
---
http_parser.c | 9 +++++++--
http_parser.h | 3 +++
test.c | 25 +++++++++++++++++++++++++
3 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/http_parser.c b/http_parser.c
index 492ef17..57a1b94 100644
--- a/http_parser.c
+++ b/http_parser.c
@@ -93,6 +93,8 @@ static const char *method_strings[] =
, "MKACTIVITY"
, "CHECKOUT"
, "MERGE"
+ , "M-SEARCH"
+ , "NOTIFY"
};
@@ -575,7 +577,8 @@ size_t http_parser_execute (http_parser *parser,
case 'G': parser->method = HTTP_GET; break;
case 'H': parser->method = HTTP_HEAD; break;
case 'L': parser->method = HTTP_LOCK; break;
- case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE */ break;
+ case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH */ break;
+ case 'N': parser->method = HTTP_NOTIFY; break;
case 'O': parser->method = HTTP_OPTIONS; break;
case 'P': parser->method = HTTP_POST; /* or PROPFIND or PROPPATCH or PUT */ break;
case 'R': parser->method = HTTP_REPORT; break;
@@ -608,6 +611,8 @@ size_t http_parser_execute (http_parser *parser,
parser->method = HTTP_MOVE;
} else if (index == 1 && ch == 'E') {
parser->method = HTTP_MERGE;
+ } else if (index == 1 && ch == '-') {
+ parser->method = HTTP_MSEARCH;
} else if (index == 2 && ch == 'A') {
parser->method = HTTP_MKACTIVITY;
}
@@ -628,7 +633,7 @@ size_t http_parser_execute (http_parser *parser,
{
if (ch == ' ') break;
- if (ch == '/') {
+ if (ch == '/' || ch == '*') {
MARK(url);
MARK(path);
state = s_req_path;
diff --git a/http_parser.h b/http_parser.h
index ca7f562..43cc1bd 100644
--- a/http_parser.h
+++ b/http_parser.h
@@ -101,6 +101,9 @@ enum http_method
, HTTP_MKACTIVITY
, HTTP_CHECKOUT
, HTTP_MERGE
+ /* ssdp */
+ , HTTP_MSEARCH
+ , HTTP_NOTIFY
};
diff --git a/test.c b/test.c
index d1feae0..e5699aa 100644
--- a/test.c
+++ b/test.c
@@ -557,6 +557,31 @@ const struct message requests[] =
,.body= ""
}
+#define MSEARCH_REQ 19
+, {.name= "m-search request"
+ ,.type= HTTP_REQUEST
+ ,.raw= "M-SEARCH * HTTP/1.1\r\n"
+ "HOST: 239.255.255.250:1900\r\n"
+ "MAN: \"ssdp:discover\"\r\n"
+ "ST: \"ssdp:all\"\r\n"
+ "\r\n"
+ ,.should_keep_alive= TRUE
+ ,.message_complete_on_eof= FALSE
+ ,.http_major= 1
+ ,.http_minor= 1
+ ,.method= HTTP_MSEARCH
+ ,.query_string= ""
+ ,.fragment= ""
+ ,.request_path= "*"
+ ,.request_url= "*"
+ ,.num_headers= 3
+ ,.headers= { { "HOST", "239.255.255.250:1900" }
+ , { "MAN", "\"ssdp:discover\"" }
+ , { "ST", "\"ssdp:all\"" }
+ }
+ ,.body= ""
+ }
+
, {.name= NULL } /* sentinel */
};
--
1.7.3.4

View File

@ -1,79 +0,0 @@
From d1bb7a564e0f92ef2081d3af8b4b7f85a307c38f Mon Sep 17 00:00:00 2001
From: Edward Thomson <ethomson@edwardthomson.com>
Date: Fri, 14 Jun 2019 17:37:22 +0100
Subject: [PATCH] url: treat empty port as default
When parsing URLs, treat an empty port (eg `http://hostname:/`) as if it
were unspecified. RFC 3986 says:
> URI producers and normalizers SHOULD omit the port component and its
> ":" delimiter if port is empty or if its value would be the same as
> that of the scheme's default.
(Emphasis on the "SHOULD" is mine.) This indicates that URIs MAY be
produced with an empty port and the `:` delimiter.
Thus, we stop failing if we end host parsing at the port delimiter.
---
http_parser.c | 1 -
test.c | 25 +++++++++++++++++++------
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/http_parser.c b/http_parser.c
index 4896385..7e268d8 100644
--- a/http_parser.c
+++ b/http_parser.c
@@ -2326,7 +2326,6 @@ http_parse_host(const char * buf, struct http_parser_url *u, int found_at) {
case s_http_host_v6:
case s_http_host_v6_zone_start:
case s_http_host_v6_zone:
- case s_http_host_port_start:
case s_http_userinfo:
case s_http_userinfo_start:
return 1;
diff --git a/test.c b/test.c
index 0140a18..54eca61 100644
--- a/test.c
+++ b/test.c
@@ -2825,6 +2825,25 @@ const struct url_test url_tests[] =
,.rv=0
}
+, {.name="proxy empty port"
+ ,.url="http://hostname:/"
+ ,.is_connect=0
+ ,.u=
+ {.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PATH)
+ ,.port=0
+ ,.field_data=
+ {{ 0, 4 } /* UF_SCHEMA */
+ ,{ 7, 8 } /* UF_HOST */
+ ,{ 0, 0 } /* UF_PORT */
+ ,{ 16, 1 } /* UF_PATH */
+ ,{ 0, 0 } /* UF_QUERY */
+ ,{ 0, 0 } /* UF_FRAGMENT */
+ ,{ 0, 0 } /* UF_USERINFO */
+ }
+ }
+ ,.rv=0
+ }
+
, {.name="CONNECT request"
,.url="hostname:443"
,.is_connect=1
@@ -3059,12 +3078,6 @@ const struct url_test url_tests[] =
,.rv=1
}
-, {.name="proxy empty port"
- ,.url="http://hostname:/"
- ,.is_connect=0
- ,.rv=1
- }
-
, {.name="CONNECT with basic auth"
,.url="a:b@hostname:443"
,.is_connect=1
--
2.25.1

View File

@ -0,0 +1,63 @@
From f825b52b7f2d4bf86c3300ae33ceb3dd1fa64571 Mon Sep 17 00:00:00 2001
From: Nathan Rajlich <nathan@tootallnate.net>
Date: Tue, 12 Oct 2010 14:09:34 -0700
Subject: [PATCH 2/2] Added support for "SUBSCRIBE" and "UNSUBSCRIBE" request methods.
---
http_parser.c | 7 ++++++-
http_parser.h | 4 +++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/http_parser.c b/http_parser.c
index 57a1b94..5a0972a 100644
--- a/http_parser.c
+++ b/http_parser.c
@@ -95,6 +95,8 @@ static const char *method_strings[] =
, "MERGE"
, "M-SEARCH"
, "NOTIFY"
+ , "SUBSCRIBE"
+ , "UNSUBSCRIBE"
};
@@ -582,8 +584,9 @@ size_t http_parser_execute (http_parser *parser,
case 'O': parser->method = HTTP_OPTIONS; break;
case 'P': parser->method = HTTP_POST; /* or PROPFIND or PROPPATCH or PUT */ break;
case 'R': parser->method = HTTP_REPORT; break;
+ case 'S': parser->method = HTTP_SUBSCRIBE; break;
case 'T': parser->method = HTTP_TRACE; break;
- case 'U': parser->method = HTTP_UNLOCK; break;
+ case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE */ break;
default: goto error;
}
state = s_req_method;
@@ -620,6 +623,8 @@ size_t http_parser_execute (http_parser *parser,
parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */
} else if (index == 1 && parser->method == HTTP_POST && ch == 'U') {
parser->method = HTTP_PUT;
+ } else if (index == 2 && parser->method == HTTP_UNLOCK && ch == 'S') {
+ parser->method = HTTP_UNSUBSCRIBE;
} else if (index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') {
parser->method = HTTP_PROPPATCH;
} else {
diff --git a/http_parser.h b/http_parser.h
index 43cc1bd..c03ec05 100644
--- a/http_parser.h
+++ b/http_parser.h
@@ -101,9 +101,11 @@ enum http_method
, HTTP_MKACTIVITY
, HTTP_CHECKOUT
, HTTP_MERGE
- /* ssdp */
+ /* upnp */
, HTTP_MSEARCH
, HTTP_NOTIFY
+ , HTTP_SUBSCRIBE
+ , HTTP_UNSUBSCRIBE
};
--
1.7.3.4

View File

@ -1,16 +1,21 @@
%global somajor 0
%global sominor 3
Name: http-parser
Version: 2.9.4
Release: 8%{?dist}
Version: %{somajor}.%{sominor}
Release: 6.20100911git%{?dist}
Summary: HTTP request/response parser for C
Group: System Environment/Libraries
License: MIT
URL: https://github.com/nodejs/http-parser
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# https://github.com/nodejs/http-parser/pull/483
Patch0001: 0001-url-treat-empty-port-as-default.patch
BuildRequires: meson
BuildRequires: gcc
URL: http://github.com/ry/http-parser
# git clone http://github.com/ry/http-parser.git
# cd http-parser/
# git archive 459507f5 --prefix=http-parser/ |gzip -9 >../http-parser.tar.gz
Source0: http-parser.tar.gz
Patch0: 0001-Add-support-for-M-SEARCH-and-NOTIFY-request-methods.patch
Patch1: 0002-Added-support-for-SUBSCRIBE-and-UNSUBSCRIBE-request-.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%description
This is a parser for HTTP messages written in C. It parses both requests and
@ -20,200 +25,70 @@ be interrupted at anytime. Depending on your architecture, it only requires
about 40 bytes of data per message stream (in a web server that is per
connection).
%package devel
Group: Development/Libraries
Summary: Development headers and libraries for http-parser
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name} = %{version}-%{release}
%description devel
Development headers and libraries for http-parser.
Development headers and libraries for htt-parser.
%prep
%autosetup -p1
%ifarch %{arm}
# https://github.com/nodejs/http-parser/issues/507
sed -i -e "/sizeof(http_parser)/d" test.c
%endif
# TODO: try to send upstream?
cat > meson.build << EOF
project('%{name}', 'c', version : '%{version}')
install_headers('http_parser.h')
foreach x : [['http_parser', ['-DHTTP_PARSER_STRICT=0']],
['http_parser_strict', ['-DHTTP_PARSER_STRICT=1']]]
lib = library(x.get(0), 'http_parser.c',
c_args : x.get(1),
version : '%{version}',
install : true)
test('test-@0@'.format(x.get(0)),
executable('test-@0@'.format(x.get(0)), 'test.c',
c_args : x.get(1),
link_with : lib),
timeout : 60)
endforeach
EOF
%setup -q -n %{name}
%patch0 -p1
%patch1 -p1
%build
%meson
%meson_build
make %{?_smp_mflags} CC="%{__cc} %{optflags} -fsigned-char -fPIC" http_parser.o
%{__cc} %{optflags} -Wl,-soname,http_parser.so.%{somajor} \
-o libhttp_parser.so -shared http_parser.o
%install
%meson_install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_includedir}
install -d $RPM_BUILD_ROOT%{_libdir}
install -pm644 http_parser.h $RPM_BUILD_ROOT%{_includedir}
install libhttp_parser.so $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor}.%{sominor}
ln -sf libhttp_parser.so.%{somajor}.%{sominor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so.%{somajor}
ln -sf libhttp_parser.so.%{somajor}.%{sominor} $RPM_BUILD_ROOT%{_libdir}/libhttp_parser.so
%check
%meson_test
make %{?_smp_mflags} CC="%{__cc} %{optflags} -fsigned-char -fPIC" test
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%ldconfig_scriptlets
%files
%license LICENSE-MIT
%doc AUTHORS README.md
%defattr(-,root,root,-)
%{_libdir}/libhttp_parser.so.*
%{_libdir}/libhttp_parser_strict.so.*
%doc CONTRIBUTIONS LICENSE-MIT README.md
%files devel
%{_includedir}/http_parser.h
%defattr(-,root,root,-)
%{_includedir}/*
%{_libdir}/libhttp_parser.so
%{_libdir}/libhttp_parser_strict.so
%changelog
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.4-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.4-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.4-3
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Apr 15 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 2.9.4-1
- Update to 2.9.4
* Mon Mar 02 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 2.9.3-2
- Include patch to work with colon but no port
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Apr 22 2019 Stephen Gallagher <sgallagh@redhat.com> - 2.9.2-1
- Update to 2.9.2
* Tue Apr 16 2019 Adam Williamson <awilliam@redhat.com> - 2.9.1-2
- Rebuild with Meson fix for #1699099
* Thu Apr 11 2019 Stephen Gallagher <sgallagh@redhat.com> - 2.9.1-1
- Update to 2.9.1
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Apr 02 2018 Stephen Gallagher <sgallagh@redhat.com> - 2.8.1-1
- Update to 2.8.1
* Sat Feb 10 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.8.0-1
- Update to 2.8.0
- Switch to meson buildsystem
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.7.1-8
- Switch to %%ldconfig_scriptlets
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Nov 21 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 2.7.1-4
- Use CMake buildsystem
* Tue Oct 25 2016 Nathaniel McCallum <npmccallum@redhat.com> - 2.7.1-3
- Add (upstreamed) status code patch
* Tue Aug 16 2016 Stephen Gallagher <sgallagh@redhat.com> - 2.7.1-2
- Upgrade to version 2.7.1
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Dec 01 2015 Stephen Gallagher <sgallagh@redhat.com> 2.6.0-1
- Upgrade to version 2.6.0
- Change to new upstream at https://github.com/nodejs/http-parser/
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-9.20121128gitcd01361
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 2.0-8.20121128gitcd01361
- Rebuilt for GCC 5 C++11 ABI change
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-7.20121128gitcd01361
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-6.20121128gitcd01361
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-5.20121128gitcd01361
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-4.20121128gitcd01361
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sun Dec 02 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0-3.20121128gitcd01361
- latest git snapshot
- fixes buffer overflow in tests
* Tue Nov 27 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0-2.20121110git245f6f0
- latest git snapshot
- fixes tests
- use SMP make flags
- build as Release instead of Debug
- ship new strict variant
* Sat Oct 13 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 2.0-1
- new upstream release 2.0
- migrate to GYP buildsystem
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Mon Aug 22 2011 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.0-1
- New upstream release 1.0
- Remove patches, no longer needed for nodejs
- Fix typo in -devel description
- use github tarball instead of checkout
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-6.20100911git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Tue Jan 11 2011 Lubomir Rintel <lkundrak@v3.sk> - 0.3-5.20100911git
- Add support for methods used by node.js
* Thu Nov 4 2010 Dan Horák <dan[at]danny.cz> - 0.3-4.20100911git
* Thu Nov 4 2010 Dan Horák <dan[at]danny.cz> - 0.3-4.20100911git
- build with -fsigned-char
* Wed Sep 29 2010 jkeating - 0.3-3.20100911git
@ -224,4 +99,3 @@ EOF
* Fri Sep 17 2010 Lubomir Rintel <lkundrak@v3.sk> - 0.3-1.20100911git
- Initial packaging

View File

@ -1,2 +0,0 @@
[koji]
targets = master fedora

View File

@ -1 +1 @@
SHA512 (http-parser-2.9.4.tar.gz) = b45df7b94d1c51079d44687d0a7f901f44faae51df4e84c7e3fe38f130c2d809d0e7c2a146c57b3723e60732aededc246bf44eadb10a95b710963d641f9fe7cd
d6a9377a4ed8288a8cb544389fd9bf88 http-parser.tar.gz