|
@@ -4204,7 +4204,7 @@ static void handle_static_file_request(struct mg_connection *conn, const char *p
|
|
mg_fclose(filep);
|
|
mg_fclose(filep);
|
|
}
|
|
}
|
|
|
|
|
|
-void mg_send_file2(struct mg_connection *conn, const char *path, int timeout)
|
|
|
|
|
|
+void mg_send_file(struct mg_connection *conn, const char *path)
|
|
{
|
|
{
|
|
struct file file = STRUCT_FILE_INITIALIZER;
|
|
struct file file = STRUCT_FILE_INITIALIZER;
|
|
if (mg_stat(conn, path, &file)) {
|
|
if (mg_stat(conn, path, &file)) {
|
|
@@ -4224,11 +4224,6 @@ void mg_send_file2(struct mg_connection *conn, const char *path, int timeout)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-void mg_send_file(struct mg_connection *conn, const char *path)
|
|
|
|
-{
|
|
|
|
- mg_send_file2(conn, path, TIMEOUT_INFINITE);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/* Parse HTTP headers from the given buffer, advance buffer to the point
|
|
/* Parse HTTP headers from the given buffer, advance buffer to the point
|
|
where parsing stopped. */
|
|
where parsing stopped. */
|
|
static void parse_http_headers(char **buf, struct mg_request_info *ri)
|
|
static void parse_http_headers(char **buf, struct mg_request_info *ri)
|
|
@@ -5880,7 +5875,8 @@ static uint32_t get_remote_ip(const struct mg_connection *conn)
|
|
return ntohl(* (uint32_t *) &conn->client.rsa.sin.sin_addr);
|
|
return ntohl(* (uint32_t *) &conn->client.rsa.sin.sin_addr);
|
|
}
|
|
}
|
|
|
|
|
|
-int mg_upload2(struct mg_connection *conn, const char *destination_dir, int timeout)
|
|
|
|
|
|
+
|
|
|
|
+int mg_upload(struct mg_connection *conn, const char *destination_dir)
|
|
{
|
|
{
|
|
/* TODO: set a timeout */
|
|
/* TODO: set a timeout */
|
|
const char *content_type_header, *boundary_start, *sc;
|
|
const char *content_type_header, *boundary_start, *sc;
|
|
@@ -6034,10 +6030,6 @@ int mg_upload2(struct mg_connection *conn, const char *destination_dir, int time
|
|
return num_uploaded_files;
|
|
return num_uploaded_files;
|
|
}
|
|
}
|
|
|
|
|
|
-int mg_upload(struct mg_connection *conn, const char *destination_dir)
|
|
|
|
-{
|
|
|
|
- return mg_upload2(conn, destination_dir, TIMEOUT_INFINITE);
|
|
|
|
-}
|
|
|
|
|
|
|
|
static int get_first_ssl_listener_index(const struct mg_context *ctx)
|
|
static int get_first_ssl_listener_index(const struct mg_context *ctx)
|
|
{
|
|
{
|