Skip to content

Commit

Permalink
* Fix: http1 parser termination with EOF required on freebsd flex
Browse files Browse the repository at this point in the history
* Test: sed -i does not seem to work on all platforms
  • Loading branch information
olofhagsand committed Feb 17, 2022
1 parent bf00fdf commit 503c4f8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/restconf/clixon_http1_parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ http1_parse_header_field(clixon_http1_yacc *hy,
/* start-line *( header-field CRLF ) CRLF [ message-body ]
* start-line = request-line / status-line (only request-line here, ignore status-line)
*/
http_message : request_line header_fields CRLF body
http_message : request_line header_fields CRLF body X_EOF
{
if ($4) {
if (http1_body(_HY, $4) < 0) YYABORT;
Expand Down
4 changes: 3 additions & 1 deletion test/test_perf_restconf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ fi
echo -n "<data>">> $ftest
cat $fdataxml >> $ftest
echo "</data>" >> $ftest
sed -i '/<data>/!d' $foutput
# -i dont always work properly
sed '/<data>/!d' $foutput > $foutput2
mv $foutput2 $foutput

ret=$(diff -i $ftest $foutput)
if [ $? -ne 0 ]; then
Expand Down
3 changes: 2 additions & 1 deletion test/test_perf_restconf_ssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ fi
echo -n "<data>">> $ftest
cat $fdataxml >> $ftest
echo "</data>" >> $ftest
sed -i '/<data>/!d' $foutput
sed '/<data>/!d' $foutput > $foutput2
mv $foutput2 $foutput

ret=$(diff -i $ftest $foutput)
if [ $? -ne 0 ]; then
Expand Down
5 changes: 3 additions & 2 deletions test/test_restconf_err.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ expectpart "$(curl $CURLOPTS -X GET -H 'Accept: application/yang-data+xml' $RCPR
# Look for netcat or nc for direct socket http calls
if [ -n "$(type netcat 2> /dev/null)" ]; then
netcat="netcat -w 1" # -N does not work on fcgi
elif [ -n "$(type nc 2> /dev/null)" ]; then
netcat=nc
# nc on freebsd does not work either
#elif [ -n "$(type nc 2> /dev/null)" ]; then
# netcat=nc
else
netcat=
fi
Expand Down

0 comments on commit 503c4f8

Please sign in to comment.