Sha256: 883c937d6939c9a1c85da2ceb7336bff5e9aa7b44664fe7c1229b2c9249446bc

Contents?: true

Size: 795 Bytes

Versions: 1

Compression:

Stored size: 795 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;
} Request;

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nyara-0.0.1.pre.3 ext/request.h