INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Clarion 6.3 Sockettools HttpServer Buffer Overflow Exception

Clarion 6.3 Sockettools HttpServer Buffer Overflow Exception

(OP)
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.

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


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

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

I tried it with:
SoftProc PROCEDURE (LONG hServer, LONG nClientId, LONG nEventId, LONG dwError, REAL dwParam) ! Declare Procedure
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



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close