Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clarion 6.3 Sockettools HttpServer Buffer Overflow Exception

Status
Not open for further replies.

samrae

Programmer
Apr 19, 2017
1
GB
Hi
I'm trying to put together a pretty basic http API and I was going to use socket tools because it seems ok but I cannot get it to work.

[tt] GLO:HTTP:LicenceKey = CSTOOLS8_LICENSE_KEY
GLO:HTTP:SrvIdentity = 'c8b0dfdc-6ccc-4c03-9f7c-f9cf74cd39b3'
GLO:HTTP:srvUUID = 'a008c77f-d92a-4c24-b124-cc68bb682716'
GLO:HTTP:srvHostName = ''
GLO:HTTP:srvRootPath = 'C:\H\webroot\web'
GLO:HTTP:srvTempPath = 'C:\H\webroot\temp'
GLO:HTTP:srvLogPath = 'C:\H\webroot\log'

IF HttpServerInitialize(GLO:HTTP:LicenceKey, 0)
!HttpServerStart(*CSTRING lpszLocalHost, LONG nLocalPort, LONG dwOptions, *ST_HTTPSERVERCONFIG lpConfig, LONG lpServProc, LONG dwServParam, LONG lpCredentials),LONG,PASCAL,RAW,NAME('HttpServerStartA')

SRVCON:nMaxClients = 100 !LONG
SRVCON:nMaxClientsPerAddress = 0!LONG
SRVCON:nMaxRequests = 100!LONG
SRVCON:nMaxPostSize = 100000000 !LONG
SRVCON:nLogFormat = HTTP_LOGFILE_EXTENDED!LONG
SRVCON:nLogLevel = 10 !LONG
SRVCON:nCacheTime = 1!LONG
SRVCON:nIdleTime = 60 !LONG
SRVCON:nExecTime = 5!LONG
SRVCON:lpszIdentity = ADDRESS(GLO:HTTP:SrvIdentity)!LONG SRVCON: Pointer
SRVCON:lpszHostUuid = ADDRESS(GLO:HTTP:srvUUID)!LONG SRVCON: Pointer
SRVCON:lpszHostName = ADDRESS(GLO:HTTP:srvHostName)!LONG SRVCON: Pointer
SRVCON:lpszRootPath = ADDRESS(GLO:HTTP:srvRootPath)
SRVCON:lpszTempPath = ADDRESS(GLO:HTTP:srvTempPath)!LONG SRVCON: Pointer
SRVCON:lpszLogFile = ADDRESS(GLO:HTTP:srvLogPath)!LONG ! Pointer
SRVCON:dwSize = SIZE(GLO:HTTP:Serverconfig)!LONG
! HttpServerStart(*CSTRING lpszLocalHost, LONG nLocalPort, LONG dwOptions, *ST_HTTPSERVERCONFIG lpConfig, LONG lpServProc, LONG dwServParam, LONG lpCredentials),LONG,PASCAL,RAW,NAME('HttpServerStartA')
MESSAGE('Address(SoftProc) = ' & ADDRESS(SoftProc))
IF HttpServerStart(GLO:HTTP:srvHostName, 80, HTTP_SERVER_DEFAULT, GLO:HTTP:Serverconfig, ADDRESS(SoftProc), 0, 0)
! IF HttpServerStart(GLO:HTTP:srvHostName, 80, HTTP_SERVER_DEFAULT, GLO:HTTP:Serverconfig, 0, 0, 0)
!MESSAGE('started')
END
END[/tt]

That all works fine. But then when the server receives a request, the application closes with a buffer overflow exception

SoftProc is defined as:
[tt]SoftProc PROCEDURE (LONG hServer, LONG nClientId, LONG nEventId, LONG dwError, LONG dwParam) ! Declare Procedure[/tt]
And currently has no code in it

I tried it with:
[tt]SoftProc PROCEDURE (LONG hServer, LONG nClientId, LONG nEventId, LONG dwError, REAL dwParam) ! Declare Procedure[/tt]
because there was something in the help about that field being a 32 or 64 bit pointer.

Not sure what to do at this point and sockettools don't really offer support.

Thanks,
Sam



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top