Codebase list httping / 90d8f3c
Fix segfault with -M flag and invalid address jybateman 7 years ago
2 changed file(s) with 15 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
1010
1111 char last_error[4096] = { 0 };
1212
13 extern char json_output;
14
1315 void error_exit(char *format, ...)
1416 {
1517 int e = errno;
1820 va_start(ap, format);
1921 (void)vfprintf(stderr, format, ap);
2022 va_end(ap);
23
24 if (json_output) {
25 printf("\n]\n");
26 }
2127
2228 fprintf(stderr, gettext("\n\nerrno=%d which means %s (if applicable)\n"), e, strerror(e));
2329
174174 printf("\"connect_ms\" : \"%e\", ", t_connect -> cur);
175175 else
176176 printf("\"connect_ms\" : \"%e\", ",-1.0);
177 printf("\"request_ms\" : \"%e\", ", t_request -> cur);
178 printf("\"total_ms\" : \"%e\", ", t_total -> cur);
177 if (t_request != NULL)
178 printf("\"request_ms\" : \"%e\", ", t_request -> cur);
179 if (t_total != NULL)
180 printf("\"total_ms\" : \"%e\", ", t_total -> cur);
179181 printf("\"http_code\" : \"%d\", ", http_code);
180182 printf("\"msg\" : \"%s\", ", msg);
181183 printf("\"header_size\" : \"%d\", ", header_size);
185187 printf("\"ssl_fingerprint\" : \"%s\", ", ssl_fp ? ssl_fp : "");
186188 printf("\"time_offset\" : \"%f\", ", toff_diff_ts);
187189 printf("\"tfo_success\" : \"%s\", ", tfo_success ? "true" : "false");
188 if (t_ssl -> cur_valid)
190 if (t_ssl != NULL && t_ssl -> cur_valid)
189191 printf("\"ssl_ms\" : \"%e\", ", t_ssl -> cur);
190192 printf("\"tfo_succes\" : \"%s\", ", tfo_success ? "true" : "false");
191193 if (t_ssl !=NULL && t_ssl -> cur_valid)
192194 printf("\"ssl_ms\" : \"%e\", ", t_ssl -> cur);
193 printf("\"write\" : \"%e\", ", t_write -> cur);
194 printf("\"close\" : \"%e\", ", t_close -> cur);
195 if (t_write != NULL)
196 printf("\"write\" : \"%e\", ", t_write -> cur);
197 if (t_close != NULL)
198 printf("\"close\" : \"%e\", ", t_close -> cur);
195199 printf("\"cookies\" : \"%d\", ", n_cookies);
196200 if (stats_to != NULL && stats_to -> cur_valid)
197201 printf("\"to\" : \"%e\", ", stats_to -> cur);