* Fix: http1 parser termination with EOF required on freebsd flex

* Test: sed -i does not seem to work on all platforms
This commit is contained in:
Olof hagsand 2022-02-17 20:54:37 +01:00
parent bf00fdf2c1
commit 503c4f8754
4 changed files with 9 additions and 5 deletions

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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