Changeset 253:a9913cdc2427 for uwsgi.c
Legend:
- Unmodified
- Added
- Removed
-
uwsgi.c
r250 r253 131 131 132 132 PyThreadState *_myself; 133 #ifndef ROCK_SOLID 133 134 /* CHECK ROCK_SOLID 134 135 struct uwsgi_app *wi = NULL; 135 136 if (wsgi_req.app_id >= 0) { 136 137 wi = &uwsgi.wsgi_apps[wsgi_req.app_id]; 137 138 } 138 #endif 139 end rock_solid */ 140 139 141 PyGILState_Ensure (); 140 142 _myself = PyThreadState_Get (); 141 143 if (wi) { 144 /* 142 145 #ifdef ROCK_SOLID 143 146 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); 144 147 #else 148 */ 145 149 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 #endif147 150 148 151 if (wi->wsgi_harakiri) { … … 197 200 content = PyString_AsString (data); 198 201 len = PyString_Size (data); 199 #ifndef ROCK_SOLID 202 203 #ifdef UWSGI_THREADING 200 204 if (uwsgi.has_threads && uwsgi.shared->options[UWSGI_OPTION_THREADS] == 1) { 201 205 Py_BEGIN_ALLOW_THREADS wsgi_req.response_size = write (uwsgi.poll.fd, content, len); … … 213 217 } 214 218 #endif 215 #if ndef ROCK_SOLID219 #ifdef UWSGI_THREADING 216 220 } 217 221 #endif … … 235 239 PyObject *h_key, *h_value; 236 240 int i, j; 241 237 242 #ifndef UNBIT 238 #ifdef ROCK_SOLID239 int base = 4;240 #else241 243 int base = 0; 242 #endif243 244 #else 244 245 int base = 4; … … 465 466 struct timeval check_interval = {.tv_sec = 1,.tv_usec = 0 }; 466 467 467 #ifndef PYTHREE 468 #ifndef ROCK_SOLID 468 #ifdef UWSGI_EMBEDDED 469 469 PyObject *uwsgi_module; 470 470 471 #endif472 471 #endif 473 472 char *pyargv[MAX_PYARGV]; … … 655 654 } 656 655 656 uwsgi.binary_path = argv[0] ; 657 657 658 #ifndef UNBIT 658 659 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) { … … 670 671 #endif 671 672 672 if (uwsgi.binary_path == NULL) {673 if (uwsgi.binary_path == argv[0]) { 673 674 cwd = uwsgi_get_cwd (); 674 675 uwsgi.binary_path = malloc (strlen (argv[0]) + 1); … … 681 682 682 683 #ifndef UNBIT 683 #ifndef ROCK_SOLID684 684 if (uwsgi.shared->options[UWSGI_OPTION_CGI_MODE] == 0) { 685 #endif686 685 #endif 687 686 if (uwsgi.test_module == NULL) { … … 849 848 wsgi_writeout = PyCFunction_New (uwsgi_write_method, NULL); 850 849 851 #ifndef PYTHREE 852 #ifndef ROCK_SOLID 850 #ifdef UWSGI_EMBEDDED 853 851 uwsgi_module = Py_InitModule ("uwsgi", null_methods); 854 852 if (uwsgi_module == NULL) { … … 898 896 899 897 init_uwsgi_embedded_module (); 900 #endif901 898 #endif 902 899 … … 1199 1196 1200 1197 #ifndef UNBIT 1201 #ifndef ROCK_SOLID1202 1198 if (no_server) { 1203 1199 fprintf (stderr, "no-server mode requested. Goodbye.\n"); 1204 1200 exit (0); 1205 1201 } 1206 #endif1207 1202 #endif 1208 1203 … … 1679 1674 else { 1680 1675 #endif 1676 fprintf(stderr,"POLL ADDR: %p\n", &uwsgi.poll); 1681 1677 if (!uwsgi_parse_response (&uwsgi.poll, uwsgi.shared->options[UWSGI_OPTION_SOCKET_TIMEOUT], (struct uwsgi_header *) &wsgi_req, uwsgi.buffer)) { 1682 1678 continue; … … 1792 1788 } 1793 1789 1794 #ifndef ROCK_SOLID1795 1790 int init_uwsgi_app (PyObject * force_wsgi_dict, PyObject * my_callable) { 1796 1791 PyObject *wsgi_module, *wsgi_dict = NULL; … … 2311 2306 } 2312 2307 2313 #endif2314 2308 2315 2309 #ifdef UNBIT … … 2512 2506 2513 2507 switch (i) { 2514 #ifndef ROCK_SOLID2515 2508 #ifndef UNBIT 2516 2509 case LONG_ARGS_PIDFILE: … … 2566 2559 uwsgi.rl.rlim_max = uwsgi.rl.rlim_cur; 2567 2560 break; 2568 #endif2569 2561 case LONG_ARGS_PASTE: 2570 2562 uwsgi.single_interpreter = 1; … … 2651 2643 uwsgi.shared->options[UWSGI_OPTION_REAPER] = 1; 2652 2644 break; 2653 #ifndef ROCK_SOLID2654 2645 case 'w': 2655 2646 uwsgi.single_interpreter = 1; … … 2662 2653 uwsgi.py_optimize = atoi (optarg); 2663 2654 break; 2664 #endif2665 2655 case 't': 2666 2656 uwsgi.shared->options[UWSGI_OPTION_HARAKIRI] = atoi (optarg); … … 2670 2660 break; 2671 2661 #ifndef UNBIT 2672 #ifndef ROCK_SOLID2673 2662 case 'c': 2674 2663 uwsgi.shared->options[UWSGI_OPTION_CGI_MODE] = 1; 2675 2664 break; 2676 #endif2677 2665 case 'a': 2678 2666 uwsgi.abstract_socket = 1; … … 2693 2681 } 2694 2682 break; 2695 #ifndef ROCK_SOLID2696 2683 case 'T': 2697 2684 uwsgi.has_threads = 1; … … 2704 2691 uwsgi.single_interpreter = 1; 2705 2692 break; 2706 #endif2707 2693 #ifndef UNBIT 2708 2694 case 'h': … … 2747 2733 \t--limit-as <MB>\t\t\tlimit the address space of processes to MB megabytes\n\ 2748 2734 \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\ 2749 2743 \t-d|--daemonize <logfile>\tdaemonize and log into <logfile>\n", uwsgi.binary_path); 2750 2744 exit (1);
