pitchfork 0.18.3 → 0.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/actions.lock +4 -4
- data/.github/workflows/ci.yml +4 -2
- data/.github/workflows/release.yml +1 -1
- data/CHANGELOG.md +7 -0
- data/ext/pitchfork_http/pitchfork_http.c +1111 -1114
- data/ext/pitchfork_http/pitchfork_http.rl +5 -6
- data/lib/pitchfork/version.rb +1 -1
- metadata +1 -1
|
@@ -349,6 +349,8 @@ static void write_value(VALUE self, struct http_parser *hp,
|
|
|
349
349
|
|
|
350
350
|
%%{
|
|
351
351
|
machine http_parser;
|
|
352
|
+
alphtype unsigned char;
|
|
353
|
+
getkey (unsigned char)*p;
|
|
352
354
|
|
|
353
355
|
action mark {MARK(mark, fpc); }
|
|
354
356
|
|
|
@@ -911,13 +913,10 @@ static VALUE HttpParser_hijacked_bang(VALUE self)
|
|
|
911
913
|
static VALUE HttpParser_filter_body(VALUE self, VALUE dst, VALUE src)
|
|
912
914
|
{
|
|
913
915
|
struct http_parser *hp = data_get(self);
|
|
914
|
-
char *srcptr;
|
|
915
916
|
long srclen;
|
|
916
917
|
|
|
917
|
-
srcptr = RSTRING_PTR(src);
|
|
918
|
-
srclen = RSTRING_LEN(src);
|
|
919
|
-
|
|
920
918
|
StringValue(dst);
|
|
919
|
+
srclen = RSTRING_LEN(src);
|
|
921
920
|
|
|
922
921
|
if (HP_FL_TEST(hp, CHUNKED)) {
|
|
923
922
|
if (!chunked_eof(hp)) {
|
|
@@ -928,7 +927,7 @@ static VALUE HttpParser_filter_body(VALUE self, VALUE dst, VALUE src)
|
|
|
928
927
|
hp->s.dest_offset = 0;
|
|
929
928
|
RB_OBJ_WRITE(self, &hp->cont, dst);
|
|
930
929
|
RB_OBJ_WRITE(self, &hp->buf, src);
|
|
931
|
-
http_parser_execute(self, hp,
|
|
930
|
+
http_parser_execute(self, hp, RSTRING_PTR(src), srclen);
|
|
932
931
|
if (hp->cs == http_parser_error)
|
|
933
932
|
parser_raise(eHttpParserError, "Invalid HTTP format, parsing fails.");
|
|
934
933
|
|
|
@@ -963,7 +962,7 @@ static VALUE HttpParser_filter_body(VALUE self, VALUE dst, VALUE src)
|
|
|
963
962
|
* when the +src+ buffer is modified (when reading off the socket).
|
|
964
963
|
*/
|
|
965
964
|
RB_OBJ_WRITE(self, &hp->buf, src);
|
|
966
|
-
memcpy(RSTRING_PTR(dst),
|
|
965
|
+
memcpy(RSTRING_PTR(dst), RSTRING_PTR(src), nr);
|
|
967
966
|
hp->len.content -= nr;
|
|
968
967
|
if (hp->len.content == 0) {
|
|
969
968
|
HP_FL_SET(hp, REQEOF);
|
data/lib/pitchfork/version.rb
CHANGED