Changeset 689 for trunk/sx/compress.c

Show
Ignore:
Timestamp:
19/08/08 12:42:16 (5 months ago)
Author:
smoku
Message:

Do not offer compression if STARTTLS is required and not enabled. Return better error on STARTTLS required failure.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/sx/compress.c

    r672 r689  
    120120    int ns; 
    121121 
    122     /* if the session is already compressed, or the app told us not to, then we don't offer anything */ 
    123     if(s->compressed || !(s->flags & SX_COMPRESS_OFFER)) 
     122    /* if the session is already compressed, or the app told us not to, 
     123         * or STARTTLS is required and stream is not encrypted yet, then we don't offer anything */ 
     124    if(s->compressed || !(s->flags & SX_COMPRESS_OFFER) || ((s->flags & SX_SSL_STARTTLS_REQUIRE) && s->ssf == 0)) 
    124125        return; 
    125126