comparison src/event/ngx_event_openssl_stapling.c @ 6811:5eb3309d0b9e

OCSP stapling: added http response status logging.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 05 Dec 2016 22:23:22 +0300
parents 64f5bfba5d96
children a7ec59df0c4d
comparison
equal deleted inserted replaced
6810:64f5bfba5d96 6811:5eb3309d0b9e
1308 ngx_int_t rc; 1308 ngx_int_t rc;
1309 1309
1310 rc = ngx_ssl_ocsp_parse_status_line(ctx); 1310 rc = ngx_ssl_ocsp_parse_status_line(ctx);
1311 1311
1312 if (rc == NGX_OK) { 1312 if (rc == NGX_OK) {
1313 #if 0 1313 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
1314 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ctx->log, 0, 1314 "ssl ocsp status %ui \"%*s\"",
1315 "ssl ocsp status line \"%*s\"", 1315 ctx->code,
1316 ctx->response->pos - ctx->response->start, 1316 ctx->header_end - ctx->header_start,
1317 ctx->response->start); 1317 ctx->header_start);
1318 #endif
1319 1318
1320 ctx->process = ngx_ssl_ocsp_process_headers; 1319 ctx->process = ngx_ssl_ocsp_process_headers;
1321 return ctx->process(ctx); 1320 return ctx->process(ctx);
1322 } 1321 }
1323 1322
1474 1473
1475 ctx->code = ctx->code * 10 + ch - '0'; 1474 ctx->code = ctx->code * 10 + ch - '0';
1476 1475
1477 if (++ctx->count == 3) { 1476 if (++ctx->count == 3) {
1478 state = sw_space_after_status; 1477 state = sw_space_after_status;
1478 ctx->header_start = p - 2;
1479 } 1479 }
1480 1480
1481 break; 1481 break;
1482 1482
1483 /* space or end of line */ 1483 /* space or end of line */
1491 break; 1491 break;
1492 case CR: 1492 case CR:
1493 state = sw_almost_done; 1493 state = sw_almost_done;
1494 break; 1494 break;
1495 case LF: 1495 case LF:
1496 ctx->header_end = p;
1496 goto done; 1497 goto done;
1497 default: 1498 default:
1498 return NGX_ERROR; 1499 return NGX_ERROR;
1499 } 1500 }
1500 break; 1501 break;
1504 switch (ch) { 1505 switch (ch) {
1505 case CR: 1506 case CR:
1506 state = sw_almost_done; 1507 state = sw_almost_done;
1507 break; 1508 break;
1508 case LF: 1509 case LF:
1510 ctx->header_end = p;
1509 goto done; 1511 goto done;
1510 } 1512 }
1511 break; 1513 break;
1512 1514
1513 /* end of status line */ 1515 /* end of status line */
1514 case sw_almost_done: 1516 case sw_almost_done:
1515 switch (ch) { 1517 switch (ch) {
1516 case LF: 1518 case LF:
1519 ctx->header_end = p - 1;
1517 goto done; 1520 goto done;
1518 default: 1521 default:
1519 return NGX_ERROR; 1522 return NGX_ERROR;
1520 } 1523 }
1521 } 1524 }