~ubuntu-branches/ubuntu/saucy/uwsgi/saucy

« back to all changes in this revision

Viewing changes to uwsgi.h

  • Committer: Package Import Robot
  • Author(s): Janos Guljas
  • Date: 2012-04-30 17:35:22 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120430173522-qucwu1au3s9bflhb
Tags: 1.2+dfsg-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#define uwsgi_str(x) uwsgi_concat2(x, "")
25
25
 
26
26
#define uwsgi_notify(x) if (uwsgi.notify) uwsgi.notify(x)
27
 
#define uwsgi_notify_ready() if (uwsgi.notify_ready) uwsgi.notify_ready()
 
27
#define uwsgi_notify_ready() uwsgi.shared->ready = 1 ; if (uwsgi.notify_ready) uwsgi.notify_ready()
28
28
 
29
29
#define uwsgi_apps uwsgi.workers[uwsgi.mywid].apps
30
30
#define uwsgi_apps_cnt uwsgi.workers[uwsgi.mywid].apps_cnt
334
334
#define uwsgi_wlock(x) uwsgi.lock_ops.wlock(x)
335
335
#define uwsgi_rwunlock(x) uwsgi.lock_ops.rwunlock(x)
336
336
 
 
337
#ifdef UWSGI_PCRE
 
338
#include <pcre.h>
 
339
#endif
337
340
 
338
341
struct uwsgi_dyn_dict {
339
342
 
345
348
        uint64_t hits;
346
349
        int status;
347
350
 
 
351
#ifdef UWSGI_PCRE
 
352
        pcre *pattern;
 
353
        pcre_extra *pattern_extra;
 
354
#endif
 
355
 
348
356
        struct uwsgi_dyn_dict *prev;
349
357
        struct uwsgi_dyn_dict *next;
350
358
};
647
655
};
648
656
 
649
657
#ifdef UWSGI_PCRE
650
 
#include <pcre.h>
651
658
int uwsgi_regexp_build(char *, pcre **, pcre_extra **);
652
659
int uwsgi_regexp_match(pcre *, pcre_extra *, char *, int);
653
660
int uwsgi_regexp_match_ovec(pcre *, pcre_extra *, char *, int, int *, int);
672
679
        void *interpreter;
673
680
        void *callable;
674
681
 
675
 
 
676
682
#ifdef UWSGI_ASYNC
677
683
        void **args;
678
684
        void **environ;
720
726
        char dir[PATH_MAX];
721
727
        pid_t pid;
722
728
        uint64_t respawned;
 
729
        uint64_t tasks;
723
730
        struct uwsgi_lock_item *lock;
724
731
        time_t harakiri;
725
732
 
917
924
        int async_plagued;
918
925
 
919
926
        int suspended;
 
927
        int write_errors;
920
928
 
921
929
        int *ovector;
922
930
        size_t post_cl;
1106
1114
        int emperor_fd_config;
1107
1115
        int early_emperor;
1108
1116
        int emperor_throttle;
 
1117
        int emperor_magic_exec;
1109
1118
        char *emperor_dir;
1110
1119
        pid_t emperor_pid;
1111
1120
        int     emperor_broodlord;
1187
1196
#endif
1188
1197
 
1189
1198
        int ignore_sigpipe;
 
1199
        int ignore_write_errors;
 
1200
        int write_errors_tolerance;
 
1201
        int write_errors_exception_only;
1190
1202
 
1191
1203
        // still working on it
1192
1204
        char *profiler;
1242
1254
        // static file serving
1243
1255
        int file_serve_mode;
1244
1256
        int build_mime_dict;
1245
 
        char *mime_file;
 
1257
 
 
1258
        struct uwsgi_string_list *mime_file;
1246
1259
 
1247
1260
        struct uwsgi_probe *probes;
1248
1261
 
1265
1278
        int daemons_cnt;
1266
1279
 
1267
1280
        struct uwsgi_dyn_dict *static_maps;
 
1281
        struct uwsgi_dyn_dict *static_maps2;
