~ubuntu-branches/ubuntu/utopic/nordugrid-arc/utopic

« back to all changes in this revision

Viewing changes to src/hed/mcc/tls/PayloadTLSMCC.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2014-05-01 20:51:02 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140501205102-icy9t3348uxobyx7
Tags: 4.1.0-1
* 4.1.0 Release
* Call dh_autoreconf to support ppc64le (Closes: #744639)

Show diffs side-by-side

added added

removed removed

Lines of Context:
414
414
    int err = SSL_shutdown(ssl_);
415
415
    if(err == 0) err = SSL_shutdown(ssl_);
416
416
    if(err < 0) { // -1 expected
417
 
      logger_.msg(INFO, "Failed to shut down SSL");
418
 
      ConfigTLSMCC::HandleError();
 
417
      err = SSL_get_error(ssl_,err);
 
418
      if((err == SSL_ERROR_WANT_READ) || (err == SSL_ERROR_WANT_WRITE)) {
 
419
        // We are not going to wait for connection to
 
420
        // close nicely. We are too impatient.
 
421
        ConfigTLSMCC::HandleError();
 
422
      } else if(err == SSL_ERROR_SYSCALL) {
 
423
        // It would be interesting to check errno. But
 
424
        // unfortunately it seems to be lost already
 
425
        // inside SSL_shutdown().
 
426
        ConfigTLSMCC::HandleError();
 
427
      } else {
 
428
        // This case is unexpected. So it is better to
 
429
        // report it.
 
430
        logger_.msg(VERBOSE, "Failed to shut down SSL: %s",ConfigTLSMCC::HandleError(err));
 
431
      }
419
432
      // Trying to get out of error
420
433
      SSL_set_quiet_shutdown(ssl_,1);
421
434
      SSL_shutdown(ssl_);