Remove benchmark mode, we do not needed anymore :D
authorEduardo Silva <edsiper@gmail.com>
Fri, 30 Oct 2009 17:55:10 +0000 (14:55 -0300)
committerEduardo Silva <edsiper@gmail.com>
Fri, 30 Oct 2009 17:55:10 +0000 (14:55 -0300)
src/monkey.c
src/request.c

index 2cc285e..2665f60 100644 (file)
@@ -91,21 +91,10 @@ void mk_help()
        exit(0);
 }
 
-
-       
-void set_benchmark_conf()
-{
-       const int max_int = 65000;
-
-       config->max_keep_alive_request = max_int;
-       config->maxclients = max_int;
-       config->max_ip = 0;
-}
-
 /* MAIN */
 int main(int argc, char **argv)
 {
-       int opt, benchmark_mode=FALSE;
+       int opt;
        int cheetah = 0;
         int daemon = 0;
        
@@ -134,9 +123,6 @@ int main(int argc, char **argv)
                                        config->file_config=optarg;
                                        break;
                                }
-                       case 'b':
-                               benchmark_mode = TRUE;
-                               break;
                        case '?':
                                printf("Monkey: Invalid option or option needs an argument.\n");
                                mk_help();
@@ -149,9 +135,10 @@ int main(int argc, char **argv)
                 return -1;
         }
 
-       if(!config->file_config)
+       if(!config->file_config){
                config->file_config=MONKEY_PATH_CONF;
-               
+        }
+
        mk_version();
        mk_signal_init();
        mk_config_start_configure();
@@ -159,18 +146,6 @@ int main(int argc, char **argv)
 
         server_fd = mk_socket_server(config->serverport);
 
-       /* 
-        Benchmark mode overwrite some configuration directives in order 
-        to disable some limit numbers as number of clients, request per 
-        client, same ip connected, etc
-       */
-       if(benchmark_mode)
-       {
-               printf("*** Running Monkey in Benchmark mode ***\n");
-               fflush(stdout);
-               set_benchmark_conf();
-       }
-
        /* Workers: logger and clock */ 
         mk_worker_spawn((void *)mk_logger_worker_init);
         mk_worker_spawn((void *)mk_clock_worker_init);
index b6cb34e..4a30e5e 100644 (file)
@@ -586,6 +586,9 @@ mk_pointer mk_request_header_find(struct header_toc *toc, int toc_len,
         {
                 for(i=0; i<toc_len; i++)
                 {
+                        /* status = 1 means that the toc entry was already
+                         * checked by monkey 
+                         */
                         if(toc[i].status == 1)
                         {
                                 continue;
@@ -1049,7 +1052,6 @@ void mk_request_header_toc_parse(struct header_toc *toc, char *data, int len)
                 {
                         toc[i].init = p;
                         toc[i].end = l;
-
                         p = l + mk_crlf.len;
                 }
                 else