1268
1282
        struct uwsgi_dyn_dict *check_static;
1269
1283
        struct uwsgi_dyn_dict *mimetypes;
1270
1284
        struct uwsgi_string_list *static_skip_ext;
1271
1285
        struct uwsgi_string_list *static_index;
 
1286
 
 
1287
        struct uwsgi_dyn_dict *static_expires_type;
 
1288
        struct uwsgi_dyn_dict *static_expires_type_mtime;
 
1289
 
 
1290
        struct uwsgi_dyn_dict *static_expires;
 
1291
        struct uwsgi_dyn_dict *static_expires_mtime;
 
1292
 
1272
1293
        int check_static_docroot;
 
1294
        int static_offload_to_thread;
 
1295
        pthread_attr_t static_offload_thread_attr;
 
1296
        pthread_mutex_t static_offload_thread_lock;
1273
1297
 
1274
1298
        char *daemonize;
1275
1299
        char *daemonize2;
1340
1364
        int spooler_numproc;
1341
1365
        struct uwsgi_spooler *i_am_a_spooler;
1342
1366
        char *spooler_chdir;
 
1367
        int spooler_max_tasks;
1343
1368
        int spooler_ordered;
1344
 
        int spooler_quiet; 
 
1369
        int spooler_quiet;
1345
1370
#endif
1346
1371
 
1347
1372
#ifdef UWSGI_SNMP
1455
1480
 
1456
1481
 
1457
1482
        int no_orphans;
 
1483
        int skip_zero;
1458
1484
 
1459
1485
        char *chdir;
1460
1486
        char *chdir2;
1570
1596
        char *cache_store;
1571
1597
        size_t cache_filesize;
1572
1598
        int cache_store_sync;
 
1599
        int cache_no_expire;
 
1600
        int cache_expire_freq;
 
1601
        int cache_report_freed_items;
1573
1602
 
1574
1603
        char *cache_server;
1575
1604
        int cache_server_threads;
1625
1654
 
1626
1655
};
1627
1656
 
 
1657
struct uwsgi_offload_request {
 
1658
        pthread_t tid;
 
1659
        struct wsgi_request wsgi_req;
 
1660
        char *buffer;
 
1661
        struct iovec *hvec;
 
1662
        char real_filename[PATH_MAX+1];
 
1663
        size_t real_filename_len;
 
1664
        struct stat st;
 
1665
};
 
1666
 
 
1667
 
1628
1668
struct uwsgi_rpc {
1629
1669
        char name[0xff];
1630
1670
        void *func;
1771
1811
        struct uwsgi_gateway gateways[MAX_GATEWAYS];
1772
1812
        int gateways_cnt;
1773
1813
        time_t gateways_harakiri[MAX_GATEWAYS];
 
1814
 
 
1815
        int ready;
1774
1816
};
1775
1817
 
1776
1818
struct uwsgi_core {
1846
1888
 
1847
1889
        uint64_t avg_response_time;
1848
1890
 
 
1891
        uint64_t static_offload_threads;
 
1892
 
1849
1893
        char name[0xff];
1850
1894
};
1851
1895
 
2114
2158
char *uwsgi_cluster_best_node(void);
2115
2159
 
2116
2160
int uwsgi_cache_set(char *, uint16_t, char *, uint64_t, uint64_t, uint16_t);
2117
 
int uwsgi_cache_del(char *, uint16_t);
 
2161
int uwsgi_cache_del(char *, uint16_t, uint64_t);
2118
2162
char *uwsgi_cache_get(char *, uint16_t, uint64_t *);
2119
2163
uint32_t uwsgi_cache_exists(char *, uint16_t);
2120
2164
 
2340
2384
int uwsgi_amqp_consume_queue(int, char *, char *, char *, char *, char *, char *);
2341
2385
char *uwsgi_amqp_consume(int, uint64_t *, char **);
2342
2386
 
2343
 
int uwsgi_file_serve(struct wsgi_request *, char *, uint16_t, char *, uint16_t);
 
