diff options
Diffstat (limited to 'src/gnutls_io.c')
-rw-r--r-- | src/gnutls_io.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/gnutls_io.c b/src/gnutls_io.c index f081284..5e0c4ef 100644 --- a/src/gnutls_io.c +++ b/src/gnutls_io.c | |||
@@ -358,12 +358,14 @@ static int gnutls_do_handshake(mod_gnutls_handle_t * ctxt) | |||
358 | int ret; | 358 | int ret; |
359 | int errcode; | 359 | int errcode; |
360 | if (ctxt->status != 0) { | 360 | if (ctxt->status != 0) { |
361 | return 0; | 361 | return -1; |
362 | } | 362 | } |
363 | 363 | ||
364 | tryagain: | 364 | tryagain: |
365 | 365 | do { | |
366 | ret = gnutls_handshake(ctxt->session); | 366 | ret = gnutls_handshake(ctxt->session); |
367 | } while (ret == GNUTLS_E_AGAIN); | ||
368 | |||
367 | if (ret < 0) { | 369 | if (ret < 0) { |
368 | if (ret == GNUTLS_E_WARNING_ALERT_RECEIVED | 370 | if (ret == GNUTLS_E_WARNING_ALERT_RECEIVED |
369 | || ret == GNUTLS_E_FATAL_ALERT_RECEIVED) { | 371 | || ret == GNUTLS_E_FATAL_ALERT_RECEIVED) { |
@@ -392,7 +394,7 @@ tryagain: | |||
392 | else { | 394 | else { |
393 | /* all done with the handshake */ | 395 | /* all done with the handshake */ |
394 | ctxt->status = 1; | 396 | ctxt->status = 1; |
395 | return ret; | 397 | return 0; |
396 | } | 398 | } |
397 | } | 399 | } |
398 | 400 | ||
@@ -411,14 +413,9 @@ int mod_gnutls_rehandshake(mod_gnutls_handle_t * ctxt) | |||
411 | 413 | ||
412 | ctxt->status = 0; | 414 | ctxt->status = 0; |
413 | 415 | ||
414 | gnutls_do_handshake(ctxt); | 416 | rv = gnutls_do_handshake(ctxt); |
415 | 417 | ||
416 | if (ctxt->status == 1) { | 418 | return rv; |
417 | return 0; | ||
418 | } | ||
419 | else { | ||
420 | return -1; | ||
421 | } | ||
422 | } | 419 | } |
423 | 420 | ||
424 | 421 | ||