Re: [fpc-pascal] fpwebfile, indexPageName and query -> 404

2022-09-13 Thread Michael Van Canneyt via fpc-pascal



On Tue, 13 Sep 2022, Luca Olivetti via fpc-pascal wrote:


El 13/9/22 a les 16:28, Michael Van Canneyt via fpc-pascal ha escrit:



On Tue, 13 Sep 2022, Luca Olivetti via fpc-pascal wrote:


Hello,

if I request, e.g.

http://localhost:8080 or http://localhost:8080/

fpwebfile returns the document defined as IndexPageName (in my case 
index.html), but if I request


http://localhost:8080?xxx or http://localhost:8080/?xxx

I get a 404.

That's because TCustomFileModule.GetRequestFIleName with an empty PathInfo 
uses the URI and thinks that the filename is ?xxx.


Maybe the

if (Result='') then
 Result:=ARequest.URI;


should be eliminated?


No, it needs to strip the query parameter.


But that's already in PathInfo:


In the HTTP application, yes. In other hosting mechanisms maybe not.
When stripping the query param, the result should be empty anyway, and then
the default file mechanism will kick in.


Michael.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpwebfile, indexPageName and query -> 404

2022-09-13 Thread Luca Olivetti via fpc-pascal

El 13/9/22 a les 16:28, Michael Van Canneyt via fpc-pascal ha escrit:



On Tue, 13 Sep 2022, Luca Olivetti via fpc-pascal wrote:


Hello,

if I request, e.g.

http://localhost:8080 or http://localhost:8080/

fpwebfile returns the document defined as IndexPageName (in my case 
index.html), but if I request


http://localhost:8080?xxx or http://localhost:8080/?xxx

I get a 404.

That's because TCustomFileModule.GetRequestFIleName with an empty 
PathInfo uses the URI and thinks that the filename is ?xxx.


Maybe the

if (Result='') then
 Result:=ARequest.URI;


should be eliminated?


No, it needs to strip the query parameter.


But that's already in PathInfo:


procedure ParseStartLine(Request : TFPHTTPConnectionRequest; AStartLine 
: String);


  Function GetNextWord(Var S : String) : string;

  Var
P : Integer;

  begin
P:=Pos(' ',S);
If (P=0) then
  P:=Length(S)+1;
Result:=Copy(S,1,P-1);
Delete(S,1,P);
  end;

Var
  S : String;
  I : Integer;

begin
  if aStartLine='' then
exit;
  Request.Method:=GetNextWord(AStartLine);
  Request.URL:=GetNextWord(AStartLine);
  S:=Request.URL;
  I:=Pos('?',S);
  if (I>0) then
S:=Copy(S,1,I-1);
  If (Length(S)>1) and (S[1]<>'/') then
S:='/'+S
  else if S='/' then
S:='';
  Request.PathInfo:=S; 


Bye
--
Luca






Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpwebfile, indexPageName and query -> 404

2022-09-13 Thread Michael Van Canneyt via fpc-pascal




On Tue, 13 Sep 2022, Luca Olivetti via fpc-pascal wrote:


Hello,

if I request, e.g.

http://localhost:8080 or http://localhost:8080/

fpwebfile returns the document defined as IndexPageName (in my case 
index.html), but if I request


http://localhost:8080?xxx or http://localhost:8080/?xxx

I get a 404.

That's because TCustomFileModule.GetRequestFIleName with an empty PathInfo 
uses the URI and thinks that the filename is ?xxx.


Maybe the

if (Result='') then
 Result:=ARequest.URI;


should be eliminated?


No, it needs to strip the query parameter.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] fpwebfile, indexPageName and query -> 404

2022-09-13 Thread Luca Olivetti via fpc-pascal

Hello,

if I request, e.g.

http://localhost:8080 or http://localhost:8080/

fpwebfile returns the document defined as IndexPageName (in my case 
index.html), but if I request


http://localhost:8080?xxx or http://localhost:8080/?xxx

I get a 404.

That's because TCustomFileModule.GetRequestFIleName with an empty 
PathInfo uses the URI and thinks that the filename is ?xxx.


Maybe the

if (Result='') then
  Result:=ARequest.URI;


should be eliminated?

Bye
--
Luca

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Test Free Pascal program not compiling

2022-09-13 Thread Tomas Hajny via fpc-pascal

