src/microspdy/internal.h File Reference

internal functions and macros for the framing layer More...

#include "platform.h"
#include "microspdy.h"
Include dependency graph for internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define SPDYF_BUFFER_SIZE   8192
#define SPDYF_INITIAL_WINDOW_SIZE   65536
#define SPDYF_NUM_SENT_FRAMES_AT_ONCE   10
#define SPDYF_PANIC(msg)   spdyf_panic (spdyf_panic_cls, __FILE__, __LINE__, msg)
#define SPDYF_ASSERT(expr, msg)
#define HTON24(n)
#define NTOH24(n)
#define NTOH31(n)
#define HTON31(n)
#define SPDYF_DEBUG(fmt,...)
#define SPDYF_PRINT_STREAM(strm, size)
#define SPDYF_SIGINT(msg)

Functions

unsigned long long SPDYF_monotonic_time (void)

Variables

SPDY_PanicCallback spdyf_panic
void * spdyf_panic_cls

Detailed Description

internal functions and macros for the framing layer

Author:
Andrey Uzunov

Definition in file internal.h.


Define Documentation

#define HTON24 (  ) 
Value:
(((((uint32_t)(n) & 0xFF)) << 16)\
        | (((uint32_t)(n) & 0xFF00))\
        | ((((uint32_t)(n) & 0xFF0000)) >> 16))

Convert 24 bit integer from host byte order to network byte order.

Parameters:
n input value (int32_t)
Returns:
converted value (uint32_t)

Definition at line 95 of file internal.h.

#define HTON31 (  ) 
Value:
(((((uint32_t)(n) & 0xFF)) << 24) | \
                  ((((uint32_t)(n) & 0xFF00)) << 8) | \
                  ((((uint32_t)(n) & 0xFF0000)) >> 8) | \
                  ((((uint32_t)(n) & 0x7F000000)) >> 24))

Convert 31 bit integer from host byte order to network byte order.

Parameters:
n input value (int32_t)
Returns:
converted value (uint32_t)

Definition at line 141 of file internal.h.

Referenced by SPDYF_handler_write_goaway(), SPDYF_handler_write_syn_reply(), SPDYF_prepare_rst_stream(), and SPDYF_prepare_window_update().

#define NTOH24 (  ) 
Value:
(((((uint32_t)(n) & 0xFF)) << 16)\
        | (((uint32_t)(n) & 0xFF00))\
        | ((((uint32_t)(n) & 0xFF0000)) >> 16))

Convert 24 bit integer from network byte order to host byte order.

Parameters:
n input value (int32_t)
Returns:
converted value (uint32_t)

Definition at line 110 of file internal.h.

#define NTOH31 (  ) 
Value:
(((((uint32_t)(n) & 0x7F)) << 24) | \
                  ((((uint32_t)(n) & 0xFF00)) << 8) | \
                  ((((uint32_t)(n) & 0xFF0000)) >> 8) | \
                  ((((uint32_t)(n) & 0xFF000000)) >> 24))

Convert 31 bit integer from network byte order to host byte order.

Parameters:
n input value (int32_t)
Returns:
converted value (uint32_t)

Definition at line 125 of file internal.h.

Referenced by spdyf_handler_read_goaway(), spdyf_handler_read_rst_stream(), and SPDYF_stream_new().

#define SPDYF_ASSERT ( expr,
msg   ) 
#define SPDYF_BUFFER_SIZE   8192

size of read buffers for each connection must be at least the size of SPDY_MAX_SUPPORTED_FRAME_SIZE

Definition at line 35 of file internal.h.

Referenced by SPDY_init(), and SPDYF_session_accept().

#define SPDYF_DEBUG ( fmt,
...   ) 
#define SPDYF_INITIAL_WINDOW_SIZE   65536

initial size of window for each stream (this is for the data within data frames that can be handled)

Definition at line 41 of file internal.h.

Referenced by spdyf_handler_read_data(), and SPDYF_stream_new().

#define SPDYF_NUM_SENT_FRAMES_AT_ONCE   10

number of frames written to the socket at once. After X frames everything should be run again. In this way the application can response to more important requests while a big file is still being transmitted to the client

Definition at line 49 of file internal.h.

Referenced by SPDYF_start_daemon_va().

#define SPDYF_PANIC ( msg   )     spdyf_panic (spdyf_panic_cls, __FILE__, __LINE__, msg)

Trigger 'panic' action based on fatal errors.

Parameters:
msg error message (const char *)

Definition at line 69 of file internal.h.

#define SPDYF_PRINT_STREAM ( strm,
size   ) 
Value:
do { \
        int ___i;\
        for(___i=0;___i<size;___i++){\
                fprintf(stdout,"%x ",*((uint8_t *) strm + ___i));\
                fflush(stdout);\
        }\
        fprintf(stdout,"\n");\
        } while (0)

Print stream for debuging.

Parameters:
strm (void *)
size (int)

Definition at line 167 of file internal.h.

#define SPDYF_SIGINT ( msg   ) 
Value:
do { \
        fprintf(stdout,"%i : %s\n", __LINE__,__FILE__);\
        fprintf(stdout,msg);\
        fprintf(stdout,"\n");\
        fflush(stdout);\
        raise(SIGINT); } while (0)

Print message and raise SIGINT for debug purposes.

Parameters:
msg message (const char *)

Definition at line 182 of file internal.h.


Function Documentation

unsigned long long SPDYF_monotonic_time ( void   ) 

Returns monotonic time, to be used for session timeouts.

Returns:
time in milliseconds

Definition at line 30 of file internal.c.

References NULL.

Referenced by SPDYF_get_fdset(), SPDYF_get_timeout(), SPDYF_session_accept(), SPDYF_session_idle(), SPDYF_session_read(), and SPDYF_session_write().

Here is the caller graph for this function:


Variable Documentation

Handler for fatal errors.

Global handler for fatal errors.

Definition at line 58 of file daemon.c.

Referenced by SPDY_set_panic_func().

Closure argument for "mhd_panic".

Global closure argument for "spdyf_panic".

Definition at line 64 of file daemon.c.

Referenced by SPDY_set_panic_func().


Generated on 11 Mar 2016 for GNU libmicrohttpd by  doxygen 1.6.1