Sha256: 7183fe235a776f44f85387e60f753e58dee4f0830424125cedde8ad8d24be956

Contents?: true

Size: 813 Bytes

Versions: 2

Compression:

Stored size: 813 Bytes

Contents

#pragma once

#include "nyara.h"
#include <multipart_parser.h>
#include <errno.h>
#ifndef write
#include <unistd.h>
#endif

enum ParseState {
  PS_INIT, PS_HEADERS_COMPLETE, PS_MESSAGE_COMPLETE, PS_ERROR
};

typedef struct {
  http_parser hparser;
  multipart_parser* mparser;

  enum http_method method;
  int fd;
  enum ParseState parse_state;
  int status;   // response status

  VALUE self;

  // request
  VALUE header;
  VALUE accept; // mime array sorted with q
  VALUE format; // string ext without dot
  VALUE fiber;
  VALUE scope;  // mapped prefix
  VALUE path_with_query;
  VALUE path;
  VALUE query;
  VALUE last_field;
  VALUE last_value;

  // response
  VALUE response_content_type;
  VALUE response_header;
  VALUE response_header_extra_lines;

  VALUE watched_fds;

  bool sleeping;
} Request;

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nyara-0.0.1.pre.5 ext/request.h
nyara-0.0.1.pre.4 ext/request.h