Changeset 32f2e60 in mod_gnutls for src/gnutls_io.c


Ignore:
Timestamp:
Dec 9, 2004, 2:52:31 AM (15 years ago)
Author:
Paul Querna <chip@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, msva, upstream
Children:
76bd3bf
Parents:
0314deb
Message:

fixes and stuff that i should of already committed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_io.c

    r0314deb r32f2e60  
    333333
    334334
    335 #define GNUTLS_HANDSHAKE_ATTEMPTS 10
    336 
    337335static void gnutls_do_handshake(mod_gnutls_handle_t * ctxt)
    338336{
    339     int i, ret;
     337    int ret;
    340338
    341339    if (ctxt->status != 0)
    342340        return;
    343 #if 0
    344 
    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_RECEIVED
    353                 || 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 #else
    375341        ret = gnutls_handshake(ctxt->session);
    376342        if (ret < 0) {
     
    394360            return;             /* all done with the handshake */
    395361        }
    396 
    397 #endif
    398362}
    399363
     
    466430                                      apr_bucket_brigade * bb)
    467431{
    468     int ret;
     432    apr_size_t ret;
    469433    mod_gnutls_handle_t *ctxt = (mod_gnutls_handle_t *) f->ctx;
    470434    apr_status_t status = APR_SUCCESS;
     
    514478        }
    515479        else {
    516 
    517480            /* filter output */
    518481            const char *data;
     
    547510                }
    548511            }
    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);
    563516            }
    564517
Note: See TracChangeset for help on using the changeset viewer.