2387
int uwsgi_file_serve(struct wsgi_request *, char *, uint16_t, char *, uint16_t, int);
2344
2388
inline int uwsgi_starts_with(char *, int, char *, int);
2345
2389
 
2346
2390
#ifdef __sun__
2371
2415
#endif
2372
2416
 
2373
2417
int uwsgi_proto_http_parser(struct wsgi_request *);
2374
 
ssize_t uwsgi_proto_http_writev_header(struct wsgi_request *, struct iovec *, size_t);
2375
 
ssize_t uwsgi_proto_http_writev(struct wsgi_request *, struct iovec *, size_t);
2376
 
ssize_t uwsgi_proto_http_write(struct wsgi_request *, char *, size_t);
2377
 
ssize_t uwsgi_proto_http_write_header(struct wsgi_request *, char *, size_t);
2378
2418
 
2379
2419
int uwsgi_proto_fastcgi_parser(struct wsgi_request *);
2380
2420
ssize_t uwsgi_proto_fastcgi_writev_header(struct wsgi_request *, struct iovec *, size_t);
2425
2465
 
2426
2466
void uwsgi_init_all_apps(void);
2427
2467
void uwsgi_socket_nb(int);
 
2468
void uwsgi_socket_b(int);
2428
2469
 
2429
2470
void uwsgi_destroy_request(struct wsgi_request *);
2430
2471
 
2632
2673
void uwsgi_opt_set_logger(char *, char *, void *);
2633
2674
void uwsgi_opt_set_str_spaced(char *, char *, void *);
2634
2675
void uwsgi_opt_add_string_list(char *, char *, void *);
 
2676
void uwsgi_opt_add_dyn_dict(char *, char *, void *);
 
2677
#ifdef UWSGI_PCRE
 
2678
void uwsgi_opt_add_regexp_dyn_dict(char *, char *, void *);
 
2679
#endif
2635
2680
void uwsgi_opt_set_int(char *, char *, void *);
 
2681
void uwsgi_opt_set_rawint(char *, char *, void *);
2636
2682
void uwsgi_opt_set_64bit(char *, char *, void *);
2637
2683
void uwsgi_opt_set_megabytes(char *, char *, void *);
2638
2684
void uwsgi_opt_set_dyn(char *, char *, void *);
2674
2720
void uwsgi_opt_set_uid(char *, char *, void *);
2675
2721
void uwsgi_opt_set_gid(char *, char *, void *);
2676
2722
void uwsgi_opt_set_env(char *, char *, void *);
 
2723
void uwsgi_opt_unset_env(char *, char *, void *);
2677
2724
void uwsgi_opt_pidfile_signal(char *, char *, void *);
2678
2725
void uwsgi_opt_add_app(char *, char *, void *);
2679
2726
 
2710
2757
int uwsgi_logic_opt_if_not_file(char *, char *);
2711
2758
int uwsgi_logic_opt_if_dir(char *, char *);
2712
2759
int uwsgi_logic_opt_if_not_dir(char *, char *);
 
2760
int uwsgi_logic_opt_if_reload(char *, char *);
 
2761
int uwsgi_logic_opt_if_not_reload(char *, char *);
2713
2762
 
2714
2763
 
2715
2764
#ifdef UWSGI_CAP
2769
2818
ssize_t uwsgi_protected_read(int, void *, size_t);
2770
2819
int uwsgi_socket_uniq(struct uwsgi_socket *, struct uwsgi_socket *);
2771
2820
int uwsgi_socket_is_already_bound(char *name);
 
2821
 
2772
2822
char *uwsgi_expand_path(char *, int, char *);
 
2823
int uwsgi_try_autoload(char *);
 
2824
 
 
2825
uint64_t uwsgi_micros(void);
 
2826
int uwsgi_is_file(char *);
 
2827
 
 
2828
void uwsgi_receive_signal(int, char *, int);
2773
2829
 
2774
2830
#ifdef UWSGI_AS_SHARED_LIBRARY
2775
2831
int uwsgi_init(int, char **, char **);