]> SAFE projects GIT repository - jmp/mailleur/commitdiff
SSL mode start to be workable
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 8 Aug 2024 01:44:46 +0000 (21:44 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 8 Aug 2024 01:44:46 +0000 (21:44 -0400)
lib/devsoc.c
lib/subrou.c
lib/unitls.c

index ed6b5ad54ef2718e250fa7c09eabd0be304be539..3ca66201421627c95e9354e612b03f6c73057689 100644 (file)
@@ -132,7 +132,6 @@ static int getnewhandle(SOCTYP *soc)
 
 int newhandle;
 
-(void) printf("JMPDBG soc handle='%d'\n",soc->handle);
 if ((newhandle=accept(soc->handle,(SOCKADDR *)0,(socklen_t *)0))<0) {
   if (errno==EAGAIN)
     errno=EWOULDBLOCK;
@@ -239,7 +238,6 @@ _Bool ready;
 int phase;
 _Bool proceed;
 
-(void) printf("JMPDBG starting from waitincoming\n");
 newsoc=(SOCTYP *)0;
 ready=false;
 phase=0;
@@ -282,7 +280,6 @@ while (proceed==true) {
     }
   phase++;
   }
-(void) printf("JMPDBG exit from waitincoming\n");
 return newsoc;
 #undef  OPEP
 }
@@ -603,7 +600,6 @@ if (soc!=(SOCTYP *)0) {
 
   polling[0].events=POLLIN|POLLPRI;
   polling[0].revents=(short)0;
-  (void) printf("JMPDBG modtls='%d'\n",soc->modtls);
   switch (soc->modtls) {
     case true   :
       polling[0].fd=SSL_get_fd(soc->tls->ssl);
@@ -659,10 +655,12 @@ while (proceed==true) {
         phase=999;      //No End Of Line yet
       break;
     case 3      :       //duplicating carpile
+      (void) printf("JMPDBG carpil=<%s>\n",soc->carpile);
       *lineptr=calloc(soc->carin+1,sizeof(char));
       *eol='\000';
       (void) strcpy(*lineptr,soc->carpile);
       (void) strcat(*lineptr,soc->EOL);
+      (void) printf("JMPDBG *lineptr=<%s>\n",*lineptr);
       got=strlen(*lineptr);
       break;
     case 4      :       //managing carpile
@@ -737,6 +735,7 @@ if (soc!=(SOCTYP *)0) {
   switch (soc->modtls) {
     case true   :
       got=tls_read(soc->tls,buffer,limit);
+      (void) printf("JMPDBG tls_read got='%d'\n",got);
       break;
     case false  :
       got=recv(soc->handle,buffer,limit,MSG_DONTWAIT);
@@ -762,6 +761,7 @@ if (soc!=(SOCTYP *)0) {
   if (got>0) {                 //we have recived some character
     soc->carin+=got;           //managing carpile
     soc->carpile[soc->carin]='\000';
+    (void) printf("JMPDBG soc_receive carpile=<%s>\n",soc->carpile);
     }
   }
 #undef  OPEP
index 360a2f6228f9884693bbadb5cad9a8104af821ce..2110aebafa1908cacd2bd73d570a5dcfedc066ea 100644 (file)
@@ -20,7 +20,7 @@
 
 //version definition 
 #define VERSION "0.3"
-#define RELEASE "31"
+#define RELEASE "32"
 
 //Public variables
 PUBLIC  int debug=0;            //debug level
index 0d0ebc275769f9e2609a827708b29504661f7b0e..724468c271734ca8e1bec399e237494820b0dbd0 100644 (file)
@@ -411,7 +411,6 @@ PUBLIC int tls_write(TLSTYP *tls,char *buffer,int tosend)
 int sent;
 
 sent=0;
-(void) printf("JMPDBG sending<%s>\n",buffer);
 if (tls!=(TLSTYP *)0) {
   _Bool proceed;
   int sofar;
@@ -420,7 +419,7 @@ if (tls!=(TLSTYP *)0) {
   while (proceed==true) {
     proceed=false;
     sofar=SSL_write(tls->ssl,buffer,tosend);
-    switch (sent) {
+    switch (sofar) {
       case -1     :       //trouble to write
         switch (SSL_get_error(tls->ssl,-1)) {
           case SSL_ERROR_WANT_READ        :     //"wanted" error