LCOV - code coverage report
Current view: top level - discof/restore/utils - fd_sshttp_private.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 0 10 0.0 %
Date: 2025-12-06 04:45:29 Functions: 0 0 -

          Line data    Source code
       1             : #ifndef HEADER_fd_src_discof_restore_utils_fd_sshttp_private_h
       2             : #define HEADER_fd_src_discof_restore_utils_fd_sshttp_private_h
       3             : 
       4             : #include "fd_sshttp.h"
       5             : 
       6             : #if FD_HAS_OPENSSL
       7             : #include <openssl/ssl.h>
       8             : #endif
       9             : 
      10           0 : #define FD_SSHTTP_MAGIC (0xF17EDA2CE5811900) /* FIREDANCE HTTP V0 */
      11             : 
      12           0 : #define FD_SSHTTP_STATE_INIT          (0) /* start */
      13           0 : #define FD_SSHTTP_STATE_CONNECT       (1) /* connecting ssl */
      14           0 : #define FD_SSHTTP_STATE_REQ           (2) /* sending request */
      15           0 : #define FD_SSHTTP_STATE_RESP          (3) /* receiving response headers */
      16           0 : #define FD_SSHTTP_STATE_DL            (4) /* downloading response body */
      17           0 : #define FD_SSHTTP_STATE_SHUTTING_DOWN (5) /* shutting down ssl */
      18           0 : #define FD_SSHTTP_STATE_REDIRECT      (6) /* redirect after shutting down ssl */
      19           0 : #define FD_SSHTTP_STATE_DONE          (7) /* done */
      20             : 
      21           0 : #define FD_SSHTTP_DEADLINE_NANOS (1L*1000L*1000L*1000L) /* 1 second  */
      22             : 
      23             : struct fd_sshttp_private {
      24             :   int   state;
      25             :   int   next_state; /* used for state transitions in https connection */
      26             :   long  deadline;
      27             :   ulong empty_recvs;
      28             : 
      29             :   int   hops;
      30             : 
      31             :   char  location[ PATH_MAX ];
      32             :   ulong location_len;
      33             : 
      34             :   fd_ip4_port_t addr;
      35             :   char const *  hostname;
      36             :   int           is_https;
      37             :   int           sockfd;
      38             : 
      39             :   char  request[ 4096UL ];
      40             :   ulong request_len;
      41             :   ulong request_sent;
      42             : 
      43             :   ulong response_len;
      44             :   char  response[ USHORT_MAX ];
      45             : 
      46             :   char  snapshot_name[ PATH_MAX ];
      47             : 
      48             : #if FD_HAS_OPENSSL
      49             :   SSL_CTX * ssl_ctx;
      50             :   SSL *     ssl;
      51             : #endif
      52             : 
      53             :   ulong content_len;
      54             :   ulong content_read;
      55             : 
      56             :   ulong magic;
      57             : };
      58             : 
      59             : #endif /* HEADER_fd_src_discof_restore_utils_fd_sshttp_private_h */

Generated by: LCOV version 1.14