mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
update comments and check error case
This commit is contained in:
16
src/ssl.c
16
src/ssl.c
@ -17076,11 +17076,23 @@ cleanup:
|
||||
}
|
||||
else {
|
||||
int idx = wc_GetCurrentIdx();
|
||||
if (idx > 0) {
|
||||
idx = idx -1;
|
||||
if (idx < 0) {
|
||||
WOLFSSL_MSG("Error with getting current index!");
|
||||
ret = BAD_STATE_E;
|
||||
WOLFSSL_LEAVE("wolfSSL_ERR_get_error", ret);
|
||||
|
||||
/* panic and try to clear out nodes and reset queue state */
|
||||
wc_ClearErrorNodes();
|
||||
}
|
||||
else if (idx > 0) {
|
||||
idx -= 1;
|
||||
wc_RemoveErrorNode(idx);
|
||||
}
|
||||
else {
|
||||
/* if current idx is 0 then the queue only had one node */
|
||||
wc_RemoveErrorNode(idx);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
#else
|
||||
|
@ -812,8 +812,10 @@ int wc_AddErrorNode(int error, int line, char* buf, char* file)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* returns the current index into the queue, can be greater than zero in cases
|
||||
* where wc_PullErrorNode() has been callded. */
|
||||
/* returns the current index into the queue, which is the node that
|
||||
* wc_current_node is pointing to. It can be greater than zero in cases
|
||||
* where wc_PullErrorNode() has been called without the node having been
|
||||
* removed. */
|
||||
int wc_GetCurrentIdx()
|
||||
{
|
||||
int ret = 0;
|
||||
|
Reference in New Issue
Block a user