ssize_t
ngx_parse_size(ngx_str_t *line)
{
    u_char     unit;
    size_t     len;
    ssize_t    size;
    ngx_int_t  scale;
    len = line->len;
    unit = line->data[len - 1];
    switch (unit) {
    case 'K':
    case 'k':
        len--;
        scale = 1024;
        break;
    case 'M':
    case 'm':
        len--;
        scale = 1024 * 1024;
        break;
    default:
        scale = 1;
    }
    size = ngx_atosz(line->data, len);
    if (size == NGX_ERROR) {
        return NGX_ERROR;
    }
    size *= scale;
    return size;
}
['char *\nngx_conf_set_size_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n    char  *p = conf;\n    size_t           *sp;\n    ngx_str_t        *value;\n    ngx_conf_post_t  *post;\n    sp = (size_t *) (p + cmd->offset);\n    if (*sp != NGX_CONF_UNSET_SIZE) {\n        return "is duplicate";\n    }\n    value = cf->args->elts;\n    *sp = ngx_parse_size(&value[1]);\n    if (*sp == (size_t) NGX_ERROR) {\n        return "invalid value";\n    }\n    if (cmd->post) {\n        post = cmd->post;\n        return post->post_handler(cf, post, sp);\n    }\n    return NGX_CONF_OK;\n}', "ssize_t\nngx_parse_size(ngx_str_t *line)\n{\n    u_char     unit;\n    size_t     len;\n    ssize_t    size;\n    ngx_int_t  scale;\n    len = line->len;\n    unit = line->data[len - 1];\n    switch (unit) {\n    case 'K':\n    case 'k':\n        len--;\n        scale = 1024;\n        break;\n    case 'M':\n    case 'm':\n        len--;\n        scale = 1024 * 1024;\n        break;\n    default:\n        scale = 1;\n    }\n    size = ngx_atosz(line->data, len);\n    if (size == NGX_ERROR) {\n        return NGX_ERROR;\n    }\n    size *= scale;\n    return size;\n}"]