ext/iodine/http1_parser.h
/* a helper that seeks the EOL, converts it to NUL and returns it's length */
a helper that seeks the EOL, converts it to NUL and returns it's length
a helper that seeks the EOL converts it to NUL and returns it ' s length
inline static uint8_t seek2eol(uint8_t **pos, uint8_t *const limit) {
  if (!seek2ch(pos, limit, '\n'))
    return 0;
  if ((*pos)[-1] == '\r') {
#if HTTP1_PARSER_CONVERT_EOL2NUL
    (*pos)[-1] = (*pos)[0] = 0;
#endif
    return 2;
  }
#if HTTP1_PARSER_CONVERT_EOL2NUL
  (*pos)[0] = 0;
#endif
  return 1;
}
inline static uint8_t seek2eol ( uint8_t * * pos , uint8_t * const limit ) { if ( ! seek2ch ( pos , limit , ' \n ' ) ) return 0 ; if ( ( * pos ) [ -1 ] == ' \r ' ) { #if HTTP1_PARSER_CONVERT_EOL2NUL ( * pos ) [ -1 ] = ( * pos ) [ 0 ] = 0 ; #endif return 2 ; } #if HTTP1_PARSER_CONVERT_EOL2NUL ( * pos ) [ 0 ] = 0 ; #endif return 1 ; }
a helper that seeks the EOL, converts it to NUL and returns it's length
a helper that seeks the EOL converts it to NUL and returns it ' s length
/* single char lookup using memchr might be better when target is far... */