~britco/nginx/master

« back to all changes in this revision

Viewing changes to modules/nginx-echo/src/ddebug.h

  • Committer: Bazaar Package Importer
  • Author(s): Kartik Mistry, Kartik Mistry, Michael Lustfield
  • Date: 2010-11-27 21:04:02 UTC
  • mfrom: (1.3.8 upstream)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: james.westby@ubuntu.com-20101127210402-14sgjpe6r3jup8a9
Tags: 0.8.53-1
[Kartik Mistry]
* debian/control:
  + Added Michael Lustfield as co-maintainer
* nginx.conf:
  + No need to use regex in gzip_disable for msie6, Thanks to António P. P.
    Almeida <appa@perusio.net> (Closes: #592147)
* conf/sites-available/default:
  + Fixed typo for "include fastcgi", Thanks to Mostafa Ghadamyari
    <nginx@gigfa.com> (Closes: #593142, #593143)
* debian/patches/fix_reloading_ipv6.diff:
  + Removed, merged upstream
* debian/init.d:
  + Added fix to control nginx by user in a simple way by setting DAEMON
    variable to an invalid name in /etc/default/nginx. Patch by Toni Mueller
    <support@oeko.net> (Closes: #594598)
* debian/NEWS.Debian:
  + Updated news for 0.8.x as stable branch

[Michael Lustfield]
* New upstream release (Closes: #602970)
  + 0.8.x branch is declared stable by upstream now
* Add a UFW profile set:
  + debian/nginx.ufw.profile: Added.
  + debian/control: nginx: Suggests ufw.
  + debian/dirs: Add 'etc/ufw/applications.d'
  + debian/rules: Add install rule for the nginx UFW profile.
* Moved debian/dirs to debian/nginx.dirs
* Added types_hash_max_size to nginx.conf
* Install simple default index.html file (Closes: #581416)
  + debian/dirs: Add 'usr/share/nginx/www'.
  + debian/nginx.install: Add 'html/* usr/share/nginx/www'.
* debian/patches/nginx-echo.diff:
  + Added Echo module
* Added files for nginx.docs
  - /usr/share/doc/nginx/
    + debian/help/docs/fcgiwrap
    + debian/help/docs/php
    + debian/help/docs/support-irc
    + debian/help/docs/upstream
* Added files for nginx.examples
  - /usr/share/doc/nginx/examples/
    + debian/help/docs/drupal
    + debian/help/docs/http
    + debian/help/docs/mail
    + debian/help/docs/mailman
    + debian/help/docs/nginx.conf
    + debian/help/docs/virtual_hosts
    + debian/help/docs/wordpress
* debian/conf/:
  + Removed excess spaces
  + Added tabs where appropriate
  + Added SCRIPT_FILENAME to fastcgi_params

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef DDEBUG_H
 
2
#define DDEBUG_H
 
3
 
 
4
#include <ngx_core.h>
 
5
#include <ngx_http.h>
 
6
 
 
7
#if defined(DDEBUG) && (DDEBUG)
 
8
 
 
9
#   if (NGX_HAVE_VARIADIC_MACROS)
 
10
 
 
11
#       define dd(...) fprintf(stderr, "echo *** %s: ", __func__); \
 
12
            fprintf(stderr, __VA_ARGS__); \
 
13
            fprintf(stderr, " at %s line %d.\n", __FILE__, __LINE__)
 
14
 
 
15
#   else
 
16
 
 
17
#include <stdarg.h>
 
18
#include <stdio.h>
 
19
 
 
20
#include <stdarg.h>
 
21
 
 
22
static void dd(const char * fmt, ...) {
 
23
}
 
24
 
 
25
#    endif
 
26
 
 
27
#   if DDEBUG > 1
 
28
 
 
29
#       define dd_enter() dd_enter_helper(r, __func__)
 
30
 
 
31
static void dd_enter_helper(ngx_http_request_t *r, const char *func) {
 
32
    ngx_http_posted_request_t       *pr;
 
33
 
 
34
    fprintf(stderr, ">enter %s %.*s %.*s?%.*s c:%d m:%p r:%p ar:%p pr:%p",
 
35
            func,
 
36
            (int) r->method_name.len, r->method_name.data,
 
37
            (int) r->uri.len, r->uri.data,
 
38
            (int) r->args.len, r->args.data,
 
39
            0/*(int) r->main->count*/, r->main,
 
40
            r, r->connection->data, r->parent);
 
41
 
 
42
    if (r->posted_requests) {
 
43
        fprintf(stderr, " posted:");
 
44
 
 
45
        for (pr = r->posted_requests; pr; pr = pr->next) {
 
46
            fprintf(stderr, "%p,", pr);
 
47
        }
 
48
    }
 
49
 
 
50
    fprintf(stderr, "\n");
 
51
}
 
52
 
 
53
#   else
 
54
 
 
55
#       define dd_enter()
 
56
 
 
57
#   endif
 
58
 
 
59
#else
 
60
 
 
61
#   if (NGX_HAVE_VARIADIC_MACROS)
 
62
 
 
63
#       define dd(...)
 
64
 
 
65
#       define dd_enter()
 
66
 
 
67
#   else
 
68
 
 
69
#include <stdarg.h>
 
70
 
 
71
static void dd(const char * fmt, ...) {
 
72
}
 
73
 
 
74
static void dd_enter() {
 
75
}
 
76
 
 
77
#   endif
 
78
 
 
79
#endif
 
80
 
 
81
#if defined(DDEBUG) && (DDEBUG)
 
82
 
 
83
#define dd_check_read_event_handler(r)   \
 
84
    dd("r->read_event_handler = %s", \
 
85
        r->read_event_handler == ngx_http_block_reading ? \
 
86
            "ngx_http_block_reading" : \
 
87
        r->read_event_handler == ngx_http_test_reading ? \
 
88
            "ngx_http_test_reading" : \
 
89
        r->read_event_handler == ngx_http_request_empty_handler ? \
 
90
            "ngx_http_request_empty_handler" : "UNKNOWN")
 
91
 
 
92
#define dd_check_write_event_handler(r)   \
 
93
    dd("r->write_event_handler = %s", \
 
94
        r->write_event_handler == ngx_http_handler ? \
 
95
            "ngx_http_handler" : \
 
96
        r->write_event_handler == ngx_http_core_run_phases ? \
 
97
            "ngx_http_core_run_phases" : \
 
98
        r->write_event_handler == ngx_http_request_empty_handler ? \
 
99
            "ngx_http_request_empty_handler" : "UNKNOWN")
 
100
 
 
101
#else
 
102
 
 
103
#define dd_check_read_event_handler(r)
 
104
#define dd_check_write_event_handler(r)
 
105
 
 
106
#endif
 
107
 
 
108
#endif /* DDEBUG_H */
 
109