#1 2016-11-08 16:44:34

turrican
Member
From: Barcelona
Registered: 2015-06-05
Posts: 94
Website

THttpApiServer.LogStart() crash

Hi,

I'm implementing your simple and fastest WinAPI HTTP.sys HTTPServer and works like a charm (better than all others servers I tested). Now when I want to start logging (client calls W3C) with the method LogStart(), thread crash.

HttpSetUrlGroupProperty failed: The parameter is incorrect (87)

I debugged and found this :

  EHttpApiServer.RaiseOnError(hSetUrlGroupProperty,
    Http.SetUrlGroupProperty(fUrlGroupID, HttpServerLoggingProperty,
      @logInfo, SizeOf(logInfo)));

I think fUrlGroupID is not inizialized because INT64 value my debugger is poiting to random address memory.

How can I solve this?

I tested on Windows 10 and Windows Server 2012R2 with HTTPApi 2.0 with elevated permissions.

Last edited by turrican (2016-11-08 16:48:25)

Offline

#2 2016-11-11 08:29:55

turrican
Member
From: Barcelona
Registered: 2015-06-05
Posts: 94
Website

Re: THttpApiServer.LogStart() crash

Do you have some examples of the method THttpApiServer.LogStart() ? I reviewed the documentation multiple times and I think I am doing well.

Here is my server constructor :

constructor TCDIHTTPServer.Create;
begin
  inherited Create(False);

  //Unlimit connections
  SetMaxConnections(0);

  //Max queue lenght UNTIL 503 error
  SetHTTPQueueLength(10000);

  //We load config
  if not FileExists('.\config.json') then CDIConfig := TCDIConfigLoader.NewConfig('.\config.json')
  else CDIConfig := TCDIConfigLoader.LoadConfig('.\config.json');

  //Add BASE URL load from config
  Self.AddUrl('', CDIConfig.Port.ToString, False, CDIConfig.BindHostname, True);

  //Init W3C Server Logging // Not working Crash HERE
  LogStart('.\logs');

  //Add CALLBACK
  Self.OnRequest := Process;

  {$IFNDEF DEBUG}
  //Clone the HTTP.SYS Process if not debug mode, because DEBUGGER can't follow 256 threads well
  Clone(256);
  {$ENDIF}

end;

Last edited by turrican (2016-11-11 08:30:39)

Offline

#3 2016-11-14 13:59:39

turrican
Member
From: Barcelona
Registered: 2015-06-05
Posts: 94
Website

Re: THttpApiServer.LogStart() crash

I am totally lost...

I put logstart method on example (09 - HttpApi web server) and is crashing as well...

Has someone the same problem?

Last edited by turrican (2016-11-14 14:00:15)

Offline

#4 2017-01-11 13:34:11

Exilon
Member
Registered: 2016-10-11
Posts: 4

Re: THttpApiServer.LogStart() crash

Same problem here! sad Is it planned to solve? Did you find an alternative solution?

Offline

Board footer

Powered by FluxBB