You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.0 KiB

  1. /*
  2. * weighttp - a lightweight and simple webserver benchmarking tool
  3. *
  4. * Author:
  5. * Copyright (c) 2009 Thomas Porzelt
  6. *
  7. * License:
  8. * MIT, see COPYING file
  9. */
  10. #ifndef WEIGHTTP_H
  11. #define WEIGHTTP_H 1
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <time.h>
  15. #include <errno.h>
  16. #include <string.h>
  17. #include <unistd.h>
  18. #include <stdint.h>
  19. #include <fcntl.h>
  20. #include <inttypes.h>
  21. #include <sys/socket.h>
  22. #include <netdb.h>
  23. #include <ev.h>
  24. #include <pthread.h>
  25. #define CLIENT_BUFFER_SIZE 32 * 1024
  26. #define W_MALLOC(t, n) ((t*) calloc((n), sizeof(t)))
  27. #define W_ERROR(f, ...) fprintf(stderr, "error: " f "\n", __VA_ARGS__)
  28. #define UNUSED(x) ( (void)(x) )
  29. struct Config;
  30. typedef struct Config Config;
  31. struct Stats;
  32. typedef struct Stats Stats;
  33. struct Worker;
  34. typedef struct Worker Worker;
  35. struct Client;
  36. typedef struct Client Client;
  37. #include "client.h"
  38. #include "worker.h"
  39. struct Config {
  40. uint64_t req_count;
  41. uint8_t thread_count;
  42. uint16_t concur_count;
  43. uint8_t keep_alive;
  44. char *request;
  45. uint32_t request_size;
  46. struct addrinfo *saddr;
  47. };
  48. #endif