"Fossies" - the Fresh Open Source Software Archive

Member "wrk-4.2.0/src/main.h" (7 Feb 2021, 1492 Bytes) of package /linux/www/wrk-4.2.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "main.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef MAIN_H
    2 #define MAIN_H
    3 
    4 #include <ctype.h>
    5 #include <errno.h>
    6 #include <fcntl.h>
    7 #include <getopt.h>
    8 #include <math.h>
    9 #include <netinet/in.h>
   10 #include <netinet/tcp.h>
   11 #include <stdarg.h>
   12 #include <stdbool.h>
   13 #include <stdio.h>
   14 #include <stdlib.h>
   15 #include <string.h>
   16 #include <signal.h>
   17 #include <time.h>
   18 #include <unistd.h>
   19 #include <sys/time.h>
   20 #include <sys/uio.h>
   21 
   22 #include "ssl.h"
   23 #include "aprintf.h"
   24 #include "stats.h"
   25 #include "units.h"
   26 #include "zmalloc.h"
   27 
   28 struct config;
   29 
   30 static void *thread_main(void *);
   31 static int connect_socket(thread *, connection *);
   32 static int reconnect_socket(thread *, connection *);
   33 
   34 static int record_rate(aeEventLoop *, long long, void *);
   35 
   36 static void socket_connected(aeEventLoop *, int, void *, int);
   37 static void socket_writeable(aeEventLoop *, int, void *, int);
   38 static void socket_readable(aeEventLoop *, int, void *, int);
   39 
   40 static int response_complete(http_parser *);
   41 static int header_field(http_parser *, const char *, size_t);
   42 static int header_value(http_parser *, const char *, size_t);
   43 static int response_body(http_parser *, const char *, size_t);
   44 
   45 static uint64_t time_us();
   46 
   47 static int parse_args(struct config *, char **, struct http_parser_url *, char **, int, char **);
   48 static char *copy_url_part(char *, struct http_parser_url *, enum http_parser_url_fields);
   49 
   50 static void print_stats_header();
   51 static void print_stats(char *, stats *, char *(*)(long double));
   52 static void print_stats_latency(stats *);
   53 
   54 #endif /* MAIN_H */