On 2022-09-12 21:12, Terry A. Haimann via fpc-pascal wrote:


Hello Terry,


I personally think it can't find the assembler.  I did test this on my
desktop and it compiled w/o error.


No, but the installed assembler doesn't know the "softvfp" FPU type 
apparently specified in the compilation options:


---

[0.430] Executing "/usr/bin/as" with command line "-mfpu=softvfp -o
Sqrt.o  Sqrt.s"
Assembler messages:
Error: unrecognized option -mfpu=softvfp

===



Below you will see the output of the compile as you suggested.  Sorry
it is so long.


As a reminder - you can always zip the file and add it to attachment, or 
place it on some server and include just a link (or reduce the size by 
removing the beginning of the file if it's so long and there's a message 
close to the end starting with "Error:").


Tomas
(one of the FPC mailing lists moderators)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Test Free Pascal program not compiling

2022-09-13 Thread Terry A. Haimann via fpc-pascal
I personally think it can't find the assembler.  I did test this on my
desktop and it compiled w/o error.
Below you will see the output of the compile as you suggested.  Sorry
it is so long.

Terry H.

terry@libre-computer:~/Documents/fpc/Silly$ fpc -va Sqrt.pas 
[0.000] Macro defined: LINUX
[0.000] Macro defined: UNIX
[0.000] Macro defined: HASUNIX
[0.000] Macro defined: CPUARMEL
[0.000] Macro defined: FPC_REQUIRES_PROPER_ALIGNMENT
[0.000] Macro defined: FPC_HAS_WINLIKERESOURCES
[0.000] Macro defined: CONSOLE
[0.000] Macro defined: LINUX
[0.000] Macro defined: FPC
[0.000] Macro defined: VER3
[0.000] Macro defined: VER3_0
[0.000] Macro defined: VER3_0_2
[0.000] Macro defined: RESSTRSECTIONS
[0.000] Macro defined: FPC_HASFIXED64BITVARIANT
[0.000] Macro defined: FPC_HASINTERNALOLEVARIANT2VARIANTCAST
[0.000] Macro defined: FPC_HAS_VARSETS
[0.000] Macro defined: FPC_HAS_VALGRINDBOOL
[0.000] Macro defined: FPC_HAS_STR_CURRENCY
[0.000] Macro defined: FPC_REAL2REAL_FIXED
[0.000] Macro defined: FPC_STRTOCHARARRAYPROC
[0.000] Macro defined: FPC_STRTOSHORTSTRINGPROC
[0.000] Macro defined: FPC_OBJFPC_EXTENDED_IF
[0.000] Macro defined: FPC_HAS_OPERATOR_ENUMERATOR
[0.000] Macro defined: FPC_HAS_CONSTREF
[0.000] Macro defined: FPC_STATICRIPFIXED
[0.000] Macro defined: FPC_VARIANTCOPY_FIXED
[0.000] Macro defined: FPC_DYNARRAYCOPY_FIXED
[0.000] Macro defined: FPC_HAS_INTERNAL_ABS_LONG
[0.000] Macro defined: FPC_HAS_UNICODESTRING
[0.000] Macro defined: FPC_RTTI_PACKSET1
[0.000] Macro defined: FPC_HAS_CPSTRING
[0.000] Macro defined: FPC_HAS_CEXTENDED
[0.000] Macro defined: FPC_HAS_RESSTRINITS
[0.000] Macro defined: FPC_HAS_INTERNAL_ROX
[0.000] Macro defined: FPC_HAS_INTERNAL_SAR
[0.000] Macro defined: FPC_HAS_MEMBAR
[0.000] Macro defined: FPC_SETBASE_USED
[0.000] Macro defined: INTERNAL_BACKTRACE
[0.000] Macro defined: STR_CONCAT_PROCS
[0.000] Macro defined: FPC_HAS_FEATURE_SUPPORT
[0.000] Macro defined: CPUARM
[0.000] Macro defined: CPU32
[0.000] Macro defined: FPC_CURRENCY_IS_INT64
[0.000] Macro defined: FPC_COMP_IS_INT64
[0.000] Configfile search: /home/terry/.fpc.cfg
[0.000] Configfile search: /usr/lib/fpc/etc/fpc.cfg
[0.000] Configfile search: /etc/fpc.cfg
[0.000] Handling option "-va"
[0.000] interpreting option "-va"
[0.000] Handling option "Sqrt.pas"
[0.000] found source file name "Sqrt.pas"
[0.000] Macro defined: ENDIAN_LITTLE
[0.000] Macro defined: FPC_LITTLE_ENDIAN
[0.000] Macro defined: FPC_ABI_EABI
[0.102] Macro defined: CPUARMV3
[0.102] Macro defined: FPUSOFT
[0.102] Macro defined: FPC_HAS_TYPE_SINGLE
[0.102] Macro defined: FPC_HAS_TYPE_DOUBLE
[0.102] Macro defined: FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE
[0.102] Macro defined: FPC_LINK_STATIC
[0.102] Macro FPC_VERSION set to 3
[0.102] Macro FPC_RELEASE set to 0
[0.102] Macro FPC_PATCH set to 2
[0.102] Macro FPC_FULLVERSION set to 30002
[0.102] Macro defined: FPC_WIDESTRING_EQUAL_UNICODESTRING
[0.102] Macro defined: FPC_HAS_FEATURE_HEAP
[0.102] Macro defined: FPC_HAS_FEATURE_INITFINAL
[0.102] Macro defined: FPC_HAS_FEATURE_RTTI
[0.102] Macro defined: FPC_HAS_FEATURE_CLASSES
[0.102] Macro defined: FPC_HAS_FEATURE_EXCEPTIONS
[0.102] Macro defined: FPC_HAS_FEATURE_EXITCODE
[0.102] Macro defined: FPC_HAS_FEATURE_ANSISTRINGS
[0.102] Macro defined: FPC_HAS_FEATURE_WIDESTRINGS
[0.102] Macro defined: FPC_HAS_FEATURE_TEXTIO
[0.102] Macro defined: FPC_HAS_FEATURE_CONSOLEIO
[0.102] Macro defined: FPC_HAS_FEATURE_FILEIO
[0.102] Macro defined: FPC_HAS_FEATURE_RANDOM
[0.102] Macro defined: FPC_HAS_FEATURE_VARIANTS
[0.102] Macro defined: FPC_HAS_FEATURE_OBJECTS
[0.102] Macro defined: FPC_HAS_FEATURE_DYNARRAYS
[0.102] Macro defined: FPC_HAS_FEATURE_THREADING
[0.102] Macro defined: FPC_HAS_FEATURE_COMMANDARGS
[0.102] Macro defined: FPC_HAS_FEATURE_PROCESSES
[0.102] Macro defined: FPC_HAS_FEATURE_STACKCHECK
[0.102] Macro defined: FPC_HAS_FEATURE_DYNLIBS
[0.102] Macro defined: FPC_HAS_FEATURE_SOFTFPU
[0.102] Macro defined: FPC_HAS_FEATURE_OBJECTIVEC1
[0.102] Macro defined: FPC_HAS_FEATURE_RESOURCES
[0.102] Macro defined: FPC_HAS_FEATURE_UNICODESTRINGS
[0.102] Searching file /lib/ld-linux.so.3... not found
[0.102] Searching file /lib/ld-uClibc.so.0... not found
[0.102] Path "/usr/X11R6/lib/" not found
[0.164] Path "/usr/lib/arm-linux-gnueabi/" not found
[0.164] Compiler: /usr/lib/fpc/3.0.2/ppcarm
[0.164] Compiler OS: Linux for ARMEL
[0.164] Target OS: Linux for ARMEL
[0.164] Using executable path: /usr/lib/fpc/3.0.2/
[0.164] Using unit path: /usr/lib/fpc/3.0.2/units/arm-linux/rtl/
[0.164] Using unit path: /usr/lib/fpc/3.0.2/
[0.164] Using library path: /lib/
[0.164] Using library path: /usr/lib/
[0.164] Using library path: /usr/lib/fpc/3.0.2/units/arm-linux/rtl/
[0.164] Using library path: /usr/lib/fpc/3.0.2/
[0.164] Using object path: /usr/lib/fpc/3.0.2/units/arm-linux/rtl/
[0.164] Using object path: /usr/lib/fpc/3.0.2/
[0.164] Compiling Sqrt.pas
[0.164] Searching file Sqrt.pas... found
2 104/1.024 Kb Used
[0.164] (SQRT) Registering new unit SYSTEM
[0.164] (SQRT) Load from