Bläddra i källkod

Remove unused timeouts that are passed as parameters

Timeouts are implemented by using the request_timeout_ms parameter
from the server configuration, thus they do not have to be passed
as arguments to functions. Remove the unused arguments.

This is similar to the timeout in getreq (issue #82)
bel 10 år sedan
förälder
incheckning
95176420bb
1 ändrade filer med 3 tillägg och 11 borttagningar
  1. 3 11
      src/civetweb.c

+ 3 - 11
src/civetweb.c

@@ -4204,7 +4204,7 @@ static void handle_static_file_request(struct mg_connection *conn, const char *p
     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;
     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
    where parsing stopped. */
 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);
 }
 
-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 */
     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;
 }
 
-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)
 {