Commit 8ed6340
authored
* Fix POST args with empty values not being parsed (issue #268)
Destroy post processor before invoking the callback to ensure pending
POST body keys with empty values are properly finalized. Without this,
POST data like "arg1=val1&arg2=" would fail to include arg2.
The fix moves MHD_destroy_post_processor call to finalize_answer()
before the resource callback is invoked, rather than waiting for
the modded_request destructor.
Added test cases verifying:
- arg1=val1&arg2= correctly parses both args
- arg1= correctly parses as empty string
- arg1=&arg2= correctly parses both as empty strings
This supersedes PR #269 with the requested code style changes.
* Fix Windows build: replace rand_r with portable rand()
rand_r is POSIX-specific and not available on Windows. Since this is
just a stress test where thread-safe randomness isn't critical, use
the portable rand() function instead.
1 parent 57522ba commit 8ed6340
2 files changed
+61
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
741 | 745 | | |
742 | 746 | | |
743 | 747 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
996 | 1052 | | |
997 | 1053 | | |
998 | 1054 | | |
| |||
1588 | 1644 | | |
1589 | 1645 | | |
1590 | 1646 | | |
1591 | | - | |
1592 | 1647 | | |
1593 | 1648 | | |
1594 | 1649 | | |
1595 | | - | |
1596 | | - | |
| 1650 | + | |
1597 | 1651 | | |
1598 | 1652 | | |
1599 | 1653 | | |
| |||
0 commit comments