#include "unitls.h"
#include "devsoc.h"
-#define MXCARIN 200 //maximun number of char within carpile
+#define MXCARIN 1200 //maximun number of char within carpile
+ //full line sould be more than 998 char
typedef struct {
PROTYP proto; //Connexion protocol type
/* Procedure to extract next line from the socket */
/* incoming pile. */
/* Return the number of character, zero if the */
-/* line is empty, -1 if now char available. */
+/* line is empty, -1 if no char are available. */
/* */
/********************************************************/
static int doextract(SOCTYP *soc,char **lineptr)
if (soc->carin==0)
phase=999; //No char,no need to check for line
break;
- case 1 : //Do we have a CRLF
+ case 1 : //do we have a buffer full;
+ if (soc->carin>=(soc->maxcarin)-1) {
+ //Overload! trying to overcome by extending carpile an adding an EOL
+ soc->carpile=(char *)realloc(soc->carpile,(soc->carin+5)*sizeof(char));
+ (void) strcat(soc->carpile,soc->EOL);
+ }
+ break;
+ case 2 : //Do we have a CRLF
eol=strstr(soc->carpile,soc->EOL);
if (eol==(char *)0)
phase=999; //No End Of Line yet
break;
- case 2 : //duplicating carpile
+ case 3 : //duplicating carpile
*lineptr=calloc(soc->carin+1,sizeof(char));
*eol='\000';
(void) strcpy(*lineptr,soc->carpile);
got=strlen(*lineptr);
break;
- case 3 : //managing carpile
+ case 4 : //managing carpile
soc->carin-=(got+strlen(soc->EOL));
if (soc->carin>0) {
int delta;
delta=got+strlen(soc->EOL);
- (void) memmove(soc->carpile,soc->carpile+delta,soc->carin);
+ (void) memmove(soc->carpile,soc->carpile+delta,soc->carin+1);
}
- soc->carpile[soc->carin]='\000';
+ //soc->carpile[soc->carin]='\000';
+ (void) rou_alert(0,"%s carpile=<%s>",OPEP,soc->carpile);
break;
default : //SAFE guard
proceed=false;
cur.tv_nsec/=10000; //100 millisec
//(void) rou_asprintf(&seq,"<%05d-%s@%s>",
// cur.tv_nsec,contact->session->sessid,contact->locname);
-seq=strdup("<01234567890ABCDEFGHIJKLMNOPQRST@mailpostg.example.com>");
+//seq=strdup("<01234567890ABCDEFGHIJKLMNOPQRST@mailpostg.example.com>");
//seq=strdup("username = <jmp@safe.ca>");
+//seq=strdup("realm=\"elwood.innosoft.com\",nonce=\"OA6MG9tEQGm2hh\",qop=\"auth\",algorithm=md5-sess,charset=utf-8");
+seq=strdup("realm=\"example.com\",nonce=\"0123456789\",algorithm=md5-sess");
(void) rou_alert(0,"%s JMPDBG SEQ=<%s>",OPEP,seq);
code=(char *)0;
usr=(USRTYP *)0;