Changeset 32f2e60 in mod_gnutls for src/gnutls_io.c
- Timestamp:
- Dec 9, 2004, 2:52:31 AM (18 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, jessie-backports, master, msva, proxy-ticket, upstream
- Children:
- 76bd3bf
- Parents:
- 0314deb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_io.c
r0314deb r32f2e60 333 333 334 334 335 #define GNUTLS_HANDSHAKE_ATTEMPTS 10336 337 335 static void gnutls_do_handshake(mod_gnutls_handle_t * ctxt) 338 336 { 339 int i,ret;337 int ret; 340 338 341 339 if (ctxt->status != 0) 342 340 return; 343 #if 0344 345 for (i = GNUTLS_HANDSHAKE_ATTEMPTS; i > 0; i--) {346 ret = gnutls_handshake(ctxt->session);347 if (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN) {348 continue;349 }350 351 if (ret < 0) {352 if (ret == GNUTLS_E_WARNING_ALERT_RECEIVED353 || ret == GNUTLS_E_FATAL_ALERT_RECEIVED) {354 ret = gnutls_alert_get(ctxt->session);355 ap_log_error(APLOG_MARK, APLOG_ERR, 0, ctxt->c->base_server,356 "GnuTLS: Hanshake Alert (%d) '%s'.\n", ret,357 gnutls_alert_get_name(ret));358 }359 360 gnutls_deinit(ctxt->session);361 ap_log_error(APLOG_MARK, APLOG_ERR, 0, ctxt->c->base_server,362 "GnuTLS: Handshake Failed (%d) '%s'", ret,363 gnutls_strerror(ret));364 ctxt->status = -1;365 return;366 }367 else {368 ctxt->status = 1;369 return; /* all done with the handshake */370 }371 }372 ctxt->status = -1;373 return;374 #else375 341 ret = gnutls_handshake(ctxt->session); 376 342 if (ret < 0) { … … 394 360 return; /* all done with the handshake */ 395 361 } 396 397 #endif398 362 } 399 363 … … 466 430 apr_bucket_brigade * bb) 467 431 { 468 int ret;432 apr_size_t ret; 469 433 mod_gnutls_handle_t *ctxt = (mod_gnutls_handle_t *) f->ctx; 470 434 apr_status_t status = APR_SUCCESS; … … 514 478 } 515 479 else { 516 517 480 /* filter output */ 518 481 const char *data; … … 547 510 } 548 511 } 549 else if ((apr_size_t) ret != len) { 550 //apr_bucket_split(bucket, ret); 551 //APR_BUCKET_REMOVE(bucket); 552 /* not all of the data was sent. */ 553 /* mod_ssl basicly errors out here.. this doesn't seem right? */ 554 ap_log_error(APLOG_MARK, APLOG_INFO, ctxt->output_rc, 555 ctxt->c->base_server, 556 "GnuTLS: failed to write %" APR_SSIZE_T_FMT 557 " of %" APR_SIZE_T_FMT " bytes.", 558 len - (apr_size_t) ret, len); 559 //continue; 560 if (ctxt->output_rc == APR_SUCCESS) { 561 ctxt->output_rc = APR_EGENERAL; 562 } 512 else if (ret != len) { 513 /* Not able to send the entire bucket, 514 split it and send it again. */ 515 apr_bucket_split(bucket, ret); 563 516 } 564 517
Note: See TracChangeset
for help on using the changeset viewer.