Skip to content

Commit 6e65dba

Browse files
committed
Fixes from peer review. Thanks
1 parent 345b90e commit 6e65dba

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

ocsp/ocsp_nonblock/ocsp_nonblock.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ static int io_timeout_sec = DEFAULT_TIMEOUT_SEC;
4545

4646
static SOCKET_T sfd = SOCKET_INVALID;
4747
static word16 port;
48-
static int ret = -1;
4948
static char path[MAX_URL_ITEM_SIZE];
5049
static char domainName[MAX_URL_ITEM_SIZE];
5150
static int nonBlockCnt = 0;
@@ -55,15 +54,17 @@ static byte* httpBuf;
5554
static 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

Comments
 (0)