Changeset fd82e59 in mod_gnutls for src/gnutls_io.c


Ignore:
Timestamp:
Feb 27, 2014, 2:26:26 AM (6 years ago)
Author:
Daniel Kahn Gillmor <dkg@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
c32240f
Parents:
8a30d35
Message:

use strict compiler arguments by default (-Wall -Werror -Wextra)

Because apache modules make heavy use of generic hooks that have to
have arguments that cover every corner use case, and we don't need all
that data, many mod_gnutls functions have unused parameters, which
have now been explicitly designated as unused.

We also have at least one generic function signature declared for our
interaction with GnuTLS as well, and we aren't using some of those
parameters either.

A useful future review might be to read up on how the unused
parameters are used by other apache modules or users of GnuTLS, to see
if we might gather useful ideas.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_io.c

    r8a30d35 rfd82e59  
    510510    if (ctxt->input_mode == AP_MODE_READBYTES ||
    511511            ctxt->input_mode == AP_MODE_SPECULATIVE) {
     512        if (readbytes < 0) {
     513            /* you're asking us to speculatively read a negative number of bytes! */
     514            return APR_ENOTIMPL;
     515        }
    512516        /* Err. This is bad. readbytes *can* be a 64bit int! len.. is NOT */
    513         if (readbytes < len) {
     517        if ((apr_size_t) readbytes < len) {
    514518            len = (apr_size_t) readbytes;
    515519        }
     
    573577
    574578apr_status_t mgs_filter_output(ap_filter_t * f, apr_bucket_brigade * bb) {
    575     apr_size_t ret;
     579    int ret;
    576580    mgs_handle_t *ctxt = (mgs_handle_t *) f->ctx;
    577581    apr_status_t status = APR_SUCCESS;
     
    672676                        return ctxt->output_rc;
    673677                    }
    674                 } else if (ret != len) {
     678                } else if ((apr_size_t)(ret) != len) {
     679                    /* we know the above cast is OK because len > 0 and ret >= 0 */
    675680                    /* Not able to send the entire bucket,
    676681                       split it and send it again. */
Note: See TracChangeset for help on using the changeset viewer.