Compare commits
No commits in common. "9164be2f37018c455c001acbc7b42f9320641646" and "610e756c07cf08aa22818e83427c472b76ee6734" have entirely different histories.
9164be2f37
...
610e756c07
20
src/http.c
20
src/http.c
@ -381,19 +381,11 @@ static void _http_add_body_bytes(tf_http_connection_t* connection, const void* d
|
|||||||
};
|
};
|
||||||
connection->request = request;
|
connection->request = request;
|
||||||
|
|
||||||
if (!connection->http->is_shutting_down)
|
tf_http_request_ref(request);
|
||||||
{
|
tf_trace_begin(connection->http->trace, connection->trace_name ? connection->trace_name : "http");
|
||||||
tf_http_request_ref(request);
|
connection->callback(request);
|
||||||
tf_trace_begin(connection->http->trace, connection->trace_name ? connection->trace_name : "http");
|
tf_trace_end(connection->http->trace);
|
||||||
connection->callback(request);
|
tf_http_request_unref(request);
|
||||||
tf_trace_end(connection->http->trace);
|
|
||||||
tf_http_request_unref(request);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const char* k_payload = tf_http_status_text(503);
|
|
||||||
tf_http_respond(request, 503, NULL, 0, k_payload, strlen(k_payload));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -792,8 +784,6 @@ const char* tf_http_status_text(int status)
|
|||||||
return "File not found";
|
return "File not found";
|
||||||
case 500:
|
case 500:
|
||||||
return "Internal server error";
|
return "Internal server error";
|
||||||
case 503:
|
|
||||||
return "Service Unavailable";
|
|
||||||
default:
|
default:
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
|
10
src/main.c
10
src/main.c
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
#include "backtrace.h"
|
#include "backtrace.h"
|
||||||
#include "sqlite3.h"
|
#include "sqlite3.h"
|
||||||
#include "unzip.h"
|
|
||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -413,18 +412,11 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
|
|||||||
.http_port = 12345,
|
.http_port = 12345,
|
||||||
.https_port = 12346,
|
.https_port = 12346,
|
||||||
.ssb_port = 8008,
|
.ssb_port = 8008,
|
||||||
|
.zip = file,
|
||||||
.db_path = k_db_path_default,
|
.db_path = k_db_path_default,
|
||||||
};
|
};
|
||||||
bool show_usage = false;
|
bool show_usage = false;
|
||||||
|
|
||||||
/* Check if the executable has data attached. */
|
|
||||||
unzFile zip = unzOpen(file);
|
|
||||||
if (zip)
|
|
||||||
{
|
|
||||||
args.zip = file;
|
|
||||||
unzClose(zip);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (!show_usage)
|
while (!show_usage)
|
||||||
{
|
{
|
||||||
static const struct option k_options[] = {
|
static const struct option k_options[] = {
|
||||||
|
Loading…
Reference in New Issue
Block a user