You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- remove parseHttpRequest() and parseHttpResponse() functions
- add php_strncpy() function
- replace sprintf() with php_strncpy()
- modify CI configuration
It is important to have all the aforelisted requirements at the ready before attempting to install `ext-mrloop`. The directives in the snippet to follow should allow you to build the extension's shared object file (`mrloop.so`).
> This is a function that utilizes the `picohttpparser` API.
393
-
394
-
**Parameter(s)**
395
-
396
-
-**request** (string) - The HTTP request to parse.
397
-
-**headerlimit** (int) - The number of headers to parse.
398
-
> The default limit is `100`.
399
-
400
-
**Return value(s)**
401
-
402
-
The parser will throw an exception in the event that an invalid HTTP request is encountered and will output a hashtable with the contents enumerated below otherwise.
403
-
404
-
-**body** (string) - The request body.
405
-
-**headers** (iterable) - An associative array containing request headers.
The example above will produce output similar to that in the snippet to follow.
451
-
452
-
```
453
-
Listening on port 8080
454
-
455
-
```
456
-
457
-
### `Mrloop::parseHttpResponse`
458
-
459
-
```php
460
-
public static Mrloop::parseHttpResponse(
461
-
string $response,
462
-
int $headerlimit = 100,
463
-
): iterable
464
-
```
465
-
466
-
Parses an HTTP response.
467
-
468
-
> This function also utilizes the `picohttpparser` API.
469
-
470
-
**Parameter(s)**
471
-
472
-
-**response** (string) - The HTTP response to parse.
473
-
-**headerlimit** (int) - The number of headers to parse.
474
-
> The default limit is `100`.
475
-
476
-
**Return value(s)**
477
-
478
-
The parser will throw an exception in the event that an invalid HTTP response is encountered and will output a hashtable with the contents enumerated below otherwise.
479
-
480
-
-**body** (string) - The response body.
481
-
-**headers** (iterable) - An associative array containing response headers.
482
-
-**status** (int) - The response status code.
483
-
-**reason** (string) - The response reason phrase.
0 commit comments