From a4c102069e39a8e15e6e8c51f7e5850f1c00a72b Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Fri, 27 Jun 2025 14:54:28 -0400 Subject: [PATCH] Starting to implement smtp session within database. --- lib/unisql.c | 21 +++++++++++++++++++++ lib/unisql.h | 12 ++++++++++++ 2 files changed, 33 insertions(+) diff --git a/lib/unisql.c b/lib/unisql.c index e2dd005..a4f7205 100644 --- a/lib/unisql.c +++ b/lib/unisql.c @@ -113,6 +113,27 @@ return usr; /* */ +/********************************************************/ +/* */ +/* Procedure to free memory used by a usesion */ +/* definition. */ +/* */ +/********************************************************/ +PUBLIC SESTYP *sql_freeses(SESTYP *ses) + +{ +if (ses!=(SESTYP *)0) { + ses->efrom=rou_freestr(ses->efrom); + ses->sfrom=rou_freestr(ses->sfrom); + ses->sessid=rou_freestr(ses->sessid); + (void) free(ses); + ses=(SESTYP *)0; + } +return ses; +} +/* + +*/ /************************************************/ /* */ /* Routine to check if string is properly */ diff --git a/lib/unisql.h b/lib/unisql.h index 2f8bee9..45fba33 100644 --- a/lib/unisql.h +++ b/lib/unisql.h @@ -26,9 +26,21 @@ typedef struct { u_long mxspace; //user maximun space }USRTYP; +//structure about an email session +//A session is the exchaneg mail from, rcpts and data +//with a remote server +typedef struct { + char *sessid; //session id + char *sfrom; //the "mail from" comming from SMTP exchange + char *efrom; //the "mail from" as within the email itself + }SESTYP; + //procedure to free space used by an USRTYP extern USRTYP *sql_freeusr(USRTYP *usr); +//procedure to free memory used by a SESTYP +extern SESTYP *sql_freeses(SESTYP *ses); + //Procedure to check if string is properly coded according DB_LANG extern void sql_checkencoding(char *strencoded); -- 2.47.3