Advertisement
Guest User

No wonder grepping for ssl-unclean-shutdown didn't work…

a guest
Aug 29th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.25 KB | None | 0 0
  1. // from apache2-2.4.10/modules/ssl/ssl_engine_kernel.c
  2.  
  3. /*
  4.  * Move SetEnvIf information from request_rec to conn_rec/BUFF
  5.  * to allow the close connection handler to use them.
  6.  */
  7.  
  8. static void ssl_configure_env(request_rec *r, SSLConnRec *sslconn)
  9. {
  10.     int i;
  11.     const apr_array_header_t *arr = apr_table_elts(r->subprocess_env);
  12.     const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts;
  13.  
  14.     sslconn->shutdown_type = SSL_SHUTDOWN_TYPE_STANDARD;
  15.  
  16.     for (i = 0; i < arr->nelts; i++) {
  17.         const char *key = elts[i].key;
  18.  
  19.         switch (*key) {
  20.           case 's':
  21.             /* being case-sensitive here.
  22.              * and not checking for the -shutdown since these are the only
  23.              * SetEnvIf "flags" we support
  24.              */
  25.             if (!strncmp(key+1, "sl-", 3)) {
  26.                 key += 4;
  27.                 if (!strncmp(key, "unclean", 7)) {
  28.                     sslconn->shutdown_type = SSL_SHUTDOWN_TYPE_UNCLEAN;
  29.                 }
  30.                 else if (!strncmp(key, "accurate", 8)) {
  31.                     sslconn->shutdown_type = SSL_SHUTDOWN_TYPE_ACCURATE;
  32.                 }
  33.                 return; /* should only ever be one ssl-*-shutdown */
  34.             }
  35.             break;
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement