The infamous to-do list

Sven Paulus sven at tin.org
Thu Jun 29 00:52:10 UTC 2000


Kevin McKinnon <kevin at sunshinecable.com> wrote:
|> There is code in nnrpd.c, perl.c, and article.c that references 
|> MaxBytesPerSecond which looks, on quick examination, to do part of 
|> what you're looking for.

Looking at the code for the first time, I ask myself if this doesn't
break SSL connections when MaxBytesPerSecond != 0? Forgive me if I'm
stupid and misunderstanding everything :)

It says:

BOOL PushIOv(void) {
    fflush(stdout);
    if (MaxBytesPerSecond != 0)
        return PushIOvRateLimited();
#ifdef HAVE_SSL
    if (tls_conn) {
      if (SSL_writev(tls_conn, iov, queued_iov) <= 0) {
        queued_iov = 0;
        return FALSE;
      }
    } else {
      if (writev(STDOUT_FILENO, iov, queued_iov) <= 0) {
        queued_iov = 0;
        return FALSE;
      }
    }
#else
    if (writev(STDOUT_FILENO, iov, queued_iov) <= 0) {
      queued_iov = 0;
      return FALSE;
    }
#endif
    queued_iov = 0;
    return TRUE;
}

But shouldn't it look like this?

BOOL PushIOv(void) {
    fflush(stdout);
#ifdef HAVE_SSL
    if (tls_conn) {
      if (SSL_writev(tls_conn, iov, queued_iov) <= 0) {
        queued_iov = 0;
        return FALSE;
      }
    } else {
#endif
      if (MaxBytesPerSecond != 0)
        return PushIOvRateLimited();
      if (writev(STDOUT_FILENO, iov, queued_iov) <= 0) {
        queued_iov = 0;
        return FALSE;
      }
#ifdef HAVE_SSL
    }
#endif
    queued_iov = 0;
    return TRUE;
}

Sven




More information about the inn-workers mailing list