Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 292 lines (254 sloc) 8.056 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
diff -rNp a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c
*** a/src/http/modules/ngx_http_rewrite_module.c 2010-06-18 16:15:20.000000000 +0100
--- b/src/http/modules/ngx_http_rewrite_module.c 2010-10-09 14:47:10.000000000 +0100
***************
*** 8,14 ****
  #include <ngx_core.h>
  #include <ngx_http.h>
  
!
  typedef struct {
      ngx_array_t *codes; /* uintptr_t */
  
--- 8,14 ----
  #include <ngx_core.h>
  #include <ngx_http.h>
  
! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS)
  typedef struct {
      ngx_array_t *codes; /* uintptr_t */
  
*************** typedef struct {
*** 17,23 ****
      ngx_flag_t log;
      ngx_flag_t uninitialized_variable_warn;
  } ngx_http_rewrite_loc_conf_t;
!
  
  static void *ngx_http_rewrite_create_loc_conf(ngx_conf_t *cf);
  static char *ngx_http_rewrite_merge_loc_conf(ngx_conf_t *cf,
--- 17,23 ----
      ngx_flag_t log;
      ngx_flag_t uninitialized_variable_warn;
  } ngx_http_rewrite_loc_conf_t;
! #endif
  
  static void *ngx_http_rewrite_create_loc_conf(ngx_conf_t *cf);
  static char *ngx_http_rewrite_merge_loc_conf(ngx_conf_t *cf,
*************** static char *ngx_http_rewrite_return(ngx
*** 28,44 ****
      void *conf);
  static char *ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd,
      void *conf);
  static char *ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd,
      void *conf);
  static char * ngx_http_rewrite_if_condition(ngx_conf_t *cf,
      ngx_http_rewrite_loc_conf_t *lcf);
  static char *ngx_http_rewrite_variable(ngx_conf_t *cf,
      ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value);
  static char *ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd,
      void *conf);
  static char * ngx_http_rewrite_value(ngx_conf_t *cf,
      ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value);
!
  
  static ngx_command_t ngx_http_rewrite_commands[] = {
  
--- 28,47 ----
      void *conf);
  static char *ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd,
      void *conf);
+ #if !(NDK_EXPOSE_REWRITE_FUNCTIONS)
  static char *ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd,
      void *conf);
  static char * ngx_http_rewrite_if_condition(ngx_conf_t *cf,
      ngx_http_rewrite_loc_conf_t *lcf);
  static char *ngx_http_rewrite_variable(ngx_conf_t *cf,
      ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value);
+ #endif
  static char *ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd,
      void *conf);
+ #if !(NDK_EXPOSE_REWRITE_FUNCTIONS)
  static char * ngx_http_rewrite_value(ngx_conf_t *cf,
      ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value);
! #endif
  
  static ngx_command_t ngx_http_rewrite_commands[] = {
  
*************** ngx_http_rewrite_handler(ngx_http_reques
*** 178,185 ****
      return r->err_status;
  }
  
!
! static ngx_int_t
  ngx_http_rewrite_var(ngx_http_request_t *r, ngx_http_variable_value_t *v,
      uintptr_t data)
  {
--- 181,190 ----
      return r->err_status;
  }
  
! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS)
! static
! #endif
! ngx_int_t
  ngx_http_rewrite_var(ngx_http_request_t *r, ngx_http_variable_value_t *v,
      uintptr_t data)
  {
*************** ngx_http_rewrite_break(ngx_conf_t *cf, n
*** 511,517 ****
  }
  
  
! static char *
  ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
  {
      ngx_http_rewrite_loc_conf_t *lcf = conf;
--- 516,525 ----
  }
  
  
! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS)
! static
! #endif
! char *
  ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
  {
      ngx_http_rewrite_loc_conf_t *lcf = conf;
*************** ngx_http_rewrite_if(ngx_conf_t *cf, ngx_
*** 627,633 ****
  }
  
  
! static char *
  ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf)
  {
      u_char *p;
--- 635,644 ----
  }
  
  
! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS)
! static
! #endif
! char *
  ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf)
  {
      u_char *p;
*************** ngx_http_rewrite_if_condition(ngx_conf_t
*** 847,853 ****
  }
  
  
! static char *
  ngx_http_rewrite_variable(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf,
      ngx_str_t *value)
  {
--- 858,867 ----
  }
  
  
! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS)
! static
! #endif
! char *
  ngx_http_rewrite_variable(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf,
      ngx_str_t *value)
  {
*************** ngx_http_rewrite_set(ngx_conf_t *cf, ngx
*** 948,954 ****
  }
  
  
! static char *
  ngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf,
      ngx_str_t *value)
  {
--- 962,971 ----
  }
  
  
