[PATCH] Core: add support for expressing size in gigabytes

Piotr Sikora piotr at cloudflare.com
Thu Jul 31 10:41:30 UTC 2014


# HG changeset patch
# User Piotr Sikora <piotr at cloudflare.com>
# Date 1406803246 25200
#      Thu Jul 31 03:40:46 2014 -0700
# Node ID c1aeec0f33fe6a42fde0a1851228a130f5ab12a1
# Parent  e0eaf2d92a8cee90abe592d7ac01d3118cb0853a
Core: add support for expressing size in gigabytes.

Signed-off-by: Piotr Sikora <piotr at cloudflare.com>

diff -r e0eaf2d92a8c -r c1aeec0f33fe src/core/ngx_parse.c
--- a/src/core/ngx_parse.c	Wed Jul 30 04:32:16 2014 -0700
+++ b/src/core/ngx_parse.c	Thu Jul 31 03:40:46 2014 -0700
@@ -33,6 +33,12 @@ ngx_parse_size(ngx_str_t *line)
         scale = 1024 * 1024;
         break;
 
+    case 'G':
+    case 'g':
+        len--;
+        scale = 1024 * 1024 * 1024;
+        break;
+
     default:
         scale = 1;
     }



More information about the nginx-devel mailing list