Diff for /embedaddon/php/sapi/cli/php_http_parser.c between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2012/05/29 12:34:35 version 1.1.1.2, 2013/07/22 01:32:13
Line 81  static const char *method_strings[] = Line 81  static const char *method_strings[] =
   , "HEAD"    , "HEAD"
   , "POST"    , "POST"
   , "PUT"    , "PUT"
     , "PATCH"
   , "CONNECT"    , "CONNECT"
   , "OPTIONS"    , "OPTIONS"
   , "TRACE"    , "TRACE"
Line 99  static const char *method_strings[] = Line 100  static const char *method_strings[] =
   , "NOTIFY"    , "NOTIFY"
   , "SUBSCRIBE"    , "SUBSCRIBE"
   , "UNSUBSCRIBE"    , "UNSUBSCRIBE"
     , "NOTIMPLEMENTED"
   };    };
   
   
Line 589  size_t php_http_parser_execute (php_http_parser *parse Line 591  size_t php_http_parser_execute (php_http_parser *parse
           case 'S': parser->method = PHP_HTTP_SUBSCRIBE; break;            case 'S': parser->method = PHP_HTTP_SUBSCRIBE; break;
           case 'T': parser->method = PHP_HTTP_TRACE; break;            case 'T': parser->method = PHP_HTTP_TRACE; break;
           case 'U': parser->method = PHP_HTTP_UNLOCK; /* or UNSUBSCRIBE */ break;            case 'U': parser->method = PHP_HTTP_UNLOCK; /* or UNSUBSCRIBE */ break;
          default: goto error;          default: parser->method = PHP_HTTP_NOT_IMPLEMENTED; break;
         }          }
         state = s_req_method;          state = s_req_method;
         break;          break;
Line 602  size_t php_http_parser_execute (php_http_parser *parse Line 604  size_t php_http_parser_execute (php_http_parser *parse
           goto error;            goto error;
   
         matcher = method_strings[parser->method];          matcher = method_strings[parser->method];
        if (ch == ' ' && matcher[index] == '\0') {        if (ch == ' ' && (matcher[index] == '\0' || parser->method == PHP_HTTP_NOT_IMPLEMENTED)) {
           state = s_req_spaces_before_url;            state = s_req_spaces_before_url;
         } else if (ch == matcher[index]) {          } else if (ch == matcher[index]) {
           ; /* nada */            ; /* nada */
Line 626  size_t php_http_parser_execute (php_http_parser *parse Line 628  size_t php_http_parser_execute (php_http_parser *parse
           parser->method = PHP_HTTP_PROPFIND; /* or HTTP_PROPPATCH */            parser->method = PHP_HTTP_PROPFIND; /* or HTTP_PROPPATCH */
         } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'U') {          } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'U') {
           parser->method = PHP_HTTP_PUT;            parser->method = PHP_HTTP_PUT;
           } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'A') {
             parser->method = PHP_HTTP_PATCH;
         } else if (index == 2 && parser->method == PHP_HTTP_UNLOCK && ch == 'S') {          } else if (index == 2 && parser->method == PHP_HTTP_UNLOCK && ch == 'S') {
           parser->method = PHP_HTTP_UNSUBSCRIBE;            parser->method = PHP_HTTP_UNSUBSCRIBE;
         } else if (index == 4 && parser->method == PHP_HTTP_PROPFIND && ch == 'P') {          } else if (index == 4 && parser->method == PHP_HTTP_PROPFIND && ch == 'P') {
           parser->method = PHP_HTTP_PROPPATCH;            parser->method = PHP_HTTP_PROPPATCH;
         } else {          } else {
          goto error;          parser->method = PHP_HTTP_NOT_IMPLEMENTED;
         }          }
   
         ++index;          ++index;

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>