aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_toolarge.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_toolarge.c')
-rw-r--r--src/testcurl/test_toolarge.c58
1 files changed, 50 insertions, 8 deletions
diff --git a/src/testcurl/test_toolarge.c b/src/testcurl/test_toolarge.c
index 36649a76..87be49dc 100644
--- a/src/testcurl/test_toolarge.c
+++ b/src/testcurl/test_toolarge.c
@@ -182,7 +182,7 @@ _mhdErrorExit_func (const char *errDesc, const char *funcName, int lineNum)
182 182
183 183
184/* Could be increased to facilitate debugging */ 184/* Could be increased to facilitate debugging */
185#define TIMEOUTS_VAL 5 185#define TIMEOUTS_VAL 50000
186 186
187#define EXPECTED_URI_BASE_PATH "/a" 187#define EXPECTED_URI_BASE_PATH "/a"
188 188
@@ -788,9 +788,16 @@ doCurlQueryInThread (struct MHD_Daemon *d,
788 mhdErrorExitDesc ("Request failed due to unexpected error"); 788 mhdErrorExitDesc ("Request failed due to unexpected error");
789 } 789 }
790 p->queryError = 1; 790 p->queryError = 1;
791 if ((0 != resp_code) && 791 switch (resp_code)
792 ((499 < resp_code) || (400 > resp_code))) /* TODO: add all expected error codes */
793 { 792 {
793 case 0: /* No parsed response */
794 case 413: /* "Content Too Large" */
795 case 414: /* "URI Too Long" */
796 case 431: /* "Request Header Fields Too Large" */
797 case 501: /* "Not Implemented" */
798 /* Expected error codes */
799 break;
800 default:
794 fprintf (stderr, 801 fprintf (stderr,
795 "Got reply with unexpected status code: %ld\n", 802 "Got reply with unexpected status code: %ld\n",
796 resp_code); 803 resp_code);
@@ -865,7 +872,14 @@ performTestQueries (struct MHD_Daemon *d, uint16_t d_port,
865 ahc_param->rp_data, 872 ahc_param->rp_data,
866 ahc_param->rp_data_size)) 873 ahc_param->rp_data_size))
867 { 874 {
868 (void) qParam.responseCode; /* TODO: check for the right response code */ 875 if ((0 != qParam.responseCode) && (501 != qParam.responseCode))
876 {
877 fprintf (stderr,
878 "Got reply with status code %d, "
879 "while code 501 (\"Not Implemented\") is expected.\n",
880 qParam.responseCode);
881 mhdErrorExit ();
882 }
869 if (TEST_OK_SIZE >= i) 883 if (TEST_OK_SIZE >= i)
870 { 884 {
871 fprintf (stderr, 885 fprintf (stderr,
@@ -922,7 +936,14 @@ performTestQueries (struct MHD_Daemon *d, uint16_t d_port,
922 ahc_param->rp_data, 936 ahc_param->rp_data,
923 ahc_param->rp_data_size)) 937 ahc_param->rp_data_size))
924 { 938 {
925 (void) qParam.responseCode; /* TODO: check for the right response code */ 939 if ((0 != qParam.responseCode) && (414 != qParam.responseCode))
940 {
941 fprintf (stderr,
942 "Got reply with status code %d, "
943 "while code 414 (\"URI Too Long\") is expected.\n",
944 qParam.responseCode);
945 mhdErrorExit ();
946 }
926 if (TEST_OK_SIZE >= i) 947 if (TEST_OK_SIZE >= i)
927 { 948 {
928 fprintf (stderr, 949 fprintf (stderr,
@@ -981,7 +1002,14 @@ performTestQueries (struct MHD_Daemon *d, uint16_t d_port,
981 ahc_param->rp_data, 1002 ahc_param->rp_data,
982 ahc_param->rp_data_size)) 1003 ahc_param->rp_data_size))
983 { 1004 {
984 (void) qParam.responseCode; /* TODO: check for the right response code */ 1005 if ((0 != qParam.responseCode) && (431 != qParam.responseCode))
1006 {
1007 fprintf (stderr,
1008 "Got reply with status code %d, while code 431 "
1009 "(\"Request Header Fields Too Large\") is expected.\n",
1010 qParam.responseCode);
1011 mhdErrorExit ();
1012 }
985 if (0 != ahc_param->header_check_param.large_header_name_size) 1013 if (0 != ahc_param->header_check_param.large_header_name_size)
986 { /* If large header was processed, it must be valid */ 1014 { /* If large header was processed, it must be valid */
987 if (i != ahc_param->header_check_param.large_header_name_size) 1015 if (i != ahc_param->header_check_param.large_header_name_size)
@@ -1055,7 +1083,14 @@ performTestQueries (struct MHD_Daemon *d, uint16_t d_port,
1055 ahc_param->rp_data, 1083 ahc_param->rp_data,
1056 ahc_param->rp_data_size)) 1084 ahc_param->rp_data_size))
1057 { 1085 {
1058 (void) qParam.responseCode; /* TODO: check for the right response code */ 1086 if ((0 != qParam.responseCode) && (431 != qParam.responseCode))
1087 {
1088 fprintf (stderr,
1089 "Got reply with status code %d, while code 431 "
1090 "(\"Request Header Fields Too Large\") is expected.\n",
1091 qParam.responseCode);
1092 mhdErrorExit ();
1093 }
1059 if (0 != ahc_param->header_check_param.large_header_name_size) 1094 if (0 != ahc_param->header_check_param.large_header_name_size)
1060 { /* If large header was processed, it must be valid */ 1095 { /* If large header was processed, it must be valid */
1061 if (1 != ahc_param->header_check_param.large_header_name_size) 1096 if (1 != ahc_param->header_check_param.large_header_name_size)
@@ -1129,7 +1164,14 @@ performTestQueries (struct MHD_Daemon *d, uint16_t d_port,
1129 ahc_param->rp_data, 1164 ahc_param->rp_data,
1130 ahc_param->rp_data_size)) 1165 ahc_param->rp_data_size))
1131 { 1166 {
1132 (void) qParam.responseCode; /* TODO: check for the right response code */ 1167 if ((0 != qParam.responseCode) && (431 != qParam.responseCode))
1168 {
1169 fprintf (stderr,
1170 "Got reply with status code %d, while code 431 "
1171 "(\"Request Header Fields Too Large\") is expected.\n",
1172 qParam.responseCode);
1173 mhdErrorExit ();
1174 }
1133 if (0 != ahc_param->header_check_param.num_n1_headers) 1175 if (0 != ahc_param->header_check_param.num_n1_headers)
1134 { /* If headers were processed, they must be valid */ 1176 { /* If headers were processed, they must be valid */
1135 if (num_hdrs != ahc_param->header_check_param.num_n1_headers) 1177 if (num_hdrs != ahc_param->header_check_param.num_n1_headers)