! #if !(NDK_EXPOSE_REWRITE_FUNCTIONS)
! static
! #endif
! char *
  ngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf,
      ngx_str_t *value)
  {
diff -rNp a/src/http/modules/ngx_http_rewrite_module.h b/src/http/modules/ngx_http_rewrite_module.h
*** a/src/http/modules/ngx_http_rewrite_module.h 1970-01-01 01:00:00.000000000 +0100
--- b/src/http/modules/ngx_http_rewrite_module.h 2010-10-09 14:38:04.000000000 +0100
***************
*** 0 ****
--- 1,47 ----
+
+ /*
+ * Copyright (C) Marcus Clyne
+ *
+ * Note : this file has been created by the Nginx Development Kit using
+ * some code from ngx_http_rewrite_module.c
+ */
+
+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS)
+
+ #ifndef _NGX_HTTP_REWRITE_H_INCLUDED_
+ #define _NGX_HTTP_REWRITE_H_INCLUDED_
+
+ #include <ngx_config.h>
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
+
+ extern ngx_module_t ngx_http_rewrite_module;
+
+
+ typedef struct {
+ ngx_array_t *codes; /* uintptr_t */
+
+ ngx_uint_t stack_size;
+
+ ngx_flag_t log;
+ ngx_flag_t uninitialized_variable_warn;
+ } ngx_http_rewrite_loc_conf_t;
+
+
+ char *
+ ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
+ char *
+ ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf);
+ char *
+ ngx_http_rewrite_variable(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf,
+ ngx_str_t *value);
+ char *
+ ngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf,
+ ngx_str_t *value);
+ ngx_int_t
+ ngx_http_rewrite_var(ngx_http_request_t *r, ngx_http_variable_value_t *v,
+ uintptr_t data);
+
+ #endif
+ #endif
diff -rNp a/src/http/ngx_http.h b/src/http/ngx_http.h
*** a/src/http/ngx_http.h 2010-06-15 16:13:34.000000000 +0100
--- b/src/http/ngx_http.h 2010-10-09 14:25:56.000000000 +0100
*************** typedef u_char *(*ngx_http_log_handler_p
*** 43,48 ****
--- 43,52 ----
  #include <ngx_http_ssl_module.h>
  #endif
  
+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS)
+ #include <ngx_http_rewrite_module.h>
+ #endif
+
  
  struct ngx_http_log_ctx_s {
      ngx_connection_t *connection;
diff -rNp a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
*** a/src/http/ngx_http_script.c 2010-09-13 13:44:43.000000000 +0100
--- b/src/http/ngx_http_script.c 2010-10-09 14:36:10.000000000 +0100
*************** static size_t ngx_http_script_full_name_
*** 26,35 ****
--- 26,43 ----
  static void ngx_http_script_full_name_code(ngx_http_script_engine_t *e);
  
  
+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS)
+
+ uintptr_t ngx_http_script_exit_code = (uintptr_t) NULL;
+
+ #else
+
  #define ngx_http_script_exit (u_char *) &ngx_http_script_exit_code
  
  static uintptr_t ngx_http_script_exit_code = (uintptr_t) NULL;
  
+ #endif
+
  
  void
  ngx_http_script_flush_complex_value(ngx_http_request_t *r,
diff -rNp a/src/http/ngx_http_script.h b/src/http/ngx_http_script.h
*** a/src/http/ngx_http_script.h 2010-09-13 13:44:43.000000000 +0100
--- b/src/http/ngx_http_script.h 2010-10-09 14:33:40.000000000 +0100
***************
*** 12,17 ****
--- 12,25 ----
  #include <ngx_core.h>
  #include <ngx_http.h>
  
+ #if (NDK_EXPOSE_REWRITE_FUNCTIONS)
+
+ #define ngx_http_script_exit (u_char *) &ngx_http_script_exit_code
+
+ extern uintptr_t ngx_http_script_exit_code;
+
+ #endif
+
  
  typedef struct {
      u_char *ip;
Something went wrong with that request. Please try again.