• Welcome, Guest. Please login.
 
October 21, 2019, 02:16:28 am

News:

Welcome to the SQLitening support forums!


Exits

Started by Bern Ertl, November 18, 2008, 04:46:30 pm

Previous topic - Next topic

Bern Ertl

Fred, I'm not sure how to create the "exits" as you call them without modifying the source for the server (causing additional work in the future to reconcile with any updates), so I am wondering if you might adapt something like this in a future release:

SQLiteningServer.BAS
Quote...
'============================<[ Globals ]>=============================
GLOBAL glFlags AS LONG                       'General purpose flags
...
GLOBAL glLogFileNumber AS LONG               'File number for the log

'=========================<[ Exits File ]>=========================
#INCLUDE "Exitmacros.inc"


...

'========================<[ Connection Main ]>=========================
FUNCTION ConnectionMain(BYVAL rqpAddr AS QUAD PTR ) AS LONG
...
   ' Close Tcp and log it
   TCP CLOSE llTcpFileNumber
   IF (llFlags AND &H01) AND (glFlags AND %gbfLogConnDcon) THEN LogIt "Dcon #" & FORMAT$(llTcpFileNumber) & "  " & IIF$(ERR = 57 OR ERR = 0, "", "Unknown Reason")

   'Call an Exit Macro
   mDisconnected


END FUNCTION
...


ExitMacros.INC
Quote'  ==========================================================================
'  |                                                                        |
'  | SQLitening Server - Exit Macros                                        |
'  |                                                                        |
'  ==========================================================================

MACRO mDisconnected
   'Put exit code here
END MACRO