Changeset 253:a9913cdc2427 for uwsgi.c

Show
Ignore:
Timestamp:
03/08/10 11:05:02 (5 months ago)
Author:
roberto@…
Branch:
default
Message:

a bit of vacuum

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • uwsgi.c

    r250 r253  
    131131 
    132132        PyThreadState *_myself; 
    133 #ifndef ROCK_SOLID 
     133 
     134/* CHECK ROCK_SOLID  
    134135        struct uwsgi_app *wi = NULL; 
    135136        if (wsgi_req.app_id >= 0) { 
    136137                wi = &uwsgi.wsgi_apps[wsgi_req.app_id]; 
    137138        } 
    138 #endif 
     139 end rock_solid */ 
     140 
    139141        PyGILState_Ensure (); 
    140142        _myself = PyThreadState_Get (); 
    141143        if (wi) { 
     144/* 
    142145#ifdef ROCK_SOLID 
    143146                fprintf (stderr, "\nF*CK !!! i must kill myself (pid: %d) wi: %p wi->wsgi_harakiri: %p thread_state: %p frame: %p...\n", uwsgi.mypid, wi, wi->wsgi_harakiri, _myself, _myself->frame); 
    144147#else 
     148*/ 
    145149                fprintf (stderr, "\nF*CK !!! i must kill myself (pid: %d app_id: %d) wi: %p wi->wsgi_harakiri: %p thread_state: %p frame: %p...\n", uwsgi.mypid, wsgi_req.app_id, wi, wi->wsgi_harakiri, _myself, _myself->frame); 
    146 #endif 
    147150 
    148151                if (wi->wsgi_harakiri) { 
     
    197200                content = PyString_AsString (data); 
    198201                len = PyString_Size (data); 
    199 #ifndef ROCK_SOLID 
     202 
     203#ifdef UWSGI_THREADING 
    200204                if (uwsgi.has_threads && uwsgi.shared->options[UWSGI_OPTION_THREADS] == 1) { 
    201205                        Py_BEGIN_ALLOW_THREADS wsgi_req.response_size = write (uwsgi.poll.fd, content, len); 
     
    213217                        } 
    214218#endif 
    215 #ifndef ROCK_SOLID 
     219#ifdef UWSGI_THREADING 
    216220                } 
    217221#endif 
     
    235239        PyObject *h_key, *h_value; 
    236240        int i, j; 
     241 
    237242#ifndef UNBIT 
    238 #ifdef ROCK_SOLID 
    239         int base = 4; 
    240 #else 
    241243        int base = 0; 
    242 #endif 
    243244#else 
    244245        int base = 4; 
     
    465466        struct timeval check_interval = {.tv_sec = 1,.tv_usec = 0 }; 
    466467 
    467 #ifndef PYTHREE 
    468 #ifndef ROCK_SOLID 
     468#ifdef UWSGI_EMBEDDED 
    469469        PyObject *uwsgi_module; 
    470470 
    471 #endif 
    472471#endif 
    473472        char *pyargv[MAX_PYARGV]; 
     
    655654        } 
    656655 
     656        uwsgi.binary_path = argv[0] ; 
     657 
    657658#ifndef UNBIT 
    658659        while ((i = getopt_long (argc, argv, "s:p:t:x:d:l:O:v:b:mcaCTPiMhrR:z:w:j:H:A:Q:L", long_options, &option_index)) != -1) { 
     
    670671#endif 
    671672 
    672         if (uwsgi.binary_path == NULL) { 
     673        if (uwsgi.binary_path == argv[0]) { 
    673674                cwd = uwsgi_get_cwd (); 
    674675                uwsgi.binary_path = malloc (strlen (argv[0]) + 1); 
     
    681682 
    682683#ifndef UNBIT 
    683 #ifndef ROCK_SOLID 
    684684        if (uwsgi.shared->options[UWSGI_OPTION_CGI_MODE] == 0) { 
    685 #endif 
    686685#endif 
    687686                if (uwsgi.test_module == NULL) { 
     
    849848        wsgi_writeout = PyCFunction_New (uwsgi_write_method, NULL); 
    850849 
    851 #ifndef PYTHREE 
    852 #ifndef ROCK_SOLID 
     850#ifdef UWSGI_EMBEDDED 
    853851        uwsgi_module = Py_InitModule ("uwsgi", null_methods); 
    854852        if (uwsgi_module == NULL) { 
     
    898896 
    899897        init_uwsgi_embedded_module (); 
    900 #endif 
    901898#endif 
    902899 
     
    11991196 
    12001197#ifndef UNBIT 
    1201 #ifndef ROCK_SOLID 
    12021198        if (no_server) { 
    12031199                fprintf (stderr, "no-server mode requested. Goodbye.\n"); 
    12041200                exit (0); 
    12051201        } 
    1206 #endif 
    12071202#endif 
    12081203 
     
    16791674                else { 
    16801675#endif 
     1676                        fprintf(stderr,"POLL ADDR: %p\n", &uwsgi.poll); 
    16811677                        if (!uwsgi_parse_response (&uwsgi.poll, uwsgi.shared->options[UWSGI_OPTION_SOCKET_TIMEOUT], (struct uwsgi_header *) &wsgi_req, uwsgi.buffer)) { 
    16821678                                continue; 
     
    17921788} 
    17931789 
    1794 #ifndef ROCK_SOLID 
    17951790int init_uwsgi_app (PyObject * force_wsgi_dict, PyObject * my_callable) { 
    17961791        PyObject *wsgi_module, *wsgi_dict = NULL; 
     
    23112306} 
    23122307 
    2313 #endif 
    23142308 
    23152309#ifdef UNBIT 
     
    25122506 
    25132507                switch (i) { 
    2514 #ifndef ROCK_SOLID 
    25152508#ifndef UNBIT 
    25162509                case LONG_ARGS_PIDFILE: 
     
    25662559                        uwsgi.rl.rlim_max = uwsgi.rl.rlim_cur; 
    25672560                        break; 
    2568 #endif 
    25692561                case LONG_ARGS_PASTE: 
    25702562                        uwsgi.single_interpreter = 1; 
     
    26512643                        uwsgi.shared->options[UWSGI_OPTION_REAPER] = 1; 
    26522644                        break; 
    2653 #ifndef ROCK_SOLID 
    26542645                case 'w': 
    26552646                        uwsgi.single_interpreter = 1; 
     
    26622653                        uwsgi.py_optimize = atoi (optarg); 
    26632654                        break; 
    2664 #endif 
    26652655                case 't': 
    26662656                        uwsgi.shared->options[UWSGI_OPTION_HARAKIRI] = atoi (optarg); 
     
    26702660                        break; 
    26712661#ifndef UNBIT 
    2672 #ifndef ROCK_SOLID 
    26732662                case 'c': 
    26742663                        uwsgi.shared->options[UWSGI_OPTION_CGI_MODE] = 1; 
    26752664                        break; 
    2676 #endif 
    26772665                case 'a': 
    26782666                        uwsgi.abstract_socket = 1; 
     
    26932681                        } 
    26942682                        break; 
    2695 #ifndef ROCK_SOLID 
    26962683                case 'T': 
    26972684                        uwsgi.has_threads = 1; 
     
    27042691                        uwsgi.single_interpreter = 1; 
    27052692                        break; 
    2706 #endif 
    27072693#ifndef UNBIT 
    27082694                case 'h': 
     
    27472733\t--limit-as <MB>\t\t\tlimit the address space of processes to MB megabytes\n\ 
    27482734\t--udp <ip:port>\t\t\tbind master process to udp socket on ip:port\n\ 
     2735\t--erlang <name@ip>\t\tenable the Erlang server with node name <node@ip>\n\ 
     2736\t--erlang-cookie <cookie>\ttset the erlang cookie to <cookie>\n\ 
     2737\t--nagios\t\t\tdo a nagios check\n\ 
     2738\t--binary-path <bin-path>\ttset the path for the next reload of uWSGI (needed for chroot environments)\n\ 
     2739\t--proxy <socket>\t\trun the uwsgi proxy on socket <socket>\n\ 
     2740\t--proxy-node <socket>\t\tadd the node <socket> to the proxy\n\ 
     2741\t--proxy-max-connections <n>\tset the max number of concurrent connections mnaged by the proxy\n\ 
     2742\t--wsgi-file <file>\t\tload the <file> wsgi file\n\ 
    27492743\t-d|--daemonize <logfile>\tdaemonize and log into <logfile>\n", uwsgi.binary_path); 
    27502744                        exit (1);