Add debug option to show http traffic

This commit is contained in:
Iwan Timmer
2017-06-11 18:14:32 +02:00
parent b0660e9dd3
commit cbf31be73b
7 changed files with 25 additions and 6 deletions

View File

@@ -64,6 +64,7 @@ static struct option long_options[] = {
{"codec", required_argument, NULL, 'x'},
{"unsupported", no_argument, NULL, 'y'},
{"verbose", no_argument, NULL, 'z'},
{"debug", no_argument, NULL, 'Z'},
{0, 0, 0, 0},
};
@@ -207,6 +208,9 @@ static void parse_argument(int c, char* value, PCONFIGURATION config) {
case 'z':
config->debug_level = 1;
break;
case 'Z':
config->debug_level = 2;
break;
case 1:
if (config->action == NULL)
config->action = value;

View File

@@ -142,6 +142,7 @@ static void help() {
printf("\t-config <config>\tLoad configuration file\n");
printf("\t-save <config>\t\tSave configuration file\n");
printf("\t-verbose\t\tEnable verbose output\n");
printf("\t-debug\t\t\tEnable verbose and debug output\n");
printf("\n Streaming options\n\n");
printf("\t-720\t\t\tUse 1280x720 resolution [default]\n");
printf("\t-1080\t\t\tUse 1920x1080 resolution\n");
@@ -215,7 +216,7 @@ int main(int argc, char* argv[]) {
printf("Connect to %s...\n", config.address);
int ret;
if ((ret = gs_init(&server, config.address, config.key_dir)) == GS_OUT_OF_MEMORY) {
if ((ret = gs_init(&server, config.address, config.key_dir, config.debug_level)) == GS_OUT_OF_MEMORY) {
fprintf(stderr, "Not enough memory\n");
exit(-1);
} else if (ret == GS_INVALID) {