@@ -45,7 +45,6 @@ static int io_timeout_sec = DEFAULT_TIMEOUT_SEC;
4545
4646static SOCKET_T sfd = SOCKET_INVALID ;
4747static word16 port ;
48- static int ret = -1 ;
4948static char path [MAX_URL_ITEM_SIZE ];
5049static char domainName [MAX_URL_ITEM_SIZE ];
5150static int nonBlockCnt = 0 ;
@@ -55,15 +54,17 @@ static byte* httpBuf;
5554static int OcspLookupNonBlockCb (void * ctx , const char * url , int urlSz ,
5655 byte * ocspReqBuf , int ocspReqSz , byte * * ocspRespBuf )
5756{
57+ int ret = WOLFSSL_CBIO_ERR_GENERAL ;
58+
5859 if (sfd != SOCKET_INVALID ) {
5960 ret = wolfIO_HttpProcessResponseOcsp (sfd , ocspRespBuf ,
60- httpBuf , HTTP_SCRATCH_BUFFER_SIZE , ctx );
61+ httpBuf , HTTP_SCRATCH_BUFFER_SIZE , NULL );
6162 nonBlockCnt ++ ;
6263 if (ret == OCSP_WANT_READ )
6364 return WOLFSSL_CBIO_ERR_WANT_READ ;
6465 printf ("OCSP Response: ret %d, nonblock count %d\n" ,
6566 ret , nonBlockCnt );
66- XFREE (httpBuf , ctx , DYNAMIC_TYPE_OCSP );
67+ XFREE (httpBuf , NULL , DYNAMIC_TYPE_OCSP );
6768 httpBuf = NULL ;
6869 return ret ;
6970 }
@@ -126,10 +127,11 @@ static int OcspLookupNonBlockCb(void* ctx, const char* url, int urlSz,
126127 }
127128 if (sfd != SOCKET_INVALID )
128129 CloseSocket (sfd );
129- XFREE (httpBuf , ctx , DYNAMIC_TYPE_OCSP );
130+ XFREE (httpBuf , NULL , DYNAMIC_TYPE_OCSP );
130131 httpBuf = NULL ;
131132 }
132133 }
134+ (void )ctx ;
133135 printf ("Resp ret: %d\n" , ret );
134136 return ret ;
135137}
0 commit comments