* 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:
parent
bf00fdf2c1
commit
503c4f8754
4 changed files with 9 additions and 5 deletions
|
|
@ -206,7 +206,7 @@ http1_parse_header_field(clixon_http1_yacc *hy,
|
||||||
/* start-line *( header-field CRLF ) CRLF [ message-body ]
|
/* start-line *( header-field CRLF ) CRLF [ message-body ]
|
||||||
* start-line = request-line / status-line (only request-line here, ignore status-line)
|
* 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 ($4) {
|
||||||
if (http1_body(_HY, $4) < 0) YYABORT;
|
if (http1_body(_HY, $4) < 0) YYABORT;
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,9 @@ fi
|
||||||
echo -n "<data>">> $ftest
|
echo -n "<data>">> $ftest
|
||||||
cat $fdataxml >> $ftest
|
cat $fdataxml >> $ftest
|
||||||
echo "</data>
" >> $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)
|
ret=$(diff -i $ftest $foutput)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,8 @@ fi
|
||||||
echo -n "<data>">> $ftest
|
echo -n "<data>">> $ftest
|
||||||
cat $fdataxml >> $ftest
|
cat $fdataxml >> $ftest
|
||||||
echo "</data>
" >> $ftest
|
echo "</data>
" >> $ftest
|
||||||
sed -i '/<data>/!d' $foutput
|
sed '/<data>/!d' $foutput > $foutput2
|
||||||
|
mv $foutput2 $foutput
|
||||||
|
|
||||||
ret=$(diff -i $ftest $foutput)
|
ret=$(diff -i $ftest $foutput)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|
|
||||||
|
|
@ -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
|
# Look for netcat or nc for direct socket http calls
|
||||||
if [ -n "$(type netcat 2> /dev/null)" ]; then
|
if [ -n "$(type netcat 2> /dev/null)" ]; then
|
||||||
netcat="netcat -w 1" # -N does not work on fcgi
|
netcat="netcat -w 1" # -N does not work on fcgi
|
||||||
elif [ -n "$(type nc 2> /dev/null)" ]; then
|
# nc on freebsd does not work either
|
||||||
netcat=nc
|
#elif [ -n "$(type nc 2> /dev/null)" ]; then
|
||||||
|
# netcat=nc
|
||||||
else
|
else
|
||||||
netcat=
|
netcat=
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue