Re: [fpc-pascal] FastCGI on Windows IIS

2016-04-23 Thread Michael Van Canneyt



On Sun, 24 Apr 2016, Marcos Douglas wrote:


On Sun, Apr 24, 2016 at 2:40 AM, Michael Van Canneyt
 wrote:



I've found the problem:
The Application.Port cannot be setted.

I think this property (Port) is only used in a self-contained server
application. Am I right?



You are right,


OK, thanks.

Now I have another problem only in fcl-web framework, I think.

I have one module:
ModuleName= 'pdf'
ModuleClass= TPDFModule

and two actions:
'act1'
'act2'

Browser:
http://localhost:2015/fcgitest/pdf/act1

Error:

The application encountered the following error:
Error: Could not determine HTTP module for request "fcgitest.exe"


Why do you put fcgitest in the request ?

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


Re: [fpc-pascal] FastCGI on Windows IIS

2016-04-23 Thread Marcos Douglas
On Sun, Apr 24, 2016 at 2:40 AM, Michael Van Canneyt
 wrote:
>
>> I've found the problem:
>> The Application.Port cannot be setted.
>>
>> I think this property (Port) is only used in a self-contained server
>> application. Am I right?
>
>
> You are right,

OK, thanks.

Now I have another problem only in fcl-web framework, I think.

I have one module:
ModuleName= 'pdf'
ModuleClass= TPDFModule

and two actions:
'act1'
'act2'

Browser:
http://localhost:2015/fcgitest/pdf/act1

Error:

The application encountered the following error:
Error: Could not determine HTTP module for request "fcgitest.exe"
Stack trace:
$004328E3
$00433012
$004323E2
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FastCGI on Windows IIS

2016-04-23 Thread Michael Van Canneyt



On Sun, 24 Apr 2016, Marcos Douglas wrote:


On Sun, Apr 24, 2016 at 1:31 AM, Marcos Douglas  wrote:

Hi,

I'm trying to use FastCGI on IIS without success.
https://www.iis.net/configreference/system.webserver/fastcgi

My environment is:
- FPC 2.6.5
- Lazarus 1.5
- IIS
- Windows 10

The CGI protocol works fine, but FastCGI not. I got an error 500.
If I change the fpFCGI to fpcgi — and comment the Application.Port —
everything works fine.


I've found the problem:
The Application.Port cannot be setted.

I think this property (Port) is only used in a self-contained server
application. Am I right?


You are right,

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

Re: [fpc-pascal] FastCGI on Windows IIS

2016-04-23 Thread Marcos Douglas
On Sun, Apr 24, 2016 at 1:31 AM, Marcos Douglas  wrote:
> Hi,
>
> I'm trying to use FastCGI on IIS without success.
> https://www.iis.net/configreference/system.webserver/fastcgi
>
> My environment is:
> - FPC 2.6.5
> - Lazarus 1.5
> - IIS
> - Windows 10
>
> The CGI protocol works fine, but FastCGI not. I got an error 500.
> If I change the fpFCGI to fpcgi — and comment the Application.Port —
> everything works fine.

I've found the problem:
The Application.Port cannot be setted.

I think this property (Port) is only used in a self-contained server
application. Am I right?

Regards,
Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] FastCGI on Windows IIS

2016-04-23 Thread Marcos Douglas
Hi,

I'm trying to use FastCGI on IIS without success.
https://www.iis.net/configreference/system.webserver/fastcgi

My environment is:
- FPC 2.6.5
- Lazarus 1.5
- IIS
- Windows 10

The CGI protocol works fine, but FastCGI not. I got an error 500.
If I change the fpFCGI to fpcgi — and comment the Application.Port —
everything works fine.

Could you help me?

Regards,
Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] c-blocks odd hints

2016-04-23 Thread Dmitry Boyarintsev
Hello,

The compiler seems to generate odd hints:

Local absolutevar "FPC_BLOCK_SELF" is not used

Here's the code.

if Assigned(gc.extendedGamepad) then
  gc.extendedGamepad.setValueChangedHandler(GamePadChange)
else if Assigned(gc.gamepad) then  // <-- hint here
  gc.gamepad.setValueChangedHandler(GamePadChange);
gc.setControllerPausedHandler(PauseHandler);  // <--hint here

Why?

PauseHandler and GamePadChange are procedures:
procedure GamePadChange(pad: GCGamePad; el: GCControllerElement);
procedure PauseHandler(gc: GCController);

thanks,
Dmitry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Linux: resolving hostnames in local network

2016-04-23 Thread Andreas Klausmann
Thanks, cnetdb.gethostbyname() works fine (at least on my raspberry).   :)
Creating a wrapper function is recently my work-around for an actual
ping component (since linux doesn't seem to have a corresponding
component like ping.dll and I want to ping as non-root)

Am 23.04.2016 um 12:42 schrieb Marco van de Voort:
> In our previous episode, Michael Van Canneyt said:
>> You will need to use the C library routines for this.
> (which is in unit cnetdb in somewhat recent FPC's)
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
>
>

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


Re: [fpc-pascal] Linux: resolving hostnames in local network

2016-04-23 Thread Graeme Geldenhuys
On 2016-04-23 10:23, Andreas Klausmann wrote:
> Testhost is reachable from console by hostname: ping testhost.local ->
> success (resolved in background by avahi)

Not sure, but you could always create a wrapper function or class around
the OS 'ping' command, or nslookup. Read the program results and let
your wrapper function or class return that as the resolved name.

Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linux: resolving hostnames in local network

2016-04-23 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said:
> You will need to use the C library routines for this.

(which is in unit cnetdb in somewhat recent FPC's)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linux: resolving hostnames in local network

2016-04-23 Thread Michael Van Canneyt



On Sat, 23 Apr 2016, Andreas Klausmann wrote:


Hi,
how can I resolve hostnames in a local (private) network under linux?
Both gethostbyname() and THostResolver work fine for google.com etc, but
not for local hostnames like testhost.local.
Testhost is reachable from console by hostname: ping testhost.local ->
success (resolved in background by avahi)

gethostbyname() works fine under Windows even for LAN resolution
(resolved in background by Netbios name service).

Currently I'm working on Ubuntu 15.10 on a raspberry, fpc 3.0.


You will need to use the C library routines for this.
The FPC native implementation does not work with avahi or local DNS caches.

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


[fpc-pascal] Linux: resolving hostnames in local network

2016-04-23 Thread Andreas Klausmann
Hi,
how can I resolve hostnames in a local (private) network under linux?
Both gethostbyname() and THostResolver work fine for google.com etc, but
not for local hostnames like testhost.local.
Testhost is reachable from console by hostname: ping testhost.local ->
success (resolved in background by avahi)

gethostbyname() works fine under Windows even for LAN resolution
(resolved in background by Netbios name service).

Currently I'm working on Ubuntu 15.10 on a raspberry, fpc 3.0.

Best regards!
Andreas

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


Re: [fpc-pascal] Unit path search order

2016-04-23 Thread Martin Schreiber
On Saturday 23 April 2016 10:40:58 Jonas Maebe wrote:
> Martin Schreiber wrote:
> > http://www.freepascal.org/docs-html/current/user/usersu7.html#x21-280003.
> >1.2 states:
> > "
> > You can add a directory to the unit search path with the (-Fu (see page
> > 100)) option. Every occurrence of one of these options will insert a
> > directory to the unit search path. i.e. the last path on the command line
> > will be searched first.
> > "
> > Does this still apply?
>
>  From looking at the compiler code: yes.
>
I made a test.

in ./:
"
program conssoletest;
uses
 testunit;
begin
 testunit0();
end.
"

in ./test:
"
unit testunit;
interface
procedure testunit0();
implementation
procedure testunit0();
begin
end;
end.
"

in ./test1:
"
unit testunit;
interface
procedure testunit1();
implementation
procedure testunit1();
begin
end;
end.
"

"
mse@linuxmse:~/proj/consoletest> fpc -oconssoletest -Fu./test -Fu./test1 
conssoletest.pas
Free Pascal Compiler version 3.0.0rc2 [2015/10/14] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling conssoletest.pas
Compiling ./test/testunit.pas
Linking conssoletest
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
14 lines compiled, 0.2 sec
"

"
mse@linuxmse:~/proj/consoletest> fpc -oconssoletest -Fu./test1 -Fu./test 
conssoletest.pas
Free Pascal Compiler version 3.0.0rc2 [2015/10/14] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling conssoletest.pas
Compiling ./test1/testunit.pas
conssoletest.pas(5,2) Error: Identifier not found "testunit0"
conssoletest.pas(7) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode
"

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


Re: [fpc-pascal] Unit path search order

2016-04-23 Thread Jonas Maebe

Martin Schreiber wrote:


http://www.freepascal.org/docs-html/current/user/usersu7.html#x21-280003.1.2
states:
"
You can add a directory to the unit search path with the (-Fu (see page 100))
option. Every occurrence of one of these options will insert a directory to
the unit search path. i.e. the last path on the command line will be searched
first.
"
Does this still apply?


From looking at the compiler code: yes.


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