Repository: aliyun/aliyun-oss-c-sdk Branch: master Commit: 052594c48bb2 Files: 281 Total size: 2.9 MB Directory structure: gitextract_876k0tp9/ ├── .github/ │ └── workflows/ │ ├── linux-clang.yml │ ├── linux-gcc.yml │ └── windows.yml ├── .travis.yml ├── CHANGELOG.md ├── CMakeLists.txt ├── LICENSE ├── README-CN.md ├── README.md ├── oss_c_sdk/ │ ├── aos_buf.c │ ├── aos_buf.h │ ├── aos_crc64.c │ ├── aos_crc64.h │ ├── aos_define.h │ ├── aos_fstack.c │ ├── aos_fstack.h │ ├── aos_http_io.c │ ├── aos_http_io.h │ ├── aos_list.h │ ├── aos_log.c │ ├── aos_log.h │ ├── aos_status.c │ ├── aos_status.h │ ├── aos_string.c │ ├── aos_string.h │ ├── aos_transport.c │ ├── aos_transport.h │ ├── aos_util.c │ ├── aos_util.h │ ├── oss_api.h │ ├── oss_auth.c │ ├── oss_auth.h │ ├── oss_bucket.c │ ├── oss_define.c │ ├── oss_define.h │ ├── oss_live.c │ ├── oss_multipart.c │ ├── oss_object.c │ ├── oss_resumable.c │ ├── oss_resumable.h │ ├── oss_util.c │ ├── oss_util.h │ ├── oss_xml.c │ └── oss_xml.h ├── oss_c_sdk.sln ├── oss_c_sdk_sample/ │ ├── CMakeLists.txt │ ├── main.c │ ├── oss_append_object_sample.c │ ├── oss_callback_sample.c │ ├── oss_config.c │ ├── oss_config.h │ ├── oss_crc_sample.c │ ├── oss_delete_object_sample.c │ ├── oss_get_object_acl_sample.c │ ├── oss_get_object_meta_sample.c │ ├── oss_get_object_sample.c │ ├── oss_head_object_sample.c │ ├── oss_image_sample.c │ ├── oss_list_object_sample.c │ ├── oss_multipart_upload_sample.c │ ├── oss_progress_sample.c │ ├── oss_put_object_acl_sample.c │ ├── oss_put_object_sample.c │ ├── oss_resumable_sample.c │ ├── oss_sample_util.c │ ├── oss_sample_util.h │ └── oss_select_object_sample.c ├── oss_c_sdk_test/ │ ├── CMakeLists.txt │ ├── CuTest-README.txt │ ├── CuTest.c │ ├── CuTest.h │ ├── ca-certificates.crt │ ├── cjson.c │ ├── cjson.h │ ├── cjson_utils.c │ ├── cjson_utils.h │ ├── oss_config.c │ ├── oss_config.h │ ├── oss_test_util.c │ ├── oss_test_util.h │ ├── sample_data.csv │ ├── test.h.in │ ├── test_all.c │ ├── test_aos.c │ ├── test_oss_bucket.c │ ├── test_oss_callback.c │ ├── test_oss_crc.c │ ├── test_oss_https.c │ ├── test_oss_image.c │ ├── test_oss_live.c │ ├── test_oss_multipart.c │ ├── test_oss_object.c │ ├── test_oss_object_tagging.c │ ├── test_oss_progress.c │ ├── test_oss_proxy.c │ ├── test_oss_resumable.c │ ├── test_oss_select_object.c │ ├── test_oss_sign.c │ └── test_oss_xml.c └── third_party/ ├── include/ │ ├── apr/ │ │ ├── apr.h │ │ ├── apr.h.in │ │ ├── apr.hnw │ │ ├── apr.hw │ │ ├── apr.hwc │ │ ├── apr_allocator.h │ │ ├── apr_atomic.h │ │ ├── apr_dso.h │ │ ├── apr_env.h │ │ ├── apr_errno.h │ │ ├── apr_escape.h │ │ ├── apr_escape_test_char.h │ │ ├── apr_file_info.h │ │ ├── apr_file_io.h │ │ ├── apr_fnmatch.h │ │ ├── apr_general.h │ │ ├── apr_getopt.h │ │ ├── apr_global_mutex.h │ │ ├── apr_hash.h │ │ ├── apr_inherit.h │ │ ├── apr_lib.h │ │ ├── apr_mmap.h │ │ ├── apr_network_io.h │ │ ├── apr_poll.h │ │ ├── apr_pools.h │ │ ├── apr_portable.h │ │ ├── apr_proc_mutex.h │ │ ├── apr_random.h │ │ ├── apr_ring.h │ │ ├── apr_shm.h │ │ ├── apr_signal.h │ │ ├── apr_skiplist.h │ │ ├── apr_strings.h │ │ ├── apr_support.h │ │ ├── apr_tables.h │ │ ├── apr_thread_cond.h │ │ ├── apr_thread_mutex.h │ │ ├── apr_thread_proc.h │ │ ├── apr_thread_rwlock.h │ │ ├── apr_time.h │ │ ├── apr_user.h │ │ ├── apr_version.h │ │ ├── apr_want.h │ │ └── arch/ │ │ ├── aix/ │ │ │ └── apr_arch_dso.h │ │ ├── apr_private_common.h │ │ ├── beos/ │ │ │ ├── apr_arch_dso.h │ │ │ ├── apr_arch_proc_mutex.h │ │ │ ├── apr_arch_thread_cond.h │ │ │ ├── apr_arch_thread_mutex.h │ │ │ ├── apr_arch_thread_rwlock.h │ │ │ └── apr_arch_threadproc.h │ │ ├── netware/ │ │ │ ├── apr_arch_dso.h │ │ │ ├── apr_arch_file_io.h │ │ │ ├── apr_arch_global_mutex.h │ │ │ ├── apr_arch_internal_time.h │ │ │ ├── apr_arch_networkio.h │ │ │ ├── apr_arch_pre_nw.h │ │ │ ├── apr_arch_proc_mutex.h │ │ │ ├── apr_arch_thread_cond.h │ │ │ ├── apr_arch_thread_mutex.h │ │ │ ├── apr_arch_thread_rwlock.h │ │ │ ├── apr_arch_threadproc.h │ │ │ └── apr_private.h │ │ ├── os2/ │ │ │ ├── apr_arch_dso.h │ │ │ ├── apr_arch_file_io.h │ │ │ ├── apr_arch_inherit.h │ │ │ ├── apr_arch_networkio.h │ │ │ ├── apr_arch_os2calls.h │ │ │ ├── apr_arch_proc_mutex.h │ │ │ ├── apr_arch_thread_cond.h │ │ │ ├── apr_arch_thread_mutex.h │ │ │ ├── apr_arch_thread_rwlock.h │ │ │ └── apr_arch_threadproc.h │ │ ├── os390/ │ │ │ └── apr_arch_dso.h │ │ ├── unix/ │ │ │ ├── apr_arch_atomic.h │ │ │ ├── apr_arch_dso.h │ │ │ ├── apr_arch_file_io.h │ │ │ ├── apr_arch_global_mutex.h │ │ │ ├── apr_arch_inherit.h │ │ │ ├── apr_arch_internal_time.h │ │ │ ├── apr_arch_misc.h │ │ │ ├── apr_arch_networkio.h │ │ │ ├── apr_arch_poll_private.h │ │ │ ├── apr_arch_proc_mutex.h │ │ │ ├── apr_arch_shm.h │ │ │ ├── apr_arch_thread_cond.h │ │ │ ├── apr_arch_thread_mutex.h │ │ │ ├── apr_arch_thread_rwlock.h │ │ │ └── apr_arch_threadproc.h │ │ └── win32/ │ │ ├── apr_arch_atime.h │ │ ├── apr_arch_dso.h │ │ ├── apr_arch_file_io.h │ │ ├── apr_arch_inherit.h │ │ ├── apr_arch_misc.h │ │ ├── apr_arch_networkio.h │ │ ├── apr_arch_proc_mutex.h │ │ ├── apr_arch_thread_cond.h │ │ ├── apr_arch_thread_mutex.h │ │ ├── apr_arch_thread_rwlock.h │ │ ├── apr_arch_threadproc.h │ │ ├── apr_arch_utf8.h │ │ ├── apr_dbg_win32_handles.h │ │ └── apr_private.h │ ├── aprutil/ │ │ ├── apr_anylock.h │ │ ├── apr_base64.h │ │ ├── apr_buckets.h │ │ ├── apr_crypto.h │ │ ├── apr_date.h │ │ ├── apr_dbd.h │ │ ├── apr_dbm.h │ │ ├── apr_hooks.h │ │ ├── apr_ldap.h │ │ ├── apr_ldap.h.in │ │ ├── apr_ldap.hnw │ │ ├── apr_ldap.hw │ │ ├── apr_ldap.hwc │ │ ├── apr_ldap_init.h │ │ ├── apr_ldap_option.h │ │ ├── apr_ldap_rebind.h │ │ ├── apr_ldap_url.h │ │ ├── apr_md4.h │ │ ├── apr_md5.h │ │ ├── apr_memcache.h │ │ ├── apr_optional.h │ │ ├── apr_optional_hooks.h │ │ ├── apr_queue.h │ │ ├── apr_reslist.h │ │ ├── apr_rmm.h │ │ ├── apr_sdbm.h │ │ ├── apr_sha1.h │ │ ├── apr_strmatch.h │ │ ├── apr_thread_pool.h │ │ ├── apr_uri.h │ │ ├── apr_uuid.h │ │ ├── apr_xlate.h │ │ ├── apr_xml.h │ │ ├── apu.h │ │ ├── apu.h.in │ │ ├── apu.hnw │ │ ├── apu.hw │ │ ├── apu.hwc │ │ ├── apu_errno.h │ │ ├── apu_version.h │ │ ├── apu_want.h │ │ ├── apu_want.h.in │ │ ├── apu_want.hnw │ │ ├── apu_want.hw │ │ └── private/ │ │ ├── apr_crypto_internal.h │ │ ├── apr_dbd_internal.h │ │ ├── apr_dbd_odbc_v2.h │ │ ├── apr_dbm_private.h │ │ ├── apu_config.h │ │ ├── apu_config.hnw │ │ ├── apu_config.hw │ │ ├── apu_internal.h │ │ ├── apu_select_dbm.h │ │ ├── apu_select_dbm.h.in │ │ └── apu_select_dbm.hw │ ├── curl/ │ │ ├── config-win32.h │ │ ├── curl.h │ │ ├── curlbuild.h │ │ ├── curlrules.h │ │ ├── curlver.h │ │ ├── easy.h │ │ ├── mprintf.h │ │ ├── multi.h │ │ ├── stdcheaders.h │ │ └── typecheck-gcc.h │ └── mxml/ │ ├── config.h │ └── mxml.h └── lib/ ├── Win32/ │ ├── libapr-1.lib │ ├── libapriconv-1.lib │ ├── libaprutil-1.lib │ ├── libcurl.lib │ ├── libexpat.lib │ └── mxml1.lib └── x64/ ├── libapr-1.lib ├── libapriconv-1.lib ├── libaprutil-1.lib ├── libcurl.lib ├── libexpat.lib └── mxml1.lib ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/workflows/linux-clang.yml ================================================ name: Ubuntu (clang) on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: strategy: matrix: mode: [ Debug, Release ] runs-on: ubuntu-22.04 steps: - name: check out uses: actions/checkout@v3 - name: Install Dependencies run: | sudo apt-get update sudo apt-get install curl libssl-dev libcurl4-openssl-dev libmxml-dev libapr1-dev libaprutil1-dev - name: configure cmake run: CXX=clang++ CC=clang cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.mode }} - name: build project run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.mode }} ================================================ FILE: .github/workflows/linux-gcc.yml ================================================ name: Ubuntu (gcc) on: push: branches: [ master ] pull_request: branches: [ master ] jobs: ubuntu_gcc: strategy: matrix: mode: [ Debug, Release ] runs-on: ubuntu-20.04 steps: - name: check out uses: actions/checkout@v3 - name: Install Dependencies run: | sudo apt-get update sudo apt-get install curl libssl-dev libcurl4-openssl-dev libmxml-dev libapr1-dev libaprutil1-dev - name: checkout gcc version run: gcc --version - name: configure cmake run: CXX=g++ CC=gcc cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.mode }} - name: build project run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.mode }} ================================================ FILE: .github/workflows/windows.yml ================================================ name: Windows Server 2022 on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: windows-latest strategy: matrix: mode: [Debug, Release] arch: [x64, Win32] env: CXX: cl.exe CC: cl.exe steps: - name: check out uses: actions/checkout@v3 - name: generate project run: cmake -B ${{ github.workspace }}\build -DCMAKE_BUILD_TYPE=${{ matrix.mode }} -A${{ matrix.arch }} - name: build project run: cmake --build ${{ github.workspace }}\build --config ${{ matrix.mode }} ================================================ FILE: .travis.yml ================================================ language: c compiler: - gcc install: - sudo apt-get update - sudo apt-get install libapr1-dev libaprutil1-dev curl - wget --quiet https://github.com/michaelrsweet/mxml/releases/download/release-2.9/mxml-2.9.tar.gz - tar zxf mxml-2.9.tar.gz - cd mxml-2.9 - ./configure && make && sudo make install - cd - - pip install --user cpp-coveralls script: - cmake -DCMAKE_BUILD_TYPE=Coverage . - make - ./build/Coverage/bin/oss_c_sdk_test after_success: env: global: - secure: kvjsFXirn2+Nys0TO0eViDHTlhz0ow5AuWuQeEzJAJnLbJfqupWng0o3i4vGF7bPpxWgbrIFJro/Pwk15F1gvUGaKjXbPWn5hae3G3ZqDwdNkDYy8Hs8VnjvqlaZ4dbpqDQOFA7+49jUuzVPdHFWJgLEleE53RADfuESN/rd0Uo6C1mZEEmyEhmj2pyHSKr08UWLbbuoLuVeaF1rfLxLRAU/Ki0S1AnnFirJcsbMSICexwQ96G+bdQTdqHass6JfQfOYklnKVSrMbk/0MuV5LmeQ3A1j1AF3iRzZ4KT4FmNXwk0hoocz+la8M3B7zaUu2wuea8LV5mZ6G5bN5p2fYHXlpZaoxstMl3HUwiQH5ETX0W6bzB1rjWl2CteKR3xt2wW1qj5XDvjqBUrPNV0yibpfMdkVfLnvic16+0qZua2cjsn93d0AyNnS6cFCGAH3PGI7+3Mm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6GNSjYlqZl5xA41Ycr6nDGqbB87xp+DiYeEzNmwFmpAnrA5Ur8ZFE9HEObGgCdouRLjyPjhLUS+QEeDangEth7bXlACBQxPMlJsjBrXuQxykT+TtqVexOWQtVe9nuJQ= ================================================ FILE: CHANGELOG.md ================================================ # ChangeLog - Aliyun OSS SDK for C ## 版本号:3.11.2 日期:2024-09-14 ### 变更内容 - 修复:潜在的空指针访问问题 ## 版本号:3.11.1 日期:2024-07-26 ### 变更内容 - 修复:delete objects 接口解析响应体时可能出现异常的问题 ## 版本号:3.11.0 日期:2024-05-29 ### 变更内容 - 添加:支持版本签名4 ## 版本号:3.10.1 日期:2023-12-05 ### 变更内容 - 添加:支持windows x64 构建 - 添加:增加对象名的合法性检查 - 添加:优化curl实例的重用 ## 版本号:3.10.0 日期:2020-08-12 ### 变更内容 - 添加:支持ip:port 形式的 endpoint参数 - 添加:支持冷归档接口 - 添加:增加endpoint的参数检查 - 修复:网络参数在断点续传场景下不生效 ## 版本号:3.9.2 日期:2020-06-19 ### 变更内容 - 添加:增加endpoint的合法性检查 - 添加:增加ssl证书校验开关 和 CA证书设置路径,默认开启ssl证书校验 - 添加:支持 生成签名URL时,不对/ 转义成%2F ## 版本号:3.9.1 日期:2019-11-22 ### 变更内容 - 添加:bucket名字的合法性检查 ## 版本号:3.9.0 日期:2019-09-09 ### 变更内容 - 添加:支持x-oss-sign-origin-only 签名子资源 ## 版本号:3.8.0 日期:2019-08-09 ### 变更内容 - 添加:支持object tagging功能 - 修复:oss_upload_part_copy源文件名没有url编码的问题 ## 版本号:3.7.1 日期:2019-04-05 ### 变更内容 - 修复:断点续传下载进度条更新不正确的问题 ## 版本号:3.7.0 日期:2019-02-23 ### 变更内容 - 添加:支持oss_get_object_meta - 添加:支持oss_put_object_acl,oss_get_object_acl - 添加:支持windows x64 平台 - 优化: 完善测试代码 - 添加:支持windows 下 使用cmake 方式构建 - 添加:添加curl debug 日志信息 - 添加:支持select object ## 版本号:3.6.0 日期:2018-04-19 ### 变更内容 - 添加:create_bucket支持指定存储类型,支持oss_restore_object - 添加:支持symlink,oss_put_symlink和oss_get_symlink - 添加:存储空间设置logging,lifecycle,website,referer,cors - 添加:支持oss_list_bucket,oss_get_bucket_location - 添加:支持oss_get_bucket_location,oss_get_bucket_info ## 版本号:3.5.2 日期:2017-11-14 ### 变更内容 - 修复:oss_resumable_upload_file、oss_resumable_download_file不支持STS鉴权方式的问题 ## 版本号:3.5.1 日期:2017-08-11 ### 变更内容 - 修复:`apr_file_info_get`在特定文件系统下报`70008 APR_INCOMPLETE`错误的问题 - 修复:`oss_delete_objects_by_prefix`在中的`params->next_marker`使用释放后的内存的问题 - 修复:Windows的`minixml`库升级到2.9 ## 版本号:3.5.0 日期:2017-08-01 ### 变更内容 - 添加:支持并发断点续传下载`oss_resumable_download_file` - 修复:`aos_should_retry`重试判读错误的问题 ## 版本号:3.4.3 日期:2017-04-26 ### 变更内容 - 修复:添加宏`ULLONG_MAX`的定义 - 修复:示例工程的CMakeLists中加入`oss_resumable_sample.c` - 修复:`oss_open_checkpoint_file`错误打印日志的问题 ## 版本号:3.4.2 日期:2017-04-23 ### 变更内容 - 修复:解决分片上传ContentType被覆盖的问题 ## 版本号:3.4.1 日期:2017-04-07 ### 变更内容 - 添加:list_object使用示例`oss_list_object_sample.c` - 修复:CMakeLists中加入`oss_resumable.h` ## 版本号:3.4.0 日期:2017-02-22 ### 变更内容 - 添加:支持并发断点续传上传`oss_resumable_upload_file` - 修复:`oss_gen_signed_url`支持临时用户签名 - 修复:初始化默认不打开`fd 2`,退出时不关闭`fd 2` - 修复:修复key为`xxx/./yyy/`,`./async_test/test`报`SignatureDoesNotMatch`的问题 ## 版本号:3.3.0 日期:2016-12-28 ### 变更内容 - 添加:支持代理Proxy - 修复:oss_get_object_to_file先下载到本地临时文件,成功后修改文件名称 - 修复:去除Visual Studio编译警告aos_util.c(512) C4146 - 修复:URL上传下载添加CRC校验 ## 版本号:3.2.1 日期:2016-11-21 ### 变更内容 - 解决oss_copy_object源文件名没有url编码的问题 ## 版本号:3.2.0 日期:2016-11-14 ### 变更内容 - 支持上传、下载[CRC](https://github.com/aliyun/aliyun-oss-c-sdk/blob/master/oss_c_sdk_test/test_oss_crc.c)检验 - 支持[上传回调](https://github.com/aliyun/aliyun-oss-c-sdk/blob/master/oss_c_sdk_test/test_oss_callback.c)功能 - 支持[进度条](https://github.com/aliyun/aliyun-oss-c-sdk/blob/master/oss_c_sdk_test/test_oss_progress.c)功能 ## 版本号:3.1.0 日期:2016-08-10 ### 变更内容 - 支持[RTMP](https://github.com/aliyun/aliyun-oss-c-sdk/blob/master/oss_c_sdk_test/test_oss_live.c)功能 - 支持[图片服务](https://github.com/aliyun/aliyun-oss-c-sdk/blob/master/oss_c_sdk_test/test_oss_image.c)功能 ## 版本号:3.0.0 日期:2016-05-24 ### 变更内容 - Windows和Linux版本合并 ## 版本号:2.1.0 日期:2016-03-28 ### 变更内容 - 完善示例程序 - header长度由限制为1K升级为最长8K - 解决部分单词拼写错误 ## 版本号:2.0.0 日期:2016-03-08 ### 变更内容 - complete multipart接口支持覆盖原有head - 重构示例程序和组织方式 - 开放params参数,允许用户自定义设置 - 允许params和headers参数为空,简化使用 - 支持https - 支持ip - 新增部分测试 - 新增oss_put_bucket_acl接口 - 新增目录相关示例 - 新增signed url相关示例 - 完善接口注释 - 删除无用的port配置参数 - 调整oss_init_multipart_upload接口参数顺序 - 优化配置参数名称,使其与官方网站保持一致 - 解决endpoint不能含有http等前缀的问题 - 解决用户无法设置content-type的问题 - 解决无法自动根据file name和key设置content-type的问题 - 解决list upload parts为空时coredump的问题 - 解决oss_upload_file接口在断点续传时可能会coredump的问题 - 解决部分单词拼写错误 - 解决所有警告 - 解决部分头文件宏保护无效的问题 - 解决oss_head_object_by_url接口不生效的问题 ## 版本号:1.0.0 日期:2015-12-16 ### 变更内容 - 调整OSS C SDK依赖的XML第三方库,使用minixml替换libxml减小OSS C SDK的大小 - 修改编译方式为CMAKE,同时提供嵌入式环境的Makefile.embeded,减少automake重复编译的问题 - 新增oss_upload_file接口,封装multipart upload相关的接口,使用multipart方式上传文件 - 新增oss_delete_objects_by_prefix接口,删除指定prefix的object - 新增OSS C SDK根据object name或者filename自动添加content_type - 完善OSS C SDK demo的调用示例,方便用户快速入门 ## 版本号:0.0.7 日期:2015-11-11 ### 变更内容 - OSS C SDK修复sts_token超过http header最大限制的问题 ## 版本号:0.0.6 日期:2015-10-29 ### 变更内容 - OSS C SDK签名时请求头支持x-oss-date,允许用户指定签名时间,解决系统时间偏差导致签名出错的问题 - OSS C SDK支持CNAME方式访问OSS,CNAME方式请求时指定is_oss_domain值为0 - 新增OSS C SDK demo,提供简单的接口调用示例,方便用户快速入门 - OSS C SDK sample示例中去除对utf8第三方库的依赖 ## 版本号:0.0.5 日期:2015-09-10 ### 变更内容 - 调整OSS C SDK获取GMT时间的方式,解决LOCALE变化可能导致签名出错的问题 - aos_status_t结构体增加req_id字段,方便定位请求出错问题 ## 版本号:0.0.4 日期:2015-07-27 ### 变更内容 - 增加生命周期相关的接口oss_put_bucket_lifecycle、oss_get_bucket_lifecycle以及oss_delete_bucket_lifecycle - OSS C SDK支持长连接,默认使用连接池支持keep alive功能 - oss_list_object增加子目录的输出 ## 版本号:0.0.3 日期:2015-07-08 ### 变更内容 - 增加oss_append_object_from_buffer接口,支持追加上传buffer中的内容到object - 增加oss_append_object_from_file接口,支持追加上传文件中的内容到object ## 版本号:0.0.2 日期:2015-06-10 ### 变更内容 - 增加oss_upload_part_copy,支持Upload Part Copy方式拷贝 - 增加sts服务临时授权方式访问OSS ## 版本号:0.0.1 日期:2015-05-28 ### 变更内容 - 基于OSS API文档,提供OSS bucket、object以及multipart相关的常见操作API - 提供基于CuTest的sample ================================================ FILE: CMakeLists.txt ================================================ PROJECT(oss_c_sdk) CMAKE_MINIMUM_REQUIRED(VERSION 2.6) set(CMAKE_VERSION 3.0.0) # default C / CXX flags if(CMAKE_HOST_WIN32) else() set(CMAKE_C_FLAGS " -g -ggdb -O0 -Wall -fpic -fPIC -D_LARGEFILE64_SOURCE") set(CMAKE_CXX_FLAGS " -g -ggdb -O0 -Wall -fpic -fPIC -D_LARGEFILE64_SOURCE") set(CMAKE_C_FLAGS_DEBUG " -g -ggdb -O0 -Wall -fpic -fPIC -D_LARGEFILE64_SOURCE") set(CMAKE_CXX_FLAGS_DEBUG " -g -ggdb -O0 -Wall -fpic -fPIC -D_LARGEFILE64_SOURCE") set(CMAKE_C_FLAGS_RELEASE " -O3 -Wall -fpic -fPIC -D_LARGEFILE64_SOURCE") set(CMAKE_CXX_FLAGS_RELEASE " -O3 -Wall -fpic -fPIC -D_LARGEFILE64_SOURCE") set(CMAKE_C_FLAGS_MINSIZEREF " -Os -Wall -fpic -fPIC -D_LARGEFILE64_SOURCE") set(CMAKE_CXX_FLAGS_MINSIZEREF " -Os -Wall -fpic -fPIC -D_LARGEFILE64_SOURCE") set(CMAKE_C_FLAGS_RELWITHDEBINFO " -O2 -Wall -fpic -fPIC -D_LARGEFILE64_SOURCE") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO " -O2 -Wall -fpic -fPIC -D_LARGEFILE64_SOURCE") set(CMAKE_C_FLAGS_COVERAGE " ${CMAKE_C_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage") set(CMAKE_CXX_FLAGS_COVERAGE " ${CMAKE_C_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage") endif() set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/build/${CMAKE_BUILD_TYPE}/lib) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/build/${CMAKE_BUILD_TYPE}/bin) set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1) set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1) # find dependency librarys if(CMAKE_HOST_WIN32) set(EXTRA_INCLUDE_PATH ${CMAKE_SOURCE_DIR}/third_party/include) if (CMAKE_CL_64) set(EXTRA_LIB_PATH ${CMAKE_SOURCE_DIR}/third_party/lib/x64/) else() set(EXTRA_LIB_PATH ${CMAKE_SOURCE_DIR}/third_party/lib/Win32/) endif() find_path(APR_INCLUDE_DIR NAMES apr.h PATH_SUFFIXES apr PATHS ${EXTRA_INCLUDE_PATH}) find_library(APR_LIBRARY NAMES libapr-1 PATHS ${EXTRA_LIB_PATH}) find_path(APR_UTIL_INCLUDE_DIR NAMES apu.h PATH_SUFFIXES aprutil PATHS ${EXTRA_INCLUDE_PATH}) find_library(APR_UTIL_LIBRARY NAMES libaprutil-1 PATHS ${EXTRA_LIB_PATH}) find_path(MINIXML_INCLUDE_DIR NAMES mxml.h PATH_SUFFIXES mxml PATHS ${EXTRA_INCLUDE_PATH}) find_library(MINIXML_LIBRARY NAMES mxml1 PATHS ${EXTRA_LIB_PATH}) find_path(CURL_INCLUDE_DIR NAMES curl/curl.h PATHS ${EXTRA_INCLUDE_PATH}) find_library(CURL_LIBRARY NAMES libcurl PATHS ${EXTRA_LIB_PATH}) else() FIND_PROGRAM(APR_CONFIG_BIN NAMES apr-config apr-1-config PATHS /usr/bin /usr/local/bin /usr/local/apr/bin/) FIND_PROGRAM(APU_CONFIG_BIN NAMES apu-config apu-1-config PATHS /usr/bin /usr/local/bin /usr/local/apr/bin/) IF (APR_CONFIG_BIN) EXECUTE_PROCESS( COMMAND ${APR_CONFIG_BIN} --includedir OUTPUT_VARIABLE APR_INCLUDE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) EXECUTE_PROCESS( COMMAND ${APR_CONFIG_BIN} --cflags OUTPUT_VARIABLE APR_C_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE ) EXECUTE_PROCESS( COMMAND ${APR_CONFIG_BIN} --link-ld OUTPUT_VARIABLE APR_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE ) ELSE() MESSAGE(FATAL_ERROR "Could not find apr-config/apr-1-config") ENDIF() IF (APU_CONFIG_BIN) EXECUTE_PROCESS( COMMAND ${APU_CONFIG_BIN} --includedir OUTPUT_VARIABLE APR_UTIL_INCLUDE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) EXECUTE_PROCESS( COMMAND ${APU_CONFIG_BIN} --cflags OUTPUT_VARIABLE APU_C_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE ) EXECUTE_PROCESS( COMMAND ${APU_CONFIG_BIN} --link-ld OUTPUT_VARIABLE APU_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE ) ELSE() MESSAGE(FATAL_ERROR "Could not find apu-config/apu-1-config") ENDIF() #curl-config FIND_PROGRAM(CURL_CONFIG_BIN NAMES curl-config) IF (CURL_CONFIG_BIN) EXECUTE_PROCESS( COMMAND ${CURL_CONFIG_BIN} --libs OUTPUT_VARIABLE CURL_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE ) ELSE() MESSAGE(FATAL_ERROR "Could not find curl-config") ENDIF() endif() # Compile and link lib_oss_c_sdk include_directories(${APR_INCLUDE_DIR}) include_directories(${APR_UTIL_INCLUDE_DIR}) include_directories(${MINIXML_INCLUDE_DIR}) include_directories(${CURL_INCLUDE_DIR}) aux_source_directory(oss_c_sdk SRC_LIST) # build & install if(CMAKE_HOST_WIN32) add_library(${CMAKE_PROJECT_NAME} STATIC ${SRC_LIST}) INSTALL(TARGETS ${CMAKE_PROJECT_NAME} ARCHIVE DESTINATION lib) else() add_library(${CMAKE_PROJECT_NAME} SHARED ${SRC_LIST}) add_library(${CMAKE_PROJECT_NAME}_static STATIC ${SRC_LIST}) set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES VERSION ${CMAKE_VERSION} SOVERSION ${CMAKE_VERSION}) INSTALL(TARGETS ${CMAKE_PROJECT_NAME} LIBRARY DESTINATION lib) INSTALL(TARGETS ${CMAKE_PROJECT_NAME}_static ARCHIVE DESTINATION lib) endif() INSTALL(FILES oss_c_sdk/aos_buf.h oss_c_sdk/aos_define.h oss_c_sdk/aos_fstack.h oss_c_sdk/aos_http_io.h oss_c_sdk/aos_list.h oss_c_sdk/aos_log.h oss_c_sdk/aos_status.h oss_c_sdk/aos_string.h oss_c_sdk/aos_transport.h oss_c_sdk/aos_util.h oss_c_sdk/aos_crc64.h oss_c_sdk/oss_api.h oss_c_sdk/oss_auth.h oss_c_sdk/oss_define.h oss_c_sdk/oss_resumable.h oss_c_sdk/oss_util.h oss_c_sdk/oss_xml.h DESTINATION include/oss_c_sdk) add_subdirectory(oss_c_sdk_sample) add_subdirectory(oss_c_sdk_test) ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2016 Aliyun Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README-CN.md ================================================ # Aliyun OSS SDK for C [![GitHub version](https://badge.fury.io/gh/aliyun%2Faliyun-oss-c-sdk.svg)](https://badge.fury.io/gh/aliyun%2Faliyun-oss-c-sdk) [![Build Status](https://travis-ci.org/aliyun/aliyun-oss-c-sdk.svg?branch=master)](https://travis-ci.org/aliyun/aliyun-oss-c-sdk) [![Coverage Status](https://coveralls.io/repos/github/aliyun/aliyun-oss-c-sdk/badge.svg?branch=master)](https://coveralls.io/github/aliyun/aliyun-oss-c-sdk?branch=master) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE) ## [README of English](https://github.com/aliyun/aliyun-oss-c-sdk/blob/master/README.md) ## 关于 阿里云对象存储(Object Storage Service,简称OSS),是阿里云对外提供的海量、安全、低成本、高可靠的云存储服务。用户可以通过调用API,在任何应用、任何时间、任何地点上传和下载数据,也可以通过用户Web控制台对数据进行简单的管理。OSS适合存放任意文件类型,适合各种网站、开发企业及开发者使用。OSS C SDK提供了一系列接口方便用户使用OSS。 ## 版本 - 当前版本:3.11.2 ## 安装方法 ### 环境依赖 OSS C SDK使用curl进行网络操作,无论是作为客户端还是服务器端,都需要依赖curl。 OSS C SDK使用apr/apr-util库解决内存管理以及跨平台问题,使用minixml库解析请求返回的xml, OSS C SDK并没有带上这几个外部库,您需要确认这些库已经安装,并且将它们的头文件目录和库文件目录都加入到了项目中。 #### 第三方库下载以及安装 ##### libcurl (建议 7.32.0 及以上版本) 请从[这里](http://curl.haxx.se/download.html)下载,并参考[libcurl 安装指南](http://curl.haxx.se/docs/install.html)安装。典型的安装方式如下: ```shell ./configure make make install ``` 注意: - 执行./configure时默认是配置安装目录为/usr/local/,如果需要指定安装目录,请使用 ./configure --prefix=/your/install/path/ ##### apr (建议 1.5.2 及以上版本) 请从[这里](https://apr.apache.org/download.cgi)下载,典型的安装方式如下: ```shell ./configure make make install ``` 注意: - 执行./configure时默认是配置安装目录为/usr/local/,如果需要指定安装目录,请使用 ./configure --prefix=/your/install/path/ ##### apr-util (建议 1.5.4 及以上版本) 请从[这里](https://apr.apache.org/download.cgi)下载,安装时需要注意指定--with-apr选项,典型的安装方式如下: ```shell ./configure --with-apr=/your/apr/install/path make make install ``` 注意: - 执行./configure时默认是配置安装目录为/usr/local/,如果需要指定安装目录,请使用 ./configure --prefix=/your/install/path/ - 需要通过--with-apr指定apr安装目录,如果apr安装到系统目录下需要指定--with-apr=/usr/local/apr/ ##### minixml (建议 2.8 及以上版本) 请从[这里](http://michaelrsweet.github.io/mxml/)下载,典型的安装方式如下: ```shell ./configure make make install ``` 注意: - 执行./configure时默认是配置安装目录为/usr/local/,如果需要指定安装目录,请使用 ./configure --prefix=/your/install/path/ ##### CMake (建议2.6.0及以上版本) 请从[这里](https://cmake.org/download)下载,典型的安装方式如下: ```shell ./configure make make install ``` 注意: - 执行./configure时默认是配置安装目录为/usr/local/,如果需要指定安装目录,请使用 ./configure --prefix=/your/install/path/ #### OSS C SDK的安装 安装时请在cmake命令中指定第三方库头文件以及库文件的路径,典型的编译命令如下: ```shell cmake . make make install ``` 注意: - 执行cmake . 时默认会到/usr/local/下面去寻找curl,apr,apr-util,mxml的头文件和库文件。 - 默认编译是Debug类型,可以指定以下几种编译类型: Debug, Release, RelWithDebInfo和MinSizeRel,如果要使用release类型编译,则执行cmake . -DCMAKE_BUILD_TYPE=Release - 如果您在安装curl,apr,apr-util,mxml时指定了安装目录,则需要在执行cmake时指定这些库的路径,比如: ```shell cmake . -DCURL_INCLUDE_DIR=/usr/local/include/curl/ -DCURL_LIBRARY=/usr/local/lib/libcurl.a -DAPR_INCLUDE_DIR=/usr/local/include/apr-1/ -DAPR_LIBRARY=/usr/local/lib/libapr-1.a -DAPR_UTIL_INCLUDE_DIR=/usr/local/apr/include/apr-1 -DAPR_UTIL_LIBRARY=/usr/local/apr/lib/libaprutil-1.a -DMINIXML_INCLUDE_DIR=/usr/local/include -DMINIXML_LIBRARY=/usr/local/lib/libmxml.a ``` - 如果要指定安装目录,则需要在cmake时增加: -DCMAKE_INSTALL_PREFIX=/your/install/path/usr/local/ ## License - MIT ## 联系我们 - [阿里云OSS官方网站](http://oss.aliyun.com) - [阿里云OSS官方论坛](http://bbs.aliyun.com) - [阿里云OSS官方文档中心](http://www.aliyun.com/product/oss#Docs) - 阿里云官方技术支持:[提交工单](https://workorder.console.aliyun.com/#/ticket/createIndex) ================================================ FILE: README.md ================================================ # Alibaba Cloud OSS SDK for C [![GitHub Version](https://badge.fury.io/gh/aliyun%2Faliyun-oss-c-sdk.svg)](https://badge.fury.io/gh/aliyun%2Faliyun-oss-c-sdk) [![Build Status](https://travis-ci.org/aliyun/aliyun-oss-c-sdk.svg?branch=master)](https://travis-ci.org/aliyun/aliyun-oss-c-sdk) [![Coverage Status](https://coveralls.io/repos/github/aliyun/aliyun-oss-c-sdk/badge.svg?branch=master)](https://coveralls.io/github/aliyun/aliyun-oss-c-sdk?branch=master) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE) ## [README of Chinese](https://github.com/aliyun/aliyun-oss-c-sdk/blob/master/README-CN.md) ## About Alibaba Cloud Object Storage Service (OSS) is a cloud storage service provided by Alibaba Cloud, featuring massive capacity, security, a low cost, and high reliability. You can upload and download data on any application anytime and anywhere by calling APIs, and perform simple management of data through the web console. The OSS can store any type of files and therefore applies to various websites, development enterprises and developers. The OSS C SDK provides a variety of interfaces for convenient use of the OSS. ## Version - Current version: 3.11.2 ## Install OSS C SDK ### Environment dependency The OSS C SDK adopts cURL for network operations on both clients and servers. OSS C SDK uses the APR and APR-Util libraries for memory management and cross-platform operations, and uses the Mini-XML library for parsing XML returned by a request. These external libraries are not included in the OSS C SDK. You need to install these libraries and add their header file directories and the library file directories to the project. #### Download and install third-party libraries ##### libcurl (Version 7.32.0 or above is recommended) Download from [here](http://curl.haxx.se/download.html) and install it by referring to [libcurl Installation Guide](http://curl.haxx.se/docs/install.html). A typical installation approach is as follows: ```shell ./configure make make install ``` Notes: - When you run the ./configure command, the default installation directory is /usr/local/. To specify another installation directory, use ./configure --prefix=/your/install/path/. ##### APR (Version 1.5.2 or above is recommended) Download from [here](https://apr.apache.org/download.cgi). A typical installation method is as follows: ```shell ./configure make make install ``` Notes: - When you run the ./configure command, the default installation directory is /usr/local/. To specify another installation directory, use ./configure --prefix=/your/install/path/. ##### APR-Util (Version 1.5.4 or above is recommended) Download from [here](https://apr.apache.org/download.cgi). The --with-apr option must be specified during installation. A typical installation method is as follows: ```shell ./configure --with-apr=/your/apr/install/path make make install ``` Notes: - When you run the ./configure command, the default installation directory is /usr/local/. To specify another installation directory, use ./configure --prefix=/your/install/path/. - You need to specify the APR installation directory through --with-apr. To install APR under a system directory, specify --with-apr=/usr/local/apr/. ##### Mini-XML (Version 2.8 or above is recommended) Download from [here](http://michaelrsweet.github.io/mxml/). A typical installation method is as follows: ```shell ./configure make make install ``` Notes: - When you run the ./configure command, the default installation directory is /usr/local/. To specify another installation directory, use ./configure --prefix=/your/install/path/. ##### CMake (Version 2.6.0 or above is recommended) Download from [here](https://cmake.org/download). A typical installation method is as follows: ```shell ./configure make make install ``` Notes: - When you run the ./configure command, the default installation directory is /usr/local/. To specify another installation directory, use ./configure --prefix=/your/install/path/. #### Install OSS C SDK Specify the third-party library header file and library file paths in the cmake command during installation. A typical compilation command is as follows: ```shell cmake . make make install ``` Notes: - When you run the cmake command, the header files and library files of cURL, APR, APR-Util and Mini-XML will be searched in the directory /usr/local/ by default. - The default compilation is of the Debug type and you can specify the following types of compilation: Debug, Release, RelWithDebInfo and MinSizeRel. To use the Release compilation type, run the command cmake . -DCMAKE_BUILD_TYPE=Release. - If You have specified installation directories for cURL, APR, APR-Util and Mini-XML, you need to specify the paths of these libraries when running CMake. For example, ```shell cmake . -DCURL_INCLUDE_DIR=/usr/local/include/curl/ -DCURL_LIBRARY=/usr/local/lib/libcurl.a -DAPR_INCLUDE_DIR=/usr/local/include/apr-1/ -DAPR_LIBRARY=/usr/local/lib/libapr-1.a -DAPR_UTIL_INCLUDE_DIR=/usr/local/apr/include/apr-1 -DAPR_UTIL_LIBRARY=/usr/local/apr/lib/libaprutil-1.a -DMINIXML_INCLUDE_DIR=/usr/local/include -DMINIXML_LIBRARY=/usr/local/lib/libmxml.a ``` - To specify an installation directory, add the following when running CMake: -DCMAKE_INSTALL_PREFIX=/your/install/path/usr/local/。 ## License - MIT ## Contact us - [Alibaba Cloud OSS official website](http://oss.aliyun.com). - [Alibaba Cloud OSS official forum](http://bbs.aliyun.com). - [Alibaba Cloud OSS official documentation center](http://www.aliyun.com/product/oss#Docs). - Alibaba Cloud official technical support: [Submit a ticket](https://workorder.console.aliyun.com/#/ticket/createIndex). ================================================ FILE: oss_c_sdk/aos_buf.c ================================================ #include "aos_buf.h" #include "aos_log.h" #include aos_buf_t *aos_create_buf(aos_pool_t *p, int size) { aos_buf_t* b; b = aos_palloc(p, sizeof(aos_buf_t) + size); if (b == NULL) { return NULL; } b->pos = (uint8_t *)b + sizeof(aos_buf_t); b->start = b->pos; b->last = b->start; b->end = b->last + size; aos_list_init(&b->node); return b; } aos_buf_t *aos_buf_pack(aos_pool_t *p, const void *data, int size) { aos_buf_t* b; b = aos_palloc(p, sizeof(aos_buf_t)); if (b == NULL) { return NULL; } b->pos = (uint8_t *)data; b->start = b->pos; b->last = b->start + size; b->end = b->last; aos_list_init(&b->node); return b; } int64_t aos_buf_list_len(aos_list_t *list) { aos_buf_t *b; int64_t len = 0; aos_list_for_each_entry(aos_buf_t, b, list, node) { len += aos_buf_size(b); } return len; } char *aos_buf_list_content(aos_pool_t *p, aos_list_t *list) { int64_t body_len; char *buf; int64_t pos = 0; int64_t size = 0; aos_buf_t *content; body_len = aos_buf_list_len(list); buf = aos_pcalloc(p, (size_t)(body_len + 1)); buf[body_len] = '\0'; aos_list_for_each_entry(aos_buf_t, content, list, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)(size)); pos += size; } return buf; } aos_file_buf_t *aos_create_file_buf(aos_pool_t *p) { return (aos_file_buf_t*)aos_pcalloc(p, sizeof(aos_file_buf_t)); } int aos_open_file_for_read(aos_pool_t *p, const char *path, aos_file_buf_t *fb) { int s; char buf[256]; apr_finfo_t finfo; if ((s = apr_file_open(&fb->file, path, APR_READ, APR_UREAD | APR_GREAD, p)) != APR_SUCCESS) { aos_error_log("apr_file_open failure, path:%s, code:%d %s.", (path ? path : ""), s, apr_strerror(s, buf, sizeof(buf))); //assert(fb->file == NULL); return AOSE_OPEN_FILE_ERROR; } if ((s = apr_file_info_get(&finfo, APR_FINFO_SIZE, fb->file)) != APR_SUCCESS) { apr_file_close(fb->file); aos_error_log("apr_file_info_get failure, path:%s, code:%d %s.", (path ? path : ""), s, apr_strerror(s, buf, sizeof(buf))); return AOSE_FILE_INFO_ERROR; } fb->file_pos = 0; fb->file_last = finfo.size; fb->owner = 1; return AOSE_OK; } int aos_open_file_for_all_read(aos_pool_t *p, const char *path, aos_file_buf_t *fb) { return aos_open_file_for_read(p, path, fb); } int aos_open_file_for_range_read(aos_pool_t *p, const char *path, int64_t file_pos, int64_t file_last, aos_file_buf_t *fb) { int s; s = aos_open_file_for_read(p, path, fb); if (s == AOSE_OK) { if (file_pos > fb->file_pos) { if (file_pos > fb->file_last) { aos_warn_log("read range beyond file size, read start:%" APR_INT64_T_FMT ", file size:%" APR_INT64_T_FMT "\n", file_pos, fb->file_last); file_pos = fb->file_last; } fb->file_pos = file_pos; } if (file_last < fb->file_last) { fb->file_last = file_last; } apr_file_seek(fb->file, APR_SET, (apr_off_t *)&fb->file_pos); } return s; } int aos_open_file_for_write(aos_pool_t *p, const char *path, aos_file_buf_t *fb) { int s; char buf[256]; if ((s = apr_file_open(&fb->file, path, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE | APR_GREAD, p)) != APR_SUCCESS) { aos_error_log("apr_file_open failure, path:%s, code:%d %s.", (path ? path : ""), s, apr_strerror(s, buf, sizeof(buf))); //assert(fb->file == NULL); return AOSE_OPEN_FILE_ERROR; } fb->owner = 1; return AOSE_OK; } int aos_open_file_for_write_notrunc(aos_pool_t *p, const char *path, aos_file_buf_t *fb) { int s; char buf[256]; if ((s = apr_file_open(&fb->file, path, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p)) != APR_SUCCESS) { aos_error_log("apr_file_open failure, path:%s, code:%d %s.", (path ? path : ""), s, apr_strerror(s, buf, sizeof(buf))); //assert(fb->file == NULL); return AOSE_OPEN_FILE_ERROR; } fb->owner = 1; return AOSE_OK; } void aos_buf_append_string(aos_pool_t *p, aos_buf_t *b, const char *str, int len) { int size; int nsize; int remain; char *buf; if (len <= 0) return; remain = b->end - b->last; if (remain > len + 128) { memcpy(b->last, str, len); b->last += len; } else { size = aos_buf_size(b); nsize = (size + len) * 2; buf = aos_palloc(p, nsize); memcpy(buf, b->pos, size); memcpy(buf+size, str, len); b->start = (uint8_t *)buf; b->end = (uint8_t *)buf + nsize; b->pos = (uint8_t *)buf; b->last = (uint8_t *)buf + size + len; } } ================================================ FILE: oss_c_sdk/aos_buf.h ================================================ #ifndef LIBAOS_BUF_H #define LIBAOS_BUF_H #include "aos_define.h" #include "aos_list.h" AOS_CPP_START typedef struct { aos_list_t node; uint8_t *pos; uint8_t *last; uint8_t *start; uint8_t *end; } aos_buf_t; typedef struct { aos_list_t node; int64_t file_pos; int64_t file_last; apr_file_t *file; uint32_t owner:1; } aos_file_buf_t; aos_buf_t *aos_create_buf(aos_pool_t *p, int size); #define aos_buf_size(b) (b->last - b->pos) aos_file_buf_t *aos_create_file_buf(aos_pool_t *p); aos_buf_t *aos_buf_pack(aos_pool_t *p, const void *data, int size); int64_t aos_buf_list_len(aos_list_t *list); char *aos_buf_list_content(aos_pool_t *p, aos_list_t *list); void aos_buf_append_string(aos_pool_t *p, aos_buf_t *b, const char *str, int len); /** * @param fb file_pos, file_last equal file_size. * @return AOSE_OK success, other failure. */ int aos_open_file_for_read(aos_pool_t *p, const char *path, aos_file_buf_t *fb); int aos_open_file_for_all_read(aos_pool_t *p, const char *path, aos_file_buf_t *fb); int aos_open_file_for_range_read(aos_pool_t *p, const char *path, int64_t file_pos, int64_t file_last, aos_file_buf_t *fb); /** * create the file if not there, truncate if file exists. * @param fb not check file_pos, file_last. * @return AOSE_OK success, other failure. */ int aos_open_file_for_write(aos_pool_t *p, const char *path, aos_file_buf_t *fb); /** * create the file if not there. * @param fb not check file_pos, file_last. * @return AOSE_OK success, other failure. */ int aos_open_file_for_write_notrunc(aos_pool_t *p, const char *path, aos_file_buf_t *fb); AOS_CPP_END #endif ================================================ FILE: oss_c_sdk/aos_crc64.c ================================================ /* aos_crc64.c -- compute CRC-64 * Copyright (C) 2013 Mark Adler * Version 1.4 16 Dec 2013 Mark Adler */ /* This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Mark Adler madler@alumni.caltech.edu */ /* Compute CRC-64 in the manner of xz, using the ECMA-182 polynomial, bit-reversed, with one's complement pre and post processing. Provide a means to combine separately computed CRC-64's. */ /* Version history: 1.0 13 Dec 2013 First version 1.1 13 Dec 2013 Fix comments in test code 1.2 14 Dec 2013 Determine endianess at run time 1.3 15 Dec 2013 Add eight-byte processing for big endian as well Make use of the pthread library optional 1.4 16 Dec 2013 Make once variable volatile for limited thread protection */ #include "aos_crc64.h" /* 64-bit CRC polynomial with these coefficients, but reversed: 64, 62, 57, 55, 54, 53, 52, 47, 46, 45, 40, 39, 38, 37, 35, 33, 32, 31, 29, 27, 24, 23, 22, 21, 19, 17, 13, 12, 10, 9, 7, 4, 1, 0 */ #define POLY UINT64_C(0xc96c5795d7870f42) /* Tables for CRC calculation -- filled in by initialization functions that are called once. These could be replaced by constant tables generated in the same way. There are two tables, one for each endianess. Since these are static, i.e. local, one should be compiled out of existence if the compiler can evaluate the endianess check in crc64() at compile time. */ static uint64_t crc64_little_table[8][256]; static uint64_t crc64_big_table[8][256]; /* Fill in the CRC-64 constants table. */ static void crc64_init(uint64_t table[][256]) { unsigned n, k; uint64_t crc; /* generate CRC-64's for all single byte sequences */ for (n = 0; n < 256; n++) { crc = n; for (k = 0; k < 8; k++) crc = crc & 1 ? POLY ^ (crc >> 1) : crc >> 1; table[0][n] = crc; } /* generate CRC-64's for those followed by 1 to 7 zeros */ for (n = 0; n < 256; n++) { crc = table[0][n]; for (k = 1; k < 8; k++) { crc = table[0][crc & 0xff] ^ (crc >> 8); table[k][n] = crc; } } } /* This function is called once to initialize the CRC-64 table for use on a little-endian architecture. */ static void crc64_little_init(void) { crc64_init(crc64_little_table); } /* Reverse the bytes in a 64-bit word. */ static APR_INLINE uint64_t rev8(uint64_t a) { uint64_t m; m = UINT64_C(0xff00ff00ff00ff); a = ((a >> 8) & m) | (a & m) << 8; m = UINT64_C(0xffff0000ffff); a = ((a >> 16) & m) | (a & m) << 16; return a >> 32 | a << 32; } /* This function is called once to initialize the CRC-64 table for use on a big-endian architecture. */ static void crc64_big_init(void) { unsigned k, n; crc64_init(crc64_big_table); for (k = 0; k < 8; k++) for (n = 0; n < 256; n++) crc64_big_table[k][n] = rev8(crc64_big_table[k][n]); } /* Run the init() function exactly once. If pthread.h is not included, then this macro will use a simple static state variable for the purpose, which is not thread-safe. The init function must be of the type void init(void). */ #ifdef PTHREAD_ONCE_INIT # define ONCE(init) \ do { \ static pthread_once_t once = PTHREAD_ONCE_INIT; \ pthread_once(&once, init); \ } while (0) #else # define ONCE(init) \ do { \ static volatile int once = 1; \ if (once) { \ if (once++ == 1) { \ init(); \ once = 0; \ } \ else \ while (once) \ ; \ } \ } while (0) #endif /* Calculate a CRC-64 eight bytes at a time on a little-endian architecture. */ static APR_INLINE uint64_t crc64_little(uint64_t crc, void *buf, size_t len) { unsigned char *next = buf; ONCE(crc64_little_init); crc = ~crc; while (len && ((uintptr_t)next & 7) != 0) { crc = crc64_little_table[0][(crc ^ *next++) & 0xff] ^ (crc >> 8); len--; } while (len >= 8) { crc ^= *(uint64_t *)next; crc = crc64_little_table[7][crc & 0xff] ^ crc64_little_table[6][(crc >> 8) & 0xff] ^ crc64_little_table[5][(crc >> 16) & 0xff] ^ crc64_little_table[4][(crc >> 24) & 0xff] ^ crc64_little_table[3][(crc >> 32) & 0xff] ^ crc64_little_table[2][(crc >> 40) & 0xff] ^ crc64_little_table[1][(crc >> 48) & 0xff] ^ crc64_little_table[0][crc >> 56]; next += 8; len -= 8; } while (len) { crc = crc64_little_table[0][(crc ^ *next++) & 0xff] ^ (crc >> 8); len--; } return ~crc; } /* Calculate a CRC-64 eight bytes at a time on a big-endian architecture. */ static APR_INLINE uint64_t crc64_big(uint64_t crc, void *buf, size_t len) { unsigned char *next = buf; ONCE(crc64_big_init); crc = ~rev8(crc); while (len && ((uintptr_t)next & 7) != 0) { crc = crc64_big_table[0][(crc >> 56) ^ *next++] ^ (crc << 8); len--; } while (len >= 8) { crc ^= *(uint64_t *)next; crc = crc64_big_table[0][crc & 0xff] ^ crc64_big_table[1][(crc >> 8) & 0xff] ^ crc64_big_table[2][(crc >> 16) & 0xff] ^ crc64_big_table[3][(crc >> 24) & 0xff] ^ crc64_big_table[4][(crc >> 32) & 0xff] ^ crc64_big_table[5][(crc >> 40) & 0xff] ^ crc64_big_table[6][(crc >> 48) & 0xff] ^ crc64_big_table[7][crc >> 56]; next += 8; len -= 8; } while (len) { crc = crc64_big_table[0][(crc >> 56) ^ *next++] ^ (crc << 8); len--; } return ~rev8(crc); } /* Return the CRC-64 of buf[0..len-1] with initial crc, processing eight bytes at a time. This selects one of two routines depending on the endianess of the architecture. A good optimizing compiler will determine the endianess at compile time if it can, and get rid of the unused code and table. If the endianess can be changed at run time, then this code will handle that as well, initializing and using two tables, if called upon to do so. */ uint64_t aos_crc64(uint64_t crc, void *buf, size_t len) { uint64_t n = 1; return *(char *)&n ? crc64_little(crc, buf, len) : crc64_big(crc, buf, len); } uint64_t aos_crc64_test(uint64_t crc, void *buf, size_t len, int little) { return little ? crc64_little(crc, buf, len): crc64_big(crc, buf, len); } #define GF2_DIM 64 /* dimension of GF(2) vectors (length of CRC) */ static uint64_t gf2_matrix_times(uint64_t *mat, uint64_t vec) { uint64_t sum; sum = 0; while (vec) { if (vec & 1) sum ^= *mat; vec >>= 1; mat++; } return sum; } static void gf2_matrix_square(uint64_t *square, uint64_t *mat) { unsigned n; for (n = 0; n < GF2_DIM; n++) square[n] = gf2_matrix_times(mat, mat[n]); } /* Return the CRC-64 of two sequential blocks, where crc1 is the CRC-64 of the first block, crc2 is the CRC-64 of the second block, and len2 is the length of the second block. */ uint64_t aos_crc64_combine(uint64_t crc1, uint64_t crc2, uintmax_t len2) { unsigned n; uint64_t row; uint64_t even[GF2_DIM]; /* even-power-of-two zeros operator */ uint64_t odd[GF2_DIM]; /* odd-power-of-two zeros operator */ /* degenerate case */ if (len2 == 0) return crc1; /* put operator for one zero bit in odd */ odd[0] = POLY; /* CRC-64 polynomial */ row = 1; for (n = 1; n < GF2_DIM; n++) { odd[n] = row; row <<= 1; } /* put operator for two zero bits in even */ gf2_matrix_square(even, odd); /* put operator for four zero bits in odd */ gf2_matrix_square(odd, even); /* apply len2 zeros to crc1 (first square will put the operator for one zero byte, eight zero bits, in even) */ do { /* apply zeros operator for this bit of len2 */ gf2_matrix_square(even, odd); if (len2 & 1) crc1 = gf2_matrix_times(even, crc1); len2 >>= 1; /* if no more bits set, then done */ if (len2 == 0) break; /* another iteration of the loop with odd and even swapped */ gf2_matrix_square(odd, even); if (len2 & 1) crc1 = gf2_matrix_times(odd, crc1); len2 >>= 1; /* if no more bits set, then done */ } while (len2 != 0); /* return combined crc */ crc1 ^= crc2; return crc1; } /*CRC32*/ static const uint32_t crc32Table[256] = { 0x00000000,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535, 0x9E6495A3,0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD, 0xE7B82D07,0x90BF1D91,0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D, 0x6DDDE4EB,0xF4D4B551,0x83D385C7,0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC, 0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5,0x3B6E20C8,0x4C69105E,0xD56041E4, 0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B,0x35B5A8FA,0x42B2986C, 0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59,0x26D930AC, 0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F, 0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924,0x2F6F7C87,0x58684C11,0xC1611DAB, 0xB6662D3D,0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F, 0x9FBFE4A5,0xE8B8D433,0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB, 0x086D3D2D,0x91646C97,0xE6635C01,0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E, 0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457,0x65B0D9C6,0x12B7E950,0x8BBEB8EA, 0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65,0x4DB26158,0x3AB551CE, 0xA3BC0074,0xD4BB30E2,0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB,0x4369E96A, 0x346ED9FC,0xAD678846,0xDA60B8D0,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9, 0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409, 0xCE61E49F,0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0x2EB40D81, 0xB7BD5C3B,0xC0BA6CAD,0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A,0xEAD54739, 0x9DD277AF,0x04DB2615,0x73DC1683,0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8, 0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1,0xF00F9344,0x8708A3D2,0x1E01F268, 0x6906C2FE,0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7,0xFED41B76,0x89D32BE0, 0x10DA7A5A,0x67DD4ACC,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5,0xD6D6A3E8, 0xA1D1937E,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B, 0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0xA867DF55,0x316E8EEF, 0x4669BE79,0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236,0xCC0C7795,0xBB0B4703, 0x220216B9,0x5505262F,0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04,0xC2D7FFA7, 0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D,0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A, 0x9C0906A9,0xEB0E363F,0x72076785,0x05005713,0x95BF4A82,0xE2B87A14,0x7BB12BAE, 0x0CB61B38,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21,0x86D3D2D4,0xF1D4E242, 0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777,0x88085AE6, 0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45, 0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2,0xA7672661,0xD06016F7,0x4969474D, 0x3E6E77DB,0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5, 0x47B2CF7F,0x30B5FFE9,0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605, 0xCDD70693,0x54DE5729,0x23D967BF,0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94, 0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D }; uint32_t aos_crc32(uint32_t crc, const void *buf, size_t bufLen) { uint32_t crc32; unsigned char *byteBuf; size_t i; /** accumulate crc32 for buffer **/ crc32 = crc ^ 0xFFFFFFFF; byteBuf = (unsigned char*)buf; for (i = 0; i < bufLen; i++) { crc32 = (crc32 >> 8) ^ crc32Table[(crc32 ^ byteBuf[i]) & 0xFF]; } return crc32 ^ 0xFFFFFFFF; } ================================================ FILE: oss_c_sdk/aos_crc64.h ================================================ #ifndef LIBAOS_CRC_H #define LIBAOS_CRC_H #include "aos_define.h" AOS_CPP_START uint64_t aos_crc64(uint64_t crc, void *buf, size_t len); uint64_t aos_crc64_combine(uint64_t crc1, uint64_t crc2, uintmax_t len2); uint32_t aos_crc32(uint32_t crc, const void *buf, size_t bufLen); uint64_t aos_crc64_test(uint64_t crc, void *buf, size_t len, int little); AOS_CPP_END #endif ================================================ FILE: oss_c_sdk/aos_define.h ================================================ #ifndef LIBAOS_DEFINE_H #define LIBAOS_DEFINE_H #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __cplusplus # define AOS_CPP_START extern "C" { # define AOS_CPP_END } #else # define AOS_CPP_START # define AOS_CPP_END #endif typedef enum { HTTP_GET, HTTP_HEAD, HTTP_PUT, HTTP_POST, HTTP_DELETE } http_method_e; typedef enum { AOSE_OK = 0, AOSE_OUT_MEMORY = -1000, AOSE_OVER_MEMORY = -999, AOSE_FAILED_CONNECT = -998, AOSE_ABORT_CALLBACK = -997, AOSE_INTERNAL_ERROR = -996, AOSE_REQUEST_TIMEOUT = -995, AOSE_INVALID_ARGUMENT = -994, AOSE_INVALID_OPERATION = -993, AOSE_CONNECTION_FAILED = -992, AOSE_FAILED_INITIALIZE = -991, AOSE_NAME_LOOKUP_ERROR = -990, AOSE_FAILED_VERIFICATION = -989, AOSE_WRITE_BODY_ERROR = -988, AOSE_READ_BODY_ERROR = -987, AOSE_SERVICE_ERROR = -986, AOSE_OPEN_FILE_ERROR = -985, AOSE_FILE_SEEK_ERROR = -984, AOSE_FILE_INFO_ERROR = -983, AOSE_FILE_READ_ERROR = -982, AOSE_FILE_WRITE_ERROR = -981, AOSE_XML_PARSE_ERROR = -980, AOSE_UTF8_ENCODE_ERROR = -979, AOSE_CRC_INCONSISTENT_ERROR = -978, AOSE_FILE_FLUSH_ERROR = -977, AOSE_FILE_TRUNC_ERROR = -976, AOSE_SELECT_OBJECT_CRC_ERROR = -975, AOSE_UNKNOWN_ERROR = -100 } aos_error_code_e; typedef apr_pool_t aos_pool_t; typedef apr_table_t aos_table_t; typedef apr_table_entry_t aos_table_entry_t; typedef apr_array_header_t aos_array_header_t; #define aos_table_elts(t) apr_table_elts(t) #define aos_is_empty_table(t) apr_is_empty_table(t) #define aos_table_make(p, n) apr_table_make(p, n) #define aos_table_add_int(t, key, value) do { \ char value_str[64]; \ apr_snprintf(value_str, sizeof(value_str), "%d", value);\ apr_table_add(t, key, value_str); \ } while(0) #define aos_table_add_int64(t, key, value) do { \ char value_str[64]; \ apr_snprintf(value_str, sizeof(value_str), "%" APR_INT64_T_FMT, value);\ apr_table_add(t, key, value_str); \ } while(0) #define aos_table_set_int64(t, key, value) do { \ char value_str[64]; \ apr_snprintf(value_str, sizeof(value_str), "%" APR_INT64_T_FMT, value);\ apr_table_set(t, key, value_str); \ } while(0) #define aos_pool_create(n, p) apr_pool_create(n, p) #define aos_pool_destroy(p) apr_pool_destroy(p) #define aos_palloc(p, s) apr_palloc(p, s) #define aos_pcalloc(p, s) apr_pcalloc(p, s) #define AOS_INIT_WINSOCK 1 #define AOS_MD5_STRING_LEN 32 #define AOS_MAX_URI_LEN 2048 #define AOS_MAX_HEADER_LEN 8192 #define AOS_MAX_QUERY_ARG_LEN 1024 #define AOS_MAX_GMT_TIME_LEN 128 #define AOS_MAX_SHORT_TIME_LEN 10 #define AOS_MAX_XML_NODE_VALUE_LEN 1024 #define AOS_MAX_INT64_STRING_LEN 64 #define AOS_MAX_UINT64_STRING_LEN 64 #define AOS_CONNECT_TIMEOUT 10 #define AOS_DNS_CACHE_TIMOUT 60 #define AOS_MIN_SPEED_LIMIT 1024 #define AOS_MIN_SPEED_TIME 15 #define AOS_MAX_MEMORY_SIZE 1024*1024*1024L #define AOS_MAX_PART_SIZE 512*1024*1024L #define AOS_DEFAULT_PART_SIZE 1024*1024L #define AOS_REQUEST_STACK_SIZE 32 #define aos_abs(value) (((value) >= 0) ? (value) : - (value)) #define aos_max(val1, val2) (((val1) < (val2)) ? (val2) : (val1)) #define aos_min(val1, val2) (((val1) > (val2)) ? (val2) : (val1)) #define LF (char) 10 #define CR (char) 13 #define CRLF "\x0d\x0a" #define AOS_VERSION "3.11.2" #define AOS_VER "aliyun-sdk-c/" AOS_VERSION #define AOS_HTTP_PREFIX "http://" #define AOS_HTTPS_PREFIX "https://" #define AOS_RTMP_PREFIX "rtmp://" #define AOS_TEMP_FILE_SUFFIX ".tmp" #define AOS_FALSE 0 #define AOS_TRUE 1 # ifndef WIN32 # ifndef __LONG_LONG_MAX__ # define __LONG_LONG_MAX__ 9223372036854775807LL # endif # ifndef LLONG_MIN # define LLONG_MIN (-LLONG_MAX-1) # endif # ifndef LLONG_MAX # define LLONG_MAX __LONG_LONG_MAX__ # endif # ifndef ULLONG_MAX # define ULLONG_MAX (LLONG_MAX * 2ULL + 1) # endif # endif #endif ================================================ FILE: oss_c_sdk/aos_fstack.c ================================================ #include "aos_fstack.h" aos_array_header_t *aos_fstack_create(aos_pool_t *p, int size) { return apr_array_make(p, size, sizeof(aos_fstack_item_t)); } void aos_fstack_push(aos_array_header_t *fstack, void *data, aos_func_u func, int order) { aos_fstack_item_t *item; item = (aos_fstack_item_t*)apr_array_push(fstack); item->data = data; item->func = func; item->order = order; } aos_fstack_item_t *aos_fstack_pop(aos_array_header_t *fstack) { aos_fstack_item_t *item; item = (aos_fstack_item_t*)apr_array_pop(fstack); if (item == NULL) { return NULL; } switch (item->order) { case 1: item->func.func1(item->data); break; case 2: item->func.func2(); break; case 3: item->func.func3(item->data); break; case 4: item->func.func4(); break; default: break; } return item; } void aos_fstack_destory(aos_array_header_t *fstack) { while (aos_fstack_pop(fstack) != NULL); } ================================================ FILE: oss_c_sdk/aos_fstack.h ================================================ #ifndef LIBAOS_FSTACK_H #define LIBAOS_FSTACK_H #include "aos_define.h" AOS_CPP_START typedef void (*aos_func1_pt)(void*); typedef void (*aos_func2_pt)(); typedef int (*aos_func3_pt)(void*); typedef int (*aos_func4_pt)(); typedef union aos_func_u { aos_func1_pt func1; aos_func2_pt func2; aos_func3_pt func3; aos_func4_pt func4; } aos_func_u; typedef struct aos_fstack_item_t { void *data; aos_func_u func; int order; } aos_fstack_item_t; aos_array_header_t *aos_fstack_create(aos_pool_t *p, int size); aos_fstack_item_t *aos_fstack_pop(aos_array_header_t *fstack); void aos_fstack_destory(aos_array_header_t *fstack); void aos_fstack_push(aos_array_header_t *fstack, void *data, aos_func_u func, int order); AOS_CPP_END #endif ================================================ FILE: oss_c_sdk/aos_http_io.c ================================================ #include "aos_log.h" #include "aos_http_io.h" #include "aos_define.h" #include #include aos_pool_t *aos_global_pool = NULL; apr_file_t *aos_stderr_file = NULL; aos_http_request_options_t *aos_default_http_request_options = NULL; aos_http_transport_options_t *aos_default_http_transport_options = NULL; aos_http_transport_create_pt aos_http_transport_create = aos_curl_http_transport_create; aos_http_transport_perform_pt aos_http_transport_perform = aos_curl_http_transport_perform; static apr_thread_mutex_t* requestStackMutexG = NULL; static CURL *requestStackG[AOS_REQUEST_STACK_SIZE]; static int requestStackCountG; static char aos_user_agent[256]; static aos_http_transport_options_t *aos_http_transport_options_create(aos_pool_t *p); CURL *aos_request_get() { CURL *request = NULL; apr_thread_mutex_lock(requestStackMutexG); if (requestStackCountG > 0) { request = requestStackG[--requestStackCountG]; } apr_thread_mutex_unlock(requestStackMutexG); // If we got one, deinitialize it for re-use if (request) { curl_easy_reset(request); } else { request = curl_easy_init(); } return request; } void request_release(CURL *request) { apr_thread_mutex_lock(requestStackMutexG); // If the request stack is full, destroy this one // else put this one at the front of the request stack; we do this because // we want the most-recently-used curl handle to be re-used on the next // request, to maximize our chances of re-using a TCP connection before it // times out if (requestStackCountG == AOS_REQUEST_STACK_SIZE) { apr_thread_mutex_unlock(requestStackMutexG); curl_easy_cleanup(request); } else { requestStackG[requestStackCountG++] = request; apr_thread_mutex_unlock(requestStackMutexG); } } void request_release2(aos_curl_http_transport_t* t) { CURL* request = t->curl; CURLcode code = t->curl_code; apr_thread_mutex_lock(requestStackMutexG); // If the request stack is full, destroy this one // else put this one at the front of the request stack; we do this because // we want the most-recently-used curl handle to be re-used on the next // request, to maximize our chances of re-using a TCP connection before it // times out if (requestStackCountG == AOS_REQUEST_STACK_SIZE || code != CURLE_OK) { apr_thread_mutex_unlock(requestStackMutexG); curl_easy_cleanup(request); } else { requestStackG[requestStackCountG++] = request; apr_thread_mutex_unlock(requestStackMutexG); } } void aos_set_default_request_options(aos_http_request_options_t *op) { aos_default_http_request_options = op; } void aos_set_default_transport_options(aos_http_transport_options_t *op) { aos_default_http_transport_options = op; } aos_http_request_options_t *aos_http_request_options_create(aos_pool_t *p) { aos_http_request_options_t *options; options = (aos_http_request_options_t *)aos_pcalloc(p, sizeof(aos_http_request_options_t)); options->speed_limit = AOS_MIN_SPEED_LIMIT; options->speed_time = AOS_MIN_SPEED_TIME; options->connect_timeout = AOS_CONNECT_TIMEOUT; options->dns_cache_timeout = AOS_DNS_CACHE_TIMOUT; options->max_memory_size = AOS_MAX_MEMORY_SIZE; options->enable_crc = AOS_TRUE; options->proxy_auth = NULL; options->proxy_host = NULL; options->verify_ssl = AOS_TRUE; options->ca_file = NULL; options->ca_path = NULL; options->verify_object_strict = AOS_TRUE; return options; } aos_http_transport_options_t *aos_http_transport_options_create(aos_pool_t *p) { return (aos_http_transport_options_t *)aos_pcalloc(p, sizeof(aos_http_transport_options_t)); } aos_http_controller_t *aos_http_controller_create(aos_pool_t *p, int owner) { int s; aos_http_controller_t *ctl; if(p == NULL) { if ((s = aos_pool_create(&p, NULL)) != APR_SUCCESS) { aos_fatal_log("aos_pool_create failure."); return NULL; } } ctl = (aos_http_controller_t *)aos_pcalloc(p, sizeof(aos_http_controller_ex_t)); ctl->pool = p; ctl->owner = owner; ctl->options = aos_default_http_request_options; return ctl; } aos_http_request_t *aos_http_request_create(aos_pool_t *p) { aos_http_request_t *req; req = (aos_http_request_t *)aos_pcalloc(p, sizeof(aos_http_request_t)); req->method = HTTP_GET; req->headers = aos_table_make(p, 5); req->query_params = aos_table_make(p, 3); aos_list_init(&req->body); req->type = BODY_IN_MEMORY; req->body_len = 0; req->pool = p; req->read_body = aos_read_http_body_memory; req->normalize_url = 0; return req; } aos_http_response_t *aos_http_response_create(aos_pool_t *p) { aos_http_response_t *resp; resp = (aos_http_response_t *)aos_pcalloc(p, sizeof(aos_http_response_t)); resp->status = -1; resp->headers = aos_table_make(p, 10); aos_list_init(&resp->body); resp->type = BODY_IN_MEMORY; resp->body_len = 0; resp->pool = p; resp->write_body = aos_write_http_body_memory; return resp; } int aos_read_http_body_memory(aos_http_request_t *req, char *buffer, int len) { int wsize; int bytes = 0; aos_buf_t *b; aos_buf_t *n; aos_list_for_each_entry_safe(aos_buf_t, b, n, &req->body, node) { wsize = aos_buf_size(b); if (wsize == 0) { aos_list_del(&b->node); continue; } wsize = aos_min(len - bytes, wsize); if (wsize == 0) { break; } memcpy(buffer + bytes, b->pos, wsize); b->pos += wsize; bytes += wsize; if (b->pos == b->last) { aos_list_del(&b->node); } } return bytes; } int aos_read_http_body_file(aos_http_request_t *req, char *buffer, int len) { int s; char buf[256]; apr_size_t nbytes = len; apr_size_t bytes_left; if (req->file_buf == NULL || req->file_buf->file == NULL) { aos_error_log("request body arg invalid file_buf NULL."); return AOSE_INVALID_ARGUMENT; } if (req->file_buf->file_pos >= req->file_buf->file_last) { aos_debug_log("file read finish."); return 0; } bytes_left = (apr_size_t)(req->file_buf->file_last - req->file_buf->file_pos); if (nbytes > bytes_left) { nbytes = bytes_left; } s = apr_file_read(req->file_buf->file, buffer, &nbytes); if (s != APR_SUCCESS && s != APR_EOF) { aos_error_log("apr_file_read filure, file:%s, code:%d %s.", req->file_path, s, apr_strerror(s, buf, sizeof(buf))); return AOSE_FILE_READ_ERROR; } req->file_buf->file_pos += nbytes; return nbytes; } int aos_write_http_body_memory(aos_http_response_t *resp, const char *buffer, int len) { aos_buf_t *b; b = aos_create_buf(resp->pool, len); memcpy(b->pos, buffer, len); b->last += len; aos_list_add_tail(&b->node, &resp->body); resp->body_len += len; return len; } int aos_write_http_body_file(aos_http_response_t *resp, const char *buffer, int len) { int elen; int s; char buf[256]; apr_size_t nbytes = len; if (resp->file_buf == NULL) { resp->file_buf = aos_create_file_buf(resp->pool); } if (resp->file_buf->file == NULL) { if (resp->file_path == NULL) { aos_error_log("resp body file arg NULL."); return AOSE_INVALID_ARGUMENT; } aos_trace_log("open file %s.", resp->file_path); if ((elen = aos_open_file_for_write(resp->pool, resp->file_path, resp->file_buf)) != AOSE_OK) { return elen; } } assert(resp->file_buf->file != NULL); if ((s = apr_file_write(resp->file_buf->file, buffer, &nbytes)) != APR_SUCCESS) { aos_error_log("apr_file_write fialure, file:%s, code:%d %s.", resp->file_path, s, apr_strerror(s, buf, sizeof(buf))); return AOSE_FILE_WRITE_ERROR; } resp->file_buf->file_last += nbytes; resp->body_len += nbytes; return nbytes; } int aos_http_io_initialize(const char *user_agent_info, int flags) { CURLcode ecode; int s; char buf[256]; aos_http_request_options_t *req_options; aos_http_transport_options_t *trans_options; if ((ecode = curl_global_init(CURL_GLOBAL_ALL & ~((flags & AOS_INIT_WINSOCK) ? 0: CURL_GLOBAL_WIN32))) != CURLE_OK) { aos_error_log("curl_global_init failure, code:%d %s.\n", ecode, curl_easy_strerror(ecode)); return AOSE_INTERNAL_ERROR; } if ((s = apr_initialize()) != APR_SUCCESS) { aos_error_log("apr_initialize failue.\n"); return AOSE_INTERNAL_ERROR; } if (!user_agent_info || !*user_agent_info) { user_agent_info = "Unknown"; } if ((s = aos_pool_create(&aos_global_pool, NULL)) != APR_SUCCESS) { aos_error_log("aos_pool_create failure, code:%d %s.\n", s, apr_strerror(s, buf, sizeof(buf))); return AOSE_INTERNAL_ERROR; } if ((s = apr_thread_mutex_create(&requestStackMutexG, APR_THREAD_MUTEX_DEFAULT, aos_global_pool)) != APR_SUCCESS) { aos_error_log("apr_thread_mutex_create failure, code:%d %s.\n", s, apr_strerror(s, buf, sizeof(buf))); return AOSE_INTERNAL_ERROR; } requestStackCountG = 0; apr_snprintf(aos_user_agent, sizeof(aos_user_agent)-1, "%s(Compatible %s)", AOS_VER, user_agent_info); req_options = aos_http_request_options_create(aos_global_pool); trans_options = aos_http_transport_options_create(aos_global_pool); trans_options->user_agent = aos_user_agent; aos_set_default_request_options(req_options); aos_set_default_transport_options(trans_options); return AOSE_OK; } void aos_http_io_deinitialize() { apr_thread_mutex_destroy(requestStackMutexG); while (requestStackCountG--) { curl_easy_cleanup(requestStackG[requestStackCountG]); } if (aos_stderr_file != NULL) { apr_file_close(aos_stderr_file); aos_stderr_file = NULL; } if (aos_global_pool != NULL) { aos_pool_destroy(aos_global_pool); aos_global_pool = NULL; } apr_terminate(); } int aos_http_send_request(aos_http_controller_t *ctl, aos_http_request_t *req, aos_http_response_t *resp) { aos_http_transport_t *t; t = aos_http_transport_create(ctl->pool); t->req = req; t->resp = resp; t->controller = (aos_http_controller_ex_t *)ctl; return aos_http_transport_perform(t); } ================================================ FILE: oss_c_sdk/aos_http_io.h ================================================ #ifndef LIBAOS_HTTP_IO_H #define LIBAOS_HTTP_IO_H #include "aos_transport.h" #include "oss_define.h" AOS_CPP_START aos_http_controller_t *aos_http_controller_create(aos_pool_t *p, int owner); /* http io error message*/ static APR_INLINE const char *aos_http_controller_get_reason(aos_http_controller_t *ctl) { aos_http_controller_ex_t *ctle = (aos_http_controller_ex_t *)ctl; return ctle->reason; } CURL *aos_request_get(); void request_release(CURL *request); void request_release2(aos_curl_http_transport_t* t); int aos_http_io_initialize(const char *user_agent_info, int flag); void aos_http_io_deinitialize(); int aos_http_send_request(aos_http_controller_t *ctl, aos_http_request_t *req, aos_http_response_t *resp); void aos_set_default_request_options(aos_http_request_options_t *op); void aos_set_default_transport_options(aos_http_transport_options_t *op); aos_http_request_options_t *aos_http_request_options_create(aos_pool_t *p); aos_http_request_t *aos_http_request_create(aos_pool_t *p); aos_http_response_t *aos_http_response_create(aos_pool_t *p); int aos_read_http_body_memory(aos_http_request_t *req, char *buffer, int len); int aos_write_http_body_memory(aos_http_response_t *resp, const char *buffer, int len); int aos_read_http_body_file(aos_http_request_t *req, char *buffer, int len); int aos_write_http_body_file(aos_http_response_t *resp, const char *buffer, int len); typedef aos_http_transport_t *(*aos_http_transport_create_pt)(aos_pool_t *p); typedef int (*aos_http_transport_perform_pt)(aos_http_transport_t *t); extern aos_pool_t *aos_global_pool; extern apr_file_t *aos_stderr_file; extern aos_http_request_options_t *aos_default_http_request_options; extern aos_http_transport_options_t *aos_default_http_transport_options; extern aos_http_transport_create_pt aos_http_transport_create; extern aos_http_transport_perform_pt aos_http_transport_perform; AOS_CPP_END #endif ================================================ FILE: oss_c_sdk/aos_list.h ================================================ #ifndef LIBAOS_LIST_H #define LIBAOS_LIST_H #include // from kernel list typedef struct aos_list_s aos_list_t; struct aos_list_s { aos_list_t *next, *prev; }; #define aos_list_head_init(name) {&(name), &(name)} #define aos_list_init(ptr) do { \ (ptr)->next = (ptr); \ (ptr)->prev = (ptr); \ } while (0) static APR_INLINE void __aos_list_add(aos_list_t *list, aos_list_t *prev, aos_list_t *next) { next->prev = list; list->next = next; list->prev = prev; prev->next = list; } // list head to add it before static APR_INLINE void aos_list_add_tail(aos_list_t *list, aos_list_t *head) { __aos_list_add(list, head->prev, head); } static APR_INLINE void __aos_list_del(aos_list_t *prev, aos_list_t *next) { next->prev = prev; prev->next = next; } // deletes entry from list static APR_INLINE void aos_list_del(aos_list_t *entry) { __aos_list_del(entry->prev, entry->next); aos_list_init(entry); } // tests whether a list is empty static APR_INLINE int aos_list_empty(const aos_list_t *head) { return (head->next == head); } // move list to new_list static APR_INLINE void aos_list_movelist(aos_list_t *list, aos_list_t *new_list) { if (!aos_list_empty(list)) { new_list->prev = list->prev; new_list->next = list->next; new_list->prev->next = new_list; new_list->next->prev = new_list; aos_list_init(list); } else { aos_list_init(new_list); } } // get last #define aos_list_get_last(list, type, member) \ aos_list_empty(list) ? NULL : aos_list_entry((list)->prev, type, member) // get first #define aos_list_get_first(list, type, member) \ aos_list_empty(list) ? NULL : aos_list_entry((list)->next, type, member) #define aos_list_entry(ptr, type, member) \ (type *)( (char *)ptr - APR_OFFSETOF(type, member) ) // traversing #define aos_list_for_each_entry(postp, pos, head, member) \ for (pos = aos_list_entry((head)->next, postp, member); \ &pos->member != (head); \ pos = aos_list_entry(pos->member.next, postp, member)) #define aos_list_for_each_entry_reverse(postp, pos, head, member) \ for (pos = aos_list_entry((head)->prev, postp, member); \ &pos->member != (head); \ pos = aos_list_entry(pos->member.prev, postp, member)) #define aos_list_for_each_entry_safe(postp, pos, n, head, member) \ for (pos = aos_list_entry((head)->next, postp, member), \ n = aos_list_entry(pos->member.next, postp, member); \ &pos->member != (head); \ pos = n, n = aos_list_entry(n->member.next, postp, member)) #define aos_list_for_each_entry_safe_reverse(postp, pos, n, head, member) \ for (pos = aos_list_entry((head)->prev, postp, member), \ n = aos_list_entry(pos->member.prev, postp, member); \ &pos->member != (head); \ pos = n, n = aos_list_entry(n->member.prev, postp, member)) #endif ================================================ FILE: oss_c_sdk/aos_log.c ================================================ #include "aos_log.h" #include "apr_portable.h" aos_log_print_pt aos_log_print = aos_log_print_default; aos_log_format_pt aos_log_format = aos_log_format_default; aos_log_level_e aos_log_level = AOS_LOG_WARN; extern apr_file_t *aos_stderr_file; void aos_log_set_print(aos_log_print_pt p) { aos_log_print = p; } void aos_log_set_format(aos_log_format_pt p) { aos_log_format = p; } void aos_log_set_level(aos_log_level_e level) { aos_log_level = level; } void aos_log_set_output(apr_file_t *output) { aos_stderr_file = output; } void aos_log_print_default(const char *message, int len) { if (aos_stderr_file == NULL) { fprintf(stderr, "%s", message); } else { apr_size_t bnytes = len; apr_file_write(aos_stderr_file, message, &bnytes); } } void aos_log_format_default(int level, const char *file, int line, const char *function, const char *fmt, ...) { int len; apr_time_t t; int s; apr_time_exp_t tm; va_list args; char buffer[4096]; t = apr_time_now(); if ((s = apr_time_exp_lt(&tm, t)) != APR_SUCCESS) { return; } len = apr_snprintf(buffer, 4090, "[%04d-%02d-%02d %02d:%02d:%02d.%03d] %" APR_INT64_T_FMT " %s:%d ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_usec/1000, (int64_t)apr_os_thread_current(), file, line); va_start(args, fmt); len += vsnprintf(buffer + len, 4090 - len, fmt, args); va_end(args); while (buffer[len -1] == '\n') len--; buffer[len++] = '\n'; buffer[len] = '\0'; aos_log_print(buffer, len); } ================================================ FILE: oss_c_sdk/aos_log.h ================================================ #ifndef LIBAOS_LOG_H #define LIBAOS_LOG_H #include "aos_define.h" AOS_CPP_START typedef void (*aos_log_print_pt)(const char *message, int len); typedef void (*aos_log_format_pt)(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 5, 6))); void aos_log_set_print(aos_log_print_pt p); void aos_log_set_format(aos_log_format_pt p); typedef enum { AOS_LOG_OFF = 1, AOS_LOG_FATAL, AOS_LOG_ERROR, AOS_LOG_WARN, AOS_LOG_INFO, AOS_LOG_DEBUG, AOS_LOG_TRACE, AOS_LOG_ALL } aos_log_level_e; #ifdef WIN32 #define aos_fatal_log(format, ...) if(aos_log_level>=AOS_LOG_FATAL) \ aos_log_format(AOS_LOG_FATAL, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__) #define aos_error_log(format, ...) if(aos_log_level>=AOS_LOG_ERROR) \ aos_log_format(AOS_LOG_ERROR, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__) #define aos_warn_log(format, ...) if(aos_log_level>=AOS_LOG_WARN) \ aos_log_format(AOS_LOG_WARN, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__) #define aos_info_log(format, ...) if(aos_log_level>=AOS_LOG_INFO) \ aos_log_format(AOS_LOG_INFO, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__) #define aos_debug_log(format, ...) if(aos_log_level>=AOS_LOG_DEBUG) \ aos_log_format(AOS_LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__) #define aos_trace_log(format, ...) if(aos_log_level>=AOS_LOG_TRACE) \ aos_log_format(AOS_LOG_TRACE, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__) #else #define aos_fatal_log(format, args...) if(aos_log_level>=AOS_LOG_FATAL) \ aos_log_format(AOS_LOG_FATAL, __FILE__, __LINE__, __FUNCTION__, format, ## args) #define aos_error_log(format, args...) if(aos_log_level>=AOS_LOG_ERROR) \ aos_log_format(AOS_LOG_ERROR, __FILE__, __LINE__, __FUNCTION__, format, ## args) #define aos_warn_log(format, args...) if(aos_log_level>=AOS_LOG_WARN) \ aos_log_format(AOS_LOG_WARN, __FILE__, __LINE__, __FUNCTION__, format, ## args) #define aos_info_log(format, args...) if(aos_log_level>=AOS_LOG_INFO) \ aos_log_format(AOS_LOG_INFO, __FILE__, __LINE__, __FUNCTION__, format, ## args) #define aos_debug_log(format, args...) if(aos_log_level>=AOS_LOG_DEBUG) \ aos_log_format(AOS_LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, format, ## args) #define aos_trace_log(format, args...) if(aos_log_level>=AOS_LOG_TRACE) \ aos_log_format(AOS_LOG_TRACE, __FILE__, __LINE__, __FUNCTION__, format, ## args) #endif void aos_log_set_level(aos_log_level_e level); void aos_log_set_output(apr_file_t *output); void aos_log_print_default(const char *message, int len); void aos_log_format_default(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 5, 6))); extern aos_log_level_e aos_log_level; extern aos_log_format_pt aos_log_format; extern aos_log_format_pt aos_log_format; AOS_CPP_END #endif ================================================ FILE: oss_c_sdk/aos_status.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_status.h" const char AOS_XML_PARSE_ERROR_CODE[] = "ParseXmlError"; const char AOS_OPEN_FILE_ERROR_CODE[] = "OpenFileFail"; const char AOS_WRITE_FILE_ERROR_CODE[] = "WriteFileFail"; const char AOS_RENAME_FILE_ERROR_CODE[] = "RenameFileFail"; const char AOS_HTTP_IO_ERROR_CODE[] = "HttpIoError"; const char AOS_UNKNOWN_ERROR_CODE[] = "UnknownError"; const char AOS_CLIENT_ERROR_CODE[] = "ClientError"; const char AOS_SERVER_ERROR_CODE[] = "ServerError"; const char AOS_UTF8_ENCODE_ERROR_CODE[] = "Utf8EncodeFail"; const char AOS_URL_ENCODE_ERROR_CODE[] = "UrlEncodeFail"; const char AOS_INCONSISTENT_ERROR_CODE[] = "InconsistentError"; const char AOS_CREATE_QUEUE_ERROR_CODE[] = "CreateQueueFail"; const char AOS_CREATE_THREAD_POOL_ERROR_CODE[] = "CreateThreadPoolFail"; const char AOS_EMPTY_STRING_ERROR[] = "EmptyStringError"; const char AOS_SELECT_OBJECT_ERROR[] = "SelectObjectError"; const char AOS_SELECT_OBJECT_CRC_ERROR[] = "SelectObjectCRCError"; const char AOS_CREATE_SELECT_OBJECT_META_ERROR[] = "CreateSelectObjectMetaError"; const char AOS_BUCKET_NAME_INVALID_ERROR[] = "BucketNameInvalidError"; const char AOS_OBJECT_NAME_INVALID_ERROR[] = "ObjectNameInvalidError"; aos_status_t *aos_status_create(aos_pool_t *p) { return (aos_status_t *)aos_pcalloc(p, sizeof(aos_status_t)); } aos_status_t *aos_status_dup(aos_pool_t *p, aos_status_t *src) { aos_status_t *dst = aos_status_create(p); dst->code = src->code; dst->error_code = apr_pstrdup(p, src->error_code); dst->error_msg = apr_pstrdup(p, src->error_msg); return dst; } int aos_should_retry(aos_status_t *s) { // HTTP Error if (s == NULL || s->code / 100 == 2) { return AOS_FALSE; } // OSS Error if (s->code / 100 == 5) { return AOS_TRUE; } // Curl Error if (s->code != AOSE_OK) { if (s->code == AOSE_CONNECTION_FAILED || s->code == AOSE_REQUEST_TIMEOUT || s->code == AOSE_FAILED_CONNECT || s->code == AOSE_SERVICE_ERROR) { return AOS_TRUE; } } return AOS_FALSE; } aos_status_t *aos_status_parse_from_body(aos_pool_t *p, aos_list_t *bc, int code, aos_status_t *s) { int res; mxml_node_t *root, *node; mxml_node_t *code_node, *message_node; const char *node_content; if (s == NULL) { s = aos_status_create(p); } s->code = code; if (aos_http_is_ok(code)) { return s; } if (aos_list_empty(bc)) { s->error_code = (char *)AOS_UNKNOWN_ERROR_CODE; return s; } if ((res = aos_parse_xml_body(bc, &root)) != AOSE_OK) { s->error_code = (char *)AOS_UNKNOWN_ERROR_CODE; return s; } node = mxmlFindElement(root, root, "Error",NULL, NULL,MXML_DESCEND); if (NULL == node) { char *xml_content = aos_buf_list_content(p, bc); aos_error_log("Xml format invalid, root node name is not Error.\n"); aos_error_log("Xml Content:%s\n", xml_content); s->error_code = (char *)AOS_UNKNOWN_ERROR_CODE; mxmlDelete(root); return s; } code_node = mxmlFindElement(node, root, "Code",NULL, NULL,MXML_DESCEND); if (NULL != code_node) { node_content = mxmlGetOpaque(code_node); if (node_content != NULL) { s->error_code = apr_pstrdup(p, (char *)node_content); } } message_node = mxmlFindElement(node, root, "Message",NULL, NULL,MXML_DESCEND); if (NULL != message_node) { node_content = mxmlGetOpaque(message_node); if (node_content != NULL) { s->error_msg = apr_pstrdup(p, node_content); } } mxmlDelete(root); return s; } ================================================ FILE: oss_c_sdk/aos_status.h ================================================ #ifndef LIBAOS_STATUS_H #define LIBAOS_STATUS_H #include "aos_define.h" #include "aos_list.h" AOS_CPP_START typedef struct aos_status_s aos_status_t; struct aos_status_s { int code; // > 0 http code char *error_code; // can't modify char *error_msg; // can't modify char *req_id; // can't modify }; static APR_INLINE int aos_status_is_ok(aos_status_t *s) { return s->code > 0 && s->code / 100 == 2; } static APR_INLINE int aos_http_is_ok(int st) { return st / 100 == 2; } #define aos_status_set(s, c, ec, es) \ (s)->code = c; (s)->error_code = (char *)ec; (s)->error_msg = (char *)es /** * @brief determine whether the request should be retried * @param[in] s the return status of api, such as oss_put_object_from_buffer * @return int AOS_FALSE indicates no retries, AOS_TRUE retry */ int aos_should_retry(aos_status_t *s); aos_status_t *aos_status_create(aos_pool_t *p); aos_status_t *aos_status_dup(aos_pool_t *p, aos_status_t *src); aos_status_t *aos_status_parse_from_body(aos_pool_t *p, aos_list_t *bc, int code, aos_status_t *s); extern const char AOS_XML_PARSE_ERROR_CODE[]; extern const char AOS_OPEN_FILE_ERROR_CODE[]; extern const char AOS_WRITE_FILE_ERROR_CODE[]; extern const char AOS_RENAME_FILE_ERROR_CODE[]; extern const char AOS_HTTP_IO_ERROR_CODE[]; extern const char AOS_UNKNOWN_ERROR_CODE[]; extern const char AOS_CLIENT_ERROR_CODE[]; extern const char AOS_SERVER_ERROR_CODE[]; extern const char AOS_UTF8_ENCODE_ERROR_CODE[]; extern const char AOS_URL_ENCODE_ERROR_CODE[]; extern const char AOS_INCONSISTENT_ERROR_CODE[]; extern const char AOS_CREATE_QUEUE_ERROR_CODE[]; extern const char AOS_CREATE_THREAD_POOL_ERROR_CODE[]; extern const char AOS_EMPTY_STRING_ERROR[]; extern const char AOS_SELECT_OBJECT_ERROR[]; extern const char AOS_SELECT_OBJECT_CRC_ERROR[]; extern const char AOS_CREATE_SELECT_OBJECT_META_ERROR[]; extern const char AOS_BUCKET_NAME_INVALID_ERROR[]; extern const char AOS_OBJECT_NAME_INVALID_ERROR[]; AOS_CPP_END #endif ================================================ FILE: oss_c_sdk/aos_string.c ================================================ #include "aos_string.h" typedef int (*aos_is_char_pt)(char c); static void aos_strip_str_func(aos_string_t *str, aos_is_char_pt func); char *aos_pstrdup(aos_pool_t *p, const aos_string_t *s) { return apr_pstrndup(p, s->data, s->len); } static void aos_strip_str_func(aos_string_t *str, aos_is_char_pt func) { char *data = str->data; int len = str->len; int offset = 0; if (len == 0) return; while (len > 0 && func(data[len - 1])) { --len; } for (; offset < len && func(data[offset]); ++offset) { // empty; } str->data = data + offset; str->len = len - offset; } void aos_unquote_str(aos_string_t *str) { aos_strip_str_func(str, aos_is_quote); } void aos_strip_space(aos_string_t *str) { aos_strip_str_func(str, aos_is_space); } void aos_trip_space_and_cntrl(aos_string_t *str) { aos_strip_str_func(str, aos_is_space_or_cntrl); } int aos_ends_with(const aos_string_t *str, const aos_string_t *suffix) { if (!str || !suffix) { return 0; } return (str->len >= suffix->len) && strncmp(str->data + str->len - suffix->len, suffix->data, suffix->len) == 0; } ================================================ FILE: oss_c_sdk/aos_string.h ================================================ #ifndef LIBAOS_STRING_H #define LIBAOS_STRING_H #include "aos_define.h" AOS_CPP_START typedef struct { int len; char *data; } aos_string_t; #define aos_string(str) { sizeof(str) - 1, (char *) str } #define aos_null_string { 0, NULL } #define aos_str_set(str, text) \ (str)->len = strlen(text); (str)->data = (char *) text #define aos_str_null(str) (str)->len = 0; (str)->data = NULL #define aos_tolower(c) (char) ((c >= 'A' && c <= 'Z') ? (c | 0x20) : c) #define aos_toupper(c) (char) ((c >= 'a' && c <= 'z') ? (c & ~0x20) : c) static APR_INLINE int aos_string_is_empty(const aos_string_t *str) { if (NULL == str || str->len == 0 || NULL == str->data || 0 == strcmp(str->data, "")) { return AOS_TRUE; } else { return AOS_FALSE; } } static APR_INLINE void aos_string_tolower(aos_string_t *str) { int i = 0; while (i < str->len) { str->data[i] = aos_tolower(str->data[i]); ++i; } } static APR_INLINE char *aos_strlchr(char *p, char *last, char c) { while (p < last) { if (*p == c) { return p; } p++; } return NULL; } static APR_INLINE int aos_is_quote(char c) { return c == '\"'; } static APR_INLINE int aos_is_space(char c) { return ((c == ' ') || (c == '\t')); } static APR_INLINE int aos_is_space_or_cntrl(char c) { return c <= ' '; } static APR_INLINE int aos_is_null_string(aos_string_t *str) { if (str == NULL || str->data == NULL || str->len == 0) { return AOS_TRUE; } return AOS_FALSE; } void aos_strip_space(aos_string_t *str); void aos_trip_space_and_cntrl(aos_string_t *str); void aos_unquote_str(aos_string_t *str); char *aos_pstrdup(aos_pool_t *p, const aos_string_t *s); int aos_ends_with(const aos_string_t *str, const aos_string_t *suffix); AOS_CPP_END #endif ================================================ FILE: oss_c_sdk/aos_transport.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_http_io.h" #include "aos_transport.h" #include "aos_crc64.h" #include "aos_status.h" static int aos_curl_code_to_status(CURLcode code); static void aos_init_curl_headers(aos_curl_http_transport_t *t); static void aos_transport_cleanup(aos_http_transport_t *t); static int aos_init_curl_url(aos_curl_http_transport_t *t); static void aos_curl_transport_headers_done(aos_curl_http_transport_t *t); static int aos_curl_transport_setup(aos_curl_http_transport_t *t); static void aos_curl_transport_finish(aos_curl_http_transport_t *t); static void aos_move_transport_state(aos_curl_http_transport_t *t, aos_transport_state_e s); static size_t aos_curl_default_header_callback(char *buffer, size_t size, size_t nitems, void *userdata); static size_t aos_curl_default_write_callback(char *ptr, size_t size, size_t nmemb, void *userdata); static size_t aos_curl_default_read_callback(char *buffer, size_t size, size_t nitems, void *instream); static int aos_curl_debug_callback(void *handle, curl_infotype type, char *data, size_t size, void *userp) { switch (type) { default: break; case CURLINFO_TEXT: aos_debug_log("curl:%pp=> Info: %.*s", handle, (int)size, data); break; case CURLINFO_HEADER_OUT: aos_debug_log("curl:%pp=> Send header: %.*s", handle, (int)size, data); break; case CURLINFO_HEADER_IN: aos_debug_log("curl:%pp=> Recv header: %.*s", handle, (int)size, data); break; } return 0; } static void aos_init_curl_headers(aos_curl_http_transport_t *t) { int pos; char *header; const aos_array_header_t *tarr; const aos_table_entry_t *telts; union aos_func_u func; if (t->req->method == HTTP_PUT || t->req->method == HTTP_POST) { header = apr_psprintf(t->pool, "Content-Length: %" APR_INT64_T_FMT, t->req->body_len); t->headers = curl_slist_append(t->headers, header); } tarr = aos_table_elts(t->req->headers); telts = (aos_table_entry_t*)tarr->elts; for (pos = 0; pos < tarr->nelts; ++pos) { header = apr_psprintf(t->pool, "%s: %s", telts[pos].key, telts[pos].val); t->headers = curl_slist_append(t->headers, header); } func.func1 = (aos_func1_pt)curl_slist_free_all; aos_fstack_push(t->cleanup, t->headers, func, 1); } static int aos_init_curl_url(aos_curl_http_transport_t *t) { int rs; const char *proto; aos_string_t querystr; char uristr[3*AOS_MAX_URI_LEN+1]; uristr[0] = '\0'; aos_str_null(&querystr); if ((rs = aos_url_encode(uristr, t->req->uri, AOS_MAX_URI_LEN)) != AOSE_OK) { t->controller->error_code = rs; t->controller->reason = "uri invalid argument."; return rs; } if ((rs = aos_query_params_to_string(t->pool, t->req->query_params, &querystr)) != AOSE_OK) { t->controller->error_code = rs; t->controller->reason = "query params invalid argument."; return rs; } proto = strlen(t->req->proto) != 0 ? t->req->proto : AOS_HTTP_PREFIX; if (querystr.len == 0) { t->url = apr_psprintf(t->pool, "%s%s/%s", proto, t->req->host, uristr); } else { t->url = apr_psprintf(t->pool, "%s%s/%s%.*s", proto, t->req->host, uristr, querystr.len, querystr.data); } aos_debug_log("url:%s.", t->url); return AOSE_OK; } static void aos_transport_cleanup(aos_http_transport_t *t) { int s; char buf[256]; if (t->req->file_buf != NULL && t->req->file_buf->owner) { aos_trace_log("close request body file."); if ((s = apr_file_close(t->req->file_buf->file)) != APR_SUCCESS) { aos_warn_log("apr_file_close failure, %s.", apr_strerror(s, buf, sizeof(buf))); } t->req->file_buf = NULL; } if (t->resp->file_buf != NULL && t->resp->file_buf->owner) { aos_trace_log("close response body file."); if ((s = apr_file_close(t->resp->file_buf->file)) != APR_SUCCESS) { aos_warn_log("apr_file_close failure, %s.", apr_strerror(s, buf, sizeof(buf))); } t->resp->file_buf = NULL; } } aos_http_transport_t *aos_curl_http_transport_create(aos_pool_t *p) { aos_func_u func; aos_curl_http_transport_t *t; t = (aos_curl_http_transport_t *)aos_pcalloc(p, sizeof(aos_curl_http_transport_t)); t->pool = p; t->options = aos_default_http_transport_options; t->cleanup = aos_fstack_create(p, 5); func.func1 = (aos_func1_pt)aos_transport_cleanup; aos_fstack_push(t->cleanup, t, func, 1); t->curl = aos_request_get(); func.func1 = (aos_func1_pt)request_release2; aos_fstack_push(t->cleanup, t, func, 1); t->header_callback = aos_curl_default_header_callback; t->read_callback = aos_curl_default_read_callback; t->write_callback = aos_curl_default_write_callback; return (aos_http_transport_t *)t; } static void aos_move_transport_state(aos_curl_http_transport_t *t, aos_transport_state_e s) { if (t->state < s) { t->state = s; } } void aos_curl_response_headers_parse(aos_pool_t *p, aos_table_t *headers, char *buffer, int len) { char *pos; aos_string_t str; aos_string_t key; aos_string_t value; str.data = buffer; str.len = len; aos_trip_space_and_cntrl(&str); pos = aos_strlchr(str.data, str.data + str.len, ':'); if (pos == NULL) { return; } key.data = str.data; key.len = pos - str.data; pos += 1; value.len = str.data + str.len - pos; value.data = pos; aos_strip_space(&value); apr_table_addn(headers, aos_pstrdup(p, &key), aos_pstrdup(p, &value)); } size_t aos_curl_default_header_callback(char *buffer, size_t size, size_t nitems, void *userdata) { int len; aos_curl_http_transport_t *t; t = (aos_curl_http_transport_t *)(userdata); len = size * nitems; if (t->controller->first_byte_time == 0) { t->controller->first_byte_time = apr_time_now(); } aos_curl_response_headers_parse(t->pool, t->resp->headers, buffer, len); aos_move_transport_state(t, TRANS_STATE_HEADER); return len; } static void aos_curl_transport_headers_done(aos_curl_http_transport_t *t) { long http_code; CURLcode code; const char *value; if (t->controller->error_code != AOSE_OK) { aos_debug_log("has error %d.", t->controller->error_code); return; } if (t->resp->status > 0) { aos_trace_log("http response status %d.", t->resp->status); return; } t->resp->status = 0; if ((code = curl_easy_getinfo(t->curl, CURLINFO_RESPONSE_CODE, &http_code)) != CURLE_OK) { t->controller->reason = apr_pstrdup(t->pool, curl_easy_strerror(code)); t->controller->error_code = AOSE_INTERNAL_ERROR; aos_error_log("get response status fail, curl code:%d, reason:%s", code, t->controller->reason); return; } else { t->resp->status = http_code; } value = apr_table_get(t->resp->headers, "Content-Length"); if (value != NULL) { t->resp->content_length = aos_atoi64(value); } } size_t aos_curl_default_write_callback(char *ptr, size_t size, size_t nmemb, void *userdata) { int len; int bytes; aos_curl_http_transport_t *t; t = (aos_curl_http_transport_t *)(userdata); len = size * nmemb; if (t->controller->first_byte_time == 0) { t->controller->first_byte_time = apr_time_now(); } aos_curl_transport_headers_done(t); if (t->controller->error_code != AOSE_OK) { aos_debug_log("write callback abort"); return 0; } // On HTTP error, we expect to parse an HTTP error response if (t->resp->status < 200 || t->resp->status > 299) { bytes = aos_write_http_body_memory(t->resp, ptr, len); assert(bytes == len); aos_move_transport_state(t, TRANS_STATE_BODY_IN); return bytes; } if (t->resp->type == BODY_IN_MEMORY && t->resp->body_len >= (int64_t)t->controller->options->max_memory_size) { t->controller->reason = apr_psprintf(t->pool, "receive body too big, current body size: %" APR_INT64_T_FMT ", max memory size: %" APR_INT64_T_FMT, t->resp->body_len, t->controller->options->max_memory_size); t->controller->error_code = AOSE_OVER_MEMORY; aos_error_log("error reason:%s, ", t->controller->reason); return 0; } if ((bytes = t->resp->write_body(t->resp, ptr, len)) < 0) { aos_debug_log("write body failure, %d.", bytes); if (bytes == AOSE_SELECT_OBJECT_CRC_ERROR) { t->controller->error_code = AOSE_SELECT_OBJECT_CRC_ERROR; t->controller->reason = (char *)AOS_SELECT_OBJECT_CRC_ERROR; } else { t->controller->error_code = AOSE_WRITE_BODY_ERROR; t->controller->reason = "write body failure."; } return 0; } if (bytes >= 0) { // progress callback if (NULL != t->resp->progress_callback) { t->resp->progress_callback(t->resp->body_len, t->resp->content_length); } // crc if (t->controller->options->enable_crc) { t->resp->crc64 = aos_crc64(t->resp->crc64, ptr, bytes); } } aos_move_transport_state(t, TRANS_STATE_BODY_IN); return bytes; } size_t aos_curl_default_read_callback(char *buffer, size_t size, size_t nitems, void *instream) { int len; int bytes; aos_curl_http_transport_t *t; t = (aos_curl_http_transport_t *)(instream); len = size * nitems; if (t->controller->error_code != AOSE_OK) { aos_debug_log("abort read callback."); return CURL_READFUNC_ABORT; } if ((bytes = t->req->read_body(t->req, buffer, len)) < 0) { aos_debug_log("read body failure, %d.", bytes); t->controller->error_code = AOSE_READ_BODY_ERROR; t->controller->reason = "read body failure."; return CURL_READFUNC_ABORT; } if (bytes >= 0) { // progress callback t->req->consumed_bytes += bytes; if (NULL != t->req->progress_callback) { t->req->progress_callback(t->req->consumed_bytes, t->req->body_len); } // crc if (t->controller->options->enable_crc) { t->req->crc64 = aos_crc64(t->req->crc64, buffer, bytes); } } aos_move_transport_state(t, TRANS_STATE_BODY_OUT); return bytes; } static int aos_curl_code_to_status(CURLcode code) { switch (code) { case CURLE_OUT_OF_MEMORY: return AOSE_OUT_MEMORY; case CURLE_COULDNT_RESOLVE_PROXY: case CURLE_COULDNT_RESOLVE_HOST: return AOSE_NAME_LOOKUP_ERROR; case CURLE_COULDNT_CONNECT: return AOSE_FAILED_CONNECT; case CURLE_WRITE_ERROR: case CURLE_OPERATION_TIMEDOUT: return AOSE_CONNECTION_FAILED; case CURLE_PARTIAL_FILE: return AOSE_OK; case CURLE_SSL_CACERT: return AOSE_FAILED_VERIFICATION; default: return AOSE_INTERNAL_ERROR; } } static void aos_curl_transport_finish(aos_curl_http_transport_t *t) { aos_curl_transport_headers_done(t); if (t->cleanup != NULL) { aos_fstack_destory(t->cleanup); t->cleanup = NULL; } } int aos_curl_transport_setup(aos_curl_http_transport_t *t) { #define curl_easy_setopt_safe(opt, val) curl_easy_setopt(t->curl, opt, val) curl_easy_setopt_safe(CURLOPT_PRIVATE, t); curl_easy_setopt_safe(CURLOPT_HEADERDATA, t); curl_easy_setopt_safe(CURLOPT_HEADERFUNCTION, t->header_callback); curl_easy_setopt_safe(CURLOPT_READDATA, t); curl_easy_setopt_safe(CURLOPT_READFUNCTION, t->read_callback); curl_easy_setopt_safe(CURLOPT_WRITEDATA, t); curl_easy_setopt_safe(CURLOPT_WRITEFUNCTION, t->write_callback); curl_easy_setopt_safe(CURLOPT_FILETIME, 1); curl_easy_setopt_safe(CURLOPT_NOSIGNAL, 1); curl_easy_setopt_safe(CURLOPT_NOPROGRESS, 1); curl_easy_setopt_safe(CURLOPT_TCP_NODELAY, 1); curl_easy_setopt_safe(CURLOPT_NETRC, CURL_NETRC_IGNORED); // transport options curl_easy_setopt_safe(CURLOPT_USERAGENT, t->options->user_agent); // ssl if (t->controller->options->verify_ssl) { curl_easy_setopt_safe(CURLOPT_SSL_VERIFYPEER, 1); curl_easy_setopt_safe(CURLOPT_SSL_VERIFYHOST, 2); } else { curl_easy_setopt_safe(CURLOPT_SSL_VERIFYPEER, 0); curl_easy_setopt_safe(CURLOPT_SSL_VERIFYHOST, 0); } if (t->controller->options->ca_path != NULL) { curl_easy_setopt_safe(CURLOPT_CAPATH, t->controller->options->ca_path); } if (t->controller->options->ca_file != NULL) { curl_easy_setopt_safe(CURLOPT_CAINFO, t->controller->options->ca_file); } // request options curl_easy_setopt_safe(CURLOPT_DNS_CACHE_TIMEOUT, t->controller->options->dns_cache_timeout); curl_easy_setopt_safe(CURLOPT_CONNECTTIMEOUT, t->controller->options->connect_timeout); curl_easy_setopt_safe(CURLOPT_LOW_SPEED_LIMIT, t->controller->options->speed_limit); curl_easy_setopt_safe(CURLOPT_LOW_SPEED_TIME, t->controller->options->speed_time); aos_init_curl_headers(t); curl_easy_setopt_safe(CURLOPT_HTTPHEADER, t->headers); if (t->controller->options->proxy_host != NULL) { // proxy curl_easy_setopt_safe(CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_easy_setopt_safe(CURLOPT_PROXY, t->controller->options->proxy_host); // authorize if (t->controller->options->proxy_auth != NULL) { curl_easy_setopt_safe(CURLOPT_PROXYAUTH, CURLAUTH_BASIC); curl_easy_setopt_safe(CURLOPT_PROXYUSERPWD, t->controller->options->proxy_auth); } } if (NULL == t->req->signed_url) { if (aos_init_curl_url(t) != AOSE_OK) { return t->controller->error_code; } } else { t->url = t->req->signed_url; } curl_easy_setopt_safe(CURLOPT_URL, t->url); switch (t->req->method) { case HTTP_HEAD: curl_easy_setopt_safe(CURLOPT_NOBODY, 1); break; case HTTP_PUT: curl_easy_setopt_safe(CURLOPT_UPLOAD, 1); break; case HTTP_POST: curl_easy_setopt_safe(CURLOPT_POST, 1); break; case HTTP_DELETE: curl_easy_setopt_safe(CURLOPT_CUSTOMREQUEST, "DELETE"); break; default: // HTTP_GET break; } if (aos_log_level >= AOS_LOG_DEBUG) { curl_easy_setopt_safe(CURLOPT_VERBOSE, 1L); curl_easy_setopt_safe(CURLOPT_DEBUGFUNCTION, aos_curl_debug_callback); } #undef curl_easy_setopt_safe t->state = TRANS_STATE_INIT; return AOSE_OK; } int aos_curl_http_transport_perform(aos_http_transport_t *t_) { int ecode; CURLcode code; aos_curl_http_transport_t *t = (aos_curl_http_transport_t *)(t_); ecode = aos_curl_transport_setup(t); if (ecode != AOSE_OK) { return ecode; } t->controller->start_time = apr_time_now(); code = curl_easy_perform(t->curl); t->controller->finish_time = apr_time_now(); aos_move_transport_state(t, TRANS_STATE_DONE); t->curl_code = code; if ((code != CURLE_OK) && (t->controller->error_code == AOSE_OK)) { ecode = aos_curl_code_to_status(code); if (ecode != AOSE_OK) { t->controller->error_code = ecode; t->controller->reason = apr_pstrdup(t->pool, curl_easy_strerror(code)); aos_error_log("transport failure curl code:%d error:%s", code, t->controller->reason); } } aos_curl_transport_finish(t); return t->controller->error_code; } ================================================ FILE: oss_c_sdk/aos_transport.h ================================================ #ifndef LIBAOS_TRANSPORT_H #define LIBAOS_TRANSPORT_H #include "aos_define.h" #include "aos_buf.h" AOS_CPP_START typedef struct aos_http_request_s aos_http_request_t; typedef struct aos_http_response_s aos_http_response_t; typedef struct aos_http_transport_s aos_http_transport_t; typedef struct aos_http_controller_s aos_http_controller_t; typedef struct aos_http_request_options_s aos_http_request_options_t; typedef struct aos_http_transport_options_s aos_http_transport_options_t; typedef struct aos_curl_http_transport_s aos_curl_http_transport_t; typedef int (*aos_read_http_body_pt)(aos_http_request_t *req, char *buffer, int len); typedef int (*aos_write_http_body_pt)(aos_http_response_t *resp, const char *buffer, int len); typedef void (*oss_progress_callback)(int64_t consumed_bytes, int64_t total_bytes); void aos_curl_response_headers_parse(aos_pool_t *p, aos_table_t *headers, char *buffer, int len); aos_http_transport_t *aos_curl_http_transport_create(aos_pool_t *p); int aos_curl_http_transport_perform(aos_http_transport_t *t); struct aos_http_request_options_s { int speed_limit; int speed_time; int dns_cache_timeout; int connect_timeout; int64_t max_memory_size; int enable_crc; char *proxy_host; char *proxy_auth; int verify_ssl; char *ca_path; char *ca_file; int verify_object_strict; }; struct aos_http_transport_options_s { char *user_agent; char *cacerts_path; uint32_t ssl_verification_disabled:1; }; #define AOS_HTTP_BASE_CONTROLLER_DEFINE \ aos_http_request_options_t *options; \ aos_pool_t *pool; \ int64_t start_time; \ int64_t first_byte_time; \ int64_t finish_time; \ uint32_t owner:1; \ void *user_data; struct aos_http_controller_s { AOS_HTTP_BASE_CONTROLLER_DEFINE }; typedef struct aos_http_controller_ex_s { AOS_HTTP_BASE_CONTROLLER_DEFINE // private int error_code; char *reason; // can't modify } aos_http_controller_ex_t; typedef enum { BODY_IN_MEMORY = 0, BODY_IN_FILE, BODY_IN_CALLBACK } aos_http_body_type_e; struct aos_http_request_s { char *host; char *proto; char *signed_url; http_method_e method; char *uri; char *resource; aos_table_t *headers; aos_table_t *query_params; aos_list_t body; int64_t body_len; char *file_path; aos_file_buf_t *file_buf; aos_pool_t *pool; void *user_data; aos_read_http_body_pt read_body; aos_http_body_type_e type; oss_progress_callback progress_callback; uint64_t crc64; int64_t consumed_bytes; int normalize_url; }; struct aos_http_response_s { int status; aos_table_t *headers; aos_list_t body; int64_t body_len; char *file_path; aos_file_buf_t* file_buf; int64_t content_length; aos_pool_t *pool; void *user_data; aos_write_http_body_pt write_body; aos_http_body_type_e type; oss_progress_callback progress_callback; uint64_t crc64; }; typedef enum { TRANS_STATE_INIT, TRANS_STATE_HEADER, TRANS_STATE_BODY_IN, TRANS_STATE_BODY_OUT, TRANS_STATE_ABORT, TRANS_STATE_DONE } aos_transport_state_e; #define AOS_HTTP_BASE_TRANSPORT_DEFINE \ aos_http_request_t *req; \ aos_http_response_t *resp; \ aos_pool_t *pool; \ aos_transport_state_e state; \ aos_array_header_t *cleanup; \ aos_http_transport_options_t *options; \ aos_http_controller_ex_t *controller; struct aos_http_transport_s { AOS_HTTP_BASE_TRANSPORT_DEFINE }; struct aos_curl_http_transport_s { AOS_HTTP_BASE_TRANSPORT_DEFINE CURL *curl; CURLcode curl_code; char *url; struct curl_slist *headers; curl_read_callback header_callback; curl_read_callback read_callback; curl_write_callback write_callback; }; AOS_CPP_END #endif ================================================ FILE: oss_c_sdk/aos_util.c ================================================ #include "aos_util.h" #include "aos_log.h" static const char *g_s_wday[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; static const char *g_s_mon[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; static const char g_s_gmt_format[] = "%s, %.2d %s %.4d %.2d:%.2d:%.2d GMT"; static const char g_s_ios8601_format[] = "%.4d%.2d%.2dT%.2d%.2d%.2dZ"; int aos_parse_xml_body(aos_list_t *bc, mxml_node_t **root) { aos_buf_t *b; size_t len; *root = NULL; len = (size_t)aos_buf_list_len(bc); { int nsize = 0; char *buffer = (char*)malloc(sizeof(char)*(len+1)); memset(buffer, 0, len + 1); aos_list_for_each_entry(aos_buf_t, b, bc, node) { memcpy(buffer + nsize, (char *)b->pos, aos_buf_size(b)); nsize += aos_buf_size(b); } *root = mxmlLoadString(NULL, buffer, MXML_OPAQUE_CALLBACK); free(buffer); if (NULL == *root) { return AOSE_INTERNAL_ERROR; } } return AOSE_OK; } int aos_convert_to_gmt_time(char* date, const char* format, apr_time_exp_t *tm) { int size = apr_snprintf(date, AOS_MAX_GMT_TIME_LEN, format, g_s_wday[tm->tm_wday], tm->tm_mday, g_s_mon[tm->tm_mon], 1900 + tm->tm_year, tm->tm_hour, tm->tm_min, tm->tm_sec); if (size >= 0 && size < AOS_MAX_GMT_TIME_LEN) { return AOSE_OK; } else { return AOSE_INTERNAL_ERROR; } } int aos_get_gmt_str_time(char datestr[AOS_MAX_GMT_TIME_LEN]) { int s; apr_time_t now; char buf[128]; apr_time_exp_t result; now = apr_time_now(); if ((s = apr_time_exp_gmt(&result, now)) != APR_SUCCESS) { aos_error_log("apr_time_exp_gmt fialure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); return AOSE_INTERNAL_ERROR; } if ((s = aos_convert_to_gmt_time(datestr, g_s_gmt_format, &result)) != AOSE_OK) { aos_error_log("aos_convert_to_GMT failure, code:%d.", s); } return s; } int aos_convert_to_iso8601_time(char* date, const char* format, apr_time_exp_t* tm) { int size = apr_snprintf(date, AOS_MAX_GMT_TIME_LEN, format, 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); if (size >= 0 && size < AOS_MAX_GMT_TIME_LEN) { return AOSE_OK; } else { return AOSE_INTERNAL_ERROR; } } int aos_get_iso8601_str_time(char datestr[AOS_MAX_GMT_TIME_LEN]) { int s; apr_time_t now; char buf[128]; apr_time_exp_t result; now = apr_time_now(); if ((s = apr_time_exp_gmt(&result, now)) != APR_SUCCESS) { aos_error_log("apr_time_exp_gmt fialure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); return AOSE_INTERNAL_ERROR; } if ((s = aos_convert_to_iso8601_time(datestr, g_s_ios8601_format, &result)) != AOSE_OK) { aos_error_log("aos_convert_to_iso8601_time failure, code:%d.", s); } return s; } int aos_get_iso8601_str_time_ex(char datestr[AOS_MAX_GMT_TIME_LEN], apr_time_t now) { int s; char buf[128]; apr_time_exp_t result; if ((s = apr_time_exp_gmt(&result, now)) != APR_SUCCESS) { aos_error_log("apr_time_exp_gmt fialure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); return AOSE_INTERNAL_ERROR; } if ((s = aos_convert_to_iso8601_time(datestr, g_s_ios8601_format, &result)) != AOSE_OK) { aos_error_log("aos_convert_to_iso8601_time failure, code:%d.", s); } return s; } int aos_get_gmt_time_date(const char *gmt, char datestr[AOS_MAX_SHORT_TIME_LEN]) { char week[4]; char month[4]; apr_time_exp_t t; int i; if (!gmt) { return 0; } memset(week,0,4); memset(month,0,4); sscanf(gmt,"%3s, %2d %3s %4d %2d:%2d:%2d GMT", week, &t.tm_mday, month, &t.tm_year, &t.tm_hour, &t.tm_min, &t.tm_sec); for (i = 0; i < 12; i++) { if (apr_strnatcmp(g_s_mon[i], (char const *)month) == 0) { t.tm_mon = i + 1; break; } } apr_snprintf(datestr, AOS_MAX_SHORT_TIME_LEN, "%.4d%.2d%.2d", t.tm_year, t.tm_mon, t.tm_mday); return 0; } int aos_url_encode(char *dest, const char *src, int maxSrcSize) { static const char *hex = "0123456789ABCDEF"; int len = 0; unsigned char c; while (*src) { if (++len > maxSrcSize) { *dest = 0; return AOSE_INVALID_ARGUMENT; } c = *src; if (isalnum(c) || (c == '-') || (c == '_') || (c == '.') || (c == '~')) { *dest++ = c; } else if (*src == ' ') { *dest++ = '%'; *dest++ = '2'; *dest++ = '0'; } else { *dest++ = '%'; *dest++ = hex[c >> 4]; *dest++ = hex[c & 15]; } src++; } *dest = 0; return AOSE_OK; } int aos_url_encode_ex(char *dest, const char *src, int maxSrcSize, int slash) { static const char *hex = "0123456789ABCDEF"; int len = 0; unsigned char c; while (*src) { if (++len > maxSrcSize) { *dest = 0; return AOSE_INVALID_ARGUMENT; } c = *src; if (isalnum(c) || (c == '-') || (c == '_') || (c == '.') || (c == '~')) { *dest++ = c; } else if (*src == ' ') { *dest++ = '%'; *dest++ = '2'; *dest++ = '0'; } else if (c == '/' && slash) { *dest++ = c; } else { *dest++ = '%'; *dest++ = hex[c >> 4]; *dest++ = hex[c & 15]; } src++; } *dest = 0; return AOSE_OK; } int aos_encode_hex(char* dest, const void* src, int srclen, int* len) { static const char hex_table[] = "0123456789abcdef"; const unsigned char* in = src; int size; if (!src) { return AOSE_INVALID_ARGUMENT; } if (dest) { for (size = 0; size < srclen; size++) { *dest++ = hex_table[in[size] >> 4]; *dest++ = hex_table[in[size] & 0xf]; } *dest = '\0'; } if (len) { *len = srclen * 2 + 1; } return AOSE_OK; } int aos_query_params_to_string(aos_pool_t *p, aos_table_t *query_params, aos_string_t *querystr) { int rs; int pos; int len; char sep = '?'; char ebuf[AOS_MAX_QUERY_ARG_LEN*3+1]; char abuf[AOS_MAX_QUERY_ARG_LEN*6+128]; int max_len; const aos_array_header_t *tarr; const aos_table_entry_t *telts; aos_buf_t *querybuf; if (apr_is_empty_table(query_params)) { return AOSE_OK; } max_len = sizeof(abuf)-1; querybuf = aos_create_buf(p, 256); aos_str_null(querystr); tarr = aos_table_elts(query_params); telts = (aos_table_entry_t*)tarr->elts; for (pos = 0; pos < tarr->nelts; ++pos) { if ((rs = aos_url_encode(ebuf, telts[pos].key, AOS_MAX_QUERY_ARG_LEN)) != AOSE_OK) { aos_error_log("query params args too big, key:%s.", telts[pos].key); return AOSE_INVALID_ARGUMENT; } len = apr_snprintf(abuf, max_len, "%c%s", sep, ebuf); if (telts[pos].val != NULL && *telts[pos].val != '\0') { if ((rs = aos_url_encode(ebuf, telts[pos].val, AOS_MAX_QUERY_ARG_LEN)) != AOSE_OK) { aos_error_log("query params args too big, value:%s.", telts[pos].val); return AOSE_INVALID_ARGUMENT; } len += apr_snprintf(abuf+len, max_len-len, "=%s", ebuf); if (len >= AOS_MAX_QUERY_ARG_LEN) { aos_error_log("query params args too big, %s.", abuf); return AOSE_INVALID_ARGUMENT; } } aos_buf_append_string(p, querybuf, abuf, len); sep = '&'; } // result querystr->data = (char *)querybuf->pos; querystr->len = aos_buf_size(querybuf); return AOSE_OK; } void aos_gnome_sort(const char **headers, int size) { const char *tmp; int i = 0, last_highest = 0; while (i < size) { if ((i == 0) || apr_strnatcasecmp(headers[i-1], headers[i]) < 0) { i = ++last_highest; } else { tmp = headers[i]; headers[i] = headers[i - 1]; headers[--i] = tmp; } } } const char* aos_http_method_to_string(http_method_e method) { switch (method) { case HTTP_GET: return "GET"; case HTTP_HEAD: return "HEAD"; case HTTP_PUT: return "PUT"; case HTTP_POST: return "POST"; case HTTP_DELETE: return "DELETE"; default: return "UNKNOWN"; } } int aos_base64_encode(const unsigned char *in, int inLen, char *out) { static const char *ENC = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; char *original_out = out; while (inLen) { // first 6 bits of char 1 *out++ = ENC[*in >> 2]; if (!--inLen) { // last 2 bits of char 1, 4 bits of 0 *out++ = ENC[(*in & 0x3) << 4]; *out++ = '='; *out++ = '='; break; } // last 2 bits of char 1, first 4 bits of char 2 *out++ = ENC[((*in & 0x3) << 4) | (*(in + 1) >> 4)]; in++; if (!--inLen) { // last 4 bits of char 2, 2 bits of 0 *out++ = ENC[(*in & 0xF) << 2]; *out++ = '='; break; } // last 4 bits of char 2, first 2 bits of char 3 *out++ = ENC[((*in & 0xF) << 2) | (*(in + 1) >> 6)]; in++; // last 6 bits of char 3 *out++ = ENC[*in & 0x3F]; in++, inLen--; } return (out - original_out); } // HMAC-SHA-1: // // K - is key padded with zeros to 512 bits // m - is message // OPAD - 0x5c5c5c... // IPAD - 0x363636... // // HMAC(K,m) = SHA1((K ^ OPAD) . SHA1((K ^ IPAD) . m)) void HMAC_SHA1(unsigned char hmac[20], const unsigned char *key, int key_len, const unsigned char *message, int message_len) { unsigned char kopad[64], kipad[64]; int i; unsigned char digest[APR_SHA1_DIGESTSIZE]; apr_sha1_ctx_t context; if (key_len > 64) { key_len = 64; } for (i = 0; i < key_len; i++) { kopad[i] = key[i] ^ 0x5c; kipad[i] = key[i] ^ 0x36; } for ( ; i < 64; i++) { kopad[i] = 0 ^ 0x5c; kipad[i] = 0 ^ 0x36; } apr_sha1_init(&context); apr_sha1_update(&context, (const char *)kipad, 64); apr_sha1_update(&context, (const char *)message, (unsigned int)message_len); apr_sha1_final(digest, &context); apr_sha1_init(&context); apr_sha1_update(&context, (const char *)kopad, 64); apr_sha1_update(&context, (const char *)digest, 20); apr_sha1_final(hmac, &context); } unsigned char* aos_md5(aos_pool_t* pool, const char *in, apr_size_t in_len) { unsigned char* out; apr_md5_ctx_t context; //APR_MD5_DIGESTSIZE: The MD5 digest size, value is 16 out = aos_palloc(pool, APR_MD5_DIGESTSIZE + 1); if (!out) { return NULL; } if (0 != apr_md5_init(&context)) { return NULL; } if (0 != apr_md5_update(&context, in, in_len)) { return NULL; } if (0 != apr_md5_final(out, &context)) { return NULL; } out[APR_MD5_DIGESTSIZE] = '\0'; return out; }; int aos_url_decode(const char *in, char *out) { static const char tbl[256] = { -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1, -1,10,11,12,13,14,15,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,10,11,12,13,14,15,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1 }; char c, v1, v2; if(in != NULL) { while((c=*in++) != '\0') { if(c == '%') { if(!(v1=*in++) || (v1=tbl[(unsigned char)v1])<0 || !(v2=*in++) || (v2=tbl[(unsigned char)v2])<0) { *out = '\0'; return -1; } c = (v1<<4)|v2; } else if (c == '+') { c = ' '; } *out++ = c; } } *out = '\0'; return 0; } /* * Convert a string to a long long integer. * * Ignores `locale' stuff. Assumes that the upper and lower case * alphabets and digits are each contiguous. */ long long aos_strtoll(const char *nptr, char **endptr, int base) { const char *s; /* LONGLONG */ long long int acc, cutoff; int c; int neg, any, cutlim; /* endptr may be NULL */ #ifdef __GNUC__ /* This outrageous construct just to shut up a GCC warning. */ (void) &acc; (void) &cutoff; #endif /* * Skip white space and pick up leading +/- sign if any. * If base is 0, allow 0x for hex and 0 for octal, else * assume decimal; if base is already 16, allow 0x. */ s = nptr; do { c = (unsigned char) *s++; } while (isspace(c)); if (c == '-') { neg = 1; c = *s++; } else { neg = 0; if (c == '+') c = *s++; } if ((base == 0 || base == 16) && c == '0' && (*s == 'x' || *s == 'X')) { c = s[1]; s += 2; base = 16; } if (base == 0) base = c == '0' ? 8 : 10; /* * Compute the cutoff value between legal numbers and illegal * numbers. That is the largest legal value, divided by the * base. An input number that is greater than this value, if * followed by a legal input character, is too big. One that * is equal to this value may be valid or not; the limit * between valid and invalid numbers is then based on the last * digit. For instance, if the range for long longs is * [-9223372036854775808..9223372036854775807] and the input base * is 10, cutoff will be set to 922337203685477580 and cutlim to * either 7 (neg==0) or 8 (neg==1), meaning that if we have * accumulated a value > 922337203685477580, or equal but the * next digit is > 7 (or 8), the number is too big, and we will * return a range error. * * Set any if any `digits' consumed; make it negative to indicate * overflow. */ cutoff = neg ? LLONG_MIN : LLONG_MAX; cutlim = (int)(cutoff % base); cutoff /= base; if (neg) { if (cutlim > 0) { cutlim -= base; cutoff += 1; } cutlim = -cutlim; } for (acc = 0, any = 0;; c = (unsigned char) *s++) { if (isdigit(c)) c -= '0'; else if (isalpha(c)) c -= isupper(c) ? 'A' - 10 : 'a' - 10; else break; if (c >= base) break; if (any < 0) continue; if (neg) { if (acc < cutoff || (acc == cutoff && c > cutlim)) { any = -1; acc = LLONG_MIN; errno = ERANGE; } else { any = 1; acc *= base; acc -= c; } } else { if (acc > cutoff || (acc == cutoff && c > cutlim)) { any = -1; acc = LLONG_MAX; errno = ERANGE; } else { any = 1; acc *= base; acc += c; } } } if (endptr != 0) /* LINTED interface specification */ *endptr = (char *)(any ? s - 1 : nptr); return (acc); } int64_t aos_atoi64(const char *nptr) { return aos_strtoull(nptr, NULL, 10); } unsigned long long aos_strtoull(const char *nptr, char **endptr, int base) { const char *s; unsigned long long acc, cutoff; int c; int neg, any, cutlim; /* * See strtoq for comments as to the logic used. */ s = nptr; do { c = (unsigned char) *s++; } while (isspace(c)); if (c == '-') { neg = 1; c = *s++; } else { neg = 0; if (c == '+') c = *s++; } if ((base == 0 || base == 16) && c == '0' && (*s == 'x' || *s == 'X')) { c = s[1]; s += 2; base = 16; } if (base == 0) base = c == '0' ? 8 : 10; cutoff = ULLONG_MAX / (unsigned long long)base; cutlim = ULLONG_MAX % (unsigned long long)base; for (acc = 0, any = 0;; c = (unsigned char) *s++) { if (isdigit(c)) c -= '0'; else if (isalpha(c)) c -= isupper(c) ? 'A' - 10 : 'a' - 10; else break; if (c >= base) break; if (any < 0) continue; if (acc > cutoff || (acc == cutoff && c > cutlim)) { any = -1; acc = ULLONG_MAX; errno = ERANGE; } else { any = 1; acc *= (unsigned long long)base; acc += c; } } if (neg && any > 0) #ifdef WIN32 #pragma warning(disable : 4146) #endif acc = -acc; #ifdef WIN32 #pragma warning(default : 4146) #endif if (endptr != 0) *endptr = (char *) (any ? s - 1 : nptr); return (acc); } uint64_t aos_atoui64(const char *nptr) { return aos_strtoull(nptr, NULL, 10); } /* ===== start - public domain SHA256 implementation ===== */ /* This is based on SHA256 implementation in LibTomCrypt that was released into * public domain by Tom St Denis. */ #define WPA_GET_BE32(a) ((((uint32_t)(a)[0]) << 24) |(((uint32_t)(a)[1]) << 16) |(((uint32_t)(a)[2]) << 8) |((uint32_t)(a)[3])) #define WPA_PUT_BE32(a, val) \ do { \ (a)[0] = (unsigned char)((((uint32_t) (val)) >> 24) & 0xff); \ (a)[1] = (unsigned char)((((uint32_t) (val)) >> 16) & 0xff); \ (a)[2] = (unsigned char)((((uint32_t) (val)) >> 8) & 0xff); \ (a)[3] = (unsigned char)(((uint32_t) (val)) & 0xff); \ } while(0) #define WPA_PUT_BE64(a, val) \ do { \ (a)[0] = (unsigned char)(((uint64_t)(val)) >> 56); \ (a)[1] = (unsigned char)(((uint64_t)(val)) >> 48); \ (a)[2] = (unsigned char)(((uint64_t)(val)) >> 40); \ (a)[3] = (unsigned char)(((uint64_t)(val)) >> 32); \ (a)[4] = (unsigned char)(((uint64_t)(val)) >> 24); \ (a)[5] = (unsigned char)(((uint64_t)(val)) >> 16); \ (a)[6] = (unsigned char)(((uint64_t)(val)) >> 8); \ (a)[7] = (unsigned char)(((uint64_t)(val)) & 0xff); \ } while(0) typedef struct sha256_state { uint64_t length; uint32_t state[8], curlen; unsigned char buf[64]; } SHA256_CTX; /* the K array */ static const uint32_t K[64] = { 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL }; /* Various logical functions */ #define RORc(x, y) \ (((((uint32_t)(x) & 0xFFFFFFFFUL) >> (uint32_t)((y) & 31)) | \ ((uint32_t)(x) << (uint32_t)(32 - ((y) & 31)))) & 0xFFFFFFFFUL) #define Ch(x,y,z) (z ^ (x & (y ^ z))) #define Maj(x,y,z) (((x | y) & z) | (x & y)) #define S(x, n) RORc((x), (n)) #define R(x, n) (((x)&0xFFFFFFFFUL)>>(n)) #define Sigma0(x) (S(x, 2) ^ S(x, 13) ^ S(x, 22)) #define Sigma1(x) (S(x, 6) ^ S(x, 11) ^ S(x, 25)) #define Gamma0(x) (S(x, 7) ^ S(x, 18) ^ R(x, 3)) #define Gamma1(x) (S(x, 17) ^ S(x, 19) ^ R(x, 10)) #ifndef MIN #define MIN(x, y) (((x) < (y)) ? (x) : (y)) #endif /* compress 512-bits */ static int sha256_compress(struct sha256_state* md, unsigned char* buf) { unsigned long S[8], W[64], t0, t1; unsigned long t; int i; /* copy state into S */ for (i = 0; i < 8; i++) { S[i] = md->state[i]; } /* copy the state into 512-bits into W[0..15] */ for (i = 0; i < 16; i++) W[i] = WPA_GET_BE32(buf + (4 * i)); /* fill W[16..63] */ for (i = 16; i < 64; i++) { W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) + W[i - 16]; } /* Compress */ #define RND(a,b,c,d,e,f,g,h,i) \ t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \ t1 = Sigma0(a) + Maj(a, b, c); \ d += t0; \ h = t0 + t1; for (i = 0; i < 64; ++i) { RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], i); t = S[7]; S[7] = S[6]; S[6] = S[5]; S[5] = S[4]; S[4] = S[3]; S[3] = S[2]; S[2] = S[1]; S[1] = S[0]; S[0] = t; } /* feedback */ for (i = 0; i < 8; i++) { md->state[i] = md->state[i] + S[i]; } return 0; } /* Initialize the hash state */ static void SHA256_Init(struct sha256_state* md) { md->curlen = 0; md->length = 0; md->state[0] = 0x6A09E667UL; md->state[1] = 0xBB67AE85UL; md->state[2] = 0x3C6EF372UL; md->state[3] = 0xA54FF53AUL; md->state[4] = 0x510E527FUL; md->state[5] = 0x9B05688CUL; md->state[6] = 0x1F83D9ABUL; md->state[7] = 0x5BE0CD19UL; } /** Process a block of memory though the hash @param md The hash state @param in The data to hash @param inlen The length of the data (octets) @return CRYPT_OK if successful */ static int SHA256_Update(struct sha256_state* md, const unsigned char* in, unsigned long inlen) { unsigned long n; #define block_size 64 if (md->curlen > sizeof(md->buf)) return -1; while (inlen > 0) { if (md->curlen == 0 && inlen >= block_size) { if (sha256_compress(md, (unsigned char*)in) < 0) return -1; md->length += block_size * 8; in += block_size; inlen -= block_size; } else { n = MIN(inlen, (block_size - md->curlen)); memcpy(md->buf + md->curlen, in, n); md->curlen += n; in += n; inlen -= n; if (md->curlen == block_size) { if (sha256_compress(md, md->buf) < 0) return -1; md->length += 8 * block_size; md->curlen = 0; } } } return 0; } /** Terminate the hash to get the digest @param md The hash state @param out [out] The destination of the hash (32 bytes) @return CRYPT_OK if successful */ static int SHA256_Final(unsigned char* out, struct sha256_state* md) { int i; if (md->curlen >= sizeof(md->buf)) return -1; /* increase the length of the message */ md->length += md->curlen * 8; /* append the '1' bit */ md->buf[md->curlen++] = (unsigned char)0x80; /* if the length is currently above 56 bytes we append zeros * then compress. Then we can fall back to padding zeros and length * encoding like normal. */ if (md->curlen > 56) { while (md->curlen < 64) { md->buf[md->curlen++] = (unsigned char)0; } sha256_compress(md, md->buf); md->curlen = 0; } /* pad up to 56 bytes of zeroes */ while (md->curlen < 56) { md->buf[md->curlen++] = (unsigned char)0; } /* store length */ WPA_PUT_BE64(md->buf + 56, md->length); sha256_compress(md, md->buf); /* copy output */ for (i = 0; i < 8; i++) WPA_PUT_BE32(out + (4 * i), md->state[i]); return 0; } /* ===== end - public domain SHA256 implementation ===== */ void aos_HMAC_SHA256(char hmac[32], const char* key, int key_len, const char* message, int message_len) { unsigned char kopad[64], kipad[64]; int i; unsigned char digest[32]; SHA256_CTX context; if (key_len > 64) { key_len = 64; } for (i = 0; i < key_len; i++) { kopad[i] = key[i] ^ 0x5c; kipad[i] = key[i] ^ 0x36; } for (; i < 64; i++) { kopad[i] = 0 ^ 0x5c; kipad[i] = 0 ^ 0x36; } SHA256_Init(&context); SHA256_Update(&context, kipad, 64); SHA256_Update(&context, (unsigned char*)message, (unsigned int)message_len); SHA256_Final(digest, &context); SHA256_Init(&context); SHA256_Update(&context, kopad, 64); SHA256_Update(&context, digest, 32); SHA256_Final((unsigned char* )hmac, &context); } void aos_SHA256(char hash[32], const char* message, int message_len) { SHA256_CTX context; memset(hash, 0, 32); SHA256_Init(&context); SHA256_Update(&context, (const unsigned char*)message, message_len); SHA256_Final((unsigned char*)hash, &context); } ================================================ FILE: oss_c_sdk/aos_util.h ================================================ #ifndef LIBAOS_UTIL_H #define LIBAOS_UTIL_H #include "aos_buf.h" #include "aos_string.h" #include "aos_define.h" #include "aos_fstack.h" #include #include #include AOS_CPP_START int aos_parse_xml_body(aos_list_t *bc, mxml_node_t **root); void aos_gnome_sort(const char **headers, int size); int aos_convert_to_gmt_time(char* date, const char* format, apr_time_exp_t *tm); int aos_get_gmt_str_time(char datestr[AOS_MAX_GMT_TIME_LEN]); int aos_convert_to_iso8601_time(char* date, const char* format, apr_time_exp_t* tm); int aos_get_iso8601_str_time(char datestr[AOS_MAX_GMT_TIME_LEN]); int aos_get_iso8601_str_time_ex(char datestr[AOS_MAX_GMT_TIME_LEN], apr_time_t now); int aos_get_gmt_time_date(const char *gmt, char datestr[AOS_MAX_SHORT_TIME_LEN]); /** * URL-encodes a string from [src] into [dest]. [dest] must have at least * 3x the number of characters that [source] has. At most [maxSrcSize] bytes * from [src] are encoded; if more are present in [src], 0 is returned from * urlEncode, else nonzero is returned. * if slash not 0, don't change / to %2F */ int aos_url_encode(char *dest, const char *src, int maxSrcSize); int aos_url_encode_ex(char *dest, const char *src, int maxSrcSize, int slash); /** * Convert binary data to a hex encoding. */ int aos_encode_hex(char* dest, const void* src, int srclen, int* len); const char* aos_http_method_to_string(http_method_e method); /** * encode query string, check query args < AOS_MAX_QUERY_ARG_LEN * result string "?a&b=x" */ int aos_query_params_to_string(aos_pool_t *p, aos_table_t *query_params, aos_string_t *querystr); /** * base64 encode bytes. The output buffer must have at least * ((4 * (inLen + 1)) / 3) bytes in it. Returns the number of bytes written * to [out]. */ int aos_base64_encode(const unsigned char *in, int inLen, char *out); /** * Compute HMAC-SHA-1 with key [key] and message [message], storing result * in [hmac] */ void HMAC_SHA1(unsigned char hmac[20], const unsigned char *key, int key_len, const unsigned char *message, int message_len); unsigned char* aos_md5(aos_pool_t* pool, const char* in, apr_size_t in_len); int aos_url_decode(const char *in, char *out); /* * Convert a string to a long long integer. * * Ignores `locale' stuff. Assumes that the upper and lower case * alphabets and digits are each contiguous. */ long long aos_strtoll(const char *nptr, char **endptr, int base); /* * @brief Convert a string to int64_t. **/ int64_t aos_atoi64(const char *nptr); /* * @brief Convert a string to an unsigned long long integer. * * Ignores `locale' stuff. Assumes that the upper and lower case * alphabets and digits are each contiguous. **/ unsigned long long aos_strtoull(const char *nptr, char **endptr, int base); /* * @brief Convert a string to uint64_t. **/ uint64_t aos_atoui64(const char *nptr); void aos_HMAC_SHA256(char hmac[32], const char* key, int key_len, const char* message, int message_len); void aos_SHA256(char hash[32], const char* message, int message_len); AOS_CPP_END #endif ================================================ FILE: oss_c_sdk/oss_api.h ================================================ #ifndef LIBOSS_API_H #define LIBOSS_API_H #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_define.h" #include "oss_util.h" OSS_CPP_START /* * @brief create oss bucket * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] oss_acl the oss bucket acl * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_create_bucket(const oss_request_options_t *options, const aos_string_t *bucket, oss_acl_e oss_acl, aos_table_t **resp_headers); /* * @brief create oss bucket with storage class * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] oss_acl the oss bucket acl * @param[in] storage_class the oss bucket storage_class * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_create_bucket_with_storage_class(const oss_request_options_t *options, const aos_string_t *bucket, oss_acl_e oss_acl, oss_storage_class_type_e storage_class, aos_table_t **resp_headers); /* * @brief delete oss bucket * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_delete_bucket(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers); /* * @brief put oss bucket acl * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] oss_acl the oss bucket acl * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_bucket_acl(const oss_request_options_t *options, const aos_string_t *bucket, oss_acl_e oss_acl, aos_table_t **resp_headers); /* * @brief get oss bucket acl * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] oss_acl the oss bucket acl * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_bucket_acl(const oss_request_options_t *options, const aos_string_t *bucket, aos_string_t *oss_acl, aos_table_t **resp_headers); /* * @brief head oss bucket * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_head_bucket(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers); /* * @brief get oss bucket location * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] oss_location the oss bucket location * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_bucket_location(const oss_request_options_t *options, const aos_string_t *bucket, aos_string_t *oss_location, aos_table_t **resp_headers); /* * @brief get oss bucket info * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] bucket_info the oss bucket info * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_bucket_info(const oss_request_options_t *options, const aos_string_t *bucket, oss_bucket_info_t *bucket_info, aos_table_t **resp_headers); /* * @brief get oss bucket stat * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] bucket_stat the oss bucket stat * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_bucket_stat(const oss_request_options_t *options, const aos_string_t *bucket, oss_bucket_stat_t *bucket_stat, aos_table_t **resp_headers); /* * @brief get oss bucket cors * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] rule_list the oss bucket cors rule list * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_bucket_cors(const oss_request_options_t *options, const aos_string_t *bucket, aos_list_t *rule_list, aos_table_t **resp_headers); /* * @brief delete oss bucket cors * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_delete_bucket_cors(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers); /* * @brief get oss bucket referer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] referer_config the oss bucket referer config * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_bucket_referer(const oss_request_options_t *options, const aos_string_t *bucket, oss_referer_config_t *referer_config, aos_table_t **resp_headers); /* * @brief put oss bucket storage capacity * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] storage_capacity the oss bucket storage capacity, unit gigabyte * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_bucket_storage_capacity(const oss_request_options_t *options, const aos_string_t *bucket, long storage_capacity, aos_table_t **resp_headers); /* * @brief get oss bucket storage capacity * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] storage_capacity the oss bucket storage capacity * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_bucket_storage_capacity(const oss_request_options_t *options, const aos_string_t *bucket, long *storage_capacity, aos_table_t **resp_headers); /* * @brief put oss bucket lifecycle * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] lifecycle_rule_list the oss bucket lifecycle list * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_bucket_lifecycle(const oss_request_options_t *options, const aos_string_t *bucket, aos_list_t *lifecycle_rule_list, aos_table_t **resp_headers); /* * @brief put oss bucket referer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] referer_config the oss bucket referer_config * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_bucket_referer(const oss_request_options_t *options, const aos_string_t *bucket, oss_referer_config_t *referer_config, aos_table_t **resp_headers); /* * @brief put oss bucket cors * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] rule_list the oss bucket ocor rule list * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_bucket_cors(const oss_request_options_t *options, const aos_string_t *bucket, aos_list_t *rule_list, aos_table_t **resp_headers); /* * @brief put oss bucket website * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] website_config the oss bucket website config * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_bucket_website(const oss_request_options_t *options, const aos_string_t *bucket, oss_website_config_t *website_config, aos_table_t **resp_headers); /* * @brief get oss bucket website * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] website_config the oss bucket website config * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_bucket_website(const oss_request_options_t *options, const aos_string_t *bucket, oss_website_config_t *website_config, aos_table_t **resp_headers); /* * @brief delete oss bucket website * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_delete_bucket_website(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers); /* * @brief put oss bucket logging * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] content the oss bucket logging content rule * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_bucket_logging(const oss_request_options_t *options, const aos_string_t *bucket, oss_logging_config_content_t *content, aos_table_t **resp_headers); /* * @brief get oss bucket logging * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] content the oss bucket logging content rule * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_bucket_logging(const oss_request_options_t *options, const aos_string_t *bucket, oss_logging_config_content_t *logging_content, aos_table_t **resp_headers); /* * @brief delete oss bucket logging * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_delete_bucket_logging(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers); /* * @brief get oss bucket lifecycle * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] lifecycle_rule_list the oss bucket lifecycle list * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_bucket_lifecycle(const oss_request_options_t *options, const aos_string_t *bucket, aos_list_t *lifecycle_rule_list, aos_table_t **resp_headers); /* * @brief delete oss bucket lifecycle * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_delete_bucket_lifecycle(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers); /* * @brief list oss objects * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] params input params for list object request, including prefix, marker, delimiter, max_ret * @param[out] params output params for list object response, including truncated, next_marker, obje list * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_list_object(const oss_request_options_t *options, const aos_string_t *bucket, oss_list_object_params_t *params, aos_table_t **resp_headers); /* * @brief list oss buckets * @param[in] options the oss request options * @param[in] params input params for list bucket request, including prefix, marker, max_keys * @param[out] params output params for list bucket response, including truncated, next_marker, bucket list * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_list_bucket(const oss_request_options_t *options, oss_list_buckets_params_t *params, aos_table_t **resp_headers); /* * @brief put oss object from buffer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] buffer the buffer containing object content * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_object_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_list_t *buffer, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief put oss object from file * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] filename the filename to put * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_object_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *filename, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief put oss object from buffer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] buffer the buffer containing object content * @param[in] headers the headers for request * @param[in] params the params for request * @param[in] progress_callback the progress callback function * @param[out] resp_headers oss server response headers * @param[out] resp_body oss server response body * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_put_object_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_list_t *buffer, aos_table_t *headers, aos_table_t *params, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body); /* * @brief put oss object from file * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] filename the filename to put * @param[in] headers the headers for request * @param[in] params the params for request * @param[in] progress_callback the progress callback function * @param[out] resp_headers oss server response headers * @param[out] resp_body oss server response body * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_put_object_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *filename, aos_table_t *headers, aos_table_t *params, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body); /* * @brief get oss object to buffer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] headers the headers for request * @param[in] params the params for request * @param[out] buffer the buffer containing object content * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_object_to_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t *params, aos_list_t *buffer, aos_table_t **resp_headers); /* * @brief restore oss object from archive bucket * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_restore_object(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief restore oss object from cold archive bucket * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] tier the mode of restoring an object * @param[in] day the day of staying in retrievable state * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_restore_object_with_tier(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, oss_tier_type_e tier, int day, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief get oss object to buffer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] headers the headers for request * @param[in] params the params for request * @param[in] progress_callback the progress callback function * @param[out] buffer the buffer containing object content * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_get_object_to_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t *params, aos_list_t *buffer, oss_progress_callback progress_callback, aos_table_t **resp_headers); /* * @brief get oss object to file * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] headers the headers for request * @param[in] params the params for request * @param[in] filename the filename storing object content * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_object_to_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t *params, aos_string_t *filename, aos_table_t **resp_headers); /* * @brief get oss object to file * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] headers the headers for request * @param[in] params the params for request * @param[in] filename the filename storing object content * @param[in] progress_callback the progress callback function * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_get_object_to_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t *params, aos_string_t *filename, oss_progress_callback progress_callback, aos_table_t **resp_headers); /* * @brief head oss object * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers containing object meta * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_head_object(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief get object meta * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[out] resp_headers oss server response headers containing object meta * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_object_meta(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t **resp_headers); /* * @brief put object acl * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] oss_acl the oss object ACL * @param[out] resp_headers oss server response headers containing object meta * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_object_acl(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, oss_acl_e oss_acl, aos_table_t **resp_headers); /* * @brief put object acl * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[out] oss_acl the oss object ACL * @param[out] resp_headers oss server response headers containing object meta * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_object_acl(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_string_t *oss_acl, aos_table_t **resp_headers); /* * @brief put symlink oss object * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] sym_object the oss symlink object name * @param[in] target_object the oss target object game * @param[out] resp_headers oss server response headers containing object meta * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_symlink(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *sym_object, const aos_string_t *target_object, aos_table_t **resp_headers); /* * @brief put symlink oss object * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] sym_object the oss symlink object name * @param[in] target_object the oss target object game * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers containing object meta * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_put_symlink(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *sym_object, const aos_string_t *target_object, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief get symlink oss object * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] sym_object the oss symlink object name * @param[out] resp_headers oss server response headers containing object meta * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_symlink(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *sym_object, aos_table_t **resp_headers); /* * @brief delete oss object * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_delete_object(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t **resp_headers); /* * @brief delete oss objects * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object_list the oss object list name * @param[in] is_quiet is quiet or verbose * @param[out] resp_headers oss server response headers * @param[out] deleted_object_list deleted object list * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_delete_objects(const oss_request_options_t *options, const aos_string_t *bucket, aos_list_t *object_list, int is_quiet, aos_table_t **resp_headers, aos_list_t *deleted_object_list); /* * @brief delete oss objects by prefix * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] prefix prefix of delete objects * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_delete_objects_by_prefix(oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *prefix); /* * @brief copy oss objects * @param[in] options the oss request options * @param[in] source_bucket the oss source bucket name * @param[in] object_list the oss source object list name * @param[in] dest_bucket the oss dest bucket name * @param[in] dest_list the oss dest object list name * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_copy_object(const oss_request_options_t *options, const aos_string_t *source_bucket, const aos_string_t *source_object, const aos_string_t *dest_bucket, const aos_string_t *dest_object, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief append oss object from buffer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] position the start position append * @param[in] buffer the buffer containing object content * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_append_object_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, int64_t position, aos_list_t *buffer, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief append oss object from buffer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] position the start position append * @param[in] init_crc the initial crc value * @param[in] buffer the buffer containing object content * @param[in] headers the headers for request * @param[in] params the params for request * @param[in] progress_callback the progress callback function * @param[out] resp_headers oss server response headers * @param[out] resp_body oss server response body * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_append_object_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, int64_t position, uint64_t init_crc, aos_list_t *buffer, aos_table_t *headers, aos_table_t *params, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body); /* * @brief append oss object from file * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] position the start position append * @param[in] append_file the file containing appending content * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_append_object_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, int64_t position, const aos_string_t *append_file, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief append oss object from file * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] position the start position append * @param[in] init_crc the initial crc value * @param[in] append_file the file containing appending content * @param[in] headers the headers for request * @param[in] params the params for request * @param[in] progress_callback the progress callback function * @param[out] resp_headers oss server response headers * @param[out] resp_body oss server response body * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_append_object_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, int64_t position, uint64_t init_crc, const aos_string_t *append_file, aos_table_t *headers, aos_table_t *params, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body); /* * @brief gen signed url for oss object api * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] expires the end expire time for signed url * @param[in] req the aos http request * @return signed url, non-NULL success, NULL failure */ char *oss_gen_signed_url(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, int64_t expires, aos_http_request_t *req); /* * @brief oss put object from buffer using signed url * @param[in] options the oss request options * @param[in] signed_url the signed url for put object * @param[in] buffer the buffer containing object content * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_object_from_buffer_by_url(const oss_request_options_t *options, const aos_string_t *signed_url, aos_list_t *buffer, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief oss put object from file using signed url * @param[in] options the oss request options * @param[in] signed_url the signed url for put object * @param[in] filename the filename containing object content * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_object_from_file_by_url(const oss_request_options_t *options, const aos_string_t *signed_url, aos_string_t *filename, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief oss get object to buffer using signed url * @param[in] options the oss request options * @param[in] signed_url the signed url for put object * @param[in] buffer the buffer containing object content * @param[in] headers the headers for request * @param[in] params the params for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_object_to_buffer_by_url(const oss_request_options_t *options, const aos_string_t *signed_url, aos_table_t *headers, aos_table_t *params, aos_list_t *buffer, aos_table_t **resp_headers); /* * @brief oss get object to file using signed url * @param[in] options the oss request options * @param[in] signed_url the signed url for put object * @param[in] headers the headers for request * @param[in] params the params for request * @param[in] filename the filename containing object content * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_object_to_file_by_url(const oss_request_options_t *options, const aos_string_t *signed_url, aos_table_t *headers, aos_table_t *params, aos_string_t *filename, aos_table_t **resp_headers); /* * @brief oss head object using signed url * @param[in] options the oss request options * @param[in] signed_url the signed url for put object * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_head_object_by_url(const oss_request_options_t *options, const aos_string_t *signed_url, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief oss get object meta using signed url * @param[in] options the oss request options * @param[in] signed_url the signed url for put object * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_object_meta_by_url(const oss_request_options_t *options, const aos_string_t *signed_url, aos_table_t **resp_headers); /* * @brief oss init multipart upload * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] upload_id the upload id to upload if has * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_init_multipart_upload(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_string_t *upload_id, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief oss upload part from buffer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] upload_id the upload id to upload if has * @param[in] part_num the upload part number * @param[in] buffer the buffer containing upload part content * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_upload_part_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, int part_num, aos_list_t *buffer, aos_table_t **resp_headers); /* * @brief oss upload part from buffer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] upload_id the upload id to upload if has * @param[in] part_num the upload part number * @param[in] buffer the buffer containing upload part content * @param[in] progress_callback the progress callback function * @param[in] headers the headers for request * @param[in] params the params for request * @param[out] resp_headers oss server response headers * @param[out] resp_body oss server response body * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_upload_part_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, int part_num, aos_list_t *buffer, oss_progress_callback progress_callback, aos_table_t *headers, aos_table_t *params, aos_table_t **resp_headers, aos_list_t *resp_body); /* * @brief oss upload part from file * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] upload_id the upload id to upload if has * @param[in] part_num the upload part number * @param[in] upload_file the file containing upload part content * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_upload_part_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, int part_num, oss_upload_file_t *upload_file, aos_table_t **resp_headers); /* * @brief oss upload part from file * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] upload_id the upload id to upload if has * @param[in] part_num the upload part number * @param[in] upload_file the file containing upload part content * @param[in] progress_callback the progress callback function * @param[in] headers the headers for request * @param[in] params the params for request * @param[out] resp_headers oss server response headers * @param[out] resp_body oss server response body * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_upload_part_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, int part_num, oss_upload_file_t *upload_file, oss_progress_callback progress_callback, aos_table_t *headers, aos_table_t *params, aos_table_t **resp_headers, aos_list_t *resp_body); /* * @brief oss abort multipart upload * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] upload_id the upload id to upload if has * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_abort_multipart_upload(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_string_t *upload_id, aos_table_t **resp_headers); /* * @brief oss complete multipart upload * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] upload_id the upload id to upload if has * @param[in] part_list the uploaded part list to complete * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_complete_multipart_upload(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, aos_list_t *part_list, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief oss complete multipart upload * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] upload_id the upload id to upload if has * @param[in] part_list the uploaded part list to complete * @param[in] headers the headers for request * @param[in] params the params for request * @param[out] resp_headers oss server response headers * @param[out] resp_body oss server response body * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_complete_multipart_upload(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, aos_list_t *part_list, aos_table_t *headers, aos_table_t *params, aos_table_t **resp_headers, aos_list_t *resp_body); /* * @brief oss list upload part with specific upload_id for object * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] upload_id the upload id to upload if has * @param[in] params the input list upload part parameters, incluing part_number_marker, max_ret * @param[out] params the output params, including next_part_number_marker, part_list, truncated * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_list_upload_part(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, oss_list_upload_part_params_t *params, aos_table_t **resp_headers); /* * @brief oss list multipart upload for bucket * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] params the input list multipart upload parameters * @param[out] params the output params including next_key_marker, next_upload_id_markert, upload_list etc * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_list_multipart_upload(const oss_request_options_t *options, const aos_string_t *bucket, oss_list_multipart_upload_params_t *params, aos_table_t **resp_headers); /* * @brief oss copy large object using upload part copy * @param[in] options the oss request options * @param[in] paramsthe upload part copy parameters * @param[in] headers the headers for request * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_upload_part_copy(const oss_request_options_t *options, oss_upload_part_copy_params_t *params, aos_table_t *headers, aos_table_t **resp_headers); /* * @brief oss upload file using multipart upload * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] upload_id the upload id to upload if has * @param[in] filename the filename containing object content * @param[in] part_size the part size for multipart upload * @param[in] headers the headers for request * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_upload_file(oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_string_t *upload_id, aos_string_t *filename, int64_t part_size, aos_table_t *headers); /* * @brief oss upload file with mulit-thread and resumable * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] filepath the filename containing object content * @param[in] headers the headers for request * @param[in] params the params for request * @param[in] clt_params the control params of upload * @param[in] progress_callback the progress callback function * @param[out] resp_headers oss server response headers * @param[out] resp_body oss server response body * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_resumable_upload_file(oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_table_t *headers, aos_table_t *params, oss_resumable_clt_params_t *clt_params, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body); /* * @brief oss upload file with mulit-thread and resumable * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] filepath download object to the file * @param[in] headers the headers for request * @param[in] params the params for request * @param[in] clt_params the control params of upload * @param[in] progress_callback the progress callback function * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_resumable_download_file(oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_table_t *headers, aos_table_t *params, oss_resumable_clt_params_t *clt_params, oss_progress_callback progress_callback, aos_table_t **resp_headers); /* * @brief oss create live channel * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] config the oss live channel configuration * @param[in] publish_url_list the publish url list * @param[in] play_url_list the play url list * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_create_live_channel(const oss_request_options_t *options, const aos_string_t *bucket, oss_live_channel_configuration_t *config, aos_list_t *publish_url_list, aos_list_t *play_url_list, aos_table_t **resp_headers); /* * @brief oss set live channel status * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] live_channel the oss live channel name * @param[in] live_channel_status the oss live channel status, enabled or disabled * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_live_channel_status(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, const aos_string_t *live_channel_status, aos_table_t **resp_headers); /* * @brief oss get live channel information * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] live_channel the oss live channel name * @param[out] info the oss live channel information * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_live_channel_info(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, oss_live_channel_configuration_t *info, aos_table_t **resp_headers); /* * @brief oss get live channel stat * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] live_channel the oss live channel name * @param[out] stat the oss live channel stat * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_live_channel_stat(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, oss_live_channel_stat_t *stat, aos_table_t **resp_headers); /* * @brief delete oss live channel * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] live_channel the oss live channel name * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_delete_live_channel(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, aos_table_t **resp_headers); /* * @brief list oss live channels * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] params input params for list live channel request, including prefix, marker, max_key * @param[out] params output params for list object response, including truncated, next_marker, live channel list * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_list_live_channel(const oss_request_options_t *options, const aos_string_t *bucket, oss_list_live_channel_params_t *params, aos_table_t **resp_headers); /* * @brief oss get live record history of live channel * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] live_channel the oss live channel name * @param[out] live_record_list the oss live records of live channel * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_live_channel_history(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, aos_list_t *live_record_list, aos_table_t **resp_headers); /* * @brief generate vod play list for a period of time * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] live_channel the oss live channel name * @param[in] play_list_name the oss live channel play list name * @param[in] start_time the start epoch time of play list, such as 1459922368 * @param[in] end_time the end epoch time of play list, such as 1459922563 * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_gen_vod_play_list(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, const aos_string_t *play_list_name, const int64_t start_time, const int64_t end_time, aos_table_t **resp_headers); /* * @brief gen signed url for put rtmp stream * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] live_channel the oss live channel name * @param[in] play_list_name the oss live channel play list name * @param[in] expires the end expire time for signed url * @return signed url, non-NULL success, NULL failure */ char *oss_gen_rtmp_signed_url(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, const aos_string_t *play_list_name, const int64_t expires); /* * @brief select oss object to buffer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] expression sql select expression * @param[in] select_params select object parameters * @param[out] buffer the buffer containing object content * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_select_object_to_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *expression, oss_select_object_params_t *select_params, aos_list_t *buffer, aos_table_t **resp_headers); /* * @brief select oss object to buffer * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] expression sql select expression * @param[in] select_params select object parameters * @param[in] headers the headers for request * @param[in] params the params for request * @param[out] buffer the buffer containing object content * @param[in] progress_callback the progress callback function * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_select_object_to_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *expression, oss_select_object_params_t *select_params, aos_table_t *headers, aos_table_t *params, aos_list_t *buffer, oss_progress_callback progress_callback, aos_table_t **resp_headers); /* * @brief select oss object to file * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] expression sql select expression * @param[in] select_params select object parameters * @param[in] filename the filename storing object content * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_select_object_to_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *expression, oss_select_object_params_t *select_params, aos_string_t *filename, aos_table_t **resp_headers); /* * @brief select oss object to file * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] expression sql select expression * @param[in] select_params select object parameters * @param[in] headers the headers for request * @param[in] params the params for request * @param[in] filename the filename storing object content * @param[in] progress_callback the progress callback function * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_do_select_object_to_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *expression, oss_select_object_params_t *select_params, aos_table_t *headers, aos_table_t *params, aos_string_t *filename, oss_progress_callback progress_callback, aos_table_t **resp_headers); /* * @brief create select oss object meta * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[in] meta_params create select object meta parameters * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_create_select_object_meta(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, oss_select_object_meta_params_t *meta_params, aos_table_t **resp_headers); /* * @brief put oss object tagging * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[out] tag_list the oss object tag list * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_put_object_tagging(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_list_t *tag_list, aos_table_t **resp_headers); /* * @brief get oss object tagging * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[out] tag_list the oss object tag list * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_get_object_tagging(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_list_t *tag_list, aos_table_t **resp_headers); /* * @brief delete oss object tagging * @param[in] options the oss request options * @param[in] bucket the oss bucket name * @param[in] object the oss object name * @param[out] resp_headers oss server response headers * @return aos_status_t, code is 2xx success, other failure */ aos_status_t *oss_delete_object_tagging(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t **resp_headers); OSS_CPP_END #endif ================================================ FILE: oss_c_sdk/oss_auth.c ================================================ #include "oss_auth.h" #include "aos_log.h" #include "oss_util.h" static const char *g_s_oss_sub_resource_list[] = { "acl", "location", "bucketInfo", "stat", "referer", "cors", "website", "restore", "logging", "symlink", "qos", "uploadId", "uploads", "partNumber", "response-content-type", "response-content-language", "response-expires", "response-cache-control", "response-content-disposition", "response-content-encoding", "append", "position", "lifecycle", "delete", "live", "status", "comp", "vod", "startTime", "endTime", "x-oss-process", "security-token", "objectMeta", "tagging", "x-oss-sign-origin-only", NULL, }; static int is_oss_sub_resource(const char *str); static int is_oss_canonicalized_header(const char *str); static int oss_get_canonicalized_headers(aos_pool_t *p, const aos_table_t *headers, aos_buf_t *signbuf); static int oss_get_canonicalized_resource(aos_pool_t *p, const aos_table_t *params, aos_buf_t *signbuf); static int oss_get_canonicalized_params(aos_pool_t *p, const aos_table_t *params, aos_buf_t *signbuf); static int oss_sign_request_v4(aos_http_request_t *req, const oss_config_t *config); static int get_oss_request_signature_v4(const oss_request_options_t *options, aos_http_request_t *req, const aos_string_t *expires, aos_string_t *signature); static int is_oss_sub_resource(const char *str) { int i = 0; for ( ; g_s_oss_sub_resource_list[i]; i++) { if (apr_strnatcmp(g_s_oss_sub_resource_list[i], str) == 0) { return 1; } } return 0; } static int is_oss_canonicalized_header(const char *str) { size_t len = strlen(OSS_CANNONICALIZED_HEADER_PREFIX); return strncasecmp(str, OSS_CANNONICALIZED_HEADER_PREFIX, len) == 0; } static int oss_get_canonicalized_headers(aos_pool_t *p, const aos_table_t *headers, aos_buf_t *signbuf) { int pos; int meta_count = 0; int i; int len; const aos_array_header_t *tarr; const aos_table_entry_t *telts; char **meta_headers; const char *value; aos_string_t tmp_str; char *tmpbuf = (char*)malloc(AOS_MAX_HEADER_LEN + 1); if (NULL == tmpbuf) { aos_error_log("malloc %d memory failed.", AOS_MAX_HEADER_LEN + 1); return AOSE_OVER_MEMORY; } if (apr_is_empty_table(headers)) { free(tmpbuf); return AOSE_OK; } // sort user meta header tarr = aos_table_elts(headers); telts = (aos_table_entry_t*)tarr->elts; meta_headers = aos_pcalloc(p, tarr->nelts * sizeof(char*)); for (pos = 0; pos < tarr->nelts; ++pos) { if (is_oss_canonicalized_header(telts[pos].key)) { aos_string_t key = aos_string(telts[pos].key); aos_string_tolower(&key); meta_headers[meta_count++] = key.data; } } if (meta_count == 0) { free(tmpbuf); return AOSE_OK; } aos_gnome_sort((const char **)meta_headers, meta_count); // sign string for (i = 0; i < meta_count; ++i) { value = apr_table_get(headers, meta_headers[i]); aos_str_set(&tmp_str, value); aos_strip_space(&tmp_str); len = apr_snprintf(tmpbuf, AOS_MAX_HEADER_LEN + 1, "%s:%.*s", meta_headers[i], tmp_str.len, tmp_str.data); if (len > AOS_MAX_HEADER_LEN) { free(tmpbuf); aos_error_log("user meta header too many, %d > %d.", len, AOS_MAX_HEADER_LEN); return AOSE_INVALID_ARGUMENT; } tmp_str.data = tmpbuf; tmp_str.len = len; aos_buf_append_string(p, signbuf, tmpbuf, len); aos_buf_append_string(p, signbuf, "\n", sizeof("\n")-1); } free(tmpbuf); return AOSE_OK; } static int oss_get_canonicalized_resource(aos_pool_t *p, const aos_table_t *params, aos_buf_t *signbuf) { int pos; int subres_count = 0; int i; int len; char sep; const char *value; char tmpbuf[AOS_MAX_QUERY_ARG_LEN+1]; char **subres_headers; const aos_array_header_t *tarr; const aos_table_entry_t *telts; if (apr_is_empty_table(params)) { return AOSE_OK; } // sort sub resource param tarr = aos_table_elts(params); telts = (aos_table_entry_t*)tarr->elts; subres_headers = aos_pcalloc(p, tarr->nelts * sizeof(char*)); for (pos = 0; pos < tarr->nelts; ++pos) { if (is_oss_sub_resource(telts[pos].key)) { subres_headers[subres_count++] = telts[pos].key; } } if (subres_count == 0) { return AOSE_OK; } aos_gnome_sort((const char **)subres_headers, subres_count); // sign string sep = '?'; for (i = 0; i < subres_count; ++i) { value = apr_table_get(params, subres_headers[i]); if (value != NULL && *value != '\0') { len = apr_snprintf(tmpbuf, sizeof(tmpbuf), "%c%s=%s", sep, subres_headers[i], value); } else { len = apr_snprintf(tmpbuf, sizeof(tmpbuf), "%c%s", sep, subres_headers[i]); } if (len >= AOS_MAX_QUERY_ARG_LEN) { aos_error_log("http query params too long, %s.", tmpbuf); return AOSE_INVALID_ARGUMENT; } aos_buf_append_string(p, signbuf, tmpbuf, len); sep = '&'; } return AOSE_OK; } int oss_get_string_to_sign(aos_pool_t *p, http_method_e method, const aos_string_t *canon_res, const aos_table_t *headers, const aos_table_t *params, aos_string_t *signstr) { int res; aos_buf_t *signbuf; const char *value; aos_str_null(signstr); signbuf = aos_create_buf(p, 1024); #define signbuf_append_from_headers(KEY) do { \ if ((value = apr_table_get(headers, KEY)) != NULL) { \ aos_buf_append_string(p, signbuf, value, strlen(value)); \ } \ aos_buf_append_string(p, signbuf, "\n", sizeof("\n")-1); \ } while (0) #define signbuf_append(VALUE, LEN) do { \ aos_buf_append_string(p, signbuf, VALUE, LEN); \ aos_buf_append_string(p, signbuf, "\n", sizeof("\n")-1); \ } while (0) value = aos_http_method_to_string(method); signbuf_append(value, strlen(value)); signbuf_append_from_headers(OSS_CONTENT_MD5); signbuf_append_from_headers(OSS_CONTENT_TYPE); // date if ((value = apr_table_get(headers, OSS_CANNONICALIZED_HEADER_DATE)) == NULL) { value = apr_table_get(headers, OSS_DATE); } if (NULL == value || *value == '\0') { aos_error_log("http header date is empty."); return AOSE_INVALID_ARGUMENT; } signbuf_append(value, strlen(value)); // user meta headers if ((res = oss_get_canonicalized_headers(p, headers, signbuf)) != AOSE_OK) { return res; } // canonicalized resource aos_buf_append_string(p, signbuf, canon_res->data, canon_res->len); if (params != NULL && (res = oss_get_canonicalized_resource(p, params, signbuf)) != AOSE_OK) { return res; } // result signstr->data = (char *)signbuf->pos; signstr->len = aos_buf_size(signbuf); return AOSE_OK; } void oss_sign_headers(aos_pool_t *p, const aos_string_t *signstr, const aos_string_t *access_key_id, const aos_string_t *access_key_secret, aos_table_t *headers) { int b64Len; char *value; unsigned char hmac[20]; char b64[((20 + 1) * 4) / 3]; HMAC_SHA1(hmac, (unsigned char *)access_key_secret->data, access_key_secret->len, (unsigned char *)signstr->data, signstr->len); // Now base-64 encode the results b64Len = aos_base64_encode(hmac, 20, b64); value = apr_psprintf(p, "OSS %.*s:%.*s", access_key_id->len, access_key_id->data, b64Len, b64); apr_table_addn(headers, OSS_AUTHORIZATION, value); return; } int oss_get_signed_headers(aos_pool_t *p, const aos_string_t *access_key_id, const aos_string_t *access_key_secret, const aos_string_t* canon_res, aos_http_request_t *req) { int res; aos_string_t signstr; res = oss_get_string_to_sign(p, req->method, canon_res, req->headers, req->query_params, &signstr); if (res != AOSE_OK) { return res; } aos_debug_log("signstr:%.*s.", signstr.len, signstr.data); oss_sign_headers(p, &signstr, access_key_id, access_key_secret, req->headers); return AOSE_OK; } int oss_sign_request(aos_http_request_t *req, const oss_config_t *config) { aos_string_t canon_res; char canon_buf[AOS_MAX_URI_LEN]; char datestr[AOS_MAX_GMT_TIME_LEN]; const char *value; int res = AOSE_OK; int len = 0; if (config->signature_version == 4) { return oss_sign_request_v4(req, config); } canon_res.data = canon_buf; if (req->resource != NULL) { len = strlen(req->resource); if (len >= AOS_MAX_URI_LEN - 1) { aos_error_log("http resource too long, %s.", req->resource); return AOSE_INVALID_ARGUMENT; } canon_res.len = apr_snprintf(canon_buf, sizeof(canon_buf), "/%s", req->resource); } else { canon_res.len = apr_snprintf(canon_buf, sizeof(canon_buf), "/"); } if ((value = apr_table_get(req->headers, OSS_CANNONICALIZED_HEADER_DATE)) == NULL) { aos_get_gmt_str_time(datestr); apr_table_set(req->headers, OSS_DATE, datestr); } res = oss_get_signed_headers(req->pool, &config->access_key_id, &config->access_key_secret, &canon_res, req); return res; } int get_oss_request_signature(const oss_request_options_t *options, aos_http_request_t *req, const aos_string_t *expires, aos_string_t *signature) { aos_string_t canon_res; char canon_buf[AOS_MAX_URI_LEN]; const char *value; aos_string_t signstr; int res = AOSE_OK; int b64Len; unsigned char hmac[20]; char b64[((20 + 1) * 4) / 3]; canon_res.data = canon_buf; canon_res.len = apr_snprintf(canon_buf, sizeof(canon_buf), "/%s", req->resource); apr_table_set(req->headers, OSS_DATE, expires->data); if ((res = oss_get_string_to_sign(options->pool, req->method, &canon_res, req->headers, req->query_params, &signstr))!= AOSE_OK) { return res; } HMAC_SHA1(hmac, (unsigned char *)options->config->access_key_secret.data, options->config->access_key_secret.len, (unsigned char *)signstr.data, signstr.len); b64Len = aos_base64_encode(hmac, 20, b64); value = apr_psprintf(options->pool, "%.*s", b64Len, b64); aos_str_set(signature, value); return res; } int oss_get_signed_url(const oss_request_options_t *options, aos_http_request_t *req, const aos_string_t *expires, aos_string_t *signed_url) { char *signed_url_str; aos_string_t querystr; char uristr[3*AOS_MAX_URI_LEN+1]; int res = AOSE_OK; aos_string_t signature; const char *proto; if (options->config->signature_version == 4) { if (options->config->sts_token.data != NULL) { apr_table_set(req->query_params, OSS_SECURITY_TOKEN_V4, options->config->sts_token.data); } res = get_oss_request_signature_v4(options, req, expires, &signature); if (res != AOSE_OK) { return res; } apr_table_set(req->query_params, OSS_SIGNATURE_V4, signature.data); } else { if (options->config->sts_token.data != NULL) { apr_table_set(req->query_params, OSS_SECURITY_TOKEN, options->config->sts_token.data); } res = get_oss_request_signature(options, req, expires, &signature); if (res != AOSE_OK) { return res; } apr_table_set(req->query_params, OSS_ACCESSKEYID, options->config->access_key_id.data); apr_table_set(req->query_params, OSS_EXPIRES, expires->data); apr_table_set(req->query_params, OSS_SIGNATURE, signature.data); } uristr[0] = '\0'; aos_str_null(&querystr); res = aos_url_encode_ex(uristr, req->uri, AOS_MAX_URI_LEN, req->normalize_url); if (res != AOSE_OK) { return res; } res = aos_query_params_to_string(options->pool, req->query_params, &querystr); if (res != AOSE_OK) { return res; } proto = strlen(req->proto) != 0 ? req->proto : AOS_HTTP_PREFIX; signed_url_str = apr_psprintf(options->pool, "%s%s/%s%.*s", proto, req->host, uristr, querystr.len, querystr.data); aos_str_set(signed_url, signed_url_str); return res; } int oss_get_rtmp_signed_url(const oss_request_options_t *options, aos_http_request_t *req, const aos_string_t *expires, const aos_string_t *play_list_name, aos_table_t *params, aos_string_t *signed_url) { char *signed_url_str; aos_string_t querystr; char uristr[3*AOS_MAX_URI_LEN+1]; int res = AOSE_OK; aos_string_t signature; int pos = 0; const aos_array_header_t *tarr; const aos_table_entry_t *telts; if (NULL != params) { tarr = aos_table_elts(params); telts = (aos_table_entry_t*)tarr->elts; for (pos = 0; pos < tarr->nelts; ++pos) { apr_table_set(req->query_params, telts[pos].key, telts[pos].val); } } apr_table_set(req->query_params, OSS_PLAY_LIST_NAME, play_list_name->data); res = get_oss_rtmp_request_signature(options, req, expires,&signature); if (res != AOSE_OK) { return res; } apr_table_set(req->query_params, OSS_ACCESSKEYID, options->config->access_key_id.data); apr_table_set(req->query_params, OSS_EXPIRES, expires->data); apr_table_set(req->query_params, OSS_SIGNATURE, signature.data); uristr[0] = '\0'; aos_str_null(&querystr); res = aos_url_encode(uristr, req->uri, AOS_MAX_URI_LEN); if (res != AOSE_OK) { return res; } res = aos_query_params_to_string(options->pool, req->query_params, &querystr); if (res != AOSE_OK) { return res; } signed_url_str = apr_psprintf(options->pool, "%s%s/%s%.*s", req->proto, req->host, uristr, querystr.len, querystr.data); aos_str_set(signed_url, signed_url_str); return res; } int get_oss_rtmp_request_signature(const oss_request_options_t *options, aos_http_request_t *req, const aos_string_t *expires, aos_string_t *signature) { aos_string_t canon_res; char canon_buf[AOS_MAX_URI_LEN]; const char *value; aos_string_t signstr; int res = AOSE_OK; int b64Len; unsigned char hmac[20]; char b64[((20 + 1) * 4) / 3]; canon_res.data = canon_buf; canon_res.len = apr_snprintf(canon_buf, sizeof(canon_buf), "/%s", req->resource); if ((res = oss_get_rtmp_string_to_sign(options->pool, expires, &canon_res, req->query_params, &signstr))!= AOSE_OK) { return res; } HMAC_SHA1(hmac, (unsigned char *)options->config->access_key_secret.data, options->config->access_key_secret.len, (unsigned char *)signstr.data, signstr.len); b64Len = aos_base64_encode(hmac, 20, b64); value = apr_psprintf(options->pool, "%.*s", b64Len, b64); aos_str_set(signature, value); return res; } int oss_get_rtmp_string_to_sign(aos_pool_t *p, const aos_string_t *expires, const aos_string_t *canon_res, const aos_table_t *params, aos_string_t *signstr) { int res; aos_buf_t *signbuf; aos_str_null(signstr); signbuf = aos_create_buf(p, 1024); // expires aos_buf_append_string(p, signbuf, expires->data, expires->len); aos_buf_append_string(p, signbuf, "\n", sizeof("\n")-1); // canonicalized params if ((res = oss_get_canonicalized_params(p, params, signbuf)) != AOSE_OK) { return res; } // canonicalized resource aos_buf_append_string(p, signbuf, canon_res->data, canon_res->len); // result signstr->data = (char *)signbuf->pos; signstr->len = aos_buf_size(signbuf); return AOSE_OK; } static int oss_get_canonicalized_params(aos_pool_t *p, const aos_table_t *params, aos_buf_t *signbuf) { int pos; int meta_count = 0; int i; int len; const aos_array_header_t *tarr; const aos_table_entry_t *telts; char **meta_headers; const char *value; aos_string_t tmp_str; char *tmpbuf = (char*)malloc(AOS_MAX_HEADER_LEN + 1); if (NULL == tmpbuf) { aos_error_log("malloc %d memory failed.", AOS_MAX_HEADER_LEN + 1); return AOSE_OVER_MEMORY; } if (apr_is_empty_table(params)) { free(tmpbuf); return AOSE_OK; } // sort user meta header tarr = aos_table_elts(params); telts = (aos_table_entry_t*)tarr->elts; meta_headers = aos_pcalloc(p, tarr->nelts * sizeof(char*)); for (pos = 0; pos < tarr->nelts; ++pos) { aos_string_t key = aos_string(telts[pos].key); meta_headers[meta_count++] = key.data; } if (meta_count == 0) { free(tmpbuf); return AOSE_OK; } aos_gnome_sort((const char **)meta_headers, meta_count); // sign string for (i = 0; i < meta_count; ++i) { value = apr_table_get(params, meta_headers[i]); aos_str_set(&tmp_str, value); aos_strip_space(&tmp_str); len = apr_snprintf(tmpbuf, AOS_MAX_HEADER_LEN + 1, "%s:%.*s", meta_headers[i], tmp_str.len, tmp_str.data); if (len > AOS_MAX_HEADER_LEN) { free(tmpbuf); aos_error_log("rtmp parameters too many, %d > %d.", len, AOS_MAX_HEADER_LEN); return AOSE_INVALID_ARGUMENT; } tmp_str.data = tmpbuf; tmp_str.len = len; aos_buf_append_string(p, signbuf, tmpbuf, len); aos_buf_append_string(p, signbuf, "\n", sizeof("\n")-1); } free(tmpbuf); return AOSE_OK; } //v4 #define AOS_SHA256_HASH_LEN 32 static int cmp_table_key_v4(const void* v1, const void* v2) { const apr_table_entry_t* s1 = (const apr_table_entry_t*)v1; const apr_table_entry_t* s2 = (const apr_table_entry_t*)v2; return strcmp(s1->key, s2->key); } static int is_oss_signed_header_v4(const char* str) { if (strncasecmp(str, OSS_CANNONICALIZED_HEADER_PREFIX, strlen(OSS_CANNONICALIZED_HEADER_PREFIX)) == 0 || strncasecmp(str, OSS_CONTENT_MD5, strlen(OSS_CONTENT_MD5)) == 0 || strncasecmp(str, OSS_CONTENT_TYPE, strlen(OSS_CONTENT_TYPE)) == 0) { return 1; } return 0; } static int oss_build_canonical_request_v4(aos_pool_t* p, aos_http_request_t* req, aos_string_t* out) { int pos; const char* value; aos_buf_t* signbuf; const aos_array_header_t* arr; const aos_table_entry_t* elts; aos_table_t *canon_querys; aos_table_t* canon_headers; signbuf = aos_create_buf(p, 1024); //http method + "\n" value = aos_http_method_to_string(req->method); aos_buf_append_string(p, signbuf, value, strlen(value)); aos_buf_append_string(p, signbuf, "\n", 1); //Canonical URI + "\n" aos_buf_append_string(p, signbuf, "/", 1); if (req->resource != NULL) { char canon_buf[AOS_MAX_URI_LEN]; canon_buf[0] = '\0'; aos_url_encode_ex(canon_buf, req->resource, AOS_MAX_URI_LEN, 1); aos_buf_append_string(p, signbuf, canon_buf, strlen(canon_buf)); } aos_buf_append_string(p, signbuf, "\n", 1); //Canonical Query String + "\n" arr = aos_table_elts(req->query_params); elts = (aos_table_entry_t*)arr->elts; canon_querys = aos_table_make(p, 0); for (pos = 0; pos < arr->nelts; ++pos) { char enc_key[AOS_MAX_QUERY_ARG_LEN]; char enc_value[AOS_MAX_URI_LEN]; aos_url_encode(enc_key, elts[pos].key, AOS_MAX_QUERY_ARG_LEN); aos_url_encode(enc_value, elts[pos].val, AOS_MAX_QUERY_ARG_LEN); apr_table_set(canon_querys, enc_key, enc_value); } arr = aos_table_elts(canon_querys); qsort(arr->elts, arr->nelts, arr->elt_size, cmp_table_key_v4); elts = (aos_table_entry_t*)arr->elts; for (pos = 0; pos < arr->nelts; ++pos) { if (pos != 0) { aos_buf_append_string(p, signbuf, "&", 1); } value = elts[pos].key; aos_buf_append_string(p, signbuf, value, strlen(value)); value = elts[pos].val; if (value != NULL && *value != '\0') { aos_buf_append_string(p, signbuf, "=", 1); aos_buf_append_string(p, signbuf, value, strlen(value)); } } aos_buf_append_string(p, signbuf, "\n", 1); //Canonical Headers + "\n" arr = aos_table_elts(req->headers); elts = (aos_table_entry_t*)arr->elts; canon_headers = aos_table_make(p, 0); for (pos = 0; pos < arr->nelts; ++pos) { if (is_oss_signed_header_v4(elts[pos].key)) { aos_string_t key; aos_str_set(&key, apr_pstrdup(p, elts[pos].key)); aos_string_tolower(&key); aos_strip_space(&key); apr_table_addn(canon_headers, key.data, elts[pos].val); } } arr = aos_table_elts(canon_headers); qsort(arr->elts, arr->nelts, arr->elt_size, cmp_table_key_v4); elts = (aos_table_entry_t*)arr->elts; for (pos = 0; pos < arr->nelts; ++pos) { aos_string_t tmp_str; aos_str_set(&tmp_str, elts[pos].val); aos_strip_space(&tmp_str); aos_buf_append_string(p, signbuf, elts[pos].key, strlen(elts[pos].key)); aos_buf_append_string(p, signbuf, ":", 1); aos_buf_append_string(p, signbuf, tmp_str.data, tmp_str.len); aos_buf_append_string(p, signbuf, "\n", 1); } aos_buf_append_string(p, signbuf, "\n", 1); //Additional Headers + "\n" aos_buf_append_string(p, signbuf, "\n", 1); //Hashed PayLoad value = apr_table_get(req->headers, OSS_CONTENT_SHA256); if (value == NULL) { aos_buf_append_string(p, signbuf, "UNSIGNED-PAYLOAD", 16); } else { aos_buf_append_string(p, signbuf, value, strlen(value)); } // result out->data = (char*)signbuf->pos; out->len = aos_buf_size(signbuf); return AOSE_OK; } static int oss_build_string_to_sign_v4(aos_pool_t* p, const aos_string_t* datetime, const aos_string_t* date, const aos_string_t* region, const aos_string_t* product, const aos_string_t* canonical_request, aos_string_t* out) { char hash[AOS_SHA256_HASH_LEN]; char hex[AOS_SHA256_HASH_LEN * 2 + 1]; aos_buf_t* signbuf; signbuf = aos_create_buf(p, 256); // OSS4-HMAC-SHA256 + \n + // dateime + \n + // data/region/product/aliyun_v4_request + \n + // toHex(sha256(canonical_request)); aos_buf_append_string(p, signbuf, "OSS4-HMAC-SHA256", 16); aos_buf_append_string(p, signbuf, "\n", 1); aos_buf_append_string(p, signbuf, datetime->data, datetime->len); aos_buf_append_string(p, signbuf, "\n", 1); //scope aos_buf_append_string(p, signbuf, date->data, date->len); aos_buf_append_string(p, signbuf, "/", 1); aos_buf_append_string(p, signbuf, region->data, region->len); aos_buf_append_string(p, signbuf, "/", 1); aos_buf_append_string(p, signbuf, product->data, product->len); aos_buf_append_string(p, signbuf, "/", 1); aos_buf_append_string(p, signbuf, "aliyun_v4_request", 17); aos_buf_append_string(p, signbuf, "\n", 1); aos_SHA256(hash, canonical_request->data, canonical_request->len); aos_encode_hex(hex, hash, AOS_SHA256_HASH_LEN, NULL); aos_buf_append_string(p, signbuf, hex, AOS_SHA256_HASH_LEN * 2); // result out->data = (char*)signbuf->pos; out->len = aos_buf_size(signbuf); return AOSE_OK; } static int oss_build_signing_key_v4(aos_pool_t* p, const aos_string_t* access_key_secret, const aos_string_t* date, const aos_string_t* region, const aos_string_t* product, char signing_key[32]) { char* signing_secret; char signing_date[AOS_SHA256_HASH_LEN]; char signing_region[AOS_SHA256_HASH_LEN]; char signing_product[AOS_SHA256_HASH_LEN]; signing_secret = apr_psprintf(p, "aliyun_v4%.*s", access_key_secret->len, access_key_secret->data); aos_HMAC_SHA256(signing_date, signing_secret, strlen(signing_secret), date->data, date->len); aos_HMAC_SHA256(signing_region, signing_date, AOS_SHA256_HASH_LEN, region->data, region->len); aos_HMAC_SHA256(signing_product, signing_region, AOS_SHA256_HASH_LEN, product->data, product->len); aos_HMAC_SHA256(signing_key, signing_product, AOS_SHA256_HASH_LEN, "aliyun_v4_request", 17); return AOSE_OK; } static int oss_build_signature_v4(aos_pool_t* p, const char signing_key[32], const aos_string_t* string_to_sign, aos_string_t* out) { char signature[AOS_SHA256_HASH_LEN]; aos_buf_t* signbuf; signbuf = aos_create_buf(p, AOS_SHA256_HASH_LEN * 2 + 1); aos_HMAC_SHA256(signature, signing_key, AOS_SHA256_HASH_LEN, string_to_sign->data, string_to_sign->len); aos_encode_hex((char*)signbuf->pos, signature, AOS_SHA256_HASH_LEN, NULL); out->data = (char*)signbuf->pos; out->len = AOS_SHA256_HASH_LEN * 2; return AOSE_OK; } static int oss_sign_request_v4(aos_http_request_t *req, const oss_config_t *config) { aos_string_t datetime; aos_string_t date; aos_string_t region; aos_string_t product; aos_string_t canonical_request; aos_string_t string_to_sign; aos_string_t signature; char signing_key[AOS_SHA256_HASH_LEN]; const char* value; int res = AOSE_OK; aos_string_t gmt_suffix; char shortdate[AOS_MAX_SHORT_TIME_LEN]; //default, ex payload, x-oss-date apr_table_set(req->headers, OSS_CONTENT_SHA256, "UNSIGNED-PAYLOAD"); if ((value = apr_table_get(req->headers, OSS_CANNONICALIZED_HEADER_DATE)) == NULL) { char datestr[AOS_MAX_GMT_TIME_LEN]; aos_get_iso8601_str_time(datestr); apr_table_set(req->headers, OSS_CANNONICALIZED_HEADER_DATE, datestr); } //datetime & date value = apr_table_get(req->headers, OSS_CANNONICALIZED_HEADER_DATE); datetime.data = (char *)value; datetime.len = strlen(value); aos_str_set(&gmt_suffix, "GMT"); if (aos_ends_with(&datetime, &gmt_suffix)) { aos_get_gmt_time_date(datetime.data, shortdate); date.data = shortdate; date.len = 8; } else { date.data = datetime.data; date.len = aos_min(8, datetime.len); } //region if (!aos_string_is_empty(&config->cloudbox_id)) { region.data = config->cloudbox_id.data; region.len = config->cloudbox_id.len; } else { region.data = config->region.data; region.len = config->region.len; } //product, oss or "oss-cloudbox" if (!aos_string_is_empty(&config->cloudbox_id)) { aos_str_set(&product, "oss-cloudbox"); } else { aos_str_set(&product, "oss"); } //canonical request if ((res = oss_build_canonical_request_v4(req->pool, req, &canonical_request)) != AOSE_OK) { return res; } //printf("\ncanonical_request:\n%s", canonical_request.data); //string to sign if ((res = oss_build_string_to_sign_v4(req->pool, &datetime, &date, ®ion, &product, &canonical_request, &string_to_sign)) != AOSE_OK) { return res; } //printf("\nstring_to_sign:\n%s", string_to_sign.data); //signing key if ((res = oss_build_signing_key_v4(req->pool, &config ->access_key_secret, &date, ®ion, &product, signing_key)) != AOSE_OK) { return res; } //signature if ((res = oss_build_signature_v4(req->pool, signing_key, &string_to_sign, &signature)) != AOSE_OK) { return res; } //printf("\nsignature:\n%s", signature.data); //sign header value = apr_psprintf(req->pool, "OSS4-HMAC-SHA256 Credential=%.*s/%.*s/%.*s/%.*s/aliyun_v4_request,Signature=%.*s", config->access_key_id.len, config->access_key_id.data, date.len, date.data, region.len, region.data, product.len, product.data, signature.len, signature.data); apr_table_addn(req->headers, OSS_AUTHORIZATION, value); //printf("\nAuthorization:\n%s", value); return res; } static int get_oss_request_signature_v4(const oss_request_options_t *options, aos_http_request_t *req, const aos_string_t *expires, aos_string_t *signature) { aos_string_t datetime; aos_string_t date; aos_string_t region; aos_string_t product; aos_string_t canonical_request; aos_string_t string_to_sign; char signing_key[AOS_SHA256_HASH_LEN]; int res = AOSE_OK; oss_config_t *config; apr_time_t now; char datetimestr[AOS_MAX_GMT_TIME_LEN]; apr_time_t expires_s; const char* value; config = options->config; //datetime & date now = apr_time_now(); aos_get_iso8601_str_time_ex(datetimestr, now); aos_str_set(&datetime, datetimestr); date.data = datetime.data; date.len = aos_min(8, datetime.len); //region if (!aos_string_is_empty(&config->cloudbox_id)) { region.data = config->cloudbox_id.data; region.len = config->cloudbox_id.len; } else { region.data = config->region.data; region.len = config->region.len; } //product, oss or "oss-cloudbox" if (!aos_string_is_empty(&config->cloudbox_id)) { aos_str_set(&product, "oss-cloudbox"); } else { aos_str_set(&product, "oss"); } // expires_s if (aos_string_is_empty(expires)) { return AOSE_INVALID_ARGUMENT; } expires_s = (apr_time_t)aos_atoi64(expires->data); //set x-oss-signature-version apr_table_set(req->query_params, OSS_SIGNATURE_VERSION, "OSS4-HMAC-SHA256"); //set x-oss-credential value = apr_psprintf(req->pool, "%.*s/%.*s/%.*s/%.*s/aliyun_v4_request", config->access_key_id.len, config->access_key_id.data, date.len, date.data, region.len, region.data, product.len, product.data); apr_table_set(req->query_params, OSS_CREDENTIAL, value); //set x-oss-date apr_table_set(req->query_params, OSS_CANNONICALIZED_HEADER_DATE, datetime.data); //set x-oss-expires expires_s = expires_s - apr_time_sec(now); value = apr_psprintf(options->pool, "%" APR_INT64_T_FMT, expires_s); apr_table_set(req->query_params, OSS_EXPIRES_V4, value); //canonical request if ((res = oss_build_canonical_request_v4(req->pool, req, &canonical_request)) != AOSE_OK) { return res; } //printf("\ncanonical_request:\n%s", canonical_request.data); //string to sign if ((res = oss_build_string_to_sign_v4(req->pool, &datetime, &date, ®ion, &product, &canonical_request, &string_to_sign)) != AOSE_OK) { return res; } //printf("\nstring_to_sign:\n%s", string_to_sign.data); //signing key if ((res = oss_build_signing_key_v4(req->pool, &config ->access_key_secret, &date, ®ion, &product, signing_key)) != AOSE_OK) { return res; } //signature if ((res = oss_build_signature_v4(req->pool, signing_key, &string_to_sign, signature)) != AOSE_OK) { return res; } //printf("\nsignature:\n%s", signature.data); return res; } ================================================ FILE: oss_c_sdk/oss_auth.h ================================================ #ifndef LIB_OSS_AUTH_H #define LIB_OSS_AUTH_H #include "aos_util.h" #include "aos_string.h" #include "aos_http_io.h" #include "oss_define.h" OSS_CPP_START /** * @brief sign oss headers **/ void oss_sign_headers(aos_pool_t *p, const aos_string_t *signstr, const aos_string_t *access_key_id, const aos_string_t *access_key_secret, aos_table_t *headers); /** * @brief get string to signature **/ int oss_get_string_to_sign(aos_pool_t *p, http_method_e method, const aos_string_t *canon_res, const aos_table_t *headers, const aos_table_t *params, aos_string_t *signstr); /** * @brief get signed oss request headers **/ int oss_get_signed_headers(aos_pool_t *p, const aos_string_t *access_key_id, const aos_string_t *access_key_secret, const aos_string_t* canon_res, aos_http_request_t *req); /** * @brief sign oss request **/ int oss_sign_request(aos_http_request_t *req, const oss_config_t *config); /** * @brief generate oss request Signature **/ int get_oss_request_signature(const oss_request_options_t *options, aos_http_request_t *req, const aos_string_t *expires, aos_string_t *signature); /** * @brief get oss signed url **/ int oss_get_signed_url(const oss_request_options_t *options, aos_http_request_t *req, const aos_string_t *expires, aos_string_t *auth_url); /** * @brief get rtmp string to signature **/ int oss_get_rtmp_string_to_sign(aos_pool_t *p, const aos_string_t *expires, const aos_string_t *canon_res, const aos_table_t *params, aos_string_t *signstr); /** * @brief generate oss rtmp request signature **/ int get_oss_rtmp_request_signature(const oss_request_options_t *options, aos_http_request_t *req, const aos_string_t *expires, aos_string_t *signature); /** * @brief get oss rtmp signed url **/ int oss_get_rtmp_signed_url(const oss_request_options_t *options, aos_http_request_t *req, const aos_string_t *expires, const aos_string_t *play_list_name, aos_table_t *params, aos_string_t *signed_url); OSS_CPP_END #endif ================================================ FILE: oss_c_sdk/oss_bucket.c ================================================ #include "aos_log.h" #include "aos_define.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" static aos_status_t *oss_create_bucket_with_params(const oss_request_options_t *options, const aos_string_t *bucket, oss_create_bucket_params_t *params, aos_table_t **resp_headers) { const char *oss_acl_str = NULL; const char *oss_storage_class_str = NULL; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *headers = NULL; aos_table_t *query_params = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 0); //init headers headers = aos_table_create_if_null(options, headers, 1); oss_acl_str = get_oss_acl_str(params->acl); if (oss_acl_str) { apr_table_set(headers, OSS_CANNONICALIZED_HEADER_ACL, oss_acl_str); } oss_init_bucket_request(options, bucket, HTTP_PUT, &req, query_params, headers, &resp); oss_storage_class_str = get_oss_storage_class_str(params->storage_class); if (oss_storage_class_str != NULL) { aos_list_t body; build_bucket_storage_class(options->pool, params->storage_class, &body); oss_write_request_body_from_buffer(&body, req); } s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_create_bucket(const oss_request_options_t *options, const aos_string_t *bucket, oss_acl_e oss_acl, aos_table_t **resp_headers) { aos_status_t *s = NULL; oss_create_bucket_params_t params; params.acl = oss_acl; params.storage_class = OSS_STORAGE_CLASS_BUTT; s = oss_create_bucket_with_params(options, bucket, ¶ms, resp_headers); return s; } aos_status_t *oss_create_bucket_with_storage_class(const oss_request_options_t *options, const aos_string_t *bucket, oss_acl_e oss_acl, oss_storage_class_type_e storage_class, aos_table_t **resp_headers) { aos_status_t *s = NULL; oss_create_bucket_params_t params; params.acl = oss_acl; params.storage_class = storage_class; s = oss_create_bucket_with_params(options, bucket, ¶ms, resp_headers); return s; } aos_status_t *oss_delete_bucket(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); headers = aos_table_create_if_null(options, headers, 0); query_params = aos_table_create_if_null(options, query_params, 0); oss_init_bucket_request(options, bucket, HTTP_DELETE, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_put_bucket_acl(const oss_request_options_t *options, const aos_string_t *bucket, oss_acl_e oss_acl, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; const char *oss_acl_str = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_ACL, ""); headers = aos_table_create_if_null(options, headers, 1); oss_acl_str = get_oss_acl_str(oss_acl); if (oss_acl_str) { apr_table_set(headers, OSS_CANNONICALIZED_HEADER_ACL, oss_acl_str); } oss_init_bucket_request(options, bucket, HTTP_PUT, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_bucket_acl(const oss_request_options_t *options, const aos_string_t *bucket, aos_string_t *oss_acl, aos_table_t **resp_headers) { aos_status_t *s = NULL; int res; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_ACL, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_acl_parse_from_body(options->pool, &resp->body, oss_acl); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_head_bucket(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 0); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_HEAD, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } return s; } aos_status_t *oss_get_bucket_location(const oss_request_options_t *options, const aos_string_t *bucket, aos_string_t *oss_location, aos_table_t **resp_headers) { aos_status_t *s = NULL; int res; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_LOCATION, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_location_parse_from_body(options->pool, &resp->body, oss_location); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_get_bucket_info(const oss_request_options_t *options, const aos_string_t *bucket, oss_bucket_info_t *bucket_info, aos_table_t **resp_headers) { aos_status_t *s = NULL; int res; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_BUCKETINFO, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_get_bucket_info_parse_from_body(options->pool, &resp->body, bucket_info); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_get_bucket_stat(const oss_request_options_t *options, const aos_string_t *bucket, oss_bucket_stat_t *bucket_stat, aos_table_t **resp_headers) { aos_status_t *s = NULL; int res; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_BUCKETSTAT, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_get_bucket_stat_parse_from_body(options->pool, &resp->body, bucket_stat); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_get_bucket_referer(const oss_request_options_t *options, const aos_string_t *bucket, oss_referer_config_t *referer_config, aos_table_t **resp_headers) { aos_status_t *s = NULL; int res; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_REFERER, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_get_bucket_referer_config_parse_from_body(options->pool, &resp->body, referer_config); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_put_bucket_storage_capacity(const oss_request_options_t *options, const aos_string_t *bucket, long storage_capacity, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; aos_list_t body; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_addn(query_params, OSS_QOS, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_PUT, &req, query_params, headers, &resp); build_bucket_storage_capacity_body(options->pool, storage_capacity, &body); oss_write_request_body_from_buffer(&body, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_bucket_storage_capacity(const oss_request_options_t *options, const aos_string_t *bucket, long *storage_capacity, aos_table_t **resp_headers) { aos_status_t *s = NULL; int res; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_QOS, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_storage_capacity_parse_from_body(options->pool, &resp->body, storage_capacity); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_list_object(const oss_request_options_t *options, const aos_string_t *bucket, oss_list_object_params_t *params, aos_table_t **resp_headers) { int res; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 4); apr_table_add(query_params, OSS_PREFIX, params->prefix.data); apr_table_add(query_params, OSS_DELIMITER, params->delimiter.data); apr_table_add(query_params, OSS_MARKER, params->marker.data); aos_table_add_int(query_params, OSS_MAX_KEYS, params->max_ret); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_list_objects_parse_from_body(options->pool, &resp->body, ¶ms->object_list, ¶ms->common_prefix_list, ¶ms->next_marker, ¶ms->truncated); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_list_bucket(const oss_request_options_t *options, oss_list_buckets_params_t *params, aos_table_t **resp_headers) { int res; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; //init query_params query_params = aos_table_create_if_null(options, query_params, 3); if (params->prefix.len) { apr_table_add(query_params, OSS_PREFIX, params->prefix.data); } if (params->marker.len) { apr_table_add(query_params, OSS_MARKER, params->marker.data); } if (params->max_keys) { aos_table_add_int(query_params, OSS_MAX_KEYS, params->max_keys); } //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_service_request(options, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_list_buckets_parse_from_body(options->pool, &resp->body, params); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_put_bucket_logging(const oss_request_options_t *options, const aos_string_t *bucket, oss_logging_config_content_t *content, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; apr_table_t *query_params = NULL; aos_table_t *headers = NULL; aos_list_t body; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_LOGGING, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_PUT, &req, query_params, headers, &resp); build_bucket_logging_body(options->pool, content, &body); oss_write_request_body_from_buffer(&body, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_bucket_logging(const oss_request_options_t *options, const aos_string_t *bucket, oss_logging_config_content_t *content, aos_table_t **resp_headers) { aos_status_t *s = NULL; int res; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_LOGGING, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_logging_parse_from_body(options->pool, &resp->body, content); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_delete_bucket_logging(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_LOGGING, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_DELETE, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_put_bucket_lifecycle(const oss_request_options_t *options, const aos_string_t *bucket, aos_list_t *lifecycle_rule_list, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; apr_table_t *query_params = NULL; aos_table_t *headers = NULL; aos_list_t body; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_LIFECYCLE, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_PUT, &req, query_params, headers, &resp); build_lifecycle_body(options->pool, lifecycle_rule_list, &body); oss_write_request_body_from_buffer(&body, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_put_bucket_cors(const oss_request_options_t *options, const aos_string_t *bucket, aos_list_t *rule_list, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; apr_table_t *query_params = NULL; aos_table_t *headers = NULL; aos_list_t body; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_CORS, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_PUT, &req, query_params, headers, &resp); build_cors_rule_body(options->pool, rule_list, &body); oss_write_request_body_from_buffer(&body, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_bucket_cors(const oss_request_options_t *options, const aos_string_t *bucket, aos_list_t *rule_list, aos_table_t **resp_headers) { aos_status_t *s = NULL; int res; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_CORS, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_get_bucket_cors_parse_from_body(options->pool, &resp->body, rule_list); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_delete_bucket_cors(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_CORS, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_DELETE, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_put_bucket_referer(const oss_request_options_t *options, const aos_string_t *bucket, oss_referer_config_t *referer_config, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; apr_table_t *query_params = NULL; aos_table_t *headers = NULL; aos_list_t body; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_REFERER, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_PUT, &req, query_params, headers, &resp); build_referer_config_body(options->pool, referer_config, &body); oss_write_request_body_from_buffer(&body, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_put_bucket_website(const oss_request_options_t *options, const aos_string_t *bucket, oss_website_config_t *website_config, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; apr_table_t *query_params = NULL; aos_table_t *headers = NULL; aos_list_t body; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_WEBSITE, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_PUT, &req, query_params, headers, &resp); build_website_config_body(options->pool, website_config, &body); oss_write_request_body_from_buffer(&body, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_bucket_website(const oss_request_options_t *options, const aos_string_t *bucket, oss_website_config_t *website_config, aos_table_t **resp_headers) { aos_status_t *s = NULL; int res; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_WEBSITE, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_get_bucket_website_parse_from_body(options->pool, &resp->body, website_config); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_delete_bucket_website(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_WEBSITE, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_DELETE, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_bucket_lifecycle(const oss_request_options_t *options, const aos_string_t *bucket, aos_list_t *lifecycle_rule_list, aos_table_t **resp_headers) { int res; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_LIFECYCLE, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_lifecycle_rules_parse_from_body(options->pool, &resp->body, lifecycle_rule_list); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_delete_bucket_lifecycle(const oss_request_options_t *options, const aos_string_t *bucket, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_LIFECYCLE, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_DELETE, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_delete_objects(const oss_request_options_t *options, const aos_string_t *bucket, aos_list_t *object_list, int is_quiet, aos_table_t **resp_headers, aos_list_t *deleted_object_list) { int res; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *headers = NULL; aos_table_t *query_params = NULL; aos_list_t body; unsigned char *md5 = NULL; char *buf = NULL; int64_t body_len; char *b64_value = NULL; int b64_buf_len = (20 + 1) * 4 / 3; int b64_len; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_DELETE, ""); //init headers headers = aos_table_create_if_null(options, headers, 1); apr_table_set(headers, OSS_CONTENT_TYPE, OSS_MULTIPART_CONTENT_TYPE); oss_init_bucket_request(options, bucket, HTTP_POST, &req, query_params, headers, &resp); build_delete_objects_body(options->pool, object_list, is_quiet, &body); //add Content-MD5 body_len = aos_buf_list_len(&body); buf = aos_buf_list_content(options->pool, &body); md5 = aos_md5(options->pool, buf, (apr_size_t)body_len); b64_value = aos_pcalloc(options->pool, b64_buf_len); b64_len = aos_base64_encode(md5, 20, b64_value); b64_value[b64_len] = '\0'; apr_table_addn(headers, OSS_CONTENT_MD5, b64_value); oss_write_request_body_from_buffer(&body, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (is_quiet) { return s; } if (!aos_status_is_ok(s)) { return s; } res = oss_delete_objects_parse_from_body(options->pool, &resp->body, deleted_object_list); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_delete_objects_by_prefix(oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *prefix) { aos_pool_t *subpool = NULL; aos_pool_t *parent_pool = NULL; int is_quiet = 1; aos_status_t *s = NULL; aos_status_t *ret = NULL; oss_list_object_params_t *params = NULL; int list_object_count = 0; const char *next_marker = NULL; oss_ensure_bucket_name_valid(bucket); parent_pool = options->pool; params = oss_create_list_object_params(parent_pool); if (prefix->data == NULL) { aos_str_set(¶ms->prefix, ""); } else { aos_str_set(¶ms->prefix, prefix->data); } while (params->truncated) { aos_table_t *list_object_resp_headers = NULL; aos_list_t object_list; aos_list_t deleted_object_list; oss_list_object_content_t *list_content = NULL; aos_table_t *delete_objects_resp_headers = NULL; char *key = NULL; aos_pool_create(&subpool, parent_pool); options->pool = subpool; list_object_count = 0; aos_list_init(&object_list); s = oss_list_object(options, bucket, params, &list_object_resp_headers); if (!aos_status_is_ok(s)) { ret = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; return ret; } aos_list_for_each_entry(oss_list_object_content_t, list_content, ¶ms->object_list, node) { oss_object_key_t *object_key = oss_create_oss_object_key(parent_pool); key = apr_psprintf(parent_pool, "%.*s", list_content->key.len, list_content->key.data); aos_str_set(&object_key->key, key); aos_list_add_tail(&object_key->node, &object_list); list_object_count += 1; } if (list_object_count == 0) { ret = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; return ret; } // swap pool if (params->next_marker.data != NULL) { next_marker = apr_pstrdup(parent_pool, params->next_marker.data); aos_str_set(¶ms->next_marker, next_marker); } aos_pool_destroy(subpool); aos_list_init(&deleted_object_list); aos_pool_create(&subpool, parent_pool); options->pool = subpool; s = oss_delete_objects(options, bucket, &object_list, is_quiet, &delete_objects_resp_headers, &deleted_object_list); if (!aos_status_is_ok(s)) { ret = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; return ret; } if (!params->truncated) { ret = aos_status_dup(parent_pool, s); } aos_pool_destroy(subpool); aos_list_init(¶ms->object_list); if (params->next_marker.data) { aos_str_set(¶ms->marker, params->next_marker.data); } } options->pool = parent_pool; return ret; } ================================================ FILE: oss_c_sdk/oss_define.c ================================================ #include "oss_define.h" const char OSS_CANNONICALIZED_HEADER_PREFIX[] = "x-oss-"; const char OSS_CANNONICALIZED_HEADER_DATE[] = "x-oss-date"; const char OSS_CANNONICALIZED_HEADER_ACL[] = "x-oss-acl"; const char OSS_CANNONICALIZED_HEADER_STORAGE_CLASS[] = "StorageClass"; const char OSS_CANNONICALIZED_HEADER_COPY_SOURCE[] = "x-oss-copy-source"; const char OSS_CANNONICALIZED_HEADER_SYMLINK[] = "x-oss-symlink-target"; const char OSS_CANNONICALIZED_HEADER_REGION[] = "x-oss-bucket-region"; const char OSS_CANNONICALIZED_HEADER_OBJECT_ACL[] = "x-oss-object-acl"; const char OSS_CONTENT_MD5[] = "Content-MD5"; const char OSS_CONTENT_TYPE[] = "Content-Type"; const char OSS_CONTENT_LENGTH[] = "Content-Length"; const char OSS_DATE[] = "Date"; const char OSS_AUTHORIZATION[] = "Authorization"; const char OSS_ACCESSKEYID[] = "OSSAccessKeyId"; const char OSS_EXPECT[] = "Expect"; const char OSS_EXPIRES[] = "Expires"; const char OSS_SIGNATURE[] = "Signature"; const char OSS_ACL[] = "acl"; const char OSS_LOCATION[] = "location"; const char OSS_BUCKETINFO[] = "bucketInfo"; const char OSS_BUCKETSTAT[] = "stat"; const char OSS_RESTORE[] = "restore"; const char OSS_SYMLINK[] = "symlink"; const char OSS_QOS[] = "qos"; const char OSS_PREFIX[] = "prefix"; const char OSS_DELIMITER[] = "delimiter"; const char OSS_MARKER[] = "marker"; const char OSS_MAX_KEYS[] = "max-keys"; const char OSS_UPLOADS[] = "uploads"; const char OSS_UPLOAD_ID[] = "uploadId"; const char OSS_MAX_PARTS[] = "max-parts"; const char OSS_PART_NUMBER_MARKER[] = "part-number-marker"; const char OSS_KEY_MARKER[] = "key-marker"; const char OSS_UPLOAD_ID_MARKER[] = "upload-id-marker"; const char OSS_MAX_UPLOADS[] = "max-uploads"; const char OSS_PARTNUMBER[] = "partNumber"; const char OSS_APPEND[] = "append"; const char OSS_POSITION[] = "position"; const char OSS_MULTIPART_CONTENT_TYPE[] = "application/x-www-form-urlencoded"; const char OSS_COPY_SOURCE[] = "x-oss-copy-source"; const char OSS_COPY_SOURCE_RANGE[] = "x-oss-copy-source-range"; const char OSS_SECURITY_TOKEN[] = "security-token"; const char OSS_STS_SECURITY_TOKEN[] = "x-oss-security-token"; const char OSS_OBJECT_TYPE[] = "x-oss-object-type"; const char OSS_NEXT_APPEND_POSITION[] = "x-oss-next-append-position"; const char OSS_HASH_CRC64_ECMA[] = "x-oss-hash-crc64ecma"; const char OSS_CALLBACK[] = "x-oss-callback"; const char OSS_CALLBACK_VAR[] = "x-oss-callback-var"; const char OSS_PROCESS[] = "x-oss-process"; const char OSS_LIFECYCLE[] = "lifecycle"; const char OSS_REFERER[] = "referer"; const char OSS_CORS[] = "cors"; const char OSS_WEBSITE[] = "website"; const char OSS_LOGGING[] = "logging"; const char OSS_DELETE[] = "delete"; const char OSS_YES[] = "yes"; const char OSS_OBJECT_TYPE_NORMAL[] = "Normal"; const char OSS_OBJECT_TYPE_APPENDABLE[] = "Appendable"; const char OSS_LIVE_CHANNEL[] = "live"; const char OSS_LIVE_CHANNEL_STATUS[] = "status"; const char OSS_COMP[] = "comp"; const char OSS_LIVE_CHANNEL_STAT[] = "stat"; const char OSS_LIVE_CHANNEL_HISTORY[] = "history"; const char OSS_LIVE_CHANNEL_VOD[] = "vod"; const char OSS_LIVE_CHANNEL_START_TIME[] = "startTime"; const char OSS_LIVE_CHANNEL_END_TIME[] = "endTime"; const char OSS_PLAY_LIST_NAME[] = "playlistName"; const char LIVE_CHANNEL_STATUS_DISABLED[] = "disabled"; const char LIVE_CHANNEL_STATUS_ENABLED[] = "enabled"; const char LIVE_CHANNEL_STATUS_IDLE[] = "idle"; const char LIVE_CHANNEL_STATUS_LIVE[] = "live"; const char LIVE_CHANNEL_DEFAULT_TYPE[] = "HLS"; const char LIVE_CHANNEL_DEFAULT_PLAYLIST[] = "playlist.m3u8"; const int LIVE_CHANNEL_DEFAULT_FRAG_DURATION = 5; const int LIVE_CHANNEL_DEFAULT_FRAG_COUNT = 3; const int OSS_MAX_PART_NUM = 10000; const int OSS_PER_RET_NUM = 1000; const int MAX_SUFFIX_LEN = 1024; const char OSS_OBJECT_META[] = "objectMeta"; const char OSS_SELECT_OBJECT_OUTPUT_RAW[] = "x-oss-select-output-raw"; const char OSS_TAGGING[] = "tagging"; const char OSS_SIGN_ORIGIN_ONLY[] = "x-oss-sign-origin-only"; const char OSS_CONTENT_SHA256[] = "x-oss-content-sha256"; const char OSS_SECURITY_TOKEN_V4[] = "x-oss-security-token"; const char OSS_SIGNATURE_VERSION[] = "x-oss-signature-version"; const char OSS_CREDENTIAL[] = "x-oss-credential"; const char OSS_EXPIRES_V4[] = "x-oss-expires"; const char OSS_SIGNATURE_V4[] = "x-oss-signature"; ================================================ FILE: oss_c_sdk/oss_define.h ================================================ #ifndef LIBOSS_DEFINE_H #define LIBOSS_DEFINE_H #include "aos_string.h" #include "aos_list.h" #include "aos_transport.h" #ifdef __cplusplus # define OSS_CPP_START extern "C" { # define OSS_CPP_END } #else # define OSS_CPP_START # define OSS_CPP_END #endif #define aos_xml_error_status_set(STATUS, RES) do { \ aos_status_set(STATUS, RES, AOS_XML_PARSE_ERROR_CODE, NULL); \ } while(0) #define aos_file_error_status_set(STATUS, RES) do { \ aos_status_set(STATUS, RES, AOS_OPEN_FILE_ERROR_CODE, NULL); \ } while(0) #define aos_inconsistent_error_status_set(STATUS, RES) do { \ aos_status_set(STATUS, RES, AOS_INCONSISTENT_ERROR_CODE, NULL); \ } while(0) #define PARAM_OUT #define PARAM_IN #define OSS_INVALID_VALUE -1 extern const char OSS_CANNONICALIZED_HEADER_ACL[]; extern const char OSS_CANNONICALIZED_HEADER_STORAGE_CLASS[]; extern const char OSS_CANNONICALIZED_HEADER_SOURCE[]; extern const char OSS_CANNONICALIZED_HEADER_PREFIX[]; extern const char OSS_CANNONICALIZED_HEADER_DATE[]; extern const char OSS_CANNONICALIZED_HEADER_COPY_SOURCE[]; extern const char OSS_CANNONICALIZED_HEADER_SYMLINK[]; extern const char OSS_CANNONICALIZED_HEADER_OBJECT[]; extern const char OSS_CANNONICALIZED_HEADER_REGION[]; extern const char OSS_CANNONICALIZED_HEADER_OBJECT_ACL[]; extern const char OSS_CONTENT_MD5[]; extern const char OSS_CONTENT_TYPE[]; extern const char OSS_CONTENT_LENGTH[]; extern const char OSS_DATE[]; extern const char OSS_AUTHORIZATION[]; extern const char OSS_ACCESSKEYID[]; extern const char OSS_EXPECT[]; extern const char OSS_EXPIRES[]; extern const char OSS_SIGNATURE[]; extern const char OSS_ACL[]; extern const char OSS_LOCATION[]; extern const char OSS_BUCKETINFO[]; extern const char OSS_BUCKETSTAT[]; extern const char OSS_RESTORE[]; extern const char OSS_SYMLINK[]; extern const char OSS_QOS[]; extern const char OSS_LOGGING[]; extern const char OSS_PREFIX[]; extern const char OSS_DELIMITER[]; extern const char OSS_MARKER[]; extern const char OSS_MAX_KEYS[]; extern const char OSS_UPLOADS[]; extern const char OSS_UPLOAD_ID[]; extern const char OSS_MAX_PARTS[]; extern const char OSS_KEY_MARKER[]; extern const char OSS_UPLOAD_ID_MARKER[]; extern const char OSS_MAX_UPLOADS[]; extern const char OSS_PARTNUMBER[]; extern const char OSS_PART_NUMBER_MARKER[]; extern const char OSS_APPEND[]; extern const char OSS_POSITION[]; extern const char OSS_MULTIPART_CONTENT_TYPE[]; extern const char OSS_COPY_SOURCE[]; extern const char OSS_COPY_SOURCE_RANGE[]; extern const char OSS_SECURITY_TOKEN[]; extern const char OSS_STS_SECURITY_TOKEN[]; extern const char OSS_OBJECT_TYPE[]; extern const char OSS_NEXT_APPEND_POSITION[]; extern const char OSS_HASH_CRC64_ECMA[]; extern const char OSS_CALLBACK[]; extern const char OSS_CALLBACK_VAR[]; extern const char OSS_PROCESS[]; extern const char OSS_LIFECYCLE[]; extern const char OSS_REFERER[]; extern const char OSS_CORS[]; extern const char OSS_WEBSITE[]; extern const char OSS_DELETE[]; extern const char OSS_YES[]; extern const char OSS_OBJECT_TYPE_NORMAL[]; extern const char OSS_OBJECT_TYPE_APPENDABLE[]; extern const char OSS_LIVE_CHANNEL[]; extern const char OSS_LIVE_CHANNEL_STATUS[]; extern const char OSS_COMP[]; extern const char OSS_LIVE_CHANNEL_STAT[]; extern const char OSS_LIVE_CHANNEL_HISTORY[]; extern const char OSS_LIVE_CHANNEL_VOD[]; extern const char OSS_LIVE_CHANNEL_START_TIME[]; extern const char OSS_LIVE_CHANNEL_END_TIME[]; extern const char OSS_PLAY_LIST_NAME[]; extern const char LIVE_CHANNEL_STATUS_DISABLED[]; extern const char LIVE_CHANNEL_STATUS_ENABLED[]; extern const char LIVE_CHANNEL_STATUS_IDLE[]; extern const char LIVE_CHANNEL_STATUS_LIVE[]; extern const char LIVE_CHANNEL_DEFAULT_TYPE[]; extern const char LIVE_CHANNEL_DEFAULT_PLAYLIST[]; extern const int LIVE_CHANNEL_DEFAULT_FRAG_DURATION; extern const int LIVE_CHANNEL_DEFAULT_FRAG_COUNT; extern const int OSS_MAX_PART_NUM; extern const int OSS_PER_RET_NUM; extern const int MAX_SUFFIX_LEN; extern const char OSS_OBJECT_META[]; extern const char OSS_SELECT_OBJECT_OUTPUT_RAW[]; extern const char OSS_TAGGING[]; extern const char OSS_SIGN_ORIGIN_ONLY[]; extern const char OSS_CONTENT_SHA256[]; extern const char OSS_SECURITY_TOKEN_V4[]; extern const char OSS_SIGNATURE_VERSION[]; extern const char OSS_CREDENTIAL[]; extern const char OSS_EXPIRES_V4[]; extern const char OSS_SIGNATURE_V4[]; typedef struct oss_lib_curl_initializer_s oss_lib_curl_initializer_t; /** * oss_acl is an ACL that can be specified when an object is created or * updated. Each canned ACL has a predefined value when expanded to a full * set of OSS ACL Grants. * Private canned ACL gives the owner FULL_CONTROL and no other permissions * are issued * Public Read canned ACL gives the owner FULL_CONTROL and all users Read * permission * Public Read Write canned ACL gives the owner FULL_CONTROL and all users * Read and Write permission * Default Inherit the ACL of the bucket in which the object is, only the * objects has this acl **/ typedef enum { OSS_ACL_PRIVATE = 0, /*< private */ OSS_ACL_PUBLIC_READ = 1, /*< public read */ OSS_ACL_PUBLIC_READ_WRITE = 2, /*< public read write */ OSS_ACL_DEFAULT = 3 /*< default */ } oss_acl_e; typedef enum { OSS_STORAGE_CLASS_STANDARD = 0, /*< standard */ OSS_STORAGE_CLASS_IA = 1, /*< IA */ OSS_STORAGE_CLASS_ARCHIVE = 2, /*< archive */ OSS_STORAGE_CLASS_BUTT = 3, OSS_STORAGE_CLASS_COLD_ARCHIVE = 4, /*< cold archive */ } oss_storage_class_type_e; typedef enum { OSS_TIER_EXPEDITED = 0, /*< Expedited */ OSS_TIER_STANDARD = 1, /*< Standard */ OSS_TIER_BULK = 2, /*< Bulk */ } oss_tier_type_e; typedef struct { aos_string_t endpoint; aos_string_t access_key_id; aos_string_t access_key_secret; aos_string_t sts_token; int is_cname; aos_string_t proxy_host; int proxy_port; aos_string_t proxy_user; aos_string_t proxy_passwd; int signature_version; aos_string_t region; aos_string_t cloudbox_id; } oss_config_t; typedef struct { oss_acl_e acl; oss_storage_class_type_e storage_class; } oss_create_bucket_params_t; typedef struct { oss_config_t *config; aos_http_controller_t *ctl; /*< aos http controller, more see aos_transport.h */ aos_pool_t *pool; } oss_request_options_t; typedef struct { aos_list_t node; aos_string_t key; aos_string_t last_modified; aos_string_t etag; aos_string_t size; aos_string_t owner_id; aos_string_t owner_display_name; aos_string_t storage_class; aos_string_t type; } oss_list_object_content_t; typedef struct { aos_list_t node; aos_string_t create_date; aos_string_t extranet_endpoint; aos_string_t intranet_endpoint; aos_string_t location; aos_string_t name; aos_string_t storage_class; } oss_list_bucket_content_t; typedef struct { aos_list_t node; aos_string_t prefix; } oss_list_object_common_prefix_t; typedef struct { aos_list_t node; aos_string_t key; aos_string_t upload_id; aos_string_t initiated; } oss_list_multipart_upload_content_t; typedef struct { aos_list_t node; aos_string_t part_number; aos_string_t size; aos_string_t etag; aos_string_t last_modified; } oss_list_part_content_t; typedef struct { aos_list_t node; aos_string_t part_number; aos_string_t etag; } oss_complete_part_content_t; typedef struct { int part_num; char *etag; } oss_upload_part_t; typedef struct { aos_string_t prefix; aos_string_t marker; aos_string_t delimiter; int max_ret; int truncated; aos_string_t next_marker; aos_list_t object_list; aos_list_t common_prefix_list; } oss_list_object_params_t; typedef struct { PARAM_IN aos_string_t prefix; PARAM_IN aos_string_t marker; PARAM_IN int max_keys; PARAM_OUT int truncated; PARAM_OUT aos_string_t next_marker; PARAM_OUT aos_string_t owner_id; PARAM_OUT aos_string_t owner_name; PARAM_OUT aos_list_t bucket_list; } oss_list_buckets_params_t; typedef struct { aos_string_t part_number_marker; int max_ret; int truncated; aos_string_t next_part_number_marker; aos_list_t part_list; } oss_list_upload_part_params_t; typedef struct { aos_string_t prefix; aos_string_t key_marker; aos_string_t upload_id_marker; aos_string_t delimiter; int max_ret; int truncated; aos_string_t next_key_marker; aos_string_t next_upload_id_marker; aos_list_t upload_list; } oss_list_multipart_upload_params_t; typedef struct { aos_string_t source_bucket; aos_string_t source_object; aos_string_t dest_bucket; aos_string_t dest_object; aos_string_t upload_id; int part_num; int64_t range_start; int64_t range_end; } oss_upload_part_copy_params_t; typedef struct { aos_string_t filename; /**< file range read filename */ int64_t file_pos; /**< file range read start position */ int64_t file_last; /**< file range read last position */ } oss_upload_file_t; typedef struct { int days; aos_string_t created_before_date; } oss_lifecycle_rule_date_t; typedef struct { aos_list_t node; aos_string_t id; aos_string_t prefix; aos_string_t status; int days; aos_string_t date; aos_string_t created_before_date; oss_lifecycle_rule_date_t abort_multipart_upload_dt; aos_list_t tag_list; } oss_lifecycle_rule_content_t; typedef struct { aos_list_t node; aos_string_t rule; } oss_sub_cors_rule_t; typedef struct { aos_list_t node; aos_list_t allowed_origin_list; aos_list_t allowed_method_list; aos_list_t allowed_head_list; aos_list_t expose_head_list; int max_age_seconds; // INT_MAX means no value } oss_cors_rule_t; typedef struct { aos_list_t node; aos_string_t referer; } oss_referer_t; typedef struct { aos_list_t referer_list; int allow_empty_referer; } oss_referer_config_t; typedef struct { aos_string_t suffix_str; aos_string_t key_str; } oss_website_config_t; typedef struct { aos_list_t node; aos_string_t target_bucket; aos_string_t prefix; int logging_enabled; } oss_logging_config_content_t; typedef struct { aos_string_t created_date; aos_string_t extranet_endpoint; aos_string_t intranet_endpoint; aos_string_t location; aos_string_t owner_id; aos_string_t owner_name; aos_string_t acl; aos_string_t storage_class; } oss_bucket_info_t; typedef struct { uint64_t storage_in_bytes; uint64_t object_count; uint64_t multipart_upload_count; } oss_bucket_stat_t; typedef struct { aos_list_t node; aos_string_t key; } oss_object_key_t; typedef struct { char *suffix; char *type; } oss_content_type_t; typedef struct { int64_t part_size; // bytes, default 1MB int32_t thread_num; // default 1 int enable_checkpoint; // default disable, false aos_string_t checkpoint_path; // dafault ./filepath.ucp or ./filepath.dcp } oss_resumable_clt_params_t; typedef struct { aos_string_t type; int32_t frag_duration; int32_t frag_count; aos_string_t play_list_name; }oss_live_channel_target_t; typedef struct { aos_string_t name; aos_string_t description; aos_string_t status; oss_live_channel_target_t target; } oss_live_channel_configuration_t; typedef struct { aos_list_t node; aos_string_t publish_url; } oss_live_channel_publish_url_t; typedef struct { aos_list_t node; aos_string_t play_url; } oss_live_channel_play_url_t; typedef struct { int32_t width; int32_t height; int32_t frame_rate; int32_t band_width; aos_string_t codec; } oss_video_stat_t; typedef struct { int32_t band_width; int32_t sample_rate; aos_string_t codec; } oss_audio_stat_t; typedef struct { aos_string_t pushflow_status; aos_string_t connected_time; aos_string_t remote_addr; oss_video_stat_t video_stat; oss_audio_stat_t audio_stat; } oss_live_channel_stat_t; typedef struct { aos_list_t node; aos_string_t name; aos_string_t description; aos_string_t status; aos_string_t last_modified; aos_list_t publish_url_list; aos_list_t play_url_list; } oss_live_channel_content_t; typedef struct { aos_string_t prefix; aos_string_t marker; int max_keys; int truncated; aos_string_t next_marker; aos_list_t live_channel_list; } oss_list_live_channel_params_t; typedef struct { aos_list_t node; aos_string_t start_time; aos_string_t end_time; aos_string_t remote_addr; } oss_live_record_content_t; typedef struct { aos_string_t compression_type; aos_string_t file_header_info; aos_string_t record_delimiter; aos_string_t field_delimiter; aos_string_t quote_character; aos_string_t comment_character; aos_string_t range; } oss_select_object_input_param_t; typedef struct { aos_string_t record_delimiter; aos_string_t field_delimiter; int32_t keep_all_columns; int32_t output_rawdata; int32_t enable_payload_crc; int32_t output_header; } oss_select_object_output_param_t; typedef struct { int32_t skip_partial_data_record; } oss_select_object_option_param_t; typedef struct { oss_select_object_input_param_t input_param; oss_select_object_output_param_t output_param; oss_select_object_option_param_t option_param; } oss_select_object_params_t; typedef struct { PARAM_IN aos_string_t compression_type; PARAM_IN aos_string_t record_delimiter; PARAM_IN aos_string_t field_delimiter; PARAM_IN aos_string_t quote_character; PARAM_IN int32_t over_write_if_existing; PARAM_OUT uint32_t splits_count; PARAM_OUT uint64_t rows_count; PARAM_OUT uint32_t columns_count; } oss_select_object_meta_params_t; typedef struct { aos_list_t node; aos_string_t key; aos_string_t value; } oss_tag_content_t; #endif ================================================ FILE: oss_c_sdk/oss_live.c ================================================ #include "aos_log.h" #include "aos_define.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" aos_status_t *oss_create_live_channel(const oss_request_options_t *options, const aos_string_t *bucket, oss_live_channel_configuration_t *config, aos_list_t *publish_url_list, aos_list_t *play_url_list, aos_table_t **resp_headers) { int res = AOSE_OK; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; aos_list_t body; oss_ensure_bucket_name_valid(bucket); //init params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_LIVE_CHANNEL, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_live_channel_request(options, bucket, &config->name, HTTP_PUT, &req, query_params, headers, &resp); // build body build_create_live_channel_body(options->pool, config, &body); oss_write_request_body_from_buffer(&body, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } // parse result res = oss_create_live_channel_parse_from_body(options->pool, &resp->body, publish_url_list, play_url_list); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_put_live_channel_status(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, const aos_string_t *live_channel_status, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init params query_params = aos_table_create_if_null(options, query_params, 2); apr_table_add(query_params, OSS_LIVE_CHANNEL, ""); apr_table_add(query_params, OSS_LIVE_CHANNEL_STATUS, live_channel_status->data); //init headers, forbid 'Expect' and 'Transfer-Encoding' of HTTP headers = aos_table_create_if_null(options, headers, 2); apr_table_set(headers, "Expect", ""); apr_table_set(headers, "Transfer-Encoding", ""); oss_init_live_channel_request(options, bucket, live_channel, HTTP_PUT, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_live_channel_info(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, oss_live_channel_configuration_t *info, aos_table_t **resp_headers) { int res = AOSE_OK; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_LIVE_CHANNEL, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_live_channel_request(options, bucket, live_channel, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } // parse result res = oss_live_channel_info_parse_from_body(options->pool, &resp->body, info); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } aos_str_set(&info->name, aos_pstrdup(options->pool, live_channel)); return s; } aos_status_t *oss_get_live_channel_stat(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, oss_live_channel_stat_t *stat, aos_table_t **resp_headers) { int res = AOSE_OK; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init params query_params = aos_table_create_if_null(options, query_params, 2); apr_table_add(query_params, OSS_LIVE_CHANNEL, ""); apr_table_add(query_params, OSS_COMP, OSS_LIVE_CHANNEL_STAT); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_live_channel_request(options, bucket, live_channel, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } // parse result res = oss_live_channel_stat_parse_from_body(options->pool, &resp->body, stat); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_delete_live_channel(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_LIVE_CHANNEL, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_live_channel_request(options, bucket, live_channel, HTTP_DELETE, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_list_live_channel(const oss_request_options_t *options, const aos_string_t *bucket, oss_list_live_channel_params_t *params, aos_table_t **resp_headers) { int res = AOSE_OK; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init params query_params = aos_table_create_if_null(options, query_params, 4); apr_table_add(query_params, OSS_LIVE_CHANNEL, ""); apr_table_add(query_params, OSS_PREFIX, params->prefix.data); apr_table_add(query_params, OSS_MARKER, params->marker.data); aos_table_add_int(query_params, OSS_MAX_KEYS, params->max_keys); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } // parse result res = oss_list_live_channel_parse_from_body(options->pool, &resp->body, ¶ms->live_channel_list, ¶ms->next_marker, ¶ms->truncated); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_get_live_channel_history(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, aos_list_t *live_record_list, aos_table_t **resp_headers) { int res = AOSE_OK; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init params query_params = aos_table_create_if_null(options, query_params, 2); apr_table_add(query_params, OSS_LIVE_CHANNEL, ""); apr_table_add(query_params, OSS_COMP, OSS_LIVE_CHANNEL_HISTORY); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_live_channel_request(options, bucket, live_channel, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } // parse result res = oss_live_channel_history_parse_from_body(options->pool, &resp->body, live_record_list); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_gen_vod_play_list(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, const aos_string_t *play_list_name, const int64_t start_time, const int64_t end_time, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; char *resource = NULL; aos_string_t resource_str; oss_ensure_bucket_name_valid(bucket); //init params query_params = aos_table_create_if_null(options, query_params, 3); apr_table_add(query_params, OSS_LIVE_CHANNEL_VOD, ""); apr_table_add(query_params, OSS_LIVE_CHANNEL_START_TIME, apr_psprintf(options->pool, "%" APR_INT64_T_FMT, start_time)); apr_table_add(query_params, OSS_LIVE_CHANNEL_END_TIME, apr_psprintf(options->pool, "%" APR_INT64_T_FMT, end_time)); //init headers headers = aos_table_create_if_null(options, headers, 1); apr_table_set(headers, OSS_CONTENT_TYPE, OSS_MULTIPART_CONTENT_TYPE); resource = apr_psprintf(options->pool, "%s/%s", live_channel->data, play_list_name->data); aos_str_set(&resource_str, resource); oss_init_live_channel_request(options, bucket, &resource_str, HTTP_POST, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } char *oss_gen_rtmp_signed_url(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, const aos_string_t *play_list_name, const int64_t expires) { aos_string_t signed_url; char *expires_str = NULL; aos_string_t expires_time; int res = AOSE_OK; aos_http_request_t *req = NULL; aos_table_t *params = NULL; expires_str = apr_psprintf(options->pool, "%" APR_INT64_T_FMT, expires); aos_str_set(&expires_time, expires_str); req = aos_http_request_create(options->pool); oss_get_rtmp_uri(options, bucket, live_channel, req); res = oss_get_rtmp_signed_url(options, req, &expires_time, play_list_name, params, &signed_url); if (res != AOSE_OK) { return NULL; } return signed_url.data; } ================================================ FILE: oss_c_sdk/oss_multipart.c ================================================ #include "aos_log.h" #include "aos_define.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" aos_status_t *oss_init_multipart_upload(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_string_t *upload_id, aos_table_t *headers, aos_table_t **resp_headers) { int res = AOSE_OK; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_UPLOADS, ""); //init headers headers = aos_table_create_if_null(options, headers, 1); set_content_type(NULL, object->data, headers); oss_init_object_request(options, bucket, object, HTTP_POST, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_upload_id_parse_from_body(options->pool, &resp->body, upload_id); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_abort_multipart_upload(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_string_t *upload_id, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_UPLOAD_ID, upload_id->data); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_object_request(options, bucket, object, HTTP_DELETE, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_list_upload_part(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, oss_list_upload_part_params_t *params, aos_table_t **resp_headers) { int res = AOSE_OK; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 3); apr_table_add(query_params, OSS_UPLOAD_ID, upload_id->data); aos_table_add_int(query_params, OSS_MAX_PARTS, params->max_ret); apr_table_add(query_params, OSS_PART_NUMBER_MARKER, params->part_number_marker.data); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_object_request(options, bucket, object, HTTP_GET, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_list_parts_parse_from_body(options->pool, &resp->body, ¶ms->part_list, ¶ms->next_part_number_marker, ¶ms->truncated); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_list_multipart_upload(const oss_request_options_t *options, const aos_string_t *bucket, oss_list_multipart_upload_params_t *params, aos_table_t **resp_headers) { int res = AOSE_OK; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, query_params, 6); apr_table_add(query_params, OSS_UPLOADS, ""); apr_table_add(query_params, OSS_PREFIX, params->prefix.data); apr_table_add(query_params, OSS_DELIMITER, params->delimiter.data); apr_table_add(query_params, OSS_KEY_MARKER, params->key_marker.data); apr_table_add(query_params, OSS_UPLOAD_ID_MARKER, params->upload_id_marker.data); aos_table_add_int(query_params, OSS_MAX_UPLOADS, params->max_ret); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_bucket_request(options, bucket, HTTP_GET, &req, query_params, headers, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_list_multipart_uploads_parse_from_body(options->pool, &resp->body, ¶ms->upload_list, ¶ms->next_key_marker, ¶ms->next_upload_id_marker, ¶ms->truncated); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_complete_multipart_upload(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, aos_list_t *part_list, aos_table_t *headers, aos_table_t **resp_headers) { return oss_do_complete_multipart_upload(options, bucket, object, upload_id, part_list, headers, NULL, resp_headers, NULL); } aos_status_t *oss_do_complete_multipart_upload(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, aos_list_t *part_list, aos_table_t *headers, aos_table_t *params, aos_table_t **resp_headers, aos_list_t *resp_body) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; apr_table_t *query_params = NULL; aos_list_t body; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, params, 1); apr_table_add(query_params, OSS_UPLOAD_ID, upload_id->data); //init headers headers = aos_table_create_if_null(options, headers, 1); apr_table_set(headers, OSS_CONTENT_TYPE, OSS_MULTIPART_CONTENT_TYPE); oss_init_object_request(options, bucket, object, HTTP_POST, &req, query_params, headers, NULL, 0, &resp); build_complete_multipart_upload_body(options->pool, part_list, &body); oss_write_request_body_from_buffer(&body, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); oss_fill_read_response_body(resp, resp_body); return s; } aos_status_t *oss_upload_part_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, int part_num, aos_list_t *buffer, aos_table_t **resp_headers) { return oss_do_upload_part_from_buffer(options, bucket, object, upload_id, part_num, buffer, NULL, NULL, NULL, resp_headers, NULL); } aos_status_t *oss_do_upload_part_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, int part_num, aos_list_t *buffer, oss_progress_callback progress_callback, aos_table_t *headers, aos_table_t *params, aos_table_t **resp_headers, aos_list_t *resp_body) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; oss_ensure_bucket_name_valid(bucket); //init query_params query_params = aos_table_create_if_null(options, params, 2); apr_table_add(query_params, OSS_UPLOAD_ID, upload_id->data); aos_table_add_int(query_params, OSS_PARTNUMBER, part_num); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_object_request(options, bucket, object, HTTP_PUT, &req, query_params, headers, progress_callback, 0, &resp); oss_write_request_body_from_buffer(buffer, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); oss_fill_read_response_body(resp, resp_body); if (is_enable_crc(options) && has_crc_in_response(resp)) { oss_check_crc_consistent(req->crc64, resp->headers, s); } return s; } aos_status_t *oss_upload_part_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, int part_num, oss_upload_file_t *upload_file, aos_table_t **resp_headers) { return oss_do_upload_part_from_file(options, bucket, object, upload_id, part_num, upload_file, NULL, NULL, NULL, resp_headers, NULL); } aos_status_t *oss_do_upload_part_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, int part_num, oss_upload_file_t *upload_file, oss_progress_callback progress_callback, aos_table_t *headers, aos_table_t *params, aos_table_t **resp_headers, aos_list_t *resp_body) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; int res = AOSE_OK; oss_ensure_bucket_name_valid(bucket); s = aos_status_create(options->pool); //init query_params query_params = aos_table_create_if_null(options, params, 2); apr_table_add(query_params, OSS_UPLOAD_ID, upload_id->data); aos_table_add_int(query_params, OSS_PARTNUMBER, part_num); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_object_request(options, bucket, object, HTTP_PUT, &req, query_params, headers, progress_callback, 0, &resp); res = oss_write_request_body_from_upload_file(options->pool, upload_file, req); if (res != AOSE_OK) { aos_file_error_status_set(s, res); return s; } s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); oss_fill_read_response_body(resp, resp_body); if (is_enable_crc(options) && has_crc_in_response(resp)) { oss_check_crc_consistent(req->crc64, resp->headers, s); } return s; } aos_status_t *oss_upload_part_copy(const oss_request_options_t *options, oss_upload_part_copy_params_t *params, aos_table_t *headers, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; char *copy_source = NULL; char *copy_source_range = NULL; char buffer[AOS_MAX_QUERY_ARG_LEN * 3 + 1]; int res = -1; oss_ensure_bucket_name_valid(¶ms->dest_bucket); s = aos_status_create(options->pool); //init query_params query_params = aos_table_create_if_null(options, query_params, 2); apr_table_add(query_params, OSS_UPLOAD_ID, params->upload_id.data); aos_table_add_int(query_params, OSS_PARTNUMBER, params->part_num); //init headers res = aos_url_encode(buffer, params->source_object.data, AOS_MAX_QUERY_ARG_LEN); if (res != AOSE_OK) { aos_status_set(s, res, AOS_URL_ENCODE_ERROR_CODE, NULL); return s; } headers = aos_table_create_if_null(options, headers, 2); copy_source = apr_psprintf(options->pool, "/%.*s/%s", params->source_bucket.len, params->source_bucket.data, buffer); apr_table_add(headers, OSS_COPY_SOURCE, copy_source); copy_source_range = apr_psprintf(options->pool, "bytes=%" APR_INT64_T_FMT "-%" APR_INT64_T_FMT, params->range_start, params->range_end); apr_table_add(headers, OSS_COPY_SOURCE_RANGE, copy_source_range); oss_init_object_request(options, ¶ms->dest_bucket, ¶ms->dest_object, HTTP_PUT, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_sorted_uploaded_part(oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *upload_id, aos_list_t *complete_part_list, int *part_count) { aos_pool_t *subpool = NULL; aos_pool_t *parent_pool = NULL; aos_status_t *s = NULL; aos_status_t *ret = NULL; oss_upload_part_t *part_arr = NULL; int part_index = 0; int index = 0; int uploaded_part_count = 0; oss_list_upload_part_params_t *params = NULL; oss_list_part_content_t *part_content = NULL; oss_complete_part_content_t *complete_content = NULL; aos_table_t *list_part_resp_headers = NULL; char *part_num_str = NULL; oss_ensure_bucket_name_valid(bucket); parent_pool = options->pool; part_arr = aos_palloc(parent_pool, OSS_MAX_PART_NUM * sizeof(oss_upload_part_t)); params = oss_create_list_upload_part_params(parent_pool); while (params->truncated) { aos_pool_create(&subpool, parent_pool); options->pool = subpool; s = oss_list_upload_part(options, bucket, object, upload_id, params, &list_part_resp_headers); if (!aos_status_is_ok(s)) { ret = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; return ret; } if (!params->truncated) { ret = aos_status_dup(parent_pool, s); } aos_list_for_each_entry(oss_list_part_content_t, part_content, ¶ms->part_list, node) { oss_upload_part_t upload_part; upload_part.etag = part_content->etag.data; upload_part.part_num = atoi(part_content->part_number.data); part_arr[part_index++] = upload_part; uploaded_part_count++; } aos_list_init(¶ms->part_list); if (params->next_part_number_marker.data != NULL) { aos_str_set(¶ms->part_number_marker, params->next_part_number_marker.data); } //sort multipart upload part content qsort(part_arr, uploaded_part_count, sizeof(part_arr[0]), part_sort_cmp); for (index = 0; index < part_index; ++index) { complete_content = oss_create_complete_part_content(parent_pool); part_num_str = apr_psprintf(parent_pool, "%d", part_arr[index].part_num); aos_str_set(&complete_content->part_number, part_num_str); aos_str_set(&complete_content->etag, part_arr[index].etag); aos_list_add_tail(&complete_content->node, complete_part_list); } part_index = 0; aos_pool_destroy(subpool); } *part_count = uploaded_part_count; options->pool = parent_pool; return ret; } aos_status_t *oss_upload_file(oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_string_t *upload_id, aos_string_t *filepath, int64_t part_size, aos_table_t *headers) { aos_pool_t *subpool = NULL; aos_pool_t *parent_pool = NULL; int64_t start_pos; int64_t end_pos; int part_num; int part_count = 0; int res = AOSE_OK; aos_status_t *s = NULL; aos_status_t *ret = NULL; aos_file_buf_t *fb = NULL; oss_upload_file_t *upload_file = NULL; aos_table_t *upload_part_resp_headers = NULL; char *part_num_str = NULL; char *etag = NULL; aos_list_t complete_part_list; oss_complete_part_content_t *complete_content = NULL; aos_table_t *complete_resp_headers = NULL; oss_ensure_bucket_name_valid(bucket); aos_list_init(&complete_part_list); parent_pool = options->pool; //get upload_id and uploaded part aos_pool_create(&subpool, options->pool); options->pool = subpool; if (NULL == upload_id->data) { aos_table_t *init_multipart_headers = NULL; aos_table_t *init_multipart_resp_headers = NULL; init_multipart_headers = aos_table_make(subpool, 0); s = oss_init_multipart_upload(options, bucket, object, upload_id, init_multipart_headers, &init_multipart_resp_headers); if (!aos_status_is_ok(s)) { ret = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; return ret; } } else { s = oss_get_sorted_uploaded_part(options, bucket, object, upload_id, &complete_part_list, &part_count); if (!aos_status_is_ok(s)) { ret = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; return ret; } } aos_pool_destroy(subpool); //get part size fb = aos_create_file_buf(parent_pool); res = aos_open_file_for_read(parent_pool, filepath->data, fb); if (res != AOSE_OK) { s = aos_status_create(parent_pool); aos_file_error_status_set(s, res); options->pool = parent_pool; return s; } oss_get_part_size(fb->file_last, &part_size); //upload part from file upload_file = oss_create_upload_file(parent_pool); aos_str_set(&upload_file->filename, filepath->data); start_pos = part_size * part_count; end_pos = start_pos + part_size; part_num = part_count + 1; while (1) { aos_pool_create(&subpool, parent_pool); options->pool = subpool; upload_file->file_pos = start_pos; upload_file->file_last = end_pos; s = oss_upload_part_from_file(options, bucket, object, upload_id, part_num, upload_file, &upload_part_resp_headers); if (!aos_status_is_ok(s)) { ret = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; return ret; } complete_content = oss_create_complete_part_content(parent_pool); part_num_str = apr_psprintf(parent_pool, "%d", part_num); aos_str_set(&complete_content->part_number, part_num_str); etag = apr_pstrdup(parent_pool, (char*)apr_table_get(upload_part_resp_headers, "ETag")); aos_str_set(&complete_content->etag, etag); aos_list_add_tail(&complete_content->node, &complete_part_list); aos_pool_destroy(subpool); if (end_pos >= fb->file_last) { break; } start_pos += part_size; end_pos += part_size; if (end_pos > fb->file_last) end_pos = fb->file_last; part_num += 1; } //complete multipart aos_pool_create(&subpool, parent_pool); options->pool = subpool; headers = aos_table_create_if_null(options, headers, 0); s = oss_complete_multipart_upload(options, bucket, object, upload_id, &complete_part_list, headers, &complete_resp_headers); ret = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; return ret; } ================================================ FILE: oss_c_sdk/oss_object.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "aos_define.h" #include "oss_define.h" char *oss_gen_signed_url(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, int64_t expires, aos_http_request_t *req) { aos_string_t signed_url; char *expires_str = NULL; aos_string_t expires_time; int res = AOSE_OK; if (!oss_is_valid_bucket_name(bucket) || !oss_is_valid_object_name_ex(object, is_verify_object_strict(options))) { return NULL; } expires_str = apr_psprintf(options->pool, "%" APR_INT64_T_FMT, expires); aos_str_set(&expires_time, expires_str); oss_get_object_uri(options, bucket, object, req); res = oss_get_signed_url(options, req, &expires_time, &signed_url); if (res != AOSE_OK) { return NULL; } return signed_url.data; } aos_status_t *oss_put_object_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_list_t *buffer, aos_table_t *headers, aos_table_t **resp_headers) { return oss_do_put_object_from_buffer(options, bucket, object, buffer, headers, NULL, NULL, resp_headers, NULL); } aos_status_t *oss_do_put_object_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_list_t *buffer, aos_table_t *headers, aos_table_t *params, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); headers = aos_table_create_if_null(options, headers, 2); set_content_type(NULL, object->data, headers); apr_table_add(headers, OSS_EXPECT, ""); query_params = aos_table_create_if_null(options, params, 0); oss_init_object_request(options, bucket, object, HTTP_PUT, &req, query_params, headers, progress_callback, 0, &resp); oss_write_request_body_from_buffer(buffer, req); s = oss_process_request(options, req, resp); oss_fill_read_response_body(resp, resp_body); oss_fill_read_response_header(resp, resp_headers); if (is_enable_crc(options) && has_crc_in_response(resp)) { oss_check_crc_consistent(req->crc64, resp->headers, s); } return s; } aos_status_t *oss_put_object_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *filename, aos_table_t *headers, aos_table_t **resp_headers) { return oss_do_put_object_from_file(options, bucket, object, filename, headers, NULL, NULL, resp_headers, NULL); } aos_status_t *oss_do_put_object_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *filename, aos_table_t *headers, aos_table_t *params, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; int res = AOSE_OK; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); s = aos_status_create(options->pool); headers = aos_table_create_if_null(options, headers, 2); set_content_type(filename->data, object->data, headers); apr_table_add(headers, OSS_EXPECT, ""); query_params = aos_table_create_if_null(options, params, 0); oss_init_object_request(options, bucket, object, HTTP_PUT, &req, query_params, headers, progress_callback, 0, &resp); res = oss_write_request_body_from_file(options->pool, filename, req); if (res != AOSE_OK) { aos_file_error_status_set(s, res); return s; } s = oss_process_request(options, req, resp); oss_fill_read_response_body(resp, resp_body); oss_fill_read_response_header(resp, resp_headers); if (is_enable_crc(options) && has_crc_in_response(resp)) { oss_check_crc_consistent(req->crc64, resp->headers, s); } return s; } aos_status_t *oss_get_object_to_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t *params, aos_list_t *buffer, aos_table_t **resp_headers) { return oss_do_get_object_to_buffer(options, bucket, object, headers, params, buffer, NULL, resp_headers); } aos_status_t *oss_do_get_object_to_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t *params, aos_list_t *buffer, oss_progress_callback progress_callback, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); headers = aos_table_create_if_null(options, headers, 0); params = aos_table_create_if_null(options, params, 0); oss_init_object_request(options, bucket, object, HTTP_GET, &req, params, headers, progress_callback, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_body(resp, buffer); oss_fill_read_response_header(resp, resp_headers); if (is_enable_crc(options) && has_crc_in_response(resp) && !has_range_or_process_in_request(req)) { oss_check_crc_consistent(resp->crc64, resp->headers, s); } return s; } aos_status_t *oss_restore_object(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t **resp_headers) { aos_table_t *params = NULL; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); params = aos_table_create_if_null(options, params, 0); apr_table_add(params, OSS_RESTORE, ""); headers = aos_table_create_if_null(options, headers, 0); /* * Because this framework will auto add content-length for HTTP_POST and HTTP_PUT method, * it has to add content type as well. Otherwise oss server will fail at signature * mismatch. * With set content type, it works. * But in future, it's better refactor framework to fix this problem. */ set_content_type(NULL, object->data, headers); oss_init_object_request(options, bucket, object, HTTP_POST, &req, params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_restore_object_with_tier(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, oss_tier_type_e tier, int day, aos_table_t *headers, aos_table_t **resp_headers) { aos_table_t *params = NULL; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_list_t body; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); params = aos_table_create_if_null(options, params, 0); apr_table_add(params, OSS_RESTORE, ""); headers = aos_table_create_if_null(options, headers, 0); set_content_type(NULL, object->data, headers); oss_init_object_request(options, bucket, object, HTTP_POST, &req, params, headers, NULL, 0, &resp); oss_build_restore_object_body(options->pool, tier, day, &body); oss_write_request_body_from_buffer(&body, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_object_to_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t *params, aos_string_t *filename, aos_table_t **resp_headers) { return oss_do_get_object_to_file(options, bucket, object, headers, params, filename, NULL, resp_headers); } aos_status_t *oss_do_get_object_to_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t *params, aos_string_t *filename, oss_progress_callback progress_callback, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; int res = AOSE_OK; aos_string_t tmp_filename; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); headers = aos_table_create_if_null(options, headers, 0); params = aos_table_create_if_null(options, params, 0); oss_get_temporary_file_name(options->pool, filename, &tmp_filename); oss_init_object_request(options, bucket, object, HTTP_GET, &req, params, headers, progress_callback, 0, &resp); s = aos_status_create(options->pool); res = oss_init_read_response_body_to_file(options->pool, &tmp_filename, resp); if (res != AOSE_OK) { aos_file_error_status_set(s, res); return s; } s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (is_enable_crc(options) && has_crc_in_response(resp) && !has_range_or_process_in_request(req)) { oss_check_crc_consistent(resp->crc64, resp->headers, s); } oss_temp_file_rename(s, tmp_filename.data, filename->data, options->pool); return s; } aos_status_t *oss_head_object(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t *headers, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); headers = aos_table_create_if_null(options, headers, 0); query_params = aos_table_create_if_null(options, query_params, 0); oss_init_object_request(options, bucket, object, HTTP_HEAD, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_object_meta(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t **resp_headers){ aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_OBJECT_META, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_object_request(options, bucket, object, HTTP_HEAD, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_put_object_acl(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, oss_acl_e oss_acl, aos_table_t **resp_headers){ aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; const char *oss_acl_str = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); s = aos_status_create(options->pool); // In this place, we use a temporary solution to the problem of empty or null values of bucket or object // And in the next release, we will use a unified approach to solve this problem for all APIs if (aos_string_is_empty(object)) { aos_status_set(s, AOSE_INVALID_ARGUMENT, AOS_EMPTY_STRING_ERROR, "bucket or object is empty!"); return s; } //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_ACL, ""); //init headers headers = aos_table_create_if_null(options, headers, 1); oss_acl_str = get_oss_acl_str(oss_acl); if (oss_acl_str){ apr_table_set(headers, OSS_CANNONICALIZED_HEADER_OBJECT_ACL, oss_acl_str); } oss_init_object_request(options, bucket, object, HTTP_PUT, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_object_acl(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_string_t *oss_acl, aos_table_t **resp_headers){ aos_status_t *s = NULL; int res; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); s = aos_status_create(options->pool); // In this place, we use a temporary solution to the problem of empty or null values of bucket or object // And in the next release, we will use a unified approach to solve this problem for all APIs if (aos_string_is_empty(object)) { aos_status_set(s, AOSE_INVALID_ARGUMENT, AOS_EMPTY_STRING_ERROR, "bucket or object is empty!"); return s; } //init query_params query_params = aos_table_create_if_null(options, headers, 1); apr_table_add(query_params, OSS_ACL, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_object_request(options, bucket, object, HTTP_GET, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_acl_parse_from_body(options->pool, &resp->body, oss_acl); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_put_symlink(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *sym_object, const aos_string_t *target_object, aos_table_t **resp_headers) { return oss_do_put_symlink(options, bucket, sym_object, target_object, NULL, resp_headers); } aos_status_t *oss_do_put_symlink(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *sym_object, const aos_string_t *target_object, aos_table_t *headers, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(sym_object); headers = aos_table_create_if_null(options, headers, 1); apr_table_set(headers, OSS_CANNONICALIZED_HEADER_SYMLINK, target_object->data); query_params = aos_table_create_if_null(options, query_params, 0); apr_table_add(query_params, OSS_SYMLINK, ""); oss_init_object_request(options, bucket, sym_object, HTTP_PUT, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_symlink(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *sym_object, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(sym_object); headers = aos_table_create_if_null(options, headers, 0); query_params = aos_table_create_if_null(options, query_params, 0); apr_table_add(query_params, OSS_SYMLINK, ""); oss_init_object_request(options, bucket, sym_object, HTTP_GET, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_delete_object(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *headers = NULL; aos_table_t *query_params = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); headers = aos_table_create_if_null(options, headers, 0); query_params = aos_table_create_if_null(options, query_params, 0); oss_init_object_request(options, bucket, object, HTTP_DELETE, &req, query_params, headers, NULL, 0, &resp); oss_get_object_uri(options, bucket, object, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_copy_object(const oss_request_options_t *options, const aos_string_t *source_bucket, const aos_string_t *source_object, const aos_string_t *dest_bucket, const aos_string_t *dest_object, aos_table_t *headers, aos_table_t **resp_headers) { char *copy_source = NULL; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; char buffer[AOS_MAX_QUERY_ARG_LEN*3+1]; int res = -1; oss_ensure_bucket_name_valid(dest_bucket); oss_ensure_object_name_valid(dest_object); s = aos_status_create(options->pool); headers = aos_table_create_if_null(options, headers, 2); query_params = aos_table_create_if_null(options, query_params, 0); /* init headers */ res = aos_url_encode(buffer, source_object->data, AOS_MAX_QUERY_ARG_LEN); if (res != AOSE_OK) { aos_status_set(s, res, AOS_URL_ENCODE_ERROR_CODE, NULL); return s; } copy_source = apr_psprintf(options->pool, "/%.*s/%s", source_bucket->len, source_bucket->data, buffer); apr_table_set(headers, OSS_CANNONICALIZED_HEADER_COPY_SOURCE, copy_source); set_content_type(NULL, dest_object->data, headers); oss_init_object_request(options, dest_bucket, dest_object, HTTP_PUT, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_append_object_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, int64_t position, aos_list_t *buffer, aos_table_t *headers, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); /* init query_params */ query_params = aos_table_create_if_null(options, query_params, 2); apr_table_add(query_params, OSS_APPEND, ""); aos_table_add_int64(query_params, OSS_POSITION, position); /* init headers */ headers = aos_table_create_if_null(options, headers, 2); set_content_type(NULL, object->data, headers); apr_table_add(headers, OSS_EXPECT, ""); oss_init_object_request(options, bucket, object, HTTP_POST, &req, query_params, headers, NULL, 0, &resp); oss_write_request_body_from_buffer(buffer, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_do_append_object_from_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, int64_t position, uint64_t init_crc, aos_list_t *buffer, aos_table_t *headers, aos_table_t *params, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); /* init query_params */ query_params = aos_table_create_if_null(options, params, 2); apr_table_add(query_params, OSS_APPEND, ""); aos_table_add_int64(query_params, OSS_POSITION, position); /* init headers */ headers = aos_table_create_if_null(options, headers, 2); set_content_type(NULL, object->data, headers); apr_table_add(headers, OSS_EXPECT, ""); oss_init_object_request(options, bucket, object, HTTP_POST, &req, query_params, headers, progress_callback, init_crc, &resp); oss_write_request_body_from_buffer(buffer, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); oss_fill_read_response_body(resp, resp_body); if (is_enable_crc(options) && has_crc_in_response(resp)) { oss_check_crc_consistent(req->crc64, resp->headers, s); } return s; } aos_status_t *oss_append_object_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, int64_t position, const aos_string_t *append_file, aos_table_t *headers, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; int res = AOSE_OK; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); /* init query_params */ query_params = aos_table_create_if_null(options, query_params, 2); apr_table_add(query_params, OSS_APPEND, ""); aos_table_add_int64(query_params, OSS_POSITION, position); /* init headers */ headers = aos_table_create_if_null(options, headers, 2); set_content_type(append_file->data, object->data, headers); apr_table_add(headers, OSS_EXPECT, ""); oss_init_object_request(options, bucket, object, HTTP_POST, &req, query_params, headers, NULL, 0, &resp); res = oss_write_request_body_from_file(options->pool, append_file, req); s = aos_status_create(options->pool); if (res != AOSE_OK) { aos_file_error_status_set(s, res); return s; } s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_do_append_object_from_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, int64_t position, uint64_t init_crc, const aos_string_t *append_file, aos_table_t *headers, aos_table_t *params, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; int res = AOSE_OK; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); /* init query_params */ query_params = aos_table_create_if_null(options, params, 2); apr_table_add(query_params, OSS_APPEND, ""); aos_table_add_int64(query_params, OSS_POSITION, position); /* init headers */ headers = aos_table_create_if_null(options, headers, 2); set_content_type(append_file->data, object->data, headers); apr_table_add(headers, OSS_EXPECT, ""); oss_init_object_request(options, bucket, object, HTTP_POST, &req, query_params, headers, progress_callback, init_crc, &resp); res = oss_write_request_body_from_file(options->pool, append_file, req); s = aos_status_create(options->pool); if (res != AOSE_OK) { aos_file_error_status_set(s, res); return s; } s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); oss_fill_read_response_body(resp, resp_body); if (is_enable_crc(options) && has_crc_in_response(resp)) { oss_check_crc_consistent(req->crc64, resp->headers, s); } return s; } aos_status_t *oss_put_object_from_buffer_by_url(const oss_request_options_t *options, const aos_string_t *signed_url, aos_list_t *buffer, aos_table_t *headers, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; /* init query_params */ headers = aos_table_create_if_null(options, headers, 0); query_params = aos_table_create_if_null(options, query_params, 0); oss_init_signed_url_request(options, signed_url, HTTP_PUT, &req, query_params, headers, &resp); oss_write_request_body_from_buffer(buffer, req); s = oss_process_signed_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (is_enable_crc(options) && has_crc_in_response(resp)) { oss_check_crc_consistent(req->crc64, resp->headers, s); } return s; } aos_status_t *oss_put_object_from_file_by_url(const oss_request_options_t *options, const aos_string_t *signed_url, aos_string_t *filename, aos_table_t *headers, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; int res = AOSE_OK; s = aos_status_create(options->pool); headers = aos_table_create_if_null(options, headers, 0); query_params = aos_table_create_if_null(options, query_params, 0); oss_init_signed_url_request(options, signed_url, HTTP_PUT, &req, query_params, headers, &resp); res = oss_write_request_body_from_file(options->pool, filename, req); if (res != AOSE_OK) { aos_file_error_status_set(s, res); return s; } s = oss_process_signed_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (is_enable_crc(options) && has_crc_in_response(resp)) { oss_check_crc_consistent(req->crc64, resp->headers, s); } return s; } aos_status_t *oss_get_object_to_buffer_by_url(const oss_request_options_t *options, const aos_string_t *signed_url, aos_table_t *headers, aos_table_t *params, aos_list_t *buffer, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; headers = aos_table_create_if_null(options, headers, 0); params = aos_table_create_if_null(options, params, 0); oss_init_signed_url_request(options, signed_url, HTTP_GET, &req, params, headers, &resp); s = oss_process_signed_request(options, req, resp); oss_fill_read_response_body(resp, buffer); oss_fill_read_response_header(resp, resp_headers); if (is_enable_crc(options) && has_crc_in_response(resp) && !has_range_or_process_in_request(req)) { oss_check_crc_consistent(resp->crc64, resp->headers, s); } return s; } aos_status_t *oss_get_object_to_file_by_url(const oss_request_options_t *options, const aos_string_t *signed_url, aos_table_t *headers, aos_table_t *params, aos_string_t *filename, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; int res = AOSE_OK; aos_string_t tmp_filename; s = aos_status_create(options->pool); headers = aos_table_create_if_null(options, headers, 0); params = aos_table_create_if_null(options, params, 0); oss_get_temporary_file_name(options->pool, filename, &tmp_filename); oss_init_signed_url_request(options, signed_url, HTTP_GET, &req, params, headers, &resp); res = oss_init_read_response_body_to_file(options->pool, filename, resp); if (res != AOSE_OK) { aos_file_error_status_set(s, res); return s; } s = oss_process_signed_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (is_enable_crc(options) && has_crc_in_response(resp) && !has_range_or_process_in_request(req)) { oss_check_crc_consistent(resp->crc64, resp->headers, s); } oss_temp_file_rename(s, tmp_filename.data, filename->data, options->pool); return s; } aos_status_t *oss_head_object_by_url(const oss_request_options_t *options, const aos_string_t *signed_url, aos_table_t *headers, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; headers = aos_table_create_if_null(options, headers, 0); query_params = aos_table_create_if_null(options, query_params, 0); oss_init_signed_url_request(options, signed_url, HTTP_HEAD, &req, query_params, headers, &resp); s = oss_process_signed_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_select_object_to_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *expression, oss_select_object_params_t *select_params, aos_list_t *buffer, aos_table_t **resp_headers) { return oss_do_select_object_to_buffer(options, bucket, object, expression, select_params, NULL, NULL, buffer, NULL, resp_headers); } aos_status_t *oss_do_select_object_to_buffer(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *expression, oss_select_object_params_t *select_params, aos_table_t *headers, aos_table_t *params, aos_list_t *buffer, oss_progress_callback progress_callback, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_list_t body; unsigned char *md5 = NULL; char *buf = NULL; int64_t body_len; char *b64_value = NULL; int b64_buf_len = (20 + 1) * 4 / 3; int b64_len; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); /*init query_params*/ query_params = aos_table_create_if_null(options, params, 1); apr_table_add(query_params, OSS_PROCESS, "csv/select"); /*init headers*/ headers = aos_table_create_if_null(options, headers, 1); apr_table_add(headers, OSS_CONTENT_TYPE, "application/x-www-form-urlencoded"); oss_init_object_request(options, bucket, object, HTTP_POST, &req, query_params, headers, progress_callback, 0, &resp); /*build post data*/ oss_build_select_object_body(options->pool, expression, select_params, &body); /*add Content-MD5*/ body_len = aos_buf_list_len(&body); buf = aos_buf_list_content(options->pool, &body); md5 = aos_md5(options->pool, buf, (apr_size_t)body_len); b64_value = aos_pcalloc(options->pool, b64_buf_len); b64_len = aos_base64_encode(md5, 20, b64_value); b64_value[b64_len] = '\0'; apr_table_addn(headers, OSS_CONTENT_MD5, b64_value); oss_write_request_body_from_buffer(&body, req); oss_init_select_object_read_response_body(options->pool, resp); s = oss_process_request(options, req, resp); oss_fill_read_response_body(resp, buffer); oss_fill_read_response_header(resp, resp_headers); oss_check_select_object_status(resp, s); return s; } aos_status_t *oss_select_object_to_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *expression, oss_select_object_params_t *select_params, aos_string_t *filename, aos_table_t **resp_headers) { return oss_do_select_object_to_file(options, bucket, object, expression, select_params, NULL, NULL, filename, NULL, resp_headers); } aos_status_t *oss_do_select_object_to_file(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, const aos_string_t *expression, oss_select_object_params_t *select_params, aos_table_t *headers, aos_table_t *params, aos_string_t *filename, oss_progress_callback progress_callback, aos_table_t **resp_headers) { int res = AOSE_OK; aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_list_t body; unsigned char *md5 = NULL; char *buf = NULL; int64_t body_len; char *b64_value = NULL; int b64_buf_len = (20 + 1) * 4 / 3; int b64_len; aos_string_t tmp_filename; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); /*init query_params*/ query_params = aos_table_create_if_null(options, params, 1); apr_table_add(query_params, OSS_PROCESS, "csv/select"); /*init headers*/ headers = aos_table_create_if_null(options, headers, 1); apr_table_add(headers, OSS_CONTENT_TYPE, "application/x-www-form-urlencoded"); oss_init_object_request(options, bucket, object, HTTP_POST, &req, query_params, headers, progress_callback, 0, &resp); /*create temp file*/ oss_get_temporary_file_name(options->pool, filename, &tmp_filename); res = oss_init_read_response_body_to_file(options->pool, &tmp_filename, resp); if (res != AOSE_OK) { s = aos_status_create(options->pool); aos_file_error_status_set(s, res); return s; } /*build post data*/ oss_build_select_object_body(options->pool, expression, select_params, &body); /*add Content-MD5*/ body_len = aos_buf_list_len(&body); buf = aos_buf_list_content(options->pool, &body); md5 = aos_md5(options->pool, buf, (apr_size_t)body_len); b64_value = aos_pcalloc(options->pool, b64_buf_len); b64_len = aos_base64_encode(md5, 20, b64_value); b64_value[b64_len] = '\0'; apr_table_addn(headers, OSS_CONTENT_MD5, b64_value); oss_write_request_body_from_buffer(&body, req); oss_init_select_object_read_response_body(options->pool, resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); oss_check_select_object_status(resp, s); oss_temp_file_rename(s, tmp_filename.data, filename->data, options->pool); return s; } aos_status_t *oss_create_select_object_meta(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, oss_select_object_meta_params_t *meta_params, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; aos_list_t body; unsigned char *md5 = NULL; char *buf = NULL; int64_t body_len; char *b64_value = NULL; int b64_buf_len = (20 + 1) * 4 / 3; int b64_len; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); /*init query_params*/ query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_PROCESS, "csv/meta"); /*init headers*/ headers = aos_table_create_if_null(options, headers, 1); apr_table_add(headers, OSS_CONTENT_TYPE, "application/x-www-form-urlencoded"); oss_init_object_request(options, bucket, object, HTTP_POST, &req, query_params, headers, NULL, 0, &resp); /*build post data*/ oss_build_create_select_object_meta_body(options->pool, meta_params, &body); /*add Content-MD5*/ body_len = aos_buf_list_len(&body); buf = aos_buf_list_content(options->pool, &body); md5 = aos_md5(options->pool, buf, (apr_size_t)body_len); b64_value = aos_pcalloc(options->pool, b64_buf_len); b64_len = aos_base64_encode(md5, 20, b64_value); b64_value[b64_len] = '\0'; apr_table_addn(headers, OSS_CONTENT_MD5, b64_value); oss_write_request_body_from_buffer(&body, req); oss_init_create_select_object_meta_read_response_body(options->pool, resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); oss_check_create_select_object_meta_status(resp, s, meta_params); return s; } aos_status_t *oss_put_object_tagging(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_list_t *tag_list, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; apr_table_t *query_params = NULL; aos_table_t *headers = NULL; aos_list_t body; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); //init query_params query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_TAGGING, ""); //init headers headers = aos_table_create_if_null(options, headers, 0); oss_init_object_request(options, bucket, object, HTTP_PUT, &req, query_params, headers, NULL, 0, &resp); build_object_tagging_body(options->pool, tag_list, &body); oss_write_request_body_from_buffer(&body, req); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } aos_status_t *oss_get_object_tagging(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_list_t *tag_list, aos_table_t **resp_headers) { aos_status_t *s = NULL; int res; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_TAGGING, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_object_request(options, bucket, object, HTTP_GET, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); if (!aos_status_is_ok(s)) { return s; } res = oss_get_tagging_parse_from_body(options->pool, &resp->body, tag_list); if (res != AOSE_OK) { aos_xml_error_status_set(s, res); } return s; } aos_status_t *oss_delete_object_tagging(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_table_t **resp_headers) { aos_status_t *s = NULL; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *query_params = NULL; aos_table_t *headers = NULL; oss_ensure_bucket_name_valid(bucket); oss_ensure_object_name_valid(object); query_params = aos_table_create_if_null(options, query_params, 1); apr_table_add(query_params, OSS_TAGGING, ""); headers = aos_table_create_if_null(options, headers, 0); oss_init_object_request(options, bucket, object, HTTP_DELETE, &req, query_params, headers, NULL, 0, &resp); s = oss_process_request(options, req, resp); oss_fill_read_response_header(resp, resp_headers); return s; } ================================================ FILE: oss_c_sdk/oss_resumable.c ================================================ #include "aos_log.h" #include "aos_define.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "aos_crc64.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_resumable.h" int32_t oss_get_thread_num(oss_resumable_clt_params_t *clt_params) { if ((NULL == clt_params) || (clt_params->thread_num <= 0 || clt_params->thread_num > 1024)) { return 1; } return clt_params->thread_num; } void oss_get_upload_checkpoint_path(oss_resumable_clt_params_t *clt_params, const aos_string_t *filepath, aos_pool_t *pool, aos_string_t *checkpoint_path) { if ((NULL == checkpoint_path) || (NULL == clt_params) || (!clt_params->enable_checkpoint)) { return; } if (aos_is_null_string(&clt_params->checkpoint_path)) { int len = filepath->len + strlen(".ucp") + 1; char *buffer = (char *)aos_pcalloc(pool, len); apr_snprintf(buffer, len, "%.*s.ucp", filepath->len, filepath->data); aos_str_set(checkpoint_path , buffer); return; } checkpoint_path->data = clt_params->checkpoint_path.data; checkpoint_path->len = clt_params->checkpoint_path.len; } void oss_get_download_checkpoint_path(oss_resumable_clt_params_t *clt_params, const aos_string_t *filepath, aos_pool_t *pool, aos_string_t *checkpoint_path) { if ((NULL == checkpoint_path) || (NULL == clt_params) || (!clt_params->enable_checkpoint)) { return; } if (aos_is_null_string(&clt_params->checkpoint_path)) { int len = filepath->len + strlen(".dcp") + 1; char *buffer = (char *)aos_pcalloc(pool, len); apr_snprintf(buffer, len, "%.*s.dcp", filepath->len, filepath->data); aos_str_set(checkpoint_path , buffer); return; } checkpoint_path->data = clt_params->checkpoint_path.data; checkpoint_path->len = clt_params->checkpoint_path.len; } int oss_get_file_info(const aos_string_t *filepath, aos_pool_t *pool, apr_finfo_t *finfo) { apr_status_t s; char buf[256]; apr_file_t *thefile; s = apr_file_open(&thefile, filepath->data, APR_READ, APR_UREAD | APR_GREAD, pool); if (s != APR_SUCCESS) { aos_error_log("apr_file_open failure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); return s; } s = apr_file_info_get(finfo, APR_FINFO_SIZE | APR_FINFO_MTIME, thefile); if (s != APR_SUCCESS) { apr_file_close(thefile); aos_error_log("apr_file_info_get failure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); return s; } apr_file_close(thefile); return AOSE_OK; } int oss_does_file_exist(const aos_string_t *filepath, aos_pool_t *pool) { apr_status_t s; apr_file_t *thefile; s = apr_file_open(&thefile, filepath->data, APR_READ, APR_UREAD | APR_GREAD, pool); if (s != APR_SUCCESS) { return AOS_FALSE; } apr_file_close(thefile); return AOS_TRUE; } int oss_open_checkpoint_file(aos_pool_t *pool, aos_string_t *checkpoint_path, oss_checkpoint_t *checkpoint) { apr_status_t s; apr_file_t *thefile; char buf[256]; s = apr_file_open(&thefile, checkpoint_path->data, APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, pool); if (s == APR_SUCCESS) { checkpoint->thefile = thefile; } else { aos_error_log("apr_file_open failure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); } return s; } int oss_get_part_num(int64_t file_size, int64_t part_size) { int64_t num = 0; int64_t left = 0; left = (file_size % part_size == 0) ? 0 : 1; num = file_size / part_size + left; return (int)num; } void oss_build_parts(int64_t file_size, int64_t part_size, oss_checkpoint_part_t *parts) { int i = 0; for (; i * part_size < file_size; i++) { parts[i].index = i; parts[i].offset = i * part_size; parts[i].size = aos_min(part_size, (file_size - i * part_size)); parts[i].completed = AOS_FALSE; } } void oss_build_thread_params(oss_thread_params_t *thd_params, int part_num, aos_pool_t *parent_pool, oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_string_t *upload_id, oss_checkpoint_part_t *parts, oss_part_task_result_t *result) { int i = 0; aos_pool_t *subpool = NULL; oss_config_t *config = NULL; aos_http_controller_t *ctl; for (; i < part_num; i++) { aos_pool_create(&subpool, parent_pool); config = oss_config_create(subpool); memcpy(config, options->config, sizeof(oss_config_t)); ctl = aos_http_controller_create(subpool, 0); thd_params[i].options.config = config; thd_params[i].options.ctl = ctl; thd_params[i].options.ctl->options = options->ctl->options; thd_params[i].options.pool = subpool; thd_params[i].bucket = bucket; thd_params[i].object = object; thd_params[i].filepath = filepath; thd_params[i].upload_id = upload_id; thd_params[i].part = parts + i; thd_params[i].result = result + i; thd_params[i].result->part = thd_params[i].part; } } void oss_destroy_thread_pool(oss_thread_params_t *thd_params, int part_num) { int i = 0; for (; i < part_num; i++) { aos_pool_destroy(thd_params[i].options.pool); } } void oss_set_task_tracker(oss_thread_params_t *thd_params, int part_num, apr_uint32_t *launched, apr_uint32_t *failed, apr_uint32_t *completed, apr_queue_t *failed_parts, apr_queue_t *completed_parts) { int i = 0; for (; i < part_num; i++) { thd_params[i].launched = launched; thd_params[i].failed = failed; thd_params[i].completed = completed; thd_params[i].failed_parts = failed_parts; thd_params[i].completed_parts = completed_parts; } } int oss_verify_checkpoint_md5(aos_pool_t *pool, const oss_checkpoint_t *checkpoint) { return AOS_TRUE; } void oss_build_upload_checkpoint(aos_pool_t *pool, oss_checkpoint_t *checkpoint, aos_string_t *file_path, apr_finfo_t *finfo, aos_string_t *upload_id, int64_t part_size) { int i = 0; checkpoint->cp_type = OSS_CP_UPLOAD; aos_str_set(&checkpoint->file_path, aos_pstrdup(pool, file_path)); checkpoint->file_size = finfo->size; checkpoint->file_last_modified = finfo->mtime; aos_str_set(&checkpoint->upload_id, aos_pstrdup(pool, upload_id)); checkpoint->part_size = part_size; for (; i * part_size < finfo->size; i++) { checkpoint->parts[i].index = i; checkpoint->parts[i].offset = i * part_size; checkpoint->parts[i].size = aos_min(part_size, (finfo->size - i * part_size)); checkpoint->parts[i].completed = AOS_FALSE; aos_str_set(&checkpoint->parts[i].etag , ""); } checkpoint->part_num = i; } void oss_build_download_checkpoint(aos_pool_t *pool, oss_checkpoint_t *checkpoint, aos_string_t *file_path, const char *object_name, int64_t object_size, const char *object_last_modified, const char *object_etag, int64_t part_size) { int i = 0; checkpoint->cp_type = OSS_CP_DOWNLOAD; checkpoint->thefile = NULL; aos_str_set(&checkpoint->file_path, aos_pstrdup(pool, file_path)); aos_str_set(&checkpoint->object_name, object_name); checkpoint->object_size = object_size; aos_str_set(&checkpoint->object_last_modified, object_last_modified); aos_str_set(&checkpoint->object_etag, object_etag); checkpoint->part_size = part_size; for (; i * part_size < object_size; i++) { checkpoint->parts[i].index = i; checkpoint->parts[i].offset = i * part_size; checkpoint->parts[i].size = aos_min(part_size, (object_size - i * part_size)); checkpoint->parts[i].completed = AOS_FALSE; aos_str_set(&checkpoint->parts[i].etag , ""); } checkpoint->part_num = i; } int oss_dump_checkpoint(aos_pool_t *pool, const oss_checkpoint_t *checkpoint) { char *xml_body = NULL; apr_status_t s; char buf[256]; apr_size_t len; // to xml xml_body = oss_build_checkpoint_xml(pool, checkpoint); if (NULL == xml_body) { return AOSE_OUT_MEMORY; } // truncate to empty s = apr_file_trunc(checkpoint->thefile, 0); if (s != APR_SUCCESS) { aos_error_log("apr_file_write failure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); return AOSE_FILE_TRUNC_ERROR; } // write to file len = strlen(xml_body); s = apr_file_write(checkpoint->thefile, xml_body, &len); if (s != APR_SUCCESS) { aos_error_log("apr_file_write failure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); return AOSE_FILE_WRITE_ERROR; } // flush file s = apr_file_flush(checkpoint->thefile); if (s != APR_SUCCESS) { aos_error_log("apr_file_flush failure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); return AOSE_FILE_FLUSH_ERROR; } return AOSE_OK; } int oss_load_checkpoint(aos_pool_t *pool, const aos_string_t *filepath, oss_checkpoint_t *checkpoint) { apr_status_t s; char buf[256]; apr_size_t len; apr_finfo_t finfo; char *xml_body = NULL; apr_file_t *thefile; // open file s = apr_file_open(&thefile, filepath->data, APR_READ, APR_UREAD | APR_GREAD, pool); if (s != APR_SUCCESS) { aos_error_log("apr_file_open failure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); return AOSE_OPEN_FILE_ERROR; } // get file stat s = apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile); if (s != APR_SUCCESS) { aos_error_log("apr_file_info_get failure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); apr_file_close(thefile); return AOSE_FILE_INFO_ERROR; } xml_body = (char *)aos_palloc(pool, (apr_size_t)(finfo.size + 1)); // read s = apr_file_read_full(thefile, xml_body, (apr_size_t)finfo.size, &len); if (s != APR_SUCCESS) { aos_error_log("apr_file_read_full failure, code:%d %s.", s, apr_strerror(s, buf, sizeof(buf))); apr_file_close(thefile); return AOSE_FILE_READ_ERROR; } apr_file_close(thefile); xml_body[len] = '\0'; // parse return oss_checkpoint_parse_from_body(pool, xml_body, checkpoint); } int oss_is_upload_checkpoint_valid(aos_pool_t *pool, oss_checkpoint_t *checkpoint, apr_finfo_t *finfo) { if (oss_verify_checkpoint_md5(pool, checkpoint) && (checkpoint->cp_type == OSS_CP_UPLOAD) && (checkpoint->file_size == finfo->size) && (checkpoint->file_last_modified == finfo->mtime)) { return AOS_TRUE; } return AOS_FALSE; } int oss_is_download_checkpoint_valid(aos_pool_t *pool, oss_checkpoint_t *checkpoint, const char *object_name, int64_t object_size, const char *object_last_modified, const char *object_etag) { if (oss_verify_checkpoint_md5(pool, checkpoint) && (checkpoint->cp_type == OSS_CP_DOWNLOAD) && (checkpoint->object_size == object_size) && !strcmp(checkpoint->object_last_modified.data, object_last_modified) && !strcasecmp(checkpoint->object_etag.data, object_etag)) { return AOS_TRUE; } return AOS_FALSE; } void oss_update_checkpoint(aos_pool_t *pool, oss_checkpoint_t *checkpoint, int32_t part_index, aos_string_t *etag, uint64_t crc64) { char *p = NULL; checkpoint->parts[part_index].completed = AOS_TRUE; p = apr_pstrdup(pool, etag->data); aos_str_set(&checkpoint->parts[part_index].etag, p); checkpoint->parts[part_index].crc64 = crc64; } void oss_get_checkpoint_todo_parts(oss_checkpoint_t *checkpoint, int *part_num, oss_checkpoint_part_t *parts) { int i = 0; int idx = 0; for (; i < checkpoint->part_num; i++) { if (!checkpoint->parts[i].completed) { parts[idx].index = checkpoint->parts[i].index; parts[idx].offset = checkpoint->parts[i].offset; parts[idx].size = checkpoint->parts[i].size; parts[idx].completed = checkpoint->parts[i].completed; parts[idx].crc64 = checkpoint->parts[i].crc64; idx++; } } *part_num = idx; } static void oss_get_checkpoint_done_parts_size(oss_checkpoint_t *checkpoint, int64_t *size) { int i = 0; int64_t total = 0; for (; i < checkpoint->part_num; i++) { if (checkpoint->parts[i].completed) { total += checkpoint->parts[i].size; } } *size = total; } void * APR_THREAD_FUNC upload_part(apr_thread_t *thd, void *data) { aos_status_t *s = NULL; oss_thread_params_t *params = NULL; oss_upload_file_t *upload_file = NULL; aos_table_t *resp_headers = NULL; int part_num; char *etag; params = (oss_thread_params_t *)data; if (apr_atomic_read32(params->failed) > 0) { apr_atomic_inc32(params->launched); return NULL; } part_num = params->part->index + 1; upload_file = oss_create_upload_file(params->options.pool); aos_str_set(&upload_file->filename, params->filepath->data); upload_file->file_pos = params->part->offset; upload_file->file_last = params->part->offset + params->part->size; s = oss_upload_part_from_file(¶ms->options, params->bucket, params->object, params->upload_id, part_num, upload_file, &resp_headers); if (!aos_status_is_ok(s)) { apr_atomic_inc32(params->failed); params->result->s = s; apr_queue_push(params->failed_parts, params->result); return s; } etag = apr_pstrdup(params->options.pool, (char*)apr_table_get(resp_headers, "ETag")); aos_str_set(¶ms->result->etag, etag); apr_atomic_inc32(params->completed); apr_queue_push(params->completed_parts, params->result); return NULL; } aos_status_t *oss_resumable_upload_file_without_cp(oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_table_t *headers, aos_table_t *params, int32_t thread_num, int64_t part_size, apr_finfo_t *finfo, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body) { aos_pool_t *subpool = NULL; aos_pool_t *parent_pool = NULL; aos_status_t *s = NULL; aos_status_t *ret = NULL; aos_list_t completed_part_list; oss_complete_part_content_t *complete_content = NULL; aos_string_t upload_id; oss_checkpoint_part_t *parts; oss_part_task_result_t *results; oss_part_task_result_t *task_res; oss_thread_params_t *thd_params; aos_table_t *cb_headers = NULL; apr_thread_pool_t *thdp; apr_uint32_t launched = 0; apr_uint32_t failed = 0; apr_uint32_t completed = 0; apr_uint32_t total_num = 0; apr_queue_t *failed_parts; apr_queue_t *completed_parts; int64_t consume_bytes = 0; void *task_result; char *part_num_str; char *etag; int part_num = 0; int i = 0; int rv; // prepare parent_pool = options->pool; ret = aos_status_create(parent_pool); part_num = oss_get_part_num(finfo->size, part_size); parts = (oss_checkpoint_part_t *)aos_palloc(parent_pool, sizeof(oss_checkpoint_part_t) * part_num); oss_build_parts(finfo->size, part_size, parts); results = (oss_part_task_result_t *)aos_palloc(parent_pool, sizeof(oss_part_task_result_t) * part_num); thd_params = (oss_thread_params_t *)aos_palloc(parent_pool, sizeof(oss_thread_params_t) * part_num); oss_build_thread_params(thd_params, part_num, parent_pool, options, bucket, object, filepath, &upload_id, parts, results); // init upload aos_pool_create(&subpool, parent_pool); options->pool = subpool; s = oss_init_multipart_upload(options, bucket, object, &upload_id, headers, resp_headers); if (!aos_status_is_ok(s)) { s = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; return s; } aos_str_set(&upload_id, apr_pstrdup(parent_pool, upload_id.data)); options->pool = parent_pool; aos_pool_destroy(subpool); // upload parts rv = apr_thread_pool_create(&thdp, 0, thread_num, parent_pool); if (APR_SUCCESS != rv) { aos_status_set(ret, rv, AOS_CREATE_THREAD_POOL_ERROR_CODE, NULL); return ret; } rv = apr_queue_create(&failed_parts, part_num, parent_pool); if (APR_SUCCESS != rv) { aos_status_set(ret, rv, AOS_CREATE_QUEUE_ERROR_CODE, NULL); return ret; } rv = apr_queue_create(&completed_parts, part_num, parent_pool); if (APR_SUCCESS != rv) { aos_status_set(ret, rv, AOS_CREATE_QUEUE_ERROR_CODE, NULL); return ret; } // launch oss_set_task_tracker(thd_params, part_num, &launched, &failed, &completed, failed_parts, completed_parts); for (i = 0; i < part_num; i++) { apr_thread_pool_push(thdp, upload_part, thd_params + i, 0, NULL); } // wait until all tasks exit total_num = apr_atomic_read32(&launched) + apr_atomic_read32(&failed) + apr_atomic_read32(&completed); for ( ; total_num < (apr_uint32_t)part_num; ) { rv = apr_queue_trypop(completed_parts, &task_result); if (rv == APR_EINTR || rv == APR_EAGAIN) { apr_sleep(1000); } else if(rv == APR_EOF) { break; } else if(rv == APR_SUCCESS) { task_res = (oss_part_task_result_t*)task_result; if (NULL != progress_callback) { consume_bytes += task_res->part->size; progress_callback(consume_bytes, finfo->size); } } total_num = apr_atomic_read32(&launched) + apr_atomic_read32(&failed) + apr_atomic_read32(&completed); } // deal with left successful parts while(APR_SUCCESS == apr_queue_trypop(completed_parts, &task_result)) { task_res = (oss_part_task_result_t*)task_result; if (NULL != progress_callback) { consume_bytes += task_res->part->size; progress_callback(consume_bytes, finfo->size); } } // failed if (apr_atomic_read32(&failed) > 0) { apr_queue_pop(failed_parts, &task_result); task_res = (oss_part_task_result_t*)task_result; s = aos_status_dup(parent_pool, task_res->s); oss_destroy_thread_pool(thd_params, part_num); return s; } // successful aos_pool_create(&subpool, parent_pool); aos_list_init(&completed_part_list); for (i = 0; i < part_num; i++) { complete_content = oss_create_complete_part_content(subpool); part_num_str = apr_psprintf(subpool, "%d", thd_params[i].part->index + 1); aos_str_set(&complete_content->part_number, part_num_str); etag = apr_pstrdup(subpool, thd_params[i].result->etag.data); aos_str_set(&complete_content->etag, etag); aos_list_add_tail(&complete_content->node, &completed_part_list); } oss_destroy_thread_pool(thd_params, part_num); // complete upload options->pool = subpool; if (NULL != headers && NULL != apr_table_get(headers, OSS_CALLBACK)) { cb_headers = aos_table_make(subpool, 2); apr_table_set(cb_headers, OSS_CALLBACK, apr_table_get(headers, OSS_CALLBACK)); if (NULL != apr_table_get(headers, OSS_CALLBACK_VAR)) { apr_table_set(cb_headers, OSS_CALLBACK_VAR, apr_table_get(headers, OSS_CALLBACK_VAR)); } } s = oss_do_complete_multipart_upload(options, bucket, object, &upload_id, &completed_part_list, cb_headers, NULL, resp_headers, resp_body); s = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; return s; } aos_status_t *oss_resumable_upload_file_with_cp(oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_table_t *headers, aos_table_t *params, int32_t thread_num, int64_t part_size, aos_string_t *checkpoint_path, apr_finfo_t *finfo, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body) { aos_pool_t *subpool = NULL; aos_pool_t *parent_pool = NULL; aos_status_t *s = NULL; aos_status_t *ret = NULL; aos_list_t completed_part_list; oss_complete_part_content_t *complete_content = NULL; aos_string_t upload_id; oss_checkpoint_part_t *parts; oss_part_task_result_t *results; oss_part_task_result_t *task_res; oss_thread_params_t *thd_params; aos_table_t *cb_headers = NULL; apr_thread_pool_t *thdp; apr_uint32_t launched = 0; apr_uint32_t failed = 0; apr_uint32_t completed = 0; apr_uint32_t total_num = 0; apr_queue_t *failed_parts; apr_queue_t *completed_parts; oss_checkpoint_t *checkpoint = NULL; int need_init_upload = AOS_TRUE; int has_left_result = AOS_FALSE; int64_t consume_bytes = 0; void *task_result; char *part_num_str; int part_num = 0; int i = 0; int rv; // checkpoint parent_pool = options->pool; ret = aos_status_create(parent_pool); checkpoint = oss_create_checkpoint_content(parent_pool); if(oss_does_file_exist(checkpoint_path, parent_pool)) { if (AOSE_OK == oss_load_checkpoint(parent_pool, checkpoint_path, checkpoint) && oss_is_upload_checkpoint_valid(parent_pool, checkpoint, finfo)) { aos_str_set(&upload_id, checkpoint->upload_id.data); need_init_upload = AOS_FALSE; } else { apr_file_remove(checkpoint_path->data, parent_pool); } } if (need_init_upload) { // init upload aos_pool_create(&subpool, parent_pool); options->pool = subpool; s = oss_init_multipart_upload(options, bucket, object, &upload_id, headers, resp_headers); if (!aos_status_is_ok(s)) { s = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; return s; } aos_str_set(&upload_id, apr_pstrdup(parent_pool, upload_id.data)); options->pool = parent_pool; aos_pool_destroy(subpool); // build checkpoint oss_build_upload_checkpoint(parent_pool, checkpoint, filepath, finfo, &upload_id, part_size); } rv = oss_open_checkpoint_file(parent_pool, checkpoint_path, checkpoint); if (rv != APR_SUCCESS) { aos_status_set(ret, rv, AOS_OPEN_FILE_ERROR_CODE, NULL); return ret; } // prepare ret = aos_status_create(parent_pool); parts = (oss_checkpoint_part_t *)aos_palloc(parent_pool, sizeof(oss_checkpoint_part_t) * (checkpoint->part_num)); oss_get_checkpoint_todo_parts(checkpoint, &part_num, parts); oss_get_checkpoint_done_parts_size(checkpoint, &consume_bytes); results = (oss_part_task_result_t *)aos_palloc(parent_pool, sizeof(oss_part_task_result_t) * part_num); thd_params = (oss_thread_params_t *)aos_palloc(parent_pool, sizeof(oss_thread_params_t) * part_num); oss_build_thread_params(thd_params, part_num, parent_pool, options, bucket, object, filepath, &upload_id, parts, results); // upload parts rv = apr_thread_pool_create(&thdp, 0, thread_num, parent_pool); if (APR_SUCCESS != rv) { aos_status_set(ret, rv, AOS_CREATE_THREAD_POOL_ERROR_CODE, NULL); return ret; } rv = apr_queue_create(&failed_parts, part_num, parent_pool); if (APR_SUCCESS != rv) { aos_status_set(ret, rv, AOS_CREATE_QUEUE_ERROR_CODE, NULL); return ret; } rv = apr_queue_create(&completed_parts, part_num, parent_pool); if (APR_SUCCESS != rv) { aos_status_set(ret, rv, AOS_CREATE_QUEUE_ERROR_CODE, NULL); return ret; } // launch oss_set_task_tracker(thd_params, part_num, &launched, &failed, &completed, failed_parts, completed_parts); for (i = 0; i < part_num; i++) { apr_thread_pool_push(thdp, upload_part, thd_params + i, 0, NULL); } // wait until all tasks exit total_num = apr_atomic_read32(&launched) + apr_atomic_read32(&failed) + apr_atomic_read32(&completed); for ( ; total_num < (apr_uint32_t)part_num; ) { rv = apr_queue_trypop(completed_parts, &task_result); if (rv == APR_EINTR || rv == APR_EAGAIN) { apr_sleep(1000); } else if(rv == APR_EOF) { break; } else if(rv == APR_SUCCESS) { task_res = (oss_part_task_result_t*)task_result; oss_update_checkpoint(parent_pool, checkpoint, task_res->part->index, &task_res->etag, 0); rv = oss_dump_checkpoint(parent_pool, checkpoint); if (rv != AOSE_OK) { int idx = task_res->part->index; aos_status_set(ret, rv, AOS_WRITE_FILE_ERROR_CODE, NULL); apr_atomic_inc32(&failed); thd_params[idx].result->s = ret; apr_queue_push(failed_parts, thd_params[idx].result); } if (NULL != progress_callback) { consume_bytes += task_res->part->size; progress_callback(consume_bytes, finfo->size); } } total_num = apr_atomic_read32(&launched) + apr_atomic_read32(&failed) + apr_atomic_read32(&completed); } // deal with left successful parts while(APR_SUCCESS == apr_queue_trypop(completed_parts, &task_result)) { task_res = (oss_part_task_result_t*)task_result; oss_update_checkpoint(parent_pool, checkpoint, task_res->part->index, &task_res->etag, 0); consume_bytes += task_res->part->size; has_left_result = AOS_TRUE; } if (has_left_result) { rv = oss_dump_checkpoint(parent_pool, checkpoint); if (rv != AOSE_OK) { aos_status_set(ret, rv, AOS_WRITE_FILE_ERROR_CODE, NULL); return ret; } if (NULL != progress_callback) { progress_callback(consume_bytes, finfo->size); } } apr_file_close(checkpoint->thefile); // failed if (apr_atomic_read32(&failed) > 0) { apr_queue_pop(failed_parts, &task_result); task_res = (oss_part_task_result_t*)task_result; s = aos_status_dup(parent_pool, task_res->s); oss_destroy_thread_pool(thd_params, part_num); return s; } // successful aos_pool_create(&subpool, parent_pool); aos_list_init(&completed_part_list); for (i = 0; i < checkpoint->part_num; i++) { complete_content = oss_create_complete_part_content(subpool); part_num_str = apr_psprintf(subpool, "%d", checkpoint->parts[i].index + 1); aos_str_set(&complete_content->part_number, part_num_str); aos_str_set(&complete_content->etag, checkpoint->parts[i].etag.data); aos_list_add_tail(&complete_content->node, &completed_part_list); } oss_destroy_thread_pool(thd_params, part_num); // complete upload options->pool = subpool; if (NULL != headers && NULL != apr_table_get(headers, OSS_CALLBACK)) { cb_headers = aos_table_make(subpool, 2); apr_table_set(cb_headers, OSS_CALLBACK, apr_table_get(headers, OSS_CALLBACK)); if (NULL != apr_table_get(headers, OSS_CALLBACK_VAR)) { apr_table_set(cb_headers, OSS_CALLBACK_VAR, apr_table_get(headers, OSS_CALLBACK_VAR)); } } s = oss_do_complete_multipart_upload(options, bucket, object, &upload_id, &completed_part_list, cb_headers, NULL, resp_headers, resp_body); s = aos_status_dup(parent_pool, s); aos_pool_destroy(subpool); options->pool = parent_pool; // remove chepoint file apr_file_remove(checkpoint_path->data, parent_pool); return s; } aos_status_t *oss_resumable_upload_file(oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_table_t *headers, aos_table_t *params, oss_resumable_clt_params_t *clt_params, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body) { int32_t thread_num = 0; int64_t part_size = 0; aos_string_t checkpoint_path; aos_pool_t *sub_pool; apr_finfo_t finfo; aos_status_t *s; int res; oss_ensure_bucket_name_valid(bucket); thread_num = oss_get_thread_num(clt_params); aos_pool_create(&sub_pool, options->pool); res = oss_get_file_info(filepath, sub_pool, &finfo); if (res != AOSE_OK) { aos_error_log("Open read file fail, filename:%s\n", filepath->data); s = aos_status_create(options->pool); aos_file_error_status_set(s, res); aos_pool_destroy(sub_pool); return s; } part_size = clt_params->part_size; oss_get_part_size(finfo.size, &part_size); if (NULL != clt_params && clt_params->enable_checkpoint) { oss_get_upload_checkpoint_path(clt_params, filepath, sub_pool, &checkpoint_path); s = oss_resumable_upload_file_with_cp(options, bucket, object, filepath, headers, params, thread_num, part_size, &checkpoint_path, &finfo, progress_callback, resp_headers, resp_body); } else { s = oss_resumable_upload_file_without_cp(options, bucket, object, filepath, headers, params, thread_num, part_size, &finfo, progress_callback, resp_headers, resp_body); } aos_pool_destroy(sub_pool); return s; } static void download_part(oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, oss_checkpoint_part_t *part, const aos_string_t *filepath, oss_part_task_result_t *result) { aos_status_t *s = NULL; aos_table_t *resp_headers = NULL; int rv; aos_http_request_t *req = NULL; aos_http_response_t *resp = NULL; aos_table_t *headers = NULL; aos_table_t *query_params = NULL; aos_file_buf_t *fb = NULL; apr_off_t offset = 0; headers = aos_table_create_if_null(options, headers, 0); query_params = aos_table_create_if_null(options, query_params, 0); oss_headers_add_range(options->pool, headers, part->offset, part->size); fb = aos_create_file_buf(options->pool); if ((rv = aos_open_file_for_write_notrunc(options->pool, filepath->data, fb)) != AOSE_OK) { aos_error_log("Open write file fail, filename:%s\n", filepath->data); result->s = aos_status_create(options->pool); aos_file_error_status_set(result->s, rv); return; } offset = part->offset; apr_file_seek(fb->file, APR_SET, &offset); oss_init_object_request(options, bucket, object, HTTP_GET, &req, query_params, headers, NULL, 0, &resp); oss_init_read_response_body_to_fb(fb, filepath, resp); s = oss_process_request(options, req, resp); if (!aos_status_is_ok(s)) { result->s = s; } else { // success const char *etag; oss_fill_read_response_header(resp, &resp_headers); etag = apr_table_get(resp_headers, "Etag"); if (etag) { aos_str_set(&result->etag, apr_pstrdup(options->pool, etag)); } result->crc64 = resp->crc64; result->s = s; } apr_file_close(fb->file); return; } void *APR_THREAD_FUNC download_part_thread(apr_thread_t *thd, void *data) { apr_queue_t *task_queue = (apr_queue_t *)data; while (1) { apr_status_t status; oss_thread_params_t *params; status = apr_queue_trypop(task_queue, (void **)¶ms); if (status != APR_SUCCESS) break; if (apr_atomic_read32(params->failed) > 0) { // skip unstarted parts if parts failure happened apr_queue_push(params->task_result_queue, NULL); } else { download_part(¶ms->options, params->bucket, params->object, params->part, params->filepath, params->result); apr_queue_push(params->task_result_queue, params->result); } } return NULL; } aos_status_t *oss_resumable_download_file_internal(oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_table_t *headers, aos_table_t *params, int32_t thread_num, int64_t part_size, aos_string_t *checkpoint_path, oss_progress_callback progress_callback, aos_table_t **resp_headers) { aos_status_t *s = NULL; int need_init_download = AOS_TRUE; oss_checkpoint_t *checkpoint = NULL; aos_table_t *head_resp_headers = NULL; aos_string_t tmp_filename; int i = 0; int part_num = 0; int64_t object_size = 0; const char *object_size_str = NULL; const char *object_last_modified = NULL; const char *object_etag = NULL; const char *crc64_str = NULL; oss_checkpoint_part_t *parts; oss_part_task_result_t *results; oss_part_task_result_t *task_res; oss_thread_params_t *thd_params; apr_uint32_t failed = 0; apr_queue_t *failed_parts; apr_queue_t *completed_parts; apr_queue_t *task_queue; apr_queue_t *task_result_queue; int64_t consume_bytes = 0; aos_file_buf_t *fb = NULL; apr_thread_t **thd_ids = NULL; int rv = AOSE_OK; oss_get_temporary_file_name(options->pool, filepath, &tmp_filename); // head object info s = oss_head_object(options, bucket, object, headers, &head_resp_headers); *resp_headers = head_resp_headers; if (!aos_status_is_ok(s)) return s; object_last_modified = apr_table_get(head_resp_headers, "Last-Modified"); object_etag = apr_table_get(head_resp_headers, "ETag"); object_size_str = apr_table_get(head_resp_headers, OSS_CONTENT_LENGTH); crc64_str = apr_table_get(head_resp_headers, OSS_HASH_CRC64_ECMA); if (!object_last_modified || !object_etag || !object_size_str) { // Invalid http response header s = aos_status_create(options->pool); aos_status_set(s, AOSE_INTERNAL_ERROR, AOS_SERVER_ERROR_CODE, "Unexpected response header"); return s; } object_size = aos_atoi64(object_size_str); // ensure part_num will not exceed OSS_MAX_PART_NUM if (part_size * OSS_MAX_PART_NUM < object_size) { part_size = (object_size + OSS_MAX_PART_NUM - 1) / OSS_MAX_PART_NUM; aos_warn_log("Part number larger than max limit, " "part size Changed to:%" APR_INT64_T_FMT "\n", part_size); } need_init_download = AOS_TRUE; checkpoint = oss_create_checkpoint_content(options->pool); if (checkpoint_path) { do { apr_finfo_t tmp_finfo; if (!oss_does_file_exist(checkpoint_path, options->pool)) break; if (AOSE_OK != oss_load_checkpoint(options->pool, checkpoint_path, checkpoint)) break; if (!oss_is_download_checkpoint_valid(options->pool, checkpoint, object->data, object_size, object_last_modified, object_etag)) break; if (!oss_does_file_exist(&tmp_filename, options->pool)) break; if (apr_stat(&tmp_finfo, tmp_filename.data, APR_FINFO_SIZE, options->pool) != APR_SUCCESS || object_size != tmp_finfo.size) break; need_init_download = AOS_FALSE; } while (0); } if (need_init_download) { aos_debug_log("need init download\n"); // build checkpoint oss_build_download_checkpoint(options->pool, checkpoint, filepath, object->data, object_size, object_last_modified, object_etag, part_size); } if (checkpoint_path) { if ((rv = oss_open_checkpoint_file(options->pool, checkpoint_path, checkpoint)) != APR_SUCCESS) { s = aos_status_create(options->pool); aos_status_set(s, rv, AOS_OPEN_FILE_ERROR_CODE, NULL); return s; } } // Open and truncate the tmp file. fb = aos_create_file_buf(options->pool); if ((rv = aos_open_file_for_write_notrunc(options->pool, tmp_filename.data, fb)) != AOSE_OK) { if (checkpoint->thefile) apr_file_close(checkpoint->thefile); aos_error_log("Open write file fail, filename:%s\n", tmp_filename.data); aos_file_error_status_set(s, rv); return s; } apr_file_trunc(fb->file, object_size); apr_file_close(fb->file); parts = (oss_checkpoint_part_t *)aos_palloc(options->pool, sizeof(*parts) * checkpoint->part_num); oss_get_checkpoint_todo_parts(checkpoint, &part_num, parts); oss_get_checkpoint_done_parts_size(checkpoint, &consume_bytes); results = (oss_part_task_result_t *)aos_palloc(options->pool, sizeof(*results) * part_num); thd_params = (oss_thread_params_t *)aos_palloc(options->pool, sizeof(*thd_params) * part_num); oss_build_thread_params(thd_params, part_num, options->pool, options, bucket, object, &tmp_filename, NULL, parts, results); thd_ids = (apr_thread_t **)aos_palloc(options->pool, sizeof(*thd_ids) * thread_num); aos_debug_log("object_size: %" APR_INT64_T_FMT ", total parts: %d, parts to download: %d\n", object_size, checkpoint->part_num, part_num); if ((rv = apr_queue_create(&failed_parts, part_num, options->pool)) != APR_SUCCESS || (rv = apr_queue_create(&completed_parts, part_num, options->pool)) != APR_SUCCESS || (rv = apr_queue_create(&task_queue, part_num, options->pool)) != APR_SUCCESS || (rv = apr_queue_create(&task_result_queue, part_num, options->pool)) != APR_SUCCESS) { if (checkpoint->thefile) apr_file_close(checkpoint->thefile); s = aos_status_create(options->pool); aos_status_set(s, rv, AOS_CREATE_QUEUE_ERROR_CODE, NULL); return s; } // launch for (i = 0; i < part_num; i++) { thd_params[i].failed = &failed; thd_params[i].task_result_queue = task_result_queue; apr_queue_push(task_queue, &thd_params[i]); } // download parts for (i = 0; i < thread_num; i++) { apr_thread_create(&thd_ids[i], NULL, download_part_thread, (void *)task_queue, options->pool); } // wait until all tasks exit for (i = 0 ; i < part_num; i++) { rv = apr_queue_pop(task_result_queue, (void **)&task_res); if (task_res && aos_status_is_ok(task_res->s) && !strcasecmp(object_etag, task_res->etag.data)) { // completed part oss_update_checkpoint(options->pool, checkpoint, task_res->part->index, &task_res->etag, task_res->crc64); if (checkpoint->thefile) { if ((rv = oss_dump_checkpoint(options->pool, checkpoint)) != AOSE_OK) { aos_warn_log("failed to persist checkpoint file %s: %d\n", checkpoint_path->data, rv); } } apr_queue_push(completed_parts, task_res); if (progress_callback) { consume_bytes += task_res->part->size; progress_callback(consume_bytes, object_size); } } else if (task_res) { // failed parts apr_atomic_inc32(&failed); apr_queue_push(failed_parts, task_res); } else { // skipped parts } } if (checkpoint->thefile) { apr_file_close(checkpoint->thefile); checkpoint->thefile = NULL; } aos_debug_log("completed: %u, failed: %u, skipped: %u\n", apr_queue_size(completed_parts), apr_queue_size(failed_parts), part_num - apr_queue_size(completed_parts) - apr_queue_size(failed_parts)); if (apr_atomic_read32(&failed) > 0) { // any parts failure apr_queue_pop(failed_parts, (void **)&task_res); s = aos_status_dup(options->pool, task_res->s); } else { // complete download for all parts rv = AOSE_OK; if (is_enable_crc(options) && crc64_str) { uint64_t iter_crc64 = 0; for (i = 0; i < checkpoint->part_num; i++) { iter_crc64 = aos_crc64_combine(iter_crc64, checkpoint->parts[i].crc64, checkpoint->parts[i].size); } if ((rv = oss_check_crc_consistent(iter_crc64, head_resp_headers, s)) != AOSE_OK) { if (checkpoint_path) { // checkpoint file should be removed here, otherwise retry downloads will // always be skipped and failed here in crc64 check if (apr_file_remove(checkpoint_path->data, options->pool) != APR_SUCCESS) { aos_warn_log("Failed to remove checkpoint file %s\n", checkpoint_path->data); } } apr_file_remove(tmp_filename.data, options->pool); } } if (rv == AOSE_OK) { if (apr_file_rename(tmp_filename.data, filepath->data, options->pool) != APR_SUCCESS) { s = aos_status_create(options->pool); aos_status_set(s, rv, AOS_RENAME_FILE_ERROR_CODE, NULL); } else { if (checkpoint_path) { apr_file_remove(checkpoint_path->data, options->pool); } } } } for (i = 0; i < thread_num; i++) { apr_status_t retval; apr_thread_join(&retval, thd_ids[i]); } oss_destroy_thread_pool(thd_params, part_num); return s; } aos_status_t *oss_resumable_download_file(oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_table_t *headers, aos_table_t *params, oss_resumable_clt_params_t *clt_params, oss_progress_callback progress_callback, aos_table_t **resp_headers) { int32_t thread_num = 0; int64_t part_size = 0; aos_string_t checkpoint_path; aos_pool_t *sub_pool; aos_status_t *s; oss_ensure_bucket_name_valid(bucket); thread_num = oss_get_thread_num(clt_params); aos_pool_create(&sub_pool, options->pool); part_size = clt_params->part_size; if (NULL != clt_params && clt_params->enable_checkpoint) { oss_get_download_checkpoint_path(clt_params, filepath, sub_pool, &checkpoint_path); s = oss_resumable_download_file_internal(options, bucket, object, filepath, headers, params, thread_num, part_size, &checkpoint_path, progress_callback, resp_headers); } else { s = oss_resumable_download_file_internal(options, bucket, object, filepath, headers, params, thread_num, part_size, NULL, progress_callback, resp_headers); } aos_pool_destroy(sub_pool); return s; } ================================================ FILE: oss_c_sdk/oss_resumable.h ================================================ #ifndef LIBOSS_RESUMABLE_H #define LIBOSS_RESUMABLE_H #include "aos_define.h" #include "aos_string.h" #include "aos_status.h" #include "apr_atomic.h" #include "apr_queue.h" #include "apr_thread_pool.h" #include "oss_define.h" AOS_CPP_START #define OSS_CP_UPLOAD 1 #define OSS_CP_DOWNLOAD 2 typedef struct { int32_t index; // the index of part, start from 0 int64_t offset; // the offset point of part int64_t size; // the size of part int completed; // AOS_TRUE completed, AOS_FALSE uncompleted aos_string_t etag; // the etag of part, for upload uint64_t crc64; } oss_checkpoint_part_t; typedef struct { aos_string_t md5; // the md5 of checkout content int cp_type; // 1 upload, 2 download apr_file_t *thefile; // the handle of checkpoint file aos_string_t file_path; // local file path int64_t file_size; // local file size, for upload apr_time_t file_last_modified; // local file last modified time, for upload aos_string_t file_md5; // the md5 of the local file content, for upload, reserved aos_string_t object_name; // object name int64_t object_size; // object size, for download aos_string_t object_last_modified; // object last modified time, for download aos_string_t object_etag; // object etag, for download aos_string_t upload_id; // upload id int part_num; // the total number of parts int64_t part_size; // the part size, byte oss_checkpoint_part_t *parts; // the parts of local or object, from 0 } oss_checkpoint_t; typedef struct { oss_checkpoint_part_t *part; aos_status_t *s; aos_string_t etag; uint64_t crc64; } oss_part_task_result_t; typedef struct { oss_request_options_t options; aos_string_t *bucket; aos_string_t *object; aos_string_t *upload_id; aos_string_t *filepath; oss_checkpoint_part_t *part; oss_part_task_result_t *result; apr_uint32_t *launched; // the number of launched part tasks, use atomic apr_uint32_t *failed; // the number of failed part tasks, use atomic apr_uint32_t *completed; // the number of completed part tasks, use atomic apr_queue_t *failed_parts; // the queue of failed parts tasks, thread safe apr_queue_t *completed_parts; // the queue of completed parts tasks, thread safe apr_queue_t *task_result_queue; } oss_thread_params_t; int32_t oss_get_thread_num(oss_resumable_clt_params_t *clt_params); void oss_get_upload_checkpoint_path(oss_resumable_clt_params_t *clt_params, const aos_string_t *filepath, aos_pool_t *pool, aos_string_t *checkpoint_path); void oss_get_download_checkpoint_path(oss_resumable_clt_params_t *clt_params, const aos_string_t *filepath, aos_pool_t *pool, aos_string_t *checkpoint_path); int oss_get_file_info(const aos_string_t *filepath, aos_pool_t *pool, apr_finfo_t *finfo); int oss_does_file_exist(const aos_string_t *filepath, aos_pool_t *pool); int oss_open_checkpoint_file(aos_pool_t *pool, aos_string_t *checkpoint_path, oss_checkpoint_t *checkpoint); int oss_open_checkpoint_file(aos_pool_t *pool, aos_string_t *checkpoint_path, oss_checkpoint_t *checkpoint); int oss_get_part_num(int64_t file_size, int64_t part_size); void oss_build_parts(int64_t file_size, int64_t part_size, oss_checkpoint_part_t *parts); void oss_build_thread_params(oss_thread_params_t *thr_params, int part_num, aos_pool_t *parent_pool, oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_string_t *upload_id, oss_checkpoint_part_t *parts, oss_part_task_result_t *result); void oss_destroy_thread_pool(oss_thread_params_t *thr_params, int part_num); void oss_set_task_tracker(oss_thread_params_t *thr_params, int part_num, apr_uint32_t *launched, apr_uint32_t *failed, apr_uint32_t *completed, apr_queue_t *failed_parts, apr_queue_t *completed_parts); int oss_verify_checkpoint_md5(aos_pool_t *pool, const oss_checkpoint_t *checkpoint); void oss_build_upload_checkpoint(aos_pool_t *pool, oss_checkpoint_t *checkpoint, aos_string_t *file_path, apr_finfo_t *finfo, aos_string_t *upload_id, int64_t part_size); void oss_build_download_checkpoint(aos_pool_t *pool, oss_checkpoint_t *checkpoint, aos_string_t *file_path, const char *object_name, int64_t object_size, const char *object_last_modified, const char *object_etag, int64_t part_size); int oss_dump_checkpoint(aos_pool_t *pool, const oss_checkpoint_t *checkpoint); int oss_load_checkpoint(aos_pool_t *pool, const aos_string_t *filepath, oss_checkpoint_t *checkpoint); int oss_is_upload_checkpoint_valid(aos_pool_t *pool, oss_checkpoint_t *checkpoint, apr_finfo_t *finfo); int oss_is_download_checkpoint_valid(aos_pool_t *pool, oss_checkpoint_t *checkpoint, const char *object_name, int64_t object_size, const char *object_last_modified, const char *object_etag); void oss_update_checkpoint(aos_pool_t *pool, oss_checkpoint_t *checkpoint, int32_t part_index, aos_string_t *etag, uint64_t crc64); void oss_get_checkpoint_todo_parts(oss_checkpoint_t *checkpoint, int *part_num, oss_checkpoint_part_t *parts); void *APR_THREAD_FUNC upload_part(apr_thread_t *thd, void *data); aos_status_t *oss_resumable_upload_file_without_cp(oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_table_t *headers, aos_table_t *params, int32_t thread_num, int64_t part_size, apr_finfo_t *finfo, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body); aos_status_t *oss_resumable_upload_file_with_cp(oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_table_t *headers, aos_table_t *params, int32_t thread_num, int64_t part_size, aos_string_t *checkpoint_path, apr_finfo_t *finfo, oss_progress_callback progress_callback, aos_table_t **resp_headers, aos_list_t *resp_body); aos_status_t *oss_resumable_download_file_internal(oss_request_options_t *options, aos_string_t *bucket, aos_string_t *object, aos_string_t *filepath, aos_table_t *headers, aos_table_t *params, int32_t thread_num, int64_t part_size, aos_string_t *checkpoint_path, oss_progress_callback progress_callback, aos_table_t **resp_headers); AOS_CPP_END #endif ================================================ FILE: oss_c_sdk/oss_util.c ================================================ #include "aos_string.h" #include "aos_util.h" #include "aos_log.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "aos_crc64.h" #ifndef WIN32 #include #include #include #endif static char *default_content_type = "application/octet-stream"; static oss_content_type_t file_type[] = { {"html", "text/html"}, {"htm", "text/html"}, {"shtml", "text/html"}, {"css", "text/css"}, {"xml", "text/xml"}, {"gif", "image/gif"}, {"jpeg", "image/jpeg"}, {"jpg", "image/jpeg"}, {"js", "application/x-javascript"}, {"atom", "application/atom+xml"}, {"rss", "application/rss+xml"}, {"mml", "text/mathml"}, {"txt", "text/plain"}, {"jad", "text/vnd.sun.j2me.app-descriptor"}, {"wml", "text/vnd.wap.wml"}, {"htc", "text/x-component"}, {"png", "image/png"}, {"tif", "image/tiff"}, {"tiff", "image/tiff"}, {"wbmp", "image/vnd.wap.wbmp"}, {"ico", "image/x-icon"}, {"jng", "image/x-jng"}, {"bmp", "image/x-ms-bmp"}, {"svg", "image/svg+xml"}, {"svgz", "image/svg+xml"}, {"webp", "image/webp"}, {"jar", "application/java-archive"}, {"war", "application/java-archive"}, {"ear", "application/java-archive"}, {"hqx", "application/mac-binhex40"}, {"doc ", "application/msword"}, {"pdf", "application/pdf"}, {"ps", "application/postscript"}, {"eps", "application/postscript"}, {"ai", "application/postscript"}, {"rtf", "application/rtf"}, {"xls", "application/vnd.ms-excel"}, {"ppt", "application/vnd.ms-powerpoint"}, {"wmlc", "application/vnd.wap.wmlc"}, {"kml", "application/vnd.google-earth.kml+xml"}, {"kmz", "application/vnd.google-earth.kmz"}, {"7z", "application/x-7z-compressed"}, {"cco", "application/x-cocoa"}, {"jardiff", "application/x-java-archive-diff"}, {"jnlp", "application/x-java-jnlp-file"}, {"run", "application/x-makeself"}, {"pl", "application/x-perl"}, {"pm", "application/x-perl"}, {"prc", "application/x-pilot"}, {"pdb", "application/x-pilot"}, {"rar", "application/x-rar-compressed"}, {"rpm", "application/x-redhat-package-manager"}, {"sea", "application/x-sea"}, {"swf", "application/x-shockwave-flash"}, {"sit", "application/x-stuffit"}, {"tcl", "application/x-tcl"}, {"tk", "application/x-tcl"}, {"der", "application/x-x509-ca-cert"}, {"pem", "application/x-x509-ca-cert"}, {"crt", "application/x-x509-ca-cert"}, {"xpi", "application/x-xpinstall"}, {"xhtml", "application/xhtml+xml"}, {"zip", "application/zip"}, {"wgz", "application/x-nokia-widget"}, {"bin", "application/octet-stream"}, {"exe", "application/octet-stream"}, {"dll", "application/octet-stream"}, {"deb", "application/octet-stream"}, {"dmg", "application/octet-stream"}, {"eot", "application/octet-stream"}, {"iso", "application/octet-stream"}, {"img", "application/octet-stream"}, {"msi", "application/octet-stream"}, {"msp", "application/octet-stream"}, {"msm", "application/octet-stream"}, {"mid", "audio/midi"}, {"midi", "audio/midi"}, {"kar", "audio/midi"}, {"mp3", "audio/mpeg"}, {"ogg", "audio/ogg"}, {"m4a", "audio/x-m4a"}, {"ra", "audio/x-realaudio"}, {"3gpp", "video/3gpp"}, {"3gp", "video/3gpp"}, {"mp4", "video/mp4"}, {"mpeg", "video/mpeg"}, {"mpg", "video/mpeg"}, {"mov", "video/quicktime"}, {"webm", "video/webm"}, {"flv", "video/x-flv"}, {"m4v", "video/x-m4v"}, {"mng", "video/x-mng"}, {"asx", "video/x-ms-asf"}, {"asf", "video/x-ms-asf"}, {"wmv", "video/x-ms-wmv"}, {"avi", "video/x-msvideo"}, {"ts", "video/MP2T"}, {"m3u8", "application/x-mpegURL"}, {"apk", "application/vnd.android.package-archive"}, {NULL, NULL} }; static int starts_with(const aos_string_t *str, const char *prefix) { uint32_t i; if(NULL != str && prefix && str->len > 0 && strlen(prefix)) { for(i = 0; str->data[i] != '\0' && prefix[i] != '\0'; i++) { if(prefix[i] != str->data[i]) return 0; } return 1; } return 0; } static void generate_proto(const oss_request_options_t *options, aos_http_request_t *req) { const char *proto; proto = starts_with(&options->config->endpoint, AOS_HTTP_PREFIX) ? AOS_HTTP_PREFIX : ""; proto = starts_with(&options->config->endpoint, AOS_HTTPS_PREFIX) ? AOS_HTTPS_PREFIX : proto; req->proto = apr_psprintf(options->pool, "%.*s", (int)strlen(proto), proto); } static void generate_rtmp_proto(const oss_request_options_t *options, aos_http_request_t *req) { const char *proto = AOS_RTMP_PREFIX; req->proto = apr_psprintf(options->pool, "%.*s", (int)strlen(proto), proto); } int is_valid_ip(const char *str) { if (!str) { return 0; } if (INADDR_NONE == inet_addr(str) || INADDR_ANY == inet_addr(str)) { return 0; } return 1; } void oss_preprocess_endpoint(aos_string_t *endpoint) { int i; char *str; if (aos_string_is_empty(endpoint)) { return; } str = endpoint->data; i = 0; for (i = 0; i < endpoint->len; i++) { if (str[i] == '/' || str[i] == '?' || str[i] == '#') { break; } } endpoint->len = i; } char* oss_get_host_from_authority(const oss_request_options_t *options, aos_string_t *authority) { char *ptr, *host; if (aos_string_is_empty(authority)) { return NULL; } host = aos_pstrdup(options->pool, authority); for (ptr = host; ptr && (*ptr != '\0'); ptr++) { if (*ptr == '@') { host = ptr + 1; break; } } for (ptr = host; ptr && (*ptr != '\0'); ptr++) { if (*ptr == ':') { *ptr = '\0'; break; } } return host; } oss_config_t *oss_config_create(aos_pool_t *p) { return (oss_config_t *)aos_pcalloc(p, sizeof(oss_config_t)); } void oss_config_resolve(aos_pool_t *pool, oss_config_t *config, aos_http_controller_t *ctl) { if(!aos_is_null_string(&config->proxy_host)) { // proxy host:port if (config->proxy_port == 0) { ctl->options->proxy_host = apr_psprintf(pool, "%.*s", config->proxy_host.len, config->proxy_host.data); } else { ctl->options->proxy_host = apr_psprintf(pool, "%.*s:%d", config->proxy_host.len, config->proxy_host.data, config->proxy_port); } // authorize user:passwd if (!aos_is_null_string(&config->proxy_user) && !aos_is_null_string(&config->proxy_passwd)) { ctl->options->proxy_auth = apr_psprintf(pool, "%.*s:%.*s", config->proxy_user.len, config->proxy_user.data, config->proxy_passwd.len, config->proxy_passwd.data); } } } oss_request_options_t *oss_request_options_create(aos_pool_t *p) { int s; oss_request_options_t *options; if(p == NULL) { if ((s = aos_pool_create(&p, NULL)) != APR_SUCCESS) { aos_fatal_log("aos_pool_create failure."); return NULL; } } options = (oss_request_options_t *)aos_pcalloc(p, sizeof(oss_request_options_t)); options->pool = p; return options; } void oss_get_object_uri(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_http_request_t *req) { int32_t proto_len; const char *raw_endpoint_str; aos_string_t raw_endpoint; generate_proto(options, req); proto_len = strlen(req->proto); req->resource = apr_psprintf(options->pool, "%.*s/%.*s", bucket->len, bucket->data, object->len, object->data); raw_endpoint.len = options->config->endpoint.len - proto_len; raw_endpoint.data = options->config->endpoint.data + proto_len; oss_preprocess_endpoint(&raw_endpoint); raw_endpoint_str = oss_get_host_from_authority(options, &raw_endpoint); if (options->config->is_cname) { req->host = apr_psprintf(options->pool, "%.*s", raw_endpoint.len, raw_endpoint.data); req->uri = object->data; } else if (is_valid_ip(raw_endpoint_str)) { req->host = apr_psprintf(options->pool, "%.*s", raw_endpoint.len, raw_endpoint.data); req->uri = apr_psprintf(options->pool, "%.*s/%.*s", bucket->len, bucket->data, object->len, object->data); } else { req->host = apr_psprintf(options->pool, "%.*s.%.*s", bucket->len, bucket->data, raw_endpoint.len, raw_endpoint.data); req->uri = object->data; } } void oss_get_service_uri(const oss_request_options_t *options, aos_http_request_t *req) { int32_t proto_len; const char *raw_endpoint_str; aos_string_t raw_endpoint; generate_proto(options, req); proto_len = strlen(req->proto); raw_endpoint.len = options->config->endpoint.len - proto_len; raw_endpoint.data = options->config->endpoint.data + proto_len; oss_preprocess_endpoint(&raw_endpoint); raw_endpoint_str = oss_get_host_from_authority(options, &raw_endpoint); if (options->config->is_cname || is_valid_ip(raw_endpoint_str)) { req->host = apr_psprintf(options->pool, "%.*s", raw_endpoint.len, raw_endpoint.data); } else { req->host = apr_psprintf(options->pool, "%.*s", raw_endpoint.len, raw_endpoint.data); } req->uri = apr_psprintf(options->pool, "%s", ""); } void oss_get_bucket_uri(const oss_request_options_t *options, const aos_string_t *bucket, aos_http_request_t *req) { int32_t proto_len; const char *raw_endpoint_str; aos_string_t raw_endpoint; generate_proto(options, req); proto_len = strlen(req->proto); raw_endpoint.len = options->config->endpoint.len - proto_len; raw_endpoint.data = options->config->endpoint.data + proto_len; oss_preprocess_endpoint(&raw_endpoint); raw_endpoint_str = oss_get_host_from_authority(options, &raw_endpoint); if (is_valid_ip(raw_endpoint_str)) { req->resource = apr_psprintf(options->pool, "%.*s", bucket->len, bucket->data); } else { req->resource = apr_psprintf(options->pool, "%.*s/", bucket->len, bucket->data); } if (options->config->is_cname || is_valid_ip(raw_endpoint_str)) { req->host = apr_psprintf(options->pool, "%.*s", raw_endpoint.len, raw_endpoint.data); req->uri = apr_psprintf(options->pool, "%.*s", bucket->len, bucket->data); } else { req->host = apr_psprintf(options->pool, "%.*s.%.*s", bucket->len, bucket->data, raw_endpoint.len, raw_endpoint.data); req->uri = apr_psprintf(options->pool, "%s", ""); } } void oss_get_rtmp_uri(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel_id, aos_http_request_t *req) { int32_t proto_len = 0; const char *raw_endpoint_str = NULL; aos_string_t raw_endpoint; generate_rtmp_proto(options, req); proto_len = strlen(req->proto); req->resource = apr_psprintf(options->pool, "%.*s/%.*s", bucket->len, bucket->data, live_channel_id->len, live_channel_id->data); raw_endpoint.len = options->config->endpoint.len - proto_len; raw_endpoint.data = options->config->endpoint.data + proto_len; oss_preprocess_endpoint(&raw_endpoint); raw_endpoint_str = oss_get_host_from_authority(options, &raw_endpoint); if (options->config->is_cname) { req->host = apr_psprintf(options->pool, "%.*s", raw_endpoint.len, raw_endpoint.data); req->uri = apr_psprintf(options->pool, "live/%.*s", live_channel_id->len, live_channel_id->data); } else if (is_valid_ip(raw_endpoint_str)) { req->host = apr_psprintf(options->pool, "%.*s", raw_endpoint.len, raw_endpoint.data); req->uri = apr_psprintf(options->pool, "%.*s/live/%.*s", bucket->len, bucket->data, live_channel_id->len, live_channel_id->data); } else { req->host = apr_psprintf(options->pool, "%.*s.%.*s", bucket->len, bucket->data, raw_endpoint.len, raw_endpoint.data); req->uri = apr_psprintf(options->pool, "live/%.*s", live_channel_id->len, live_channel_id->data); } } void oss_write_request_body_from_buffer(aos_list_t *buffer, aos_http_request_t *req) { aos_list_movelist(buffer, &req->body); req->body_len = aos_buf_list_len(&req->body); } int oss_write_request_body_from_file(aos_pool_t *p, const aos_string_t *filename, aos_http_request_t *req) { int res = AOSE_OK; aos_file_buf_t *fb = aos_create_file_buf(p); res = aos_open_file_for_all_read(p, filename->data, fb); if (res != AOSE_OK) { aos_error_log("Open read file fail, filename:%s\n", filename->data); return res; } req->body_len = fb->file_last; req->file_path = filename->data; req->file_buf = fb; req->type = BODY_IN_FILE; req->read_body = aos_read_http_body_file; return res; } int oss_write_request_body_from_upload_file(aos_pool_t *p, oss_upload_file_t *upload_file, aos_http_request_t *req) { int res = AOSE_OK; aos_file_buf_t *fb = aos_create_file_buf(p); res = aos_open_file_for_range_read(p, upload_file->filename.data, upload_file->file_pos, upload_file->file_last, fb); if (res != AOSE_OK) { aos_error_log("Open read file fail, filename:%s\n", upload_file->filename.data); return res; } req->body_len = fb->file_last - fb->file_pos; req->file_path = upload_file->filename.data; req->file_buf = fb; req->type = BODY_IN_FILE; req->read_body = aos_read_http_body_file; return res; } void oss_fill_read_response_body(aos_http_response_t *resp, aos_list_t *buffer) { if (NULL != buffer) { aos_list_movelist(&resp->body, buffer); } } int oss_init_read_response_body_to_file(aos_pool_t *p, const aos_string_t *filename, aos_http_response_t *resp) { int res = AOSE_OK; aos_file_buf_t *fb = aos_create_file_buf(p); res = aos_open_file_for_write(p, filename->data, fb); if (res != AOSE_OK) { aos_error_log("Open write file fail, filename:%s\n", filename->data); return res; } resp->file_path = filename->data; resp->file_buf = fb; resp->write_body = aos_write_http_body_file; resp->type = BODY_IN_FILE; return res; } int oss_init_read_response_body_to_fb(aos_file_buf_t *fb, const aos_string_t *filename, aos_http_response_t *resp) { int res = AOSE_OK; resp->file_path = filename->data; resp->file_buf = fb; resp->write_body = aos_write_http_body_file; resp->type = BODY_IN_FILE; return res; } void oss_fill_read_response_header(aos_http_response_t *resp, aos_table_t **headers) { if (NULL != headers && NULL != resp) { *headers = resp->headers; } } void *oss_create_api_result_content(aos_pool_t *p, size_t size) { void *result_content = NULL; if (NULL == p) { return NULL; } result_content = aos_palloc(p, size); if (NULL == result_content) { return NULL; } aos_list_init((aos_list_t *)result_content); return result_content; } oss_list_bucket_content_t *oss_create_list_bucket_content(aos_pool_t *p) { return (oss_list_bucket_content_t *)oss_create_api_result_content( p, sizeof(oss_list_bucket_content_t)); } oss_bucket_info_t *oss_create_bucket_info(aos_pool_t *p) { return (oss_bucket_info_t *)oss_create_api_result_content( p, sizeof(oss_bucket_info_t)); } oss_list_object_content_t *oss_create_list_object_content(aos_pool_t *p) { return (oss_list_object_content_t *)oss_create_api_result_content( p, sizeof(oss_list_object_content_t)); } oss_list_object_common_prefix_t *oss_create_list_object_common_prefix(aos_pool_t *p) { return (oss_list_object_common_prefix_t *)oss_create_api_result_content( p, sizeof(oss_list_object_common_prefix_t)); } oss_list_multipart_upload_content_t *oss_create_list_multipart_upload_content(aos_pool_t *p) { return (oss_list_multipart_upload_content_t*)oss_create_api_result_content( p, sizeof(oss_list_multipart_upload_content_t)); } oss_list_part_content_t *oss_create_list_part_content(aos_pool_t *p) { oss_list_part_content_t *list_part_content = NULL; list_part_content = (oss_list_part_content_t*)oss_create_api_result_content(p, sizeof(oss_list_part_content_t)); return list_part_content; } oss_complete_part_content_t *oss_create_complete_part_content(aos_pool_t *p) { oss_complete_part_content_t *complete_part_content = NULL; complete_part_content = (oss_complete_part_content_t*)oss_create_api_result_content( p, sizeof(oss_complete_part_content_t)); return complete_part_content; } oss_list_object_params_t *oss_create_list_object_params(aos_pool_t *p) { oss_list_object_params_t * params; params = (oss_list_object_params_t *)aos_pcalloc( p, sizeof(oss_list_object_params_t)); aos_list_init(¶ms->object_list); aos_list_init(¶ms->common_prefix_list); aos_str_set(¶ms->prefix, ""); aos_str_set(¶ms->marker, ""); aos_str_set(¶ms->delimiter, ""); params->truncated = 1; params->max_ret = OSS_PER_RET_NUM; return params; } oss_list_buckets_params_t *oss_create_list_buckets_params(aos_pool_t *p) { oss_list_buckets_params_t * params; params = (oss_list_buckets_params_t *)aos_pcalloc( p, sizeof(oss_list_buckets_params_t)); aos_str_set(¶ms->prefix, ""); aos_str_set(¶ms->marker, ""); aos_str_set(¶ms->next_marker, ""); aos_str_set(¶ms->owner_id, ""); aos_str_set(¶ms->owner_name, ""); aos_list_init(¶ms->bucket_list); params->truncated = 0; params->max_keys= 0; return params; } oss_list_upload_part_params_t *oss_create_list_upload_part_params(aos_pool_t *p) { oss_list_upload_part_params_t *params; params = (oss_list_upload_part_params_t *)aos_pcalloc( p, sizeof(oss_list_upload_part_params_t)); aos_list_init(¶ms->part_list); aos_str_set(¶ms->part_number_marker, ""); params->max_ret = OSS_PER_RET_NUM; params->truncated = 1; return params; } oss_list_multipart_upload_params_t *oss_create_list_multipart_upload_params(aos_pool_t *p) { oss_list_multipart_upload_params_t *params; params = (oss_list_multipart_upload_params_t *)aos_pcalloc( p, sizeof(oss_list_multipart_upload_params_t)); aos_list_init(¶ms->upload_list); aos_str_set(¶ms->prefix, ""); aos_str_set(¶ms->key_marker, ""); aos_str_set(¶ms->upload_id_marker, ""); aos_str_set(¶ms->delimiter, ""); params->truncated = 1; params->max_ret = OSS_PER_RET_NUM; return params; } oss_upload_part_copy_params_t *oss_create_upload_part_copy_params(aos_pool_t *p) { return (oss_upload_part_copy_params_t *)aos_pcalloc( p, sizeof(oss_upload_part_copy_params_t)); } static APR_INLINE void oss_init_lifecycle_rule_date(oss_lifecycle_rule_date_t *date) { date->days = INT_MAX; aos_str_set(&date->created_before_date, ""); } oss_logging_config_content_t *oss_create_logging_rule_content(aos_pool_t *p) { oss_logging_config_content_t *rule; rule = (oss_logging_config_content_t *)aos_pcalloc( p, sizeof(oss_logging_config_content_t)); aos_str_set(&rule->prefix, ""); aos_str_set(&rule->target_bucket, ""); rule->logging_enabled = 0; return rule; } oss_lifecycle_rule_content_t *oss_create_lifecycle_rule_content(aos_pool_t *p) { oss_lifecycle_rule_content_t *rule; rule = (oss_lifecycle_rule_content_t *)aos_pcalloc( p, sizeof(oss_lifecycle_rule_content_t)); aos_str_set(&rule->id, ""); aos_str_set(&rule->prefix, ""); aos_str_set(&rule->status, ""); aos_str_set(&rule->date, ""); aos_str_set(&rule->created_before_date, ""); rule->days = INT_MAX; oss_init_lifecycle_rule_date(&rule->abort_multipart_upload_dt); aos_list_init(&rule->tag_list); return rule; } void oss_create_sub_cors_rule(aos_pool_t *p, aos_list_t *list, char *rule_content) { oss_sub_cors_rule_t *sub_rule; sub_rule = (oss_sub_cors_rule_t *)aos_pcalloc(p, sizeof(oss_sub_cors_rule_t)); aos_str_set(&sub_rule->rule, rule_content); aos_list_add_tail(&sub_rule->node, list); } oss_cors_rule_t *oss_create_cors_rule(aos_pool_t *p) { oss_cors_rule_t *rule; if (p == NULL) { return NULL; } rule = (oss_cors_rule_t *)aos_pcalloc(p, sizeof(oss_cors_rule_t)); aos_list_init(&rule->allowed_origin_list); aos_list_init(&rule->allowed_method_list); aos_list_init(&rule->allowed_head_list); aos_list_init(&rule->expose_head_list); rule->max_age_seconds = INT_MAX; return rule; } oss_referer_t * oss_create_and_add_refer(aos_pool_t *p, oss_referer_config_t *refer_config, char *refer_str) { oss_referer_t *refer; refer = (oss_referer_t *)aos_pcalloc( p, sizeof(oss_referer_t)); if (!refer) { return refer; } aos_str_set(&refer->referer, refer_str); aos_list_add_tail(&refer->node, &refer_config->referer_list); return refer; } oss_upload_file_t *oss_create_upload_file(aos_pool_t *p) { return (oss_upload_file_t *)aos_pcalloc(p, sizeof(oss_upload_file_t)); } oss_object_key_t *oss_create_oss_object_key(aos_pool_t *p) { return (oss_object_key_t *)aos_pcalloc(p, sizeof(oss_object_key_t)); } oss_live_channel_publish_url_t *oss_create_live_channel_publish_url(aos_pool_t *p) { return (oss_live_channel_publish_url_t *)aos_pcalloc(p, sizeof(oss_live_channel_publish_url_t)); } oss_live_channel_play_url_t *oss_create_live_channel_play_url(aos_pool_t *p) { return (oss_live_channel_play_url_t *)aos_pcalloc(p, sizeof(oss_live_channel_play_url_t)); } oss_live_channel_content_t *oss_create_list_live_channel_content(aos_pool_t *p) { oss_live_channel_content_t *list_live_channel_content = NULL; list_live_channel_content = (oss_live_channel_content_t*)oss_create_api_result_content(p, sizeof(oss_live_channel_content_t)); aos_list_init(&list_live_channel_content->publish_url_list); aos_list_init(&list_live_channel_content->play_url_list); return list_live_channel_content; } oss_live_record_content_t *oss_create_live_record_content(aos_pool_t *p) { oss_live_record_content_t *live_record_content = NULL; live_record_content = (oss_live_record_content_t*)oss_create_api_result_content(p, sizeof(oss_live_record_content_t)); return live_record_content; } oss_live_channel_configuration_t *oss_create_live_channel_configuration_content(aos_pool_t *p) { oss_live_channel_configuration_t *config; config = (oss_live_channel_configuration_t *)aos_pcalloc( p, sizeof(oss_live_channel_configuration_t)); aos_str_set(&config->name, ""); aos_str_set(&config->description, ""); aos_str_set(&config->status, LIVE_CHANNEL_STATUS_ENABLED); aos_str_set(&config->target.type, LIVE_CHANNEL_DEFAULT_TYPE); aos_str_set(&config->target.play_list_name, LIVE_CHANNEL_DEFAULT_PLAYLIST); config->target.frag_duration = LIVE_CHANNEL_DEFAULT_FRAG_DURATION; config->target.frag_count = LIVE_CHANNEL_DEFAULT_FRAG_COUNT; return config; } oss_checkpoint_t *oss_create_checkpoint_content(aos_pool_t *p) { oss_checkpoint_t *cp; cp = (oss_checkpoint_t *)aos_pcalloc(p, sizeof(oss_checkpoint_t)); cp->parts = (oss_checkpoint_part_t *)aos_pcalloc(p, sizeof(oss_checkpoint_part_t) * OSS_MAX_PART_NUM); aos_str_set(&cp->md5, ""); aos_str_set(&cp->file_path, ""); aos_str_set(&cp->file_md5, ""); aos_str_set(&cp->object_name, ""); aos_str_set(&cp->object_last_modified, ""); aos_str_set(&cp->object_etag, ""); aos_str_set(&cp->upload_id, ""); return cp; } oss_resumable_clt_params_t *oss_create_resumable_clt_params_content(aos_pool_t *p, int64_t part_size, int32_t thread_num, int enable_checkpoint, const char *checkpoint_path) { oss_resumable_clt_params_t *clt; clt = (oss_resumable_clt_params_t *)aos_pcalloc(p, sizeof(oss_resumable_clt_params_t)); clt->part_size = part_size; clt->thread_num = thread_num; clt->enable_checkpoint = enable_checkpoint; if (enable_checkpoint && NULL != checkpoint_path) { aos_str_set(&clt->checkpoint_path, checkpoint_path); } return clt; } oss_list_live_channel_params_t *oss_create_list_live_channel_params(aos_pool_t *p) { oss_list_live_channel_params_t *params; params = (oss_list_live_channel_params_t *)aos_pcalloc( p, sizeof(oss_list_live_channel_params_t)); aos_list_init(¶ms->live_channel_list); aos_str_set(¶ms->prefix, ""); aos_str_set(¶ms->marker, ""); params->truncated = 1; params->max_keys = OSS_PER_RET_NUM; return params; } oss_select_object_params_t *oss_create_select_object_params(aos_pool_t *p) { oss_select_object_params_t *params; params = (oss_select_object_params_t *)aos_pcalloc( p, sizeof(oss_select_object_params_t)); //input aos_str_set(¶ms->input_param.compression_type, ""); aos_str_set(¶ms->input_param.file_header_info, ""); aos_str_set(¶ms->input_param.record_delimiter, ""); aos_str_set(¶ms->input_param.field_delimiter, ""); aos_str_set(¶ms->input_param.quote_character, ""); aos_str_set(¶ms->input_param.comment_character, ""); aos_str_set(¶ms->input_param.range, ""); //output aos_str_set(¶ms->output_param.record_delimiter, ""); aos_str_set(¶ms->output_param.field_delimiter, ""); params->output_param.keep_all_columns = OSS_INVALID_VALUE; params->output_param.output_rawdata = OSS_INVALID_VALUE; params->output_param.enable_payload_crc = OSS_INVALID_VALUE; params->output_param.output_header = AOS_FALSE; //option params->option_param.skip_partial_data_record = AOS_FALSE; return params; } oss_select_object_meta_params_t *oss_create_select_object_meta_params(aos_pool_t *p) { oss_select_object_meta_params_t *params; params = (oss_select_object_meta_params_t *)aos_pcalloc( p, sizeof(oss_select_object_meta_params_t)); aos_str_set(¶ms->compression_type, "None"); aos_str_set(¶ms->record_delimiter, ""); aos_str_set(¶ms->field_delimiter, ""); aos_str_set(¶ms->quote_character, ""); params->over_write_if_existing = OSS_INVALID_VALUE; return params; } const char *get_oss_acl_str(oss_acl_e oss_acl) { switch (oss_acl) { case OSS_ACL_PRIVATE: return "private"; case OSS_ACL_PUBLIC_READ: return "public-read"; case OSS_ACL_PUBLIC_READ_WRITE: return "public-read-write"; case OSS_ACL_DEFAULT: return "default"; default: return NULL; } } const char *get_oss_storage_class_str(oss_storage_class_type_e storage_class) { switch (storage_class) { case OSS_STORAGE_CLASS_STANDARD: return "Standard"; case OSS_STORAGE_CLASS_IA: return "IA"; case OSS_STORAGE_CLASS_ARCHIVE: return "Archive"; case OSS_STORAGE_CLASS_COLD_ARCHIVE: return "ColdArchive"; default: return NULL; } } const char *get_oss_tier_type_str(oss_tier_type_e tier) { switch (tier) { case OSS_TIER_EXPEDITED: return "Expedited"; case OSS_TIER_STANDARD: return "Standard"; case OSS_TIER_BULK: return "Bulk"; default: return NULL; } } void oss_init_request(const oss_request_options_t *options, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, aos_http_response_t **resp) { *req = aos_http_request_create(options->pool); *resp = aos_http_response_create(options->pool); (*req)->method = method; init_sts_token_header(); (*req)->headers = headers; (*req)->query_params = params; } void oss_init_service_request(const oss_request_options_t *options, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, aos_http_response_t **resp) { oss_init_request(options, method, req, params, headers, resp); oss_get_service_uri(options, *req); } void oss_init_bucket_request(const oss_request_options_t *options, const aos_string_t *bucket, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, aos_http_response_t **resp) { oss_init_request(options, method, req, params, headers, resp); oss_get_bucket_uri(options, bucket, *req); } void oss_init_object_request(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, oss_progress_callback cb, uint64_t init_crc, aos_http_response_t **resp) { oss_init_request(options, method, req, params, headers, resp); if (HTTP_GET == method) { (*resp)->progress_callback = cb; } else if (HTTP_PUT == method || HTTP_POST == method) { (*req)->progress_callback = cb; (*req)->crc64 = init_crc; } oss_get_object_uri(options, bucket, object, *req); } void oss_init_live_channel_request(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, aos_http_response_t **resp) { oss_init_request(options, method, req, params, headers, resp); oss_get_object_uri(options, bucket, live_channel, *req); } void oss_init_signed_url_request(const oss_request_options_t *options, const aos_string_t *signed_url, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, aos_http_response_t **resp) { *req = aos_http_request_create(options->pool); *resp = aos_http_response_create(options->pool); (*req)->method = method; (*req)->headers = headers; (*req)->query_params = params; (*req)->signed_url = signed_url->data; } aos_status_t *oss_send_request(aos_http_controller_t *ctl, aos_http_request_t *req, aos_http_response_t *resp) { aos_status_t *s; const char *reason; int res = AOSE_OK; s = aos_status_create(ctl->pool); res = aos_http_send_request(ctl, req, resp); if (res != AOSE_OK) { reason = aos_http_controller_get_reason(ctl); aos_status_set(s, res, AOS_HTTP_IO_ERROR_CODE, reason); } else if (!aos_http_is_ok(resp->status)) { s = aos_status_parse_from_body(ctl->pool, &resp->body, resp->status, s); } else { s->code = resp->status; } s->req_id = (char*)(apr_table_get(resp->headers, "x-oss-request-id")); if (s->req_id == NULL) { s->req_id = (char*)(apr_table_get(resp->headers, "x-img-request-id")); if (s->req_id == NULL) { s->req_id = ""; } } return s; } aos_status_t *oss_process_request(const oss_request_options_t *options, aos_http_request_t *req, aos_http_response_t *resp) { int res = AOSE_OK; aos_status_t *s; s = aos_status_create(options->pool); res = oss_sign_request(req, options->config); if (res != AOSE_OK) { aos_status_set(s, res, AOS_CLIENT_ERROR_CODE, NULL); return s; } if (!oss_is_valid_host(req->host)) { aos_status_set(s, AOSE_INVALID_ARGUMENT, AOS_CLIENT_ERROR_CODE, "The endpoint is invalid."); return s; } return oss_send_request(options->ctl, req, resp); } aos_status_t *oss_process_signed_request(const oss_request_options_t *options, aos_http_request_t *req, aos_http_response_t *resp) { return oss_send_request(options->ctl, req, resp); } void oss_get_part_size(int64_t filesize, int64_t *part_size) { if (filesize > (*part_size) * OSS_MAX_PART_NUM) { *part_size = (filesize + OSS_MAX_PART_NUM - filesize % OSS_MAX_PART_NUM) / OSS_MAX_PART_NUM; aos_warn_log("Part number larger than max limit, " "part size Changed to:%" APR_INT64_T_FMT "\n", *part_size); } } int part_sort_cmp(const void *a, const void *b) { return (((oss_upload_part_t*)a)->part_num - ((oss_upload_part_t*)b)->part_num > 0 ? 1 : -1); } void oss_headers_add_range(apr_pool_t *pool, apr_table_t *headers, int64_t offset, int64_t size) { char *range; range = apr_psprintf(pool, "bytes=%" APR_INT64_T_FMT "-%" APR_INT64_T_FMT, offset, offset + size - 1); apr_table_set(headers, "Range", range); } char *get_content_type_by_suffix(const char *suffix) { oss_content_type_t *content_type; for (content_type = file_type; content_type->suffix; ++content_type) { if (strcasecmp(content_type->suffix, suffix) == 0) { return content_type->type; } } return default_content_type; } char *get_content_type(const char *name) { char *begin; char *content_type = NULL; begin = strrchr(name, '.'); if (begin) { content_type = get_content_type_by_suffix(begin + 1); } return content_type; } void set_content_type(const char* file_name, const char* key, aos_table_t *headers) { char *user_content_type = NULL; char *content_type = NULL; const char *mime_key = NULL; mime_key = file_name == NULL ? key : file_name; user_content_type = (char*)apr_table_get(headers, OSS_CONTENT_TYPE); if (NULL == user_content_type && mime_key != NULL) { content_type = get_content_type(mime_key); if (content_type) { apr_table_set(headers, OSS_CONTENT_TYPE, content_type); } else { apr_table_set(headers, OSS_CONTENT_TYPE, default_content_type); } } } aos_table_t* aos_table_create_if_null(const oss_request_options_t *options, aos_table_t *table, int table_size) { if (table == NULL) { table = aos_table_make(options->pool, table_size); } return table; } int is_enable_crc(const oss_request_options_t *options) { return options->ctl->options->enable_crc; } int has_crc_in_response(const aos_http_response_t *resp) { if (NULL != apr_table_get(resp->headers, OSS_HASH_CRC64_ECMA)) { return AOS_TRUE; } return AOS_FALSE; } int has_range_or_process_in_request(const aos_http_request_t *req) { if (NULL != apr_table_get(req->headers, "Range") || NULL != apr_table_get(req->query_params, OSS_PROCESS)) { return AOS_TRUE; } return AOS_FALSE; } static int check_crc(uint64_t crc, const apr_table_t *headers) { char * srv_crc = (char*)(apr_table_get(headers, OSS_HASH_CRC64_ECMA)); if (NULL != srv_crc && crc != aos_atoui64(srv_crc)) { return AOSE_CRC_INCONSISTENT_ERROR; } return AOSE_OK; } int oss_check_crc_consistent(uint64_t crc, const apr_table_t *resp_headers, aos_status_t *s) { int res = check_crc(crc, resp_headers); if (res != AOSE_OK) { aos_inconsistent_error_status_set(s, res); } return res; } int oss_get_temporary_file_name(aos_pool_t *p, const aos_string_t *filename, aos_string_t *temp_file_name) { int len = filename->len + 1; char *temp_file_name_ptr = NULL; len += strlen(AOS_TEMP_FILE_SUFFIX); temp_file_name_ptr = aos_pcalloc(p, len); apr_snprintf(temp_file_name_ptr, len, "%.*s%s", filename->len, filename->data, AOS_TEMP_FILE_SUFFIX); aos_str_set(temp_file_name, temp_file_name_ptr); return len; } int oss_temp_file_rename(aos_status_t *s, const char *from_path, const char *to_path, apr_pool_t *pool) { int res = -1; if (s != NULL) { if (aos_status_is_ok(s)) { res = apr_file_rename(from_path, to_path, pool); } else { res = apr_file_remove(from_path, pool); } } return res; } #define FRAME_HEADER_LEN (12+8) #define SELECT_OBJECT_MAGIC 0xFF123456 typedef struct { uint32_t magic; int32_t select_output_raw; uint8_t header[FRAME_HEADER_LEN]; // header + payload offset: 12 + 8 int32_t header_len; uint8_t tail[4]; int32_t tail_len; int32_t payload_remains; uint32_t header_crc32; //not use now uint32_t payload_crc32; uint8_t end_frame[256]; uint32_t end_frame_size; } select_object_depack_frame; static void oss_init_depack_frame(aos_http_response_t *resp) { select_object_depack_frame *depack = (select_object_depack_frame *)resp->user_data; if (depack && depack->select_output_raw < 0) { char *select_output_raw = NULL; select_output_raw = (char*)apr_table_get(resp->headers, OSS_SELECT_OBJECT_OUTPUT_RAW); if (select_output_raw && !strncasecmp(select_output_raw, "true", 4)) { depack->select_output_raw = AOS_TRUE; } else { depack->select_output_raw = AOS_FALSE; } depack->payload_remains = 0; depack->header_len = 0; depack->end_frame_size = 0; } } static int oss_depack_frame(select_object_depack_frame *depack, const char *in_buf, int len, int *frame_type, char **payload_buf, int *payload_len) { int remain = len; const char *ptr = in_buf; if (!depack || !frame_type || !payload_buf || !payload_len) { return len; } *frame_type = 0; *payload_buf = NULL; *payload_len = 0; //Version | Frame - Type | Payload Length | Header Checksum | Payload | Payload Checksum //<1 byte> <--3 bytes--> <-- 4 bytes --> <------4 bytes--> <----4bytes------> //Payload // //<8 types> //header if (depack->header_len < FRAME_HEADER_LEN) { int copy = FRAME_HEADER_LEN - depack->header_len; copy = aos_min(copy, remain); memcpy(depack->header + depack->header_len, ptr, copy); depack->header_len += copy; ptr += copy; remain -= copy; if (depack->header_len == FRAME_HEADER_LEN) { uint32_t payload_length; payload_length = depack->header[4]; payload_length = (payload_length << 8) | depack->header[5]; payload_length = (payload_length << 8) | depack->header[6]; payload_length = (payload_length << 8) | depack->header[7]; depack->payload_remains = payload_length - 8; depack->payload_crc32 = aos_crc32(0, depack->header + 12, 8); } } //payload if (depack->payload_remains > 0) { uint32_t type; int copy = aos_min(depack->payload_remains, remain); type = depack->header[1]; type = (type << 8) | depack->header[2]; type = (type << 8) | depack->header[3]; *frame_type = type; *payload_buf = (char *)ptr; *payload_len = copy; remain -= copy; depack->payload_remains -= copy; depack->payload_crc32 = aos_crc32(depack->payload_crc32, ptr, copy); return len - remain; } //tail if (depack->tail_len < 4) { int copy = 4 - depack->tail_len; copy = aos_min(copy, remain); memcpy(depack->tail + depack->tail_len, ptr, copy); depack->tail_len += copy; ptr += copy; remain -= copy; } return len - remain; } static int oss_write_select_object_to(aos_http_response_t *resp, const char *buffer, int len) { if (resp->type == BODY_IN_FILE) { return aos_write_http_body_file(resp, buffer, len); } else if (resp->type == BODY_IN_MEMORY ){ return aos_write_http_body_memory(resp, buffer, len); } return AOSE_INVALID_OPERATION; } static int oss_write_select_object_body(aos_http_response_t *resp, const char *buffer, int len) { select_object_depack_frame *depack = (select_object_depack_frame *)resp->user_data; //init select_output_raw oss_init_depack_frame(resp); //depack frame if (depack->select_output_raw == AOS_FALSE) { int remain = len; const char *ptr = buffer; int frame_type; char *payload_buf; int payload_len; int ret; while (remain > 0) { ret = oss_depack_frame(depack, ptr, remain, &frame_type, &payload_buf, &payload_len); switch (frame_type) { case 0x800001: //Data Frame { int wlen = oss_write_select_object_to(resp, payload_buf, payload_len); if (wlen != payload_len) { return wlen; } } break; case 0x800004: //Continuous Frame break; case 0x800005: //Select object End Frame case 0x800006: //Create Meta End Frame { int32_t left = sizeof(depack->end_frame) - depack->end_frame_size; int32_t copy = aos_min(left, payload_len); if (copy > 0) { memcpy(depack->end_frame + depack->end_frame_size, payload_buf, copy); depack->end_frame_size += copy; } } break; default: //get payload checksum if (depack->tail_len == 4) { //compare check sum uint32_t payload_crc32; payload_crc32 = depack->tail[0]; payload_crc32 = (payload_crc32 << 8) | depack->tail[1]; payload_crc32 = (payload_crc32 << 8) | depack->tail[2]; payload_crc32 = (payload_crc32 << 8) | depack->tail[3]; if (payload_crc32 != 0 && payload_crc32 != depack->payload_crc32) { return AOSE_SELECT_OBJECT_CRC_ERROR; } //reset to get next frame depack->header_len = 0; depack->tail_len = 0; } break; } ptr += ret; remain -= ret; } } else { len = oss_write_select_object_to(resp, buffer, len); } return len; } int oss_init_select_object_read_response_body(aos_pool_t *p, aos_http_response_t *resp) { int res = AOSE_OK; select_object_depack_frame *depack; if (!p || !resp || resp->type == BODY_IN_CALLBACK) { return res; } depack = (select_object_depack_frame *)aos_pcalloc(p, sizeof(select_object_depack_frame)); depack->magic = SELECT_OBJECT_MAGIC; depack->select_output_raw = OSS_INVALID_VALUE; resp->user_data = (void *)depack; resp->write_body = oss_write_select_object_body; return res; } void oss_check_select_object_status(aos_http_response_t *resp, aos_status_t *s) { select_object_depack_frame *depack; if (!resp || !s) { return; } if (!aos_status_is_ok(s)) { return; } depack = (select_object_depack_frame *)resp->user_data; if (depack && (depack->magic == SELECT_OBJECT_MAGIC) && (depack->select_output_raw == AOS_FALSE)) { uint32_t http_code; http_code = depack->end_frame[8]; http_code = (http_code << 8) | depack->end_frame[9]; http_code = (http_code << 8) | depack->end_frame[10]; http_code = (http_code << 8) | depack->end_frame[11]; if (!aos_http_is_ok(http_code)) { char *error_msg = NULL; if (depack->end_frame_size > 12) { error_msg = apr_pstrmemdup(resp->pool, (const char *)depack->end_frame + 12, depack->end_frame_size - 12); } aos_status_set(s, http_code, AOS_SELECT_OBJECT_ERROR, error_msg); } else { //update the httpcode s->code = http_code; } } } int oss_init_create_select_object_meta_read_response_body(aos_pool_t *p, aos_http_response_t *resp) { int res = AOSE_OK; select_object_depack_frame *depack; if (!p || !resp || resp->type == BODY_IN_CALLBACK) { return res; } depack = (select_object_depack_frame *)aos_pcalloc(p, sizeof(select_object_depack_frame)); depack->magic = SELECT_OBJECT_MAGIC; depack->select_output_raw = AOS_FALSE; resp->user_data = (void *)depack; resp->write_body = oss_write_select_object_body; return res; } void oss_check_create_select_object_meta_status(aos_http_response_t *resp, aos_status_t *s, oss_select_object_meta_params_t *meta_params) { select_object_depack_frame *depack; if (!resp || !s) { return; } if (!aos_status_is_ok(s)) { return; } /** * Format of end frame * |--total scan size(8 bytes)--| * |--status code(4 bytes)--|--total splits count(4 bytes)--| * |--total lines(8 bytes)--|--columns count(4 bytes)--|--error message(optional)--| */ depack = (select_object_depack_frame *)resp->user_data; if (depack && (depack->magic == SELECT_OBJECT_MAGIC) && (depack->select_output_raw == AOS_FALSE)) { uint32_t http_code; uint32_t splits_count; uint64_t rows_count; uint32_t columns_count; http_code = depack->end_frame[8]; http_code = (http_code << 8) | depack->end_frame[9]; http_code = (http_code << 8) | depack->end_frame[10]; http_code = (http_code << 8) | depack->end_frame[11]; splits_count = depack->end_frame[12]; splits_count = (splits_count << 8) | depack->end_frame[13]; splits_count = (splits_count << 8) | depack->end_frame[14]; splits_count = (splits_count << 8) | depack->end_frame[15]; rows_count = depack->end_frame[16]; rows_count = (rows_count << 8) | depack->end_frame[17]; rows_count = (rows_count << 8) | depack->end_frame[18]; rows_count = (rows_count << 8) | depack->end_frame[19]; rows_count = (rows_count << 8) | depack->end_frame[20]; rows_count = (rows_count << 8) | depack->end_frame[21]; rows_count = (rows_count << 8) | depack->end_frame[22]; rows_count = (rows_count << 8) | depack->end_frame[23]; columns_count = depack->end_frame[24]; columns_count = (columns_count << 8) | depack->end_frame[25]; columns_count = (columns_count << 8) | depack->end_frame[26]; columns_count = (columns_count << 8) | depack->end_frame[27]; if (!aos_http_is_ok(http_code)) { char *error_msg = NULL; if (depack->end_frame_size > 28) { error_msg = apr_pstrmemdup(resp->pool, (const char *)depack->end_frame + 12, depack->end_frame_size - 12); } aos_status_set(s, http_code, AOS_CREATE_SELECT_OBJECT_META_ERROR, error_msg); } else { //update the httpcode s->code = http_code; if (meta_params) { meta_params->splits_count = splits_count; meta_params->rows_count = rows_count; meta_params->columns_count = columns_count; } } } } oss_tag_content_t *oss_create_tag_content(aos_pool_t *p) { return (oss_tag_content_t *)aos_pcalloc(p, sizeof(oss_tag_content_t)); } int oss_is_valid_bucket_name(const aos_string_t *str) { int i; if (aos_string_is_empty(str)) { return 0; } if (str->len < 3 || str->len > 63) { return 0; } if (str->data[0] == '-' || str->data[str->len - 1] == '-') { return 0; } for (i = 0; i < str->len; i++) { char c = str->data[i]; if (!((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '-')) { return 0; } } return 1; } aos_status_t *oss_get_bucket_name_invalid_error() { static aos_status_t oss_bucket_name_invalid_error = { AOSE_INVALID_ARGUMENT, (char *)AOS_BUCKET_NAME_INVALID_ERROR, "The bucket name is invalid, please check.", NULL }; return &oss_bucket_name_invalid_error; } int oss_is_valid_object_name(const aos_string_t* str) { if (aos_string_is_empty(str)) { return 0; } return 1; } int oss_is_valid_object_name_ex(const aos_string_t* str, int strict) { if (aos_string_is_empty(str)) { return 0; } if (strict && str->data[0] == '?') { return 0; } return 1; } aos_status_t* oss_get_object_name_invalid_error() { static aos_status_t oss_object_name_invalid_error = { AOSE_INVALID_ARGUMENT, (char*)AOS_OBJECT_NAME_INVALID_ERROR, "The object name is invalid, please check.", NULL }; return &oss_object_name_invalid_error; } int oss_is_valid_host(const char *host) { //format like: userinfo@host:port, just check host const char *ptr; const char *prevptr; if (host == NULL) { return 0; } prevptr = host; //find @ for (ptr = prevptr; *ptr != '\0'; ptr++) { if (*ptr == '@') { prevptr = ptr + 1; break; } } //find : for (ptr = prevptr; *ptr != '\0'; ptr++) { if (*ptr == ':') { break; } } if (prevptr == ptr) { return 0; } while (prevptr != ptr) { char c = *prevptr; if (!((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c == '_') || (c == '-') || (c == '.'))) { return 0; } prevptr++; } return 1; } int is_verify_object_strict(const oss_request_options_t* options) { if (options->config->signature_version == 4) { return 0; } return options->ctl->options->verify_object_strict; } ================================================ FILE: oss_c_sdk/oss_util.h ================================================ #ifndef LIBOSS_UTIL_H #define LIBOSS_UTIL_H #include "aos_string.h" #include "aos_transport.h" #include "aos_status.h" #include "oss_define.h" #include "oss_resumable.h" OSS_CPP_START #define init_sts_token_header() do { \ if (options->config->sts_token.data != NULL) {\ apr_table_set(headers, OSS_STS_SECURITY_TOKEN, options->config->sts_token.data);\ }\ } while(0) /** * @brief check hostname ends with specific oss domain suffix. **/ int is_oss_domain(const aos_string_t *str); /** * @brief check hostname is ip. **/ int is_valid_ip(const char *str); /** * @brief get oss acl str according oss_acl * @param[in] oss_acl the oss bucket acl * @return oss acl str **/ const char *get_oss_acl_str(oss_acl_e oss_acl); /** * @brief get oss storage type str according oss_storage_class * @param[in] storage_class the oss bucket storage class * @return oss storage class str **/ const char *get_oss_storage_class_str(oss_storage_class_type_e storage_class); /** * @brief get oss tier type str according oss_tier_type_e * @param[in] tier the oss bucket tier type * @return oss tier type str **/ const char *get_oss_tier_type_str(oss_tier_type_e tier); /** * @brief create oss config including host, port, access_key_id, access_key_secret, is_oss_domain **/ oss_config_t *oss_config_create(aos_pool_t *p); /** * @brief evaluate config to curl **/ void oss_config_resolve(aos_pool_t *pool, oss_config_t *config, aos_http_controller_t *ctl); /** * @brief create oss request options * @return oss request options **/ oss_request_options_t *oss_request_options_create(aos_pool_t *p); /** * @brief init oss request **/ void oss_init_request(const oss_request_options_t *options, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, aos_http_response_t **resp); /** * @brief init oss bucket request **/ void oss_init_bucket_request(const oss_request_options_t *options, const aos_string_t *bucket, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, aos_http_response_t **resp); /** * @brief init oss service request **/ void oss_init_service_request(const oss_request_options_t *options, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, aos_http_response_t **resp); /** * @brief init oss object request **/ void oss_init_object_request(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, oss_progress_callback cb, uint64_t initcrc, aos_http_response_t **resp); /** * @brief init oss live channel request **/ void oss_init_live_channel_request(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, aos_http_response_t **resp); /** * @brief init oss request with signed_url **/ void oss_init_signed_url_request(const oss_request_options_t *options, const aos_string_t *signed_url, http_method_e method, aos_http_request_t **req, aos_table_t *params, aos_table_t *headers, aos_http_response_t **resp); /** * @brief oss send request **/ aos_status_t *oss_send_request(aos_http_controller_t *ctl, aos_http_request_t *req, aos_http_response_t *resp); /** * @brief process oss request including sign request, send request, get response **/ aos_status_t *oss_process_request(const oss_request_options_t *options, aos_http_request_t *req, aos_http_response_t *resp); /** * @brief process oss request with signed_url including send request, get response **/ aos_status_t *oss_process_signed_request(const oss_request_options_t *options, aos_http_request_t *req, aos_http_response_t *resp); /** * @brief get object uri using third-level domain if hostname is oss domain, otherwise second-level domain **/ void oss_get_object_uri(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *object, aos_http_request_t *req); /** * @brief bucket uri using third-level domain if hostname is oss domain, otherwise second-level domain **/ void oss_get_bucket_uri(const oss_request_options_t *options, const aos_string_t *bucket, aos_http_request_t *req); /** * @brief get rtmp uri using third-level domain if hostname is oss domain, otherwise second-level domain **/ void oss_get_rtmp_uri(const oss_request_options_t *options, const aos_string_t *bucket, const aos_string_t *live_channel_id, aos_http_request_t *req); /** * @brief write body content into oss request body from buffer **/ void oss_write_request_body_from_buffer(aos_list_t *buffer, aos_http_request_t *req); /** * @brief write body content into oss request body from file **/ int oss_write_request_body_from_file(aos_pool_t *p, const aos_string_t *filename, aos_http_request_t *req); /** * @brief write body content into oss request body from multipart upload file **/ int oss_write_request_body_from_upload_file(aos_pool_t *p, oss_upload_file_t *upload_file, aos_http_request_t *req); /** * @brief read body content from oss response body to buffer **/ void oss_fill_read_response_body(aos_http_response_t *resp, aos_list_t *buffer); /** * @brief read body content from oss response body to file **/ int oss_init_read_response_body_to_file(aos_pool_t *p, const aos_string_t *filename, aos_http_response_t *resp); /** * @brief read body content from oss response body to file buffer **/ int oss_init_read_response_body_to_fb(aos_file_buf_t *fb, const aos_string_t *filename, aos_http_response_t *resp); /** * @brief read response header if headers is not null **/ void oss_fill_read_response_header(aos_http_response_t *resp, aos_table_t **headers); /** * @brief create oss api result content * @return oss api result content **/ void *oss_create_api_result_content(aos_pool_t *p, size_t size); oss_list_object_content_t *oss_create_list_object_content(aos_pool_t *p); oss_list_object_common_prefix_t *oss_create_list_object_common_prefix(aos_pool_t *p); oss_list_part_content_t *oss_create_list_part_content(aos_pool_t *p); oss_list_multipart_upload_content_t *oss_create_list_multipart_upload_content(aos_pool_t *p); oss_complete_part_content_t *oss_create_complete_part_content(aos_pool_t *p); /** * @brief create oss api bucket list result content * @return oss api bucket list result content **/ oss_list_bucket_content_t *oss_create_list_bucket_content(aos_pool_t *p); /** * @brief create oss api bucket info result * @return oss api bucket info result **/ oss_bucket_info_t *oss_create_bucket_info(aos_pool_t *p); /** * @brief create oss api list parameters * @return oss api list parameters **/ oss_list_object_params_t *oss_create_list_object_params(aos_pool_t *p); /** * @brief create oss api list bucket parameters * @return oss api list bucket parameters **/ oss_list_buckets_params_t *oss_create_list_buckets_params(aos_pool_t *p); oss_list_upload_part_params_t *oss_create_list_upload_part_params(aos_pool_t *p); oss_list_multipart_upload_params_t *oss_create_list_multipart_upload_params(aos_pool_t *p); oss_list_live_channel_params_t *oss_create_list_live_channel_params(aos_pool_t *p); /** * @brief create upload part copy params * @return upload part copy params struct for upload part copy **/ oss_upload_part_copy_params_t *oss_create_upload_part_copy_params(aos_pool_t *p); /** * @brief create upload file struct for range multipart upload * @return upload file struct for range multipart upload **/ oss_upload_file_t *oss_create_upload_file(aos_pool_t *p); /** * @brief create lifecycle rule content * @return lifecycle rule content **/ oss_lifecycle_rule_content_t *oss_create_lifecycle_rule_content(aos_pool_t *p); /** * @brief create cors rule content * @return cors rule content **/ void oss_create_sub_cors_rule(aos_pool_t *p, aos_list_t *list, char *rule_content); oss_cors_rule_t *oss_create_cors_rule(aos_pool_t *p); /** * @brief create and add refer * @return new refer **/ oss_referer_t * oss_create_and_add_refer(aos_pool_t *p, oss_referer_config_t *refer_config, char *refer_str); /** * @brief create logging rule content * @return logging rule content **/ oss_logging_config_content_t *oss_create_logging_rule_content(aos_pool_t *p); /** * @brief create oss object content for delete objects * @return oss object content **/ oss_object_key_t *oss_create_oss_object_key(aos_pool_t *p); /** * @brief create oss live channel publish url content for delete objects * @return oss live channel publish url content **/ oss_live_channel_publish_url_t *oss_create_live_channel_publish_url(aos_pool_t *p); /** * @brief create oss live channel play url content for delete objects * @return oss live channel play url content **/ oss_live_channel_play_url_t *oss_create_live_channel_play_url(aos_pool_t *p); /** * @brief create oss list live channel content for delete objects * @return oss list live channel content **/ oss_live_channel_content_t *oss_create_list_live_channel_content(aos_pool_t *p); /** * @brief create oss live recored content for delete objects * @return oss live record content **/ oss_live_record_content_t *oss_create_live_record_content(aos_pool_t *p); /** * @brief create live channel configuration content * @return live channel configuration content **/ oss_live_channel_configuration_t *oss_create_live_channel_configuration_content(aos_pool_t *p); /** * @brief create oss checkpoint content * @return oss checkpoint content **/ oss_checkpoint_t *oss_create_checkpoint_content(aos_pool_t *p); /** * @brief create oss resumable clt params content * @return oss checkpoint content **/ oss_resumable_clt_params_t *oss_create_resumable_clt_params_content(aos_pool_t *p, int64_t part_size, int32_t thread_num, int enable_checkpoint, const char *checkpoint_path); /** * @brief create select object params * @return oss select object params **/ oss_select_object_params_t *oss_create_select_object_params(aos_pool_t *p); /** * @brief create select object meta params * @return oss select object meta params **/ oss_select_object_meta_params_t *oss_create_select_object_meta_params(aos_pool_t *p); /** * @brief get part size for multipart upload **/ void oss_get_part_size(int64_t filesize, int64_t *part_size); /** * @brief compare function for part sort **/ int part_sort_cmp(const void *a, const void *b); /** * @brief add range in http request **/ void oss_headers_add_range(apr_pool_t *pool, apr_table_t *headers, int64_t offset, int64_t size); /** * @brief set content type for object according to objectname * @return oss content type **/ char *get_content_type(const char *name); char *get_content_type_by_suffix(const char *suffix); /** * @brief set content type for object according to filename **/ void set_content_type(const char* filename, const char* key, aos_table_t *headers); aos_table_t* aos_table_create_if_null(const oss_request_options_t *options, aos_table_t *table, int table_size); int is_enable_crc(const oss_request_options_t *options); int has_crc_in_response(const aos_http_response_t *resp); int has_range_or_process_in_request(const aos_http_request_t *req) ; /** * @brief check crc consistent between client and server **/ int oss_check_crc_consistent(uint64_t crc, const apr_table_t *resp_headers, aos_status_t *s); int oss_get_temporary_file_name(aos_pool_t *p, const aos_string_t *filename, aos_string_t *temp_file_name); int oss_temp_file_rename(aos_status_t *s, const char *from_path, const char *to_path, apr_pool_t *pool); /** * @brief read select object body content from oss response body **/ int oss_init_select_object_read_response_body(aos_pool_t *p, aos_http_response_t *resp); /** * @brief check select object result after getting all body **/ void oss_check_select_object_status(aos_http_response_t *resp, aos_status_t *s); /** * @brief read create select object meta body content from oss response body **/ int oss_init_create_select_object_meta_read_response_body(aos_pool_t *p, aos_http_response_t *resp); /** * @brief check create select object result after getting all body **/ void oss_check_create_select_object_meta_status(aos_http_response_t *resp, aos_status_t *s, oss_select_object_meta_params_t *meta_params); /** * @brief create oss tag content for tagging * @return oss tag content **/ oss_tag_content_t *oss_create_tag_content(aos_pool_t *p); /** * @brief check if bucket name is valid. **/ int oss_is_valid_bucket_name(const aos_string_t *str); /** * @brief check if object name is valid. **/ int oss_is_valid_object_name(const aos_string_t *str); int oss_is_valid_object_name_ex(const aos_string_t* str, int strict); /** * @brief pre-process endpoint, just keep host and port. **/ void oss_preprocess_endpoint(aos_string_t *endpoint); /** * @brief get host form the authority of url **/ char* oss_get_host_from_authority(const oss_request_options_t *options, aos_string_t *authority); aos_status_t *oss_get_bucket_name_invalid_error(); #define oss_ensure_bucket_name_valid(a) do { \ if (!oss_is_valid_bucket_name(a)) { \ return oss_get_bucket_name_invalid_error(); \ } \ } while(0) aos_status_t* oss_get_object_name_invalid_error(); #define oss_ensure_object_name_valid(a) do { \ if (!oss_is_valid_object_name(a)) { \ return oss_get_object_name_invalid_error(); \ } \ } while(0) /** * @brief check if the host is valid. **/ int oss_is_valid_host(const char *host); int is_verify_object_strict(const oss_request_options_t * options); OSS_CPP_END #endif ================================================ FILE: oss_c_sdk/oss_xml.c ================================================ #include "aos_string.h" #include "aos_list.h" #include "aos_buf.h" #include "aos_util.h" #include "aos_log.h" #include "aos_status.h" #include "oss_util.h" #include "oss_auth.h" #include "oss_xml.h" #include "oss_define.h" static int get_truncated_from_xml(aos_pool_t *p, mxml_node_t *xml_node, const char *truncated_xml_path); int get_truncated_from_xml(aos_pool_t *p, mxml_node_t *xml_node, const char *truncated_xml_path) { char *is_truncated; int truncated = 0; is_truncated = get_xmlnode_value(p, xml_node, truncated_xml_path); if (is_truncated) { truncated = strcasecmp(is_truncated, "false") == 0 ? 0 : 1; } return truncated; } static char* new_xml_buff(mxml_node_t *doc); char* new_xml_buff(mxml_node_t *doc) { int bytes; char buffer[8192]; char *s; bytes = mxmlSaveString(doc, buffer, sizeof(buffer), MXML_NO_CALLBACK); if (bytes <= 0) { return (NULL); } if (bytes < (int)(sizeof(buffer) - 1)) { return (strdup(buffer)); } if ((s = malloc(bytes + 1)) == NULL) { return (NULL); } mxmlSaveString(doc, s, bytes + 1, MXML_NO_CALLBACK); return (s); } int get_xmldoc(aos_list_t *bc, mxml_node_t **root) { int res; if (aos_list_empty(bc)) { return AOSE_XML_PARSE_ERROR; } if ((res = aos_parse_xml_body(bc, root)) != AOSE_OK) { return AOSE_XML_PARSE_ERROR; } return AOSE_OK; } char *get_xmlnode_value(aos_pool_t *p, mxml_node_t *xml_node, const char *xml_path) { char *value = NULL; mxml_node_t *node; const char *node_content; node = mxmlFindElement(xml_node, xml_node, xml_path, NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (node_content != NULL) { value = apr_pstrdup(p, node_content); } return value; } int oss_acl_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_string_t *oss_acl) { int res; mxml_node_t *doc = NULL; const char xml_path[] = "Grant"; char *acl; res = get_xmldoc(bc, &doc); if (res == AOSE_OK) { acl = get_xmlnode_value(p, doc, xml_path); if (acl) { aos_str_set(oss_acl, acl); } mxmlDelete(doc); } return res; } int oss_location_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_string_t *oss_location) { int res; mxml_node_t *doc = NULL; const char xml_path[] = "LocationConstraint"; char *location; res = get_xmldoc(bc, &doc); if (res == AOSE_OK) { location = get_xmlnode_value(p, doc, xml_path); if (location) { aos_str_set(oss_location, location); } mxmlDelete(doc); } return res; } int oss_storage_capacity_parse_from_body(aos_pool_t *p, aos_list_t *bc, long *storage_capacity) { int res; mxml_node_t *doc = NULL; const char xml_path[] = "StorageCapacity"; char *capacity_str; res = get_xmldoc(bc, &doc); if (res == AOSE_OK) { capacity_str = get_xmlnode_value(p, doc, xml_path); if (capacity_str) { *storage_capacity = atol(capacity_str); } mxmlDelete(doc); } return res; } int oss_logging_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_logging_config_content_t *rule_content) { const char xml_logging_status_path[] = "BucketLoggingStatus"; const char xml_logging_state_path[] = "LoggingEnabled"; const char xml_target_bucket_path[] = "TargetBucket"; const char xml_log_prefix_path[] = "TargetPrefix"; mxml_node_t *doc = NULL; mxml_node_t *logging_node; mxml_node_t *enabled_node; int res; res = get_xmldoc(bc, &doc); if (res == AOSE_OK) { logging_node = mxmlFindElement(doc, doc, xml_logging_status_path, NULL, NULL, MXML_DESCEND); if (logging_node) { enabled_node = mxmlFindElement(logging_node, doc, xml_logging_state_path, NULL, NULL, MXML_DESCEND); if (enabled_node) { char *prefix = NULL; char *target_bucket = NULL; rule_content->logging_enabled = 1; target_bucket = get_xmlnode_value(p, enabled_node, xml_target_bucket_path); if (target_bucket) { aos_str_set(&rule_content->target_bucket, target_bucket); } prefix = get_xmlnode_value(p, enabled_node, xml_log_prefix_path); if (prefix) { aos_str_set(&rule_content->prefix, prefix); } } } } mxmlDelete(doc); return res; } void oss_list_objects_owner_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_list_object_content_t *content) { mxml_node_t *node; const char *node_content; char *owner_id; char *owner_display_name; node = mxmlFindElement(xml_node, xml_node, "ID",NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { owner_id = apr_pstrdup(p, node_content); aos_str_set(&content->owner_id, owner_id); } node = mxmlFindElement(xml_node, xml_node, "DisplayName", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { owner_display_name = apr_pstrdup(p, node_content); aos_str_set(&content->owner_display_name, owner_display_name); } } void oss_list_objects_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_list_object_content_t *content) { char *key; char *last_modified; char *etag; char *size; const char *node_content; mxml_node_t *node; char *str_value; node = mxmlFindElement(xml_node, xml_node, "Key", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { key = apr_pstrdup(p, node_content); aos_str_set(&content->key, key); } node = mxmlFindElement(xml_node, xml_node, "LastModified", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { last_modified = apr_pstrdup(p, node_content); aos_str_set(&content->last_modified, last_modified); } node = mxmlFindElement(xml_node, xml_node, "ETag", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { etag = apr_pstrdup(p, node_content); aos_str_set(&content->etag, etag); } node = mxmlFindElement(xml_node, xml_node, "Size", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { size = apr_pstrdup(p, node_content); aos_str_set(&content->size, size); } node = mxmlFindElement(xml_node, xml_node, "Owner", NULL, NULL, MXML_DESCEND); if (NULL != node) { oss_list_objects_owner_parse(p, node, content); } node = mxmlFindElement(xml_node, xml_node, "StorageClass", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); aos_str_null(&content->storage_class); if (NULL != node_content) { str_value = apr_pstrdup(p, node_content); aos_str_set(&content->storage_class, str_value); } node = mxmlFindElement(xml_node, xml_node, "Type", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); aos_str_null(&content->type); if (NULL != node_content) { str_value = apr_pstrdup(p, node_content); aos_str_set(&content->type, str_value); } } void oss_list_objects_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *object_list) { mxml_node_t *content_node; oss_list_object_content_t *content; content_node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); for ( ; content_node != NULL; ) { content = oss_create_list_object_content(p); oss_list_objects_content_parse(p, content_node, content); aos_list_add_tail(&content->node, object_list); content_node = mxmlFindElement(content_node, root, xml_path, NULL, NULL, MXML_DESCEND); } } void oss_list_objects_prefix_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_list_object_common_prefix_t *common_prefix) { char *prefix; mxml_node_t *node; const char *node_content; node = mxmlFindElement(xml_node, xml_node, "Prefix", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { prefix = apr_pstrdup(p, node_content); aos_str_set(&common_prefix->prefix, prefix); } } void oss_list_objects_common_prefix_parse(aos_pool_t *p, mxml_node_t *xml_node, const char *xml_path, aos_list_t *common_prefix_list) { mxml_node_t *node; oss_list_object_common_prefix_t *common_prefix; node = mxmlFindElement(xml_node, xml_node, xml_path, NULL, NULL, MXML_DESCEND); for ( ; node != NULL; ) { common_prefix = oss_create_list_object_common_prefix(p); oss_list_objects_prefix_parse(p, node, common_prefix); aos_list_add_tail(&common_prefix->node, common_prefix_list); node = mxmlFindElement(node, xml_node, xml_path, NULL, NULL, MXML_DESCEND); } } int oss_list_objects_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *object_list, aos_list_t *common_prefix_list, aos_string_t *marker, int *truncated) { int res; mxml_node_t *root; const char next_marker_xml_path[] = "NextMarker"; const char truncated_xml_path[] = "IsTruncated"; const char buckets_xml_path[] = "Contents"; const char common_prefix_xml_path[] = "CommonPrefixes"; char* next_marker; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { next_marker = get_xmlnode_value(p, root, next_marker_xml_path); if (next_marker) { aos_str_set(marker, next_marker); } *truncated = get_truncated_from_xml(p, root, truncated_xml_path); oss_list_objects_contents_parse(p, root, buckets_xml_path, object_list); oss_list_objects_common_prefix_parse(p, root, common_prefix_xml_path, common_prefix_list); mxmlDelete(root); } return res; } void oss_list_buckets_content_parse(aos_pool_t *p, mxml_node_t *xml_node, aos_list_t *node_list) { char* value; const char *xml_value; mxml_node_t *node; oss_list_bucket_content_t *content; content = oss_create_list_bucket_content(p); if (content == NULL) { aos_error_log("malloc memory for list bucket failed\n"); return; } node = mxmlFindElement(xml_node, xml_node, "Name", NULL, NULL, MXML_DESCEND); xml_value = mxmlGetOpaque(node); if (NULL != xml_value) { value = apr_pstrdup(p, xml_value); aos_str_set(&content->name, value); } node = mxmlFindElement(xml_node, xml_node, "CreationDate", NULL, NULL, MXML_DESCEND); xml_value = mxmlGetOpaque(node); if (NULL != xml_value) { value = apr_pstrdup(p, xml_value); aos_str_set(&content->create_date, value); } node = mxmlFindElement(xml_node, xml_node, "ExtranetEndpoint", NULL, NULL, MXML_DESCEND); xml_value = mxmlGetOpaque(node); if (NULL != xml_value) { value = apr_pstrdup(p, xml_value); aos_str_set(&content->extranet_endpoint, value); } node = mxmlFindElement(xml_node, xml_node, "IntranetEndpoint", NULL, NULL, MXML_DESCEND); xml_value = mxmlGetOpaque(node); if (NULL != xml_value) { value = apr_pstrdup(p, xml_value); aos_str_set(&content->intranet_endpoint, value); } node = mxmlFindElement(xml_node, xml_node, "Location", NULL, NULL, MXML_DESCEND); xml_value = mxmlGetOpaque(node); if (NULL != xml_value) { value = apr_pstrdup(p, xml_value); aos_str_set(&content->location, value); } node = mxmlFindElement(xml_node, xml_node, "StorageClass", NULL, NULL, MXML_DESCEND); xml_value = mxmlGetOpaque(node); if (NULL != xml_value) { value = apr_pstrdup(p, xml_value); aos_str_set(&content->storage_class, value); } aos_list_add_tail(&content->node, node_list); } void oss_list_node_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *node_list, NODE_PARSE_FUN parse_funptr) { mxml_node_t *content_node; content_node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); for ( ; content_node != NULL; ) { parse_funptr(p, content_node, node_list); content_node = mxmlFindElement(content_node, root, xml_path, NULL, NULL, MXML_DESCEND); } } void oss_list_buckets_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *buckets_list) { oss_list_node_contents_parse(p, root, xml_path, buckets_list, oss_list_buckets_content_parse); } int oss_list_buckets_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_list_buckets_params_t *params) { int res = AOSE_OK; mxml_node_t *root; const char next_marker_xml_path[] = "NextMarker"; const char truncated_xml_path[] = "IsTruncated"; const char owner_id_xml_path[] = "ID"; const char owner_name_xml_path[] = "DisplayName"; const char buckets_xml_path[] = "Bucket"; char *next_marker, *owner_id, *owner_name; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { next_marker = get_xmlnode_value(p, root, next_marker_xml_path); if (next_marker) { aos_str_set(¶ms->next_marker, next_marker); } params->truncated = get_truncated_from_xml(p, root, truncated_xml_path); owner_id = get_xmlnode_value(p, root, owner_id_xml_path); if (owner_id) { aos_str_set(¶ms->owner_id, owner_id); } owner_name = get_xmlnode_value(p, root, owner_name_xml_path); if (owner_name) { aos_str_set(¶ms->owner_name, owner_name); } oss_list_buckets_contents_parse(p, root, buckets_xml_path, ¶ms->bucket_list); mxmlDelete(root); } return res; } int oss_get_bucket_info_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_bucket_info_t *bucket_info) { int res = AOSE_OK; mxml_node_t *root; char *value; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { value = get_xmlnode_value(p, root, "CreationDate"); if (NULL != value) { aos_str_set(&bucket_info->created_date, value); } value = get_xmlnode_value(p, root, "ExtranetEndpoint"); if (NULL != value) { aos_str_set(&bucket_info->extranet_endpoint, value); } value = get_xmlnode_value(p, root, "IntranetEndpoint"); if (NULL != value) { aos_str_set(&bucket_info->intranet_endpoint, value); } value = get_xmlnode_value(p, root, "Location"); if (NULL != value) { aos_str_set(&bucket_info->location, value); } value = get_xmlnode_value(p, root, "DisplayName"); if (NULL != value) { aos_str_set(&bucket_info->owner_name, value); } value = get_xmlnode_value(p, root, "ID"); if (NULL != value) { aos_str_set(&bucket_info->owner_id, value); } value = get_xmlnode_value(p, root, "Grant"); if (NULL != value) { aos_str_set(&bucket_info->acl, value); } value = get_xmlnode_value(p, root, "StorageClass"); aos_str_null(&bucket_info->storage_class); if (NULL != value) { aos_str_set(&bucket_info->storage_class, value); } mxmlDelete(root); } return res; } int oss_get_bucket_stat_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_bucket_stat_t *bucket_stat) { int res = AOSE_OK; mxml_node_t *root; char *value; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { value = get_xmlnode_value(p, root, "Storage"); if (NULL != value) { bucket_stat->storage_in_bytes = aos_atoui64(value); } value = get_xmlnode_value(p, root, "ObjectCount"); if (NULL != value) { bucket_stat->object_count = aos_atoui64(value); } value = get_xmlnode_value(p, root, "MultipartUploadCount"); if (NULL != value) { bucket_stat->multipart_upload_count = aos_atoui64(value); } mxmlDelete(root); } return res; } int oss_get_bucket_website_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_website_config_t *website_config) { int res = AOSE_OK; mxml_node_t *root; char *value; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { value = get_xmlnode_value(p, root, "Suffix"); if (NULL != value) { aos_str_set(&website_config->suffix_str, value); } value = get_xmlnode_value(p, root, "Key"); if (NULL != value) { aos_str_set(&website_config->key_str, value); } mxmlDelete(root); } return res; } void parse_referer_str(aos_pool_t *p, mxml_node_t *xml_node, aos_list_t *referer_config_ptr) { char* value; const char* node_content; oss_referer_config_t *referer_config = (oss_referer_config_t *)referer_config_ptr; node_content = mxmlGetOpaque(xml_node); value = apr_pstrdup(p, node_content); if (NULL != value) { oss_create_and_add_refer(p, referer_config, value); } } int oss_get_bucket_referer_config_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_referer_config_t *referer_config) { int res = AOSE_OK; mxml_node_t *root; char *value; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { value = get_xmlnode_value(p, root, "AllowEmptyReferer"); if (NULL != value) { if (!strncmp(value, "true", 4)) { referer_config->allow_empty_referer = 1; } else { referer_config->allow_empty_referer = 0; } } oss_list_node_contents_parse(p, root, "Referer", (aos_list_t *)referer_config, parse_referer_str); mxmlDelete(root); } return res; } void parse_sub_ctors_rule(aos_pool_t *p, mxml_node_t *xml_node, aos_list_t *sub_rule_list) { char* value; const char* node_content; node_content = mxmlGetOpaque(xml_node); value = apr_pstrdup(p, node_content); if (NULL != value) { oss_create_sub_cors_rule(p, sub_rule_list, value); } } void oss_cors_rule_content_parse(aos_pool_t *p, mxml_node_t *xml_node, aos_list_t *node_list) { const char *xml_value; mxml_node_t *node; oss_cors_rule_t *content; content = oss_create_cors_rule(p); if (content == NULL) { aos_error_log("malloc memory for list bucket failed\n"); return; } node = mxmlFindElement(xml_node, xml_node, "MaxAgeSeconds", NULL, NULL, MXML_DESCEND); xml_value = mxmlGetOpaque(node); if (NULL != xml_value) { content->max_age_seconds = atoi(xml_value); } oss_list_node_contents_parse(p, xml_node, "AllowedOrigin", &content->allowed_origin_list, parse_sub_ctors_rule); oss_list_node_contents_parse(p, xml_node, "AllowedMethod", &content->allowed_method_list, parse_sub_ctors_rule); oss_list_node_contents_parse(p, xml_node, "AllowedHeader", &content->allowed_head_list, parse_sub_ctors_rule); oss_list_node_contents_parse(p, xml_node, "ExposeHeader", &content->expose_head_list, parse_sub_ctors_rule); aos_list_add_tail(&content->node, node_list); } int oss_get_bucket_cors_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *rule_list) { int res = AOSE_OK; mxml_node_t *root; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { oss_list_node_contents_parse(p, root, "CORSRule", rule_list, oss_cors_rule_content_parse); mxmlDelete(root); } return res; } int oss_upload_id_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_string_t *upload_id) { int res; mxml_node_t *root; const char xml_path[] = "UploadId"; char *id; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { id = get_xmlnode_value(p, root, xml_path); if (id) { aos_str_set(upload_id, id); } mxmlDelete(root); } return res; } void oss_list_parts_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *part_list) { mxml_node_t *content_node; oss_list_part_content_t *content; content_node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); for ( ; content_node != NULL; ) { content = oss_create_list_part_content(p); oss_list_parts_content_parse(p, content_node, content); aos_list_add_tail(&content->node, part_list); content_node = mxmlFindElement(content_node, root, xml_path, NULL, NULL, MXML_DESCEND); } } void oss_list_parts_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_list_part_content_t *content) { char *part_number; char *last_modified; char *etag; char *size; const char *node_content; mxml_node_t *node; node = mxmlFindElement(xml_node, xml_node, "PartNumber", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { part_number = apr_pstrdup(p, node_content); aos_str_set(&content->part_number, part_number); } node = mxmlFindElement(xml_node, xml_node, "LastModified", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { last_modified = apr_pstrdup(p, node_content); aos_str_set(&content->last_modified, last_modified); } node = mxmlFindElement(xml_node, xml_node, "ETag", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { etag = apr_pstrdup(p, node_content); aos_str_set(&content->etag, etag); } node = mxmlFindElement(xml_node, xml_node, "Size", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { size = apr_pstrdup(p, node_content); aos_str_set(&content->size, size); } } int oss_list_parts_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *part_list, aos_string_t *partnumber_marker, int *truncated) { int res; mxml_node_t *root; const char next_partnumber_marker_xml_path[] = "NextPartNumberMarker"; const char truncated_xml_path[] = "IsTruncated"; const char parts_xml_path[] = "Part"; char *next_partnumber_marker; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { next_partnumber_marker = get_xmlnode_value(p, root, next_partnumber_marker_xml_path); if (next_partnumber_marker) { aos_str_set(partnumber_marker, next_partnumber_marker); } *truncated = get_truncated_from_xml(p, root, truncated_xml_path); oss_list_parts_contents_parse(p, root, parts_xml_path, part_list); mxmlDelete(root); } return res; } void oss_list_multipart_uploads_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *upload_list) { mxml_node_t *content_node; oss_list_multipart_upload_content_t *content; content_node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); for ( ; content_node != NULL; ) { content = oss_create_list_multipart_upload_content(p); oss_list_multipart_uploads_content_parse(p, content_node, content); aos_list_add_tail(&content->node, upload_list); content_node = mxmlFindElement(content_node, root, xml_path, NULL, NULL, MXML_DESCEND); } } void oss_list_multipart_uploads_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_list_multipart_upload_content_t *content) { char *key; char *upload_id; char *initiated; const char *node_content; mxml_node_t *node; node = mxmlFindElement(xml_node, xml_node, "Key",NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { key = apr_pstrdup(p, node_content); aos_str_set(&content->key, key); } node = mxmlFindElement(xml_node, xml_node, "UploadId",NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { upload_id = apr_pstrdup(p, node_content); aos_str_set(&content->upload_id, upload_id); } node = mxmlFindElement(xml_node, xml_node, "Initiated",NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { initiated = apr_pstrdup(p, node_content); aos_str_set(&content->initiated, initiated); } } int oss_list_multipart_uploads_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *upload_list, aos_string_t *key_marker, aos_string_t *upload_id_marker, int *truncated) { int res; mxml_node_t *root; const char next_key_marker_xml_path[] = "NextKeyMarker"; const char next_upload_id_marker_xml_path[] = "NextUploadIdMarker"; const char truncated_xml_path[] = "IsTruncated"; const char uploads_xml_path[] = "Upload"; char *next_key_marker; char *next_upload_id_marker; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { next_key_marker = get_xmlnode_value(p, root, next_key_marker_xml_path); if (next_key_marker) { aos_str_set(key_marker, next_key_marker); } next_upload_id_marker = get_xmlnode_value(p, root, next_upload_id_marker_xml_path); if (next_upload_id_marker) { aos_str_set(upload_id_marker, next_upload_id_marker); } *truncated = get_truncated_from_xml(p, root, truncated_xml_path); oss_list_multipart_uploads_contents_parse(p, root, uploads_xml_path, upload_list); mxmlDelete(root); } return res; } char *build_complete_multipart_upload_xml(aos_pool_t *p, aos_list_t *bc) { char *xml_buff; char *complete_part_xml; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; oss_complete_part_content_t *content; doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "CompleteMultipartUpload"); aos_list_for_each_entry(oss_complete_part_content_t, content, bc, node) { mxml_node_t *part_node = mxmlNewElement(root_node, "Part"); mxml_node_t *part_number_node = mxmlNewElement(part_node, "PartNumber"); mxml_node_t *etag_node = mxmlNewElement(part_node, "ETag"); mxmlNewText(part_number_node, 0, content->part_number.data); mxmlNewText(etag_node, 0, content->etag.data); } xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); complete_part_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return complete_part_xml; } void build_complete_multipart_upload_body(aos_pool_t *p, aos_list_t *part_list, aos_list_t *body) { char *complete_multipart_upload_xml; aos_buf_t *b; complete_multipart_upload_xml = build_complete_multipart_upload_xml(p, part_list); aos_list_init(body); b = aos_buf_pack(p, complete_multipart_upload_xml, strlen(complete_multipart_upload_xml)); aos_list_add_tail(&b->node, body); } char *build_bucket_logging_xml(aos_pool_t *p, oss_logging_config_content_t *content) { char *logging_xml; char *xml_buff; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node, *log_node; doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "BucketLoggingStatus"); log_node = mxmlNewElement(root_node, "LoggingEnabled"); if (!aos_string_is_empty(&content->target_bucket)) { mxml_node_t *target_bucket_node = mxmlNewElement(log_node, "TargetBucket"); mxmlNewText(target_bucket_node, 0, content->target_bucket.data); } if (!aos_string_is_empty(&content->prefix)) { mxml_node_t *prefix_node = mxmlNewElement(log_node, "TargetPrefix"); mxmlNewText(prefix_node, 0, content->prefix.data); } xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); logging_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return logging_xml; } void build_bucket_logging_body(aos_pool_t *p, oss_logging_config_content_t *content, aos_list_t *body) { char *logging_xml; aos_buf_t *b; logging_xml = build_bucket_logging_xml(p, content); aos_list_init(body); b = aos_buf_pack(p, logging_xml, strlen(logging_xml)); aos_list_add_tail(&b->node, body); } char *build_lifecycle_xml(aos_pool_t *p, aos_list_t *lifecycle_rule_list) { char *lifecycle_xml; char *xml_buff; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; oss_lifecycle_rule_content_t *content; doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "LifecycleConfiguration"); aos_list_for_each_entry(oss_lifecycle_rule_content_t, content, lifecycle_rule_list, node) { oss_tag_content_t *tag = NULL; mxml_node_t *rule_node = mxmlNewElement(root_node, "Rule"); mxml_node_t *id_node = mxmlNewElement(rule_node, "ID"); mxml_node_t *prefix_node = mxmlNewElement(rule_node, "Prefix"); mxml_node_t *status_node = mxmlNewElement(rule_node, "Status"); mxml_node_t *expire_node = mxmlNewElement(rule_node, "Expiration"); mxmlNewText(id_node, 0, content->id.data); mxmlNewText(prefix_node, 0, content->prefix.data); mxmlNewText(status_node, 0, content->status.data); if (content->days != INT_MAX) { char value_str[64]; mxml_node_t *days_node = mxmlNewElement(expire_node, "Days"); apr_snprintf(value_str, sizeof(value_str), "%d", content->days); mxmlNewText(days_node, 0, value_str); } else if (content->date.len != 0 && strcmp(content->date.data, "") != 0) { mxml_node_t *date_node = mxmlNewElement(expire_node, "Date"); mxmlNewText(date_node, 0, content->date.data); } else if (content->created_before_date.len != 0 && strcmp(content->created_before_date.data, "") != 0) { mxml_node_t *cbd_node = mxmlNewElement(expire_node, "CreatedBeforeDate"); mxmlNewText(cbd_node, 0, content->created_before_date.data); } if (content->abort_multipart_upload_dt.days != INT_MAX) { char value_str[64]; mxml_node_t *abort_mulpart_node = mxmlNewElement(rule_node, "AbortMultipartUpload"); mxml_node_t *abort_days_node = mxmlNewElement(abort_mulpart_node, "Days"); apr_snprintf(value_str, sizeof(value_str), "%d", content->abort_multipart_upload_dt.days); mxmlNewText(abort_days_node, 0, value_str); } else if (!aos_string_is_empty(&content->abort_multipart_upload_dt.created_before_date)) { mxml_node_t *abort_mulpart_node = mxmlNewElement(rule_node, "AbortMultipartUpload"); mxml_node_t *abort_date_node = mxmlNewElement(abort_mulpart_node, "CreatedBeforeDate"); mxmlNewText(abort_date_node, 0, content->abort_multipart_upload_dt.created_before_date.data); } //tag aos_list_for_each_entry(oss_tag_content_t, tag, &content->tag_list, node) { mxml_node_t *tag_node = mxmlNewElement(rule_node, "Tag"); mxml_node_t *key_node = mxmlNewElement(tag_node, "Key"); mxml_node_t *value_node = mxmlNewElement(tag_node, "Value"); mxmlNewText(key_node, 0, tag->key.data); mxmlNewText(value_node, 0, tag->value.data); } } xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); lifecycle_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return lifecycle_xml; } void build_lifecycle_body(aos_pool_t *p, aos_list_t *lifecycle_rule_list, aos_list_t *body) { char *lifecycle_xml; aos_buf_t *b; lifecycle_xml = build_lifecycle_xml(p, lifecycle_rule_list); aos_list_init(body); b = aos_buf_pack(p, lifecycle_xml, strlen(lifecycle_xml)); aos_list_add_tail(&b->node, body); } char *build_referer_config_xml(aos_pool_t *p, oss_referer_config_t *referer_config) { char *referer_config_xml; char *xml_buff; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; mxml_node_t *sub_node; oss_referer_t *referer; doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "RefererConfiguration"); sub_node = mxmlNewElement(root_node, "AllowEmptyReferer"); mxmlNewText(sub_node, 0, referer_config->allow_empty_referer ? "true" : "false"); sub_node = mxmlNewElement(root_node, "RefererList"); aos_list_for_each_entry(oss_referer_t, referer, &referer_config->referer_list, node) { mxml_node_t *referer_node = mxmlNewElement(sub_node, "Referer"); mxmlNewText(referer_node, 0, referer->referer.data); } xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); referer_config_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return referer_config_xml; } void build_referer_config_body(aos_pool_t *p, oss_referer_config_t *referer_config, aos_list_t *body) { char *referer_config_xml; aos_buf_t *b; referer_config_xml = build_referer_config_xml(p, referer_config); aos_list_init(body); b = aos_buf_pack(p, referer_config_xml, strlen(referer_config_xml)); aos_list_add_tail(&b->node, body); } char *build_cors_rule_xml(aos_pool_t *p, aos_list_t *rule_list) { char *cors_rule_xml; char *xml_buff; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; mxml_node_t *sub_node; oss_cors_rule_t *cors_rule; doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "CORSConfiguration"); aos_list_for_each_entry(oss_cors_rule_t, cors_rule, rule_list, node) { oss_sub_cors_rule_t *sub_cors_rule; sub_node = mxmlNewElement(root_node, "CORSRule"); aos_list_for_each_entry(oss_sub_cors_rule_t, sub_cors_rule, &cors_rule->allowed_origin_list, node) { mxml_node_t *list_node = mxmlNewElement(sub_node, "AllowedOrigin"); mxmlNewText(list_node, 0, sub_cors_rule->rule.data); } aos_list_for_each_entry(oss_sub_cors_rule_t, sub_cors_rule, &cors_rule->allowed_method_list, node) { mxml_node_t *list_node = mxmlNewElement(sub_node, "AllowedMethod"); mxmlNewText(list_node, 0, sub_cors_rule->rule.data); } aos_list_for_each_entry(oss_sub_cors_rule_t, sub_cors_rule, &cors_rule->allowed_head_list, node) { mxml_node_t *list_node = mxmlNewElement(sub_node, "AllowedHeader"); mxmlNewText(list_node, 0, sub_cors_rule->rule.data); } aos_list_for_each_entry(oss_sub_cors_rule_t, sub_cors_rule, &cors_rule->expose_head_list, node) { mxml_node_t *list_node = mxmlNewElement(sub_node, "ExposeHeader"); mxmlNewText(list_node, 0, sub_cors_rule->rule.data); } if (cors_rule->max_age_seconds != INT_MAX) { char value_str[64]; mxml_node_t *list_node = mxmlNewElement(sub_node, "MaxAgeSeconds"); apr_snprintf(value_str, sizeof(value_str), "%d", cors_rule->max_age_seconds); mxmlNewText(list_node, 0, value_str); } } xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); cors_rule_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return cors_rule_xml; } void build_cors_rule_body(aos_pool_t *p, aos_list_t *rule_list, aos_list_t *body) { char *cors_rule_xml; aos_buf_t *b; cors_rule_xml = build_cors_rule_xml(p, rule_list); aos_list_init(body); b = aos_buf_pack(p, cors_rule_xml, strlen(cors_rule_xml)); aos_list_add_tail(&b->node, body); } char *build_website_config_xml(aos_pool_t *p, oss_website_config_t *website_config) { char *website_config_xml; char *xml_buff; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; mxml_node_t *sub_node, *suffix_node, *key_node; doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "WebsiteConfiguration"); sub_node = mxmlNewElement(root_node, "IndexDocument"); suffix_node = mxmlNewElement(sub_node, "Suffix"); mxmlNewText(suffix_node, 0, website_config->suffix_str.data); if (!aos_string_is_empty(&website_config->key_str)) { sub_node = mxmlNewElement(root_node, "ErrorDocument"); key_node = mxmlNewElement(sub_node, "Key"); mxmlNewText(key_node, 0, website_config->key_str.data); } xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); website_config_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return website_config_xml; } void build_website_config_body(aos_pool_t *p, oss_website_config_t *website_config, aos_list_t *body) { char *website_config_xml; aos_buf_t *b; website_config_xml = build_website_config_xml(p, website_config); aos_list_init(body); b = aos_buf_pack(p, website_config_xml, strlen(website_config_xml)); aos_list_add_tail(&b->node, body); } char *build_bucket_storage_class_xml(aos_pool_t *p, oss_storage_class_type_e storage_class) { char *bucket_storage_class_xml; char *xml_buff; const char *storage_class_str; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; mxml_node_t *storage_node; storage_class_str = get_oss_storage_class_str(storage_class); if (!storage_class_str) { return NULL; } doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "CreateBucketConfiguration"); storage_node = mxmlNewElement(root_node, "StorageClass"); mxmlNewText(storage_node, 0, storage_class_str); xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); bucket_storage_class_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return bucket_storage_class_xml; } void build_bucket_storage_class(aos_pool_t *p, oss_storage_class_type_e storage_class, aos_list_t *body) { char *bucket_storage_class_xml; aos_buf_t *b; bucket_storage_class_xml = build_bucket_storage_class_xml(p, storage_class); if (bucket_storage_class_xml) { aos_list_init(body); b = aos_buf_pack(p, bucket_storage_class_xml, strlen(bucket_storage_class_xml)); aos_list_add_tail(&b->node, body); } } char *build_bucket_storage_capacity_xml(aos_pool_t *p, long storage_capacity) { char *bucket_storage_capacity_xml; char *xml_buff; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; mxml_node_t *storage_node; char value_str[64]; doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "BucketUserQos"); apr_snprintf(value_str, sizeof(value_str), "%ld", storage_capacity); storage_node = mxmlNewElement(root_node, "StorageCapacity"); mxmlNewText(storage_node, 0, value_str); xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); bucket_storage_capacity_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return bucket_storage_capacity_xml; } void build_bucket_storage_capacity_body(aos_pool_t *p, long storage_capacity, aos_list_t *body) { char *bucket_storage_capacity_xml; aos_buf_t *b; bucket_storage_capacity_xml = build_bucket_storage_capacity_xml(p, storage_capacity); if (bucket_storage_capacity_xml) { aos_list_init(body); b = aos_buf_pack(p, bucket_storage_capacity_xml, strlen(bucket_storage_capacity_xml)); aos_list_add_tail(&b->node, body); } } int oss_lifecycle_rules_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *lifecycle_rule_list) { int res; mxml_node_t *root = NULL; const char rule_xml_path[] = "Rule"; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { oss_lifecycle_rule_contents_parse(p, root, rule_xml_path, lifecycle_rule_list); mxmlDelete(root); } return res; } void oss_lifecycle_rule_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *lifecycle_rule_list) { mxml_node_t *node; oss_lifecycle_rule_content_t *content; node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); for ( ; node != NULL; ) { content = oss_create_lifecycle_rule_content(p); oss_lifecycle_rule_content_parse(p, node, content); aos_list_add_tail(&content->node, lifecycle_rule_list); node = mxmlFindElement(node, root, xml_path, NULL, NULL, MXML_DESCEND); } } void oss_lifecycle_rule_content_parse(aos_pool_t *p, mxml_node_t * xml_node, oss_lifecycle_rule_content_t *content) { char *id; char *prefix; char *status; const char *node_content; mxml_node_t *node; node = mxmlFindElement(xml_node, xml_node, "ID",NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { id = apr_pstrdup(p, node_content); aos_str_set(&content->id, id); } node = mxmlFindElement(xml_node, xml_node, "Prefix",NULL, NULL,MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { prefix = apr_pstrdup(p, node_content); aos_str_set(&content->prefix, prefix); } node = mxmlFindElement(xml_node, xml_node, "Status",NULL, NULL,MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { status = apr_pstrdup(p, node_content); aos_str_set(&content->status, status); } node = mxmlFindElement(xml_node, xml_node, "Expiration",NULL, NULL,MXML_DESCEND); if (NULL != node) { oss_lifecycle_rule_expire_parse(p, node, content); } node = mxmlFindElement(xml_node, xml_node, "AbortMultipartUpload",NULL, NULL,MXML_DESCEND); if (NULL != node) { oss_lifecycle_rule_date_parse(p, node, &content->abort_multipart_upload_dt); } node = mxmlFindElement(xml_node, xml_node, "Tag", NULL, NULL, MXML_DESCEND); for (; node != NULL; ) { oss_tag_content_t *tag = oss_create_tag_content(p); oss_lifecycle_rule_tag_parse(p, node, tag); aos_list_add_tail(&tag->node, &content->tag_list); node = mxmlFindElement(node, xml_node, "Tag", NULL, NULL, MXML_DESCEND); } } void oss_lifecycle_rule_date_parse(aos_pool_t *p, mxml_node_t * xml_node, oss_lifecycle_rule_date_t *rule_date) { char* days; char *created_before_date; mxml_node_t *node; const char *node_content; node = mxmlFindElement(xml_node, xml_node, "Days", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { days = apr_pstrdup(p, node_content); rule_date->days = atoi(days); } node = mxmlFindElement(xml_node, xml_node, "CreatedBeforeDate", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { created_before_date = apr_pstrdup(p, node_content); aos_str_set(&rule_date->created_before_date, created_before_date); } } void oss_lifecycle_rule_expire_parse(aos_pool_t *p, mxml_node_t * xml_node, oss_lifecycle_rule_content_t *content) { char* days; char *date; char *created_before_date; mxml_node_t *node; const char *node_content; node = mxmlFindElement(xml_node, xml_node, "Days", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { days = apr_pstrdup(p, node_content); content->days = atoi(days); } node = mxmlFindElement(xml_node, xml_node, "Date", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node) { date = apr_pstrdup(p, node_content); aos_str_set(&content->date, date); } node = mxmlFindElement(xml_node, xml_node, "CreatedBeforeDate", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { created_before_date = apr_pstrdup(p, node_content); aos_str_set(&content->created_before_date, created_before_date); } } void oss_lifecycle_rule_tag_parse(aos_pool_t *p, mxml_node_t * xml_node, oss_tag_content_t *tag) { mxml_node_t *node; const char *node_content; node = mxmlFindElement(xml_node, xml_node, "Key", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { char *key; key = apr_pstrdup(p, node_content); aos_str_set(&tag->key, key); } node = mxmlFindElement(xml_node, xml_node, "Value", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { char *value; value = apr_pstrdup(p, node_content); aos_str_set(&tag->value, value); } } void oss_delete_objects_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *object_list) { mxml_node_t *node; node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); for ( ; node != NULL; ) { oss_object_key_t *content = oss_create_oss_object_key(p); oss_object_key_parse(p, node, content); aos_list_add_tail(&content->node, object_list); node = mxmlFindElement(node, root, xml_path, NULL, NULL, MXML_DESCEND); } } void oss_object_key_parse(aos_pool_t *p, mxml_node_t * xml_node, oss_object_key_t *content) { char *key; char *encoded_key; const char *node_content; mxml_node_t *node; node = mxmlFindElement(xml_node, xml_node, "Key",NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { encoded_key = (char*)node_content; key = (char *) aos_palloc(p, strlen(encoded_key) + 1); aos_url_decode(encoded_key, key); aos_str_set(&content->key, key); } } int oss_delete_objects_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *object_list) { int res; mxml_node_t *root = NULL; const char deleted_xml_path[] = "Deleted"; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { oss_delete_objects_contents_parse(p, root, deleted_xml_path, object_list); mxmlDelete(root); } return res; } void oss_publish_url_parse(aos_pool_t *p, mxml_node_t *node, oss_live_channel_publish_url_t *content) { char *url; const char *node_content; node_content = mxmlGetOpaque(node); if (NULL != node_content) { url = apr_pstrdup(p, node_content); aos_str_set(&content->publish_url, url); } } void oss_play_url_parse(aos_pool_t *p, mxml_node_t *node, oss_live_channel_play_url_t *content) { char *url; const char *node_content; node_content = mxmlGetOpaque(node); if (NULL != node_content) { url = apr_pstrdup(p, node_content); aos_str_set(&content->play_url, url); } } void oss_publish_urls_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *publish_xml_list) { mxml_node_t *node; node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); for ( ; node != NULL; ) { oss_live_channel_publish_url_t *content = oss_create_live_channel_publish_url(p); oss_publish_url_parse(p, node, content); aos_list_add_tail(&content->node, publish_xml_list); node = mxmlFindElement(node, root, xml_path, NULL, NULL, MXML_DESCEND); } } void oss_play_urls_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *play_xml_list) { mxml_node_t *node; node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); for ( ; node != NULL; ) { oss_live_channel_play_url_t *content = oss_create_live_channel_play_url(p); oss_play_url_parse(p, node, content); aos_list_add_tail(&content->node, play_xml_list); node = mxmlFindElement(node, root, xml_path, NULL, NULL, MXML_DESCEND); } } void oss_create_live_channel_content_parse(aos_pool_t *p, mxml_node_t *root, const char *publish_xml_path, aos_list_t *publish_url_list, const char *play_xml_path, aos_list_t *play_url_list) { mxml_node_t *node; const char url_xml_path[] = "Url"; node = mxmlFindElement(root, root, publish_xml_path, NULL, NULL, MXML_DESCEND); if (NULL != node) { oss_publish_urls_contents_parse(p, node, url_xml_path, publish_url_list); } node = mxmlFindElement(root, root, play_xml_path, NULL, NULL, MXML_DESCEND); if (NULL != node) { oss_play_urls_contents_parse(p, node, url_xml_path, play_url_list); } } int oss_create_live_channel_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *publish_url_list, aos_list_t *play_url_list) { int res; mxml_node_t *root = NULL; const char publish_urls_xml_path[] = "PublishUrls"; const char play_urls_xml_path[] = "PlayUrls"; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { oss_create_live_channel_content_parse(p, root, publish_urls_xml_path, publish_url_list, play_urls_xml_path, play_url_list); mxmlDelete(root); } return res; } char *build_create_live_channel_xml(aos_pool_t *p, oss_live_channel_configuration_t *config) { char *xml_buff; char *complete_part_xml; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; char value_str[64]; mxml_node_t *description_node; mxml_node_t *status_node; mxml_node_t *target_node; mxml_node_t *type_node; mxml_node_t *frag_duration_node; mxml_node_t *frag_count_node; mxml_node_t *play_list_node; doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "LiveChannelConfiguration"); description_node = mxmlNewElement(root_node, "Description"); mxmlNewText(description_node, 0, config->description.data); status_node = mxmlNewElement(root_node, "Status"); mxmlNewText(status_node, 0, config->status.data); // target target_node = mxmlNewElement(root_node, "Target"); type_node = mxmlNewElement(target_node, "Type"); mxmlNewText(type_node, 0, config->target.type.data); apr_snprintf(value_str, sizeof(value_str), "%d", config->target.frag_duration); frag_duration_node = mxmlNewElement(target_node, "FragDuration"); mxmlNewText(frag_duration_node, 0, value_str); apr_snprintf(value_str, sizeof(value_str), "%d", config->target.frag_count); frag_count_node = mxmlNewElement(target_node, "FragCount"); mxmlNewText(frag_count_node, 0, value_str); play_list_node = mxmlNewElement(target_node, "PlaylistName"); mxmlNewText(play_list_node, 0, config->target.play_list_name.data); // dump xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); complete_part_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return complete_part_xml; } void build_create_live_channel_body(aos_pool_t *p, oss_live_channel_configuration_t *config, aos_list_t *body) { char *live_channel_xml; aos_buf_t *b; live_channel_xml = build_create_live_channel_xml(p, config); aos_list_init(body); b = aos_buf_pack(p, live_channel_xml, strlen(live_channel_xml)); aos_list_add_tail(&b->node, body); } void oss_live_channel_info_target_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_live_channel_target_t *target) { char *type; char *frag_duration; char *frag_count; char *play_list; const char *node_content; mxml_node_t *node; node = mxmlFindElement(xml_node, xml_node, "Type", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { type = apr_pstrdup(p, node_content); aos_str_set(&target->type, type); } node = mxmlFindElement(xml_node, xml_node, "FragDuration", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { frag_duration = apr_pstrdup(p, node_content); target->frag_duration = atoi(frag_duration); } node = mxmlFindElement(xml_node, xml_node, "FragCount", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { frag_count = apr_pstrdup(p, node_content); target->frag_count = atoi(frag_count); } node = mxmlFindElement(xml_node, xml_node, "PlaylistName",NULL, NULL,MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { play_list = apr_pstrdup(p, node_content); aos_str_set(&target->play_list_name, play_list); } } void oss_live_channel_info_content_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, oss_live_channel_configuration_t *info) { mxml_node_t *cofig_node; mxml_node_t *target_node; cofig_node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); if (NULL != cofig_node) { char *description; char *status; const char *node_content; mxml_node_t *node; node = mxmlFindElement(cofig_node, cofig_node, "Description", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { description = apr_pstrdup(p, node_content); aos_str_set(&info->description, description); } node = mxmlFindElement(cofig_node, cofig_node, "Status", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { status = apr_pstrdup(p, node_content); aos_str_set(&info->status, status); } target_node = mxmlFindElement(cofig_node, cofig_node, "Target", NULL, NULL, MXML_DESCEND); if (NULL != target_node) { oss_live_channel_info_target_content_parse(p, target_node, &info->target); } } } int oss_live_channel_info_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_live_channel_configuration_t *info) { int res; mxml_node_t *root; const char xml_path[] = "LiveChannelConfiguration"; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { oss_live_channel_info_content_parse(p, root, xml_path, info); mxmlDelete(root); } return res; } void oss_live_channel_stat_video_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_video_stat_t *video_stat) { char *width; char *height; char *frame_rate; char *band_width; char *codec; const char *node_content; mxml_node_t *node; node = mxmlFindElement(xml_node, xml_node, "Width", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { width = apr_pstrdup(p, node_content); video_stat->width = atoi(width); } node = mxmlFindElement(xml_node, xml_node, "Height", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { height = apr_pstrdup(p, node_content); video_stat->height = atoi(height); } node = mxmlFindElement(xml_node, xml_node, "FrameRate", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { frame_rate = apr_pstrdup(p, node_content); video_stat->frame_rate = atoi(frame_rate); } node = mxmlFindElement(xml_node, xml_node, "Bandwidth", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { band_width = apr_pstrdup(p, node_content); video_stat->band_width = atoi(band_width); } node = mxmlFindElement(xml_node, xml_node, "Codec", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { codec = apr_pstrdup(p, node_content); aos_str_set(&video_stat->codec, codec); } } void oss_live_channel_stat_audio_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_audio_stat_t *audio_stat) { char *band_width; char *sample_rate; char *codec; const char *node_content; mxml_node_t *node; node = mxmlFindElement(xml_node, xml_node, "Bandwidth", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { band_width = apr_pstrdup(p, node_content); audio_stat->band_width = atoi(band_width); } node = mxmlFindElement(xml_node, xml_node, "SampleRate", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { sample_rate = apr_pstrdup(p, node_content); audio_stat->sample_rate = atoi(sample_rate); } node = mxmlFindElement(xml_node, xml_node, "Codec", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { codec = apr_pstrdup(p, node_content); aos_str_set(&audio_stat->codec, codec); } } void oss_live_channel_stat_content_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, oss_live_channel_stat_t *stat) { mxml_node_t *stat_node; stat_node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); if (NULL != stat_node) { char *status; char *connected_time; char *remote_addr; const char *node_content; mxml_node_t *node; node = mxmlFindElement(stat_node, stat_node, "Status", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { status = apr_pstrdup(p, node_content); aos_str_set(&stat->pushflow_status, status); } node = mxmlFindElement(stat_node, stat_node, "ConnectedTime", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { connected_time = apr_pstrdup(p, node_content); aos_str_set(&stat->connected_time, connected_time); } node = mxmlFindElement(stat_node, stat_node, "RemoteAddr", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { remote_addr = apr_pstrdup(p, node_content); aos_str_set(&stat->remote_addr, remote_addr); } node = mxmlFindElement(stat_node, stat_node, "Video", NULL, NULL, MXML_DESCEND); if (NULL != node) { oss_live_channel_stat_video_content_parse(p, node, &stat->video_stat); } node = mxmlFindElement(stat_node, stat_node, "Audio", NULL, NULL, MXML_DESCEND); if (NULL != node) { oss_live_channel_stat_audio_content_parse(p, node, &stat->audio_stat); } } } int oss_live_channel_stat_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_live_channel_stat_t *stat) { int res; mxml_node_t *root; const char xml_path[] = "LiveChannelStat"; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { oss_live_channel_stat_content_parse(p, root, xml_path, stat); mxmlDelete(root); } return res; } void oss_list_live_channel_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_live_channel_content_t *content) { char *name; char *description; char *status; char *last_modified; const char *node_content; mxml_node_t *node; node = mxmlFindElement(xml_node, xml_node, "Name", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { name = apr_pstrdup(p, node_content); aos_str_set(&content->name, name); } node = mxmlFindElement(xml_node, xml_node, "Description", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { description = apr_pstrdup(p, node_content); aos_str_set(&content->description, description); } else { aos_str_set(&content->description, ""); } node = mxmlFindElement(xml_node, xml_node, "Status", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { status = apr_pstrdup(p, node_content); aos_str_set(&content->status, status); } node = mxmlFindElement(xml_node, xml_node, "LastModified", NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node) { last_modified = apr_pstrdup(p, node_content); aos_str_set(&content->last_modified, last_modified); } node = mxmlFindElement(xml_node, xml_node, "PublishUrls", NULL, NULL, MXML_DESCEND); if (NULL != node) { oss_publish_urls_contents_parse(p, node, "Url", &content->publish_url_list); } node = mxmlFindElement(xml_node, xml_node, "PlayUrls", NULL, NULL, MXML_DESCEND); if (NULL != node) { oss_play_urls_contents_parse(p, node, "Url", &content->play_url_list); } } void oss_list_live_channel_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *live_channel_list) { mxml_node_t *content_node; oss_live_channel_content_t *content; content_node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); for ( ; content_node != NULL; ) { content = oss_create_list_live_channel_content(p); oss_list_live_channel_content_parse(p, content_node, content); aos_list_add_tail(&content->node, live_channel_list); content_node = mxmlFindElement(content_node, root, xml_path, NULL, NULL, MXML_DESCEND); } } int oss_list_live_channel_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *live_channel_list, aos_string_t *next_marker, int *truncated) { int res; mxml_node_t *root; const char next_marker_xml_path[] = "NextMarker"; const char truncated_xml_path[] = "IsTruncated"; const char live_channel_xml_path[] = "LiveChannel"; char *next_partnumber_marker; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { next_partnumber_marker = get_xmlnode_value(p, root, next_marker_xml_path); if (next_partnumber_marker) { aos_str_set(next_marker, next_partnumber_marker); } *truncated = get_truncated_from_xml(p, root, truncated_xml_path); oss_list_live_channel_contents_parse(p, root, live_channel_xml_path, live_channel_list); mxmlDelete(root); } return res; } void oss_live_channel_history_content_parse(aos_pool_t *p, mxml_node_t * xml_node, oss_live_record_content_t *content) { char *start_time; char *end_time; char *remote_addr; const char *node_content; mxml_node_t *node; node = mxmlFindElement(xml_node, xml_node, "StartTime",NULL, NULL, MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { start_time = apr_pstrdup(p, node_content); aos_str_set(&content->start_time, start_time); } node = mxmlFindElement(xml_node, xml_node, "EndTime",NULL, NULL,MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node_content) { end_time = apr_pstrdup(p, node_content); aos_str_set(&content->end_time, end_time); } node = mxmlFindElement(xml_node, xml_node, "RemoteAddr",NULL, NULL,MXML_DESCEND); node_content = mxmlGetOpaque(node); if (NULL != node) { remote_addr = apr_pstrdup(p, node_content); aos_str_set(&content->remote_addr, remote_addr); } } void oss_live_channel_history_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *live_record_list) { mxml_node_t *node; oss_live_record_content_t *content; node = mxmlFindElement(root, root, xml_path, NULL, NULL, MXML_DESCEND); for ( ; node != NULL; ) { content = oss_create_live_record_content(p); oss_live_channel_history_content_parse(p, node, content); aos_list_add_tail(&content->node, live_record_list); node = mxmlFindElement(node, root, xml_path, NULL, NULL, MXML_DESCEND); } } int oss_live_channel_history_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *live_record_list) { int res; mxml_node_t *root = NULL; const char rule_xml_path[] = "LiveRecord"; res = get_xmldoc(bc, &root); if (res == AOSE_OK) { oss_live_channel_history_contents_parse(p, root, rule_xml_path, live_record_list); mxmlDelete(root); } return res; } char *build_objects_xml(aos_pool_t *p, aos_list_t *object_list, const char *quiet) { char *object_xml; char *xml_buff; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; oss_object_key_t *content; mxml_node_t *quiet_node; doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "Delete"); quiet_node = mxmlNewElement(root_node, "Quiet"); mxmlNewText(quiet_node, 0, quiet); aos_list_for_each_entry(oss_object_key_t, content, object_list, node) { mxml_node_t *object_node = mxmlNewElement(root_node, "Object"); mxml_node_t *key_node = mxmlNewElement(object_node, "Key"); mxmlNewText(key_node, 0, content->key.data); } xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); object_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return object_xml; } void build_delete_objects_body(aos_pool_t *p, aos_list_t *object_list, int is_quiet, aos_list_t *body) { char *objects_xml; aos_buf_t *b; char *quiet; quiet = is_quiet > 0 ? "true": "false"; objects_xml = build_objects_xml(p, object_list, quiet); aos_list_init(body); b = aos_buf_pack(p, objects_xml, strlen(objects_xml)); aos_list_add_tail(&b->node, body); } mxml_node_t *set_xmlnode_value_str(mxml_node_t *parent, const char *name, const aos_string_t *value) { mxml_node_t *node; char buff[AOS_MAX_XML_NODE_VALUE_LEN]; node = mxmlNewElement(parent, name); apr_snprintf(buff, AOS_MAX_XML_NODE_VALUE_LEN, "%.*s", value->len, value->data); return mxmlNewText(node, 0, buff); } mxml_node_t *set_xmlnode_value_int(mxml_node_t *parent, const char *name, int value) { mxml_node_t *node; char buff[AOS_MAX_INT64_STRING_LEN]; node = mxmlNewElement(parent, name); apr_snprintf(buff, AOS_MAX_INT64_STRING_LEN, "%d", value); return mxmlNewText(node, 0, buff); } mxml_node_t *set_xmlnode_value_int64(mxml_node_t *parent, const char *name, int64_t value) { mxml_node_t *node; char buff[AOS_MAX_INT64_STRING_LEN]; node = mxmlNewElement(parent, name); apr_snprintf(buff, AOS_MAX_INT64_STRING_LEN, "%" APR_INT64_T_FMT, value); return mxmlNewText(node, 0, buff); } mxml_node_t *set_xmlnode_value_uint64(mxml_node_t *parent, const char *name, uint64_t value) { mxml_node_t *node; char buff[AOS_MAX_UINT64_STRING_LEN]; node = mxmlNewElement(parent, name); apr_snprintf(buff, AOS_MAX_UINT64_STRING_LEN, "%" APR_UINT64_T_FMT, value); return mxmlNewText(node, 0, buff); } int get_xmlnode_value_str(aos_pool_t *p, mxml_node_t *xml_node, const char *xml_path, aos_string_t *value) { char *node_content; node_content = get_xmlnode_value(p, xml_node, xml_path); if (NULL == node_content) { return AOS_FALSE; } aos_str_set(value, node_content); return AOS_TRUE; } int get_xmlnode_value_int(aos_pool_t *p, mxml_node_t *xml_node, const char *xml_path, int *value) { char *node_content; node_content = get_xmlnode_value(p, xml_node, xml_path); if (NULL == node_content) { return AOS_FALSE; } *value = atoi(node_content); return AOS_TRUE; } int get_xmlnode_value_int64(aos_pool_t *p, mxml_node_t *xml_node, const char *xml_path, int64_t *value) { char *node_content; node_content = get_xmlnode_value(p, xml_node, xml_path); if (NULL == node_content) { return AOS_FALSE; } *value = aos_atoi64(node_content); return AOS_TRUE; } int get_xmlnode_value_uint64(aos_pool_t *p, mxml_node_t *xml_node, const char *xml_path, uint64_t *value) { char *node_content; node_content = get_xmlnode_value(p, xml_node, xml_path); if (NULL == node_content) { return AOS_FALSE; } *value = aos_atoui64(node_content); return AOS_TRUE; } char *oss_build_checkpoint_xml(aos_pool_t *p, const oss_checkpoint_t *checkpoint) { char *checkpoint_xml; char *xml_buff; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; mxml_node_t *local_node; mxml_node_t *object_node; mxml_node_t *cpparts_node; mxml_node_t *parts_node; int i = 0; if (p == NULL) { return NULL; } doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "Checkpoint"); // MD5 set_xmlnode_value_str(root_node, "MD5", &checkpoint->md5); // Type set_xmlnode_value_int(root_node, "Type", checkpoint->cp_type); // LocalFile local_node = mxmlNewElement(root_node, "LocalFile"); // LocalFile.Path set_xmlnode_value_str(local_node, "Path", &checkpoint->file_path); // LocalFile.Size set_xmlnode_value_int64(local_node, "Size", checkpoint->file_size); // LocalFile.LastModified set_xmlnode_value_int64(local_node, "LastModified", checkpoint->file_last_modified); // LocalFile.MD5 set_xmlnode_value_str(local_node, "MD5", &checkpoint->file_md5); // Object object_node = mxmlNewElement(root_node, "Object"); // Object.Key set_xmlnode_value_str(object_node, "Key", &checkpoint->object_name); // Object.Size set_xmlnode_value_int64(object_node, "Size", checkpoint->object_size); // Object.LastModified set_xmlnode_value_str(object_node, "LastModified", &checkpoint->object_last_modified); // Object.ETag set_xmlnode_value_str(object_node, "ETag", &checkpoint->object_etag); // UploadId set_xmlnode_value_str(root_node, "UploadId", &checkpoint->upload_id); // CpParts cpparts_node = mxmlNewElement(root_node, "CPParts"); // CpParts.Number set_xmlnode_value_int(cpparts_node, "Number", checkpoint->part_num); // CpParts.Size set_xmlnode_value_int64(cpparts_node, "Size", checkpoint->part_size); // CpParts.Parts parts_node = mxmlNewElement(cpparts_node, "Parts"); for (i = 0; i < checkpoint->part_num; i++) { mxml_node_t *part_node = mxmlNewElement(parts_node, "Part"); set_xmlnode_value_int(part_node, "Index", checkpoint->parts[i].index); set_xmlnode_value_int64(part_node, "Offset", checkpoint->parts[i].offset); set_xmlnode_value_int64(part_node, "Size", checkpoint->parts[i].size); set_xmlnode_value_int(part_node, "Completed", checkpoint->parts[i].completed); set_xmlnode_value_str(part_node, "ETag", &checkpoint->parts[i].etag); set_xmlnode_value_uint64(part_node, "Crc64", checkpoint->parts[i].crc64); } // dump xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); checkpoint_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return checkpoint_xml; } int oss_checkpoint_parse_from_body(aos_pool_t *p, const char *xml_body, oss_checkpoint_t *checkpoint) { mxml_node_t *root; mxml_node_t *local_node; mxml_node_t *object_node; mxml_node_t *cpparts_node; mxml_node_t *parts_node; mxml_node_t *node; int index = 0; root = mxmlLoadString(NULL, xml_body, MXML_OPAQUE_CALLBACK); if (NULL == root) { return AOSE_XML_PARSE_ERROR; } // MD5 get_xmlnode_value_str(p, root, "MD5", &checkpoint->md5); // Type get_xmlnode_value_int(p, root, "Type", &checkpoint->cp_type); // LocalFile local_node = mxmlFindElement(root, root, "LocalFile", NULL, NULL, MXML_DESCEND); // LocalFile.Path get_xmlnode_value_str(p, local_node, "Path", &checkpoint->file_path); // LocalFile.Size get_xmlnode_value_int64(p, local_node, "Size", &checkpoint->file_size); // LocalFile.LastModified get_xmlnode_value_int64(p, local_node, "LastModified", &checkpoint->file_last_modified); // LocalFile.MD5 get_xmlnode_value_str(p, local_node, "MD5", &checkpoint->file_md5); // Object object_node = mxmlFindElement(root, root, "Object", NULL, NULL, MXML_DESCEND); // Object.Key get_xmlnode_value_str(p, object_node, "Key", &checkpoint->object_name); // Object.Size get_xmlnode_value_int64(p, object_node, "Size", &checkpoint->object_size); // Object.LastModified get_xmlnode_value_str(p, object_node, "LastModified", &checkpoint->object_last_modified); // Object.ETag get_xmlnode_value_str(p, object_node, "ETag", &checkpoint->object_etag); // UploadId get_xmlnode_value_str(p, root, "UploadId", &checkpoint->upload_id); // CpParts cpparts_node = mxmlFindElement(root, root, "CPParts", NULL, NULL, MXML_DESCEND); // CpParts.Number get_xmlnode_value_int(p, cpparts_node, "Number", &checkpoint->part_num); // CpParts.Size get_xmlnode_value_int64(p, cpparts_node, "Size", &checkpoint->part_size); // CpParts.Parts parts_node = mxmlFindElement(cpparts_node, cpparts_node, "Parts", NULL, NULL, MXML_DESCEND); node = mxmlFindElement(parts_node, parts_node, "Part", NULL, NULL, MXML_DESCEND); for ( ; node != NULL; ) { get_xmlnode_value_int(p, node, "Index", &index); checkpoint->parts[index].index = index; get_xmlnode_value_int64(p, node, "Offset", &checkpoint->parts[index].offset); get_xmlnode_value_int64(p, node, "Size", &checkpoint->parts[index].size); get_xmlnode_value_int(p, node, "Completed", &checkpoint->parts[index].completed); get_xmlnode_value_str(p, node, "ETag", &checkpoint->parts[index].etag); get_xmlnode_value_uint64(p, node, "Crc64", &checkpoint->parts[index].crc64); node = mxmlFindElement(node, parts_node, "Part", NULL, NULL, MXML_DESCEND); } mxmlDelete(root); return AOSE_OK; } static char *oss_build_select_object_xml(aos_pool_t *p, const aos_string_t *expression, const oss_select_object_params_t *params) { char *select_object_xml; char *xml_buff; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; mxml_node_t *input_node; mxml_node_t *output_node; mxml_node_t *option_node; int b64_len; char b64_buf[2048]; aos_string_t value; int max_b64_expression_len = 0; int32_t has_compression = 0; int32_t has_csv = 0; if (!expression || !params) { return NULL; } doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "SelectRequest"); // Expression max_b64_expression_len = (expression->len + 1) * 4 / 3; if (max_b64_expression_len > sizeof(b64_buf)) { char *tmp = (char *)malloc(max_b64_expression_len); if (!tmp) { return NULL; } b64_len = aos_base64_encode((unsigned char*)(expression->data), expression->len, tmp); value.data = tmp; value.len = b64_len; set_xmlnode_value_str(root_node, "Expression", &value); free(tmp); } else { b64_len = aos_base64_encode((unsigned char*)(expression->data), expression->len, b64_buf); value.data = b64_buf; value.len = b64_len; set_xmlnode_value_str(root_node, "Expression", &value); } // InputSerialization has_compression = !aos_string_is_empty(¶ms->input_param.compression_type); has_csv = !aos_string_is_empty(¶ms->input_param.file_header_info) || !aos_string_is_empty(¶ms->input_param.record_delimiter) || !aos_string_is_empty(¶ms->input_param.field_delimiter) || !aos_string_is_empty(¶ms->input_param.quote_character) || !aos_string_is_empty(¶ms->input_param.comment_character)|| !aos_string_is_empty(¶ms->input_param.range); if (has_compression || has_csv) { input_node = mxmlNewElement(root_node, "InputSerialization"); if (has_compression) { set_xmlnode_value_str(input_node, "CompressionType", ¶ms->input_param.compression_type); } if (has_csv) { mxml_node_t *csv_node = mxmlNewElement(input_node, "CSV"); if (!aos_string_is_empty(¶ms->input_param.file_header_info)) { set_xmlnode_value_str(csv_node, "FileHeaderInfo", ¶ms->input_param.file_header_info); } if (!aos_string_is_empty(¶ms->input_param.record_delimiter)) { value = params->input_param.record_delimiter; b64_len = aos_base64_encode((unsigned char*)value.data, value.len, b64_buf); value.data = b64_buf; value.len = b64_len; set_xmlnode_value_str(csv_node, "RecordDelimiter", &value); } if (!aos_string_is_empty(¶ms->input_param.field_delimiter)) { value = params->input_param.field_delimiter; b64_len = aos_base64_encode((unsigned char*)value.data, value.len, b64_buf); value.data = b64_buf; value.len = b64_len; set_xmlnode_value_str(csv_node, "FieldDelimiter", &value); } if (!aos_string_is_empty(¶ms->input_param.quote_character)) { value = params->input_param.quote_character; b64_len = aos_base64_encode((unsigned char*)value.data, value.len, b64_buf); value.data = b64_buf; value.len = b64_len; set_xmlnode_value_str(csv_node, "QuoteCharacter", &value); } if (!aos_string_is_empty(¶ms->input_param.comment_character)) { value = params->input_param.comment_character; b64_len = aos_base64_encode((unsigned char*)value.data, value.len, b64_buf); value.data = b64_buf; value.len = b64_len; set_xmlnode_value_str(csv_node, "CommentCharacter", &value); } if (!aos_string_is_empty(¶ms->input_param.range)) { set_xmlnode_value_str(csv_node, "Range", ¶ms->input_param.range); } } } // OutputSerialization has_csv = !aos_string_is_empty(¶ms->output_param.record_delimiter) || !aos_string_is_empty(¶ms->output_param.field_delimiter); output_node = mxmlNewElement(root_node, "OutputSerialization"); if (has_csv) { mxml_node_t *csv_node = mxmlNewElement(output_node, "CSV"); if (!aos_string_is_empty(¶ms->output_param.record_delimiter)) { value = params->output_param.record_delimiter; b64_len = aos_base64_encode((unsigned char*)value.data, value.len, b64_buf); value.data = b64_buf; value.len = b64_len; set_xmlnode_value_str(csv_node, "RecordDelimiter", &value); } if (!aos_string_is_empty(¶ms->output_param.field_delimiter)) { value = params->output_param.field_delimiter; b64_len = aos_base64_encode((unsigned char*)value.data, value.len, b64_buf); value.data = b64_buf; value.len = b64_len; set_xmlnode_value_str(csv_node, "FieldDelimiter", &value); } } if (params->output_param.keep_all_columns != OSS_INVALID_VALUE) { if (params->output_param.keep_all_columns) { aos_str_set(&value, "true"); } else { aos_str_set(&value, "false"); } set_xmlnode_value_str(output_node, "KeepAllColumns", &value); } if (params->output_param.output_rawdata != OSS_INVALID_VALUE) { if (params->output_param.output_rawdata) { aos_str_set(&value, "true"); } else { aos_str_set(&value, "false"); } set_xmlnode_value_str(output_node, "OutputRawData", &value); } if (params->output_param.enable_payload_crc != OSS_INVALID_VALUE) { if (params->output_param.enable_payload_crc) { aos_str_set(&value, "true"); } else { aos_str_set(&value, "false"); } set_xmlnode_value_str(output_node, "EnablePayloadCrc", &value); } aos_str_set(&value, "false"); if (params->output_param.output_header) { aos_str_set(&value, "true"); } set_xmlnode_value_str(output_node, "OutputHeader", &value); //Options option_node = mxmlNewElement(root_node, "Options"); aos_str_set(&value, "false"); if (params->option_param.skip_partial_data_record) { aos_str_set(&value, "true"); } set_xmlnode_value_str(option_node, "SkipPartialDataRecord", &value); // dump xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); select_object_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return select_object_xml; } void oss_build_select_object_body(aos_pool_t *p, const aos_string_t *expression, const oss_select_object_params_t *params, aos_list_t *body) { char *select_object_xml; aos_buf_t *b; aos_list_init(body); select_object_xml = oss_build_select_object_xml(p, expression, params); if (select_object_xml) { b = aos_buf_pack(p, select_object_xml, strlen(select_object_xml)); aos_list_add_tail(&b->node, body); } } static char *oss_build_create_select_object_meta_xml(aos_pool_t *p, const oss_select_object_meta_params_t *params) { char *meta_xml; char *xml_buff; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node; mxml_node_t *input_node; int b64_len; char b64_buf[1024]; aos_string_t value; int32_t has_csv = 0; if (!params) { return NULL; } doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "CsvMetaRequest"); // InputSerialization input_node = mxmlNewElement(root_node, "InputSerialization"); aos_str_set(&value, "None"); set_xmlnode_value_str(input_node, "CompressionType", &value); has_csv = !aos_string_is_empty(¶ms->record_delimiter) || !aos_string_is_empty(¶ms->field_delimiter) || !aos_string_is_empty(¶ms->quote_character); if (has_csv) { mxml_node_t *csv_node = mxmlNewElement(input_node, "CSV"); if (!aos_string_is_empty(¶ms->record_delimiter)) { value = params->record_delimiter; b64_len = aos_base64_encode((unsigned char*)value.data, value.len, b64_buf); value.data = b64_buf; value.len = b64_len; set_xmlnode_value_str(csv_node, "RecordDelimiter", &value); } if (!aos_string_is_empty(¶ms->field_delimiter)) { value = params->field_delimiter; b64_len = aos_base64_encode((unsigned char*)value.data, value.len, b64_buf); value.data = b64_buf; value.len = b64_len; set_xmlnode_value_str(csv_node, "FieldDelimiter", &value); } if (!aos_string_is_empty(¶ms->quote_character)) { value = params->quote_character; b64_len = aos_base64_encode((unsigned char*)value.data, value.len, b64_buf); value.data = b64_buf; value.len = b64_len; set_xmlnode_value_str(csv_node, "QuoteCharacter", &value); } } if (params->over_write_if_existing != OSS_INVALID_VALUE) { if (params->over_write_if_existing) { aos_str_set(&value, "true"); } else { aos_str_set(&value, "false"); } set_xmlnode_value_str(root_node, "OverwriteIfExists", &value); } // dump xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); meta_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return meta_xml; } void oss_build_create_select_object_meta_body(aos_pool_t *p, const oss_select_object_meta_params_t *params, aos_list_t *body) { char *meta_xml; aos_buf_t *b; aos_list_init(body); meta_xml = oss_build_create_select_object_meta_xml(p, params); if (meta_xml) { b = aos_buf_pack(p, meta_xml, strlen(meta_xml)); aos_list_add_tail(&b->node, body); } } char *build_object_tagging_xml(aos_pool_t *p, aos_list_t *tag_list) { char *tagging_xml; char *xml_buff; aos_string_t xml_doc; mxml_node_t *doc; mxml_node_t *root_node, *tags_node; oss_tag_content_t *content; doc = mxmlNewXML("1.0"); root_node = mxmlNewElement(doc, "Tagging"); tags_node = mxmlNewElement(root_node, "TagSet"); aos_list_for_each_entry(oss_tag_content_t, content, tag_list, node) { mxml_node_t *tag_node = mxmlNewElement(tags_node, "Tag"); mxml_node_t *key_node = mxmlNewElement(tag_node, "Key"); mxml_node_t *value_node = mxmlNewElement(tag_node, "Value"); mxmlNewText(key_node, 0, content->key.data); mxmlNewText(value_node, 0, content->value.data); } xml_buff = new_xml_buff(doc); if (xml_buff == NULL) { return NULL; } aos_str_set(&xml_doc, xml_buff); tagging_xml = aos_pstrdup(p, &xml_doc); free(xml_buff); mxmlDelete(doc); return tagging_xml; } void build_object_tagging_body(aos_pool_t *p, aos_list_t *tag_list, aos_list_t *body) { char *tagging_xml; aos_buf_t *b; tagging_xml = build_object_tagging_xml(p, tag_list); aos_list_init(body); b = aos_buf_pack(p, tagging_xml, strlen(tagging_xml)); aos_list_add_tail(&b->node, body); } int oss_get_tagging_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *tag_list) { mxml_node_t *doc = NULL; mxml_node_t *tagging_node; mxml_node_t *tagset_node; int res; res = get_xmldoc(bc, &doc); if (res == AOSE_OK) { tagging_node = mxmlFindElement(doc, doc, "Tagging", NULL, NULL, MXML_DESCEND); if (tagging_node) { tagset_node = mxmlFindElement(tagging_node, doc, "TagSet", NULL, NULL, MXML_DESCEND); if (tagset_node) { mxml_node_t * node = mxmlFindElement(tagset_node, doc, "Tag", NULL, NULL, MXML_DESCEND); for (; node != NULL; ) { oss_tag_content_t *content = oss_create_tag_content(p); get_xmlnode_value_str(p, node, "Key", &content->key); get_xmlnode_value_str(p, node, "Value", &content->value); aos_list_add_tail(&content->node, tag_list); node = mxmlFindElement(node, tagset_node, "Tag", NULL, NULL, MXML_DESCEND); } } } } mxmlDelete(doc); return res; } static char *build_restore_object_xml(aos_pool_t *p, oss_tier_type_e tier, int day) { const char *fmt = "\n" "\n" "%d\n" "%s\n" "\n"; return apr_psprintf(p, fmt, day, get_oss_tier_type_str(tier)); } void oss_build_restore_object_body(aos_pool_t *p, oss_tier_type_e tier, int day, aos_list_t *body) { char *restore_object_xml; aos_buf_t *b; restore_object_xml = build_restore_object_xml(p, tier, day); if (restore_object_xml) { aos_list_init(body); b = aos_buf_pack(p, restore_object_xml, strlen(restore_object_xml)); aos_list_add_tail(&b->node, body); } } ================================================ FILE: oss_c_sdk/oss_xml.h ================================================ #ifndef LIBOSS_XML_H #define LIBOSS_XML_H #include #include "aos_string.h" #include "aos_transport.h" #include "aos_status.h" #include "oss_define.h" #include "oss_resumable.h" typedef void (*NODE_PARSE_FUN)(aos_pool_t *p, mxml_node_t *xml_node, aos_list_t *node_list); OSS_CPP_START /** * @brief functions for xml body parse **/ int get_xmldoc(aos_list_t *bc, mxml_node_t **root); char *get_xmlnode_value(aos_pool_t *p, mxml_node_t * root, const char *xml_path); /** * @brief build xml body for complete_multipart_upload **/ char *build_complete_multipart_upload_xml(aos_pool_t *p, aos_list_t *bc); /** * @brief build body for complete multipart upload **/ void build_complete_multipart_upload_body(aos_pool_t *p, aos_list_t *part_list, aos_list_t *body); /** * @brief build xml body for put lifecycle **/ char *build_lifecycle_xml(aos_pool_t *p, aos_list_t *lifecycle_rule_list); /** * @brief build body for put lifecycle **/ void build_lifecycle_body(aos_pool_t *p, aos_list_t *lifecycle_rule_list, aos_list_t *body); /** * @brief build body for put referer **/ void build_referer_config_body(aos_pool_t *p, oss_referer_config_t *referer_config, aos_list_t *body); /** * @brief build body for put website **/ void build_website_config_body(aos_pool_t *p, oss_website_config_t *website_config, aos_list_t *body); /** * @brief build body for put cors **/ void build_cors_rule_body(aos_pool_t *p, aos_list_t *rule_list, aos_list_t *body); /** * @brief build body for put bucket logging **/ void build_bucket_logging_body(aos_pool_t *p, oss_logging_config_content_t *content, aos_list_t *body); /** * @brief build body for put storage class **/ void build_bucket_storage_class(aos_pool_t *p, oss_storage_class_type_e storage_class, aos_list_t *body); /** * @brief build body for put storage capacity **/ void build_bucket_storage_capacity_body(aos_pool_t *p, long storage_capacity, aos_list_t *body); /** * @brief build xml body for delete objects **/ char *build_objects_xml(aos_pool_t *p, aos_list_t *object_list, const char *quiet); /** * @brief build body for delete objects **/ void build_delete_objects_body(aos_pool_t *p, aos_list_t *object_list, int is_quiet, aos_list_t *body); mxml_node_t *set_xmlnode_value_str(mxml_node_t *parent, const char *name, const aos_string_t *value); mxml_node_t *set_xmlnode_value_int(mxml_node_t *parent, const char *name, int value); mxml_node_t *set_xmlnode_value_int64(mxml_node_t *parent, const char *name, int64_t value); mxml_node_t *set_xmlnode_value_uint64(mxml_node_t *parent, const char *name, uint64_t value); int get_xmlnode_value_str(aos_pool_t *p, mxml_node_t *xml_node, const char *xml_path, aos_string_t *value); int get_xmlnode_value_int(aos_pool_t *p, mxml_node_t *xml_node, const char *xml_path, int *value); int get_xmlnode_value_int64(aos_pool_t *p, mxml_node_t *xml_node, const char *xml_path, int64_t *value); int get_xmlnode_value_uint64(aos_pool_t *p, mxml_node_t *xml_node, const char *xml_path, uint64_t *value); /** * @brief build xml for checkpoint **/ char *oss_build_checkpoint_xml(aos_pool_t *p, const oss_checkpoint_t *checkpoint); /** * @bried parse checkpoint from xml **/ int oss_checkpoint_parse_from_body(aos_pool_t *p, const char *xml_body, oss_checkpoint_t *checkpoint); /** * @bried parse acl from xml body for get_bucket_acl **/ int oss_acl_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_string_t *oss_acl); /** * @bried parse location from xml body for get_bucket_location **/ int oss_location_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_string_t *oss_location); /** * @bried parse storage capacity from xml body for get_bucket_storage_capacity **/ int oss_storage_capacity_parse_from_body(aos_pool_t *p, aos_list_t *bc, long *storage_capacity); /** * @bried parse logging info from xml body for get_bucket_logging **/ int oss_logging_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_logging_config_content_t *logging_content); /** * @bried parse bucket info from xml body for get_bucket_logging **/ int oss_get_bucket_info_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_bucket_info_t *bucket_info); /** * @bried parse bucket stat from xml body for get_bucket_stat **/ int oss_get_bucket_stat_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_bucket_stat_t *bucket_stat); /** * @bried parse bucket website info from xml body for get_bucket_website **/ int oss_get_bucket_website_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_website_config_t *website_config); /** * @bried parse bucket referer configuration from xml body for get_bucket_logging **/ int oss_get_bucket_referer_config_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_referer_config_t *referer_config); /** * @bried parse bucket cors from xml body for get_bucket_cors **/ void oss_cors_rule_content_parse(aos_pool_t *p, mxml_node_t *xml_node, aos_list_t *node_list); int oss_get_bucket_cors_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *rule_list); /** * @brief parse upload_id from xml body for init multipart upload **/ int oss_upload_id_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_string_t *upload_id); /** * @brief parse objects from xml body for list buckets **/ void oss_list_node_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *node_list, NODE_PARSE_FUN parse_funptr); void oss_list_buckets_content_parse(aos_pool_t *p, mxml_node_t *xml_node, aos_list_t *node_list); int oss_list_buckets_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_list_buckets_params_t *params); /** * @brief parse objects from xml body for list objects **/ void oss_list_objects_owner_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_list_object_content_t *content); void oss_list_objects_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_list_object_content_t *content); void oss_list_objects_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *object_list); void oss_list_objects_prefix_parse(aos_pool_t *p, mxml_node_t *root, oss_list_object_common_prefix_t *common_prefix); void oss_list_objects_common_prefix_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *common_prefix_list); int oss_list_objects_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *object_list, aos_list_t *common_prefix_list, aos_string_t *marker, int *truncated); /** * @brief parse parts from xml body for list upload part **/ void oss_list_parts_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *part_list); void oss_list_parts_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_list_part_content_t *content); int oss_list_parts_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *part_list, aos_string_t *part_number_marker, int *truncated); /** * @brief parse uploads from xml body for list multipart upload **/ void oss_list_multipart_uploads_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *upload_list); void oss_list_multipart_uploads_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_list_multipart_upload_content_t *content); int oss_list_multipart_uploads_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *upload_list, aos_string_t *key_marker, aos_string_t *upload_id_marker, int *truncated); /** * @brief parse lifecycle rules from xml body **/ void oss_lifecycle_rule_expire_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_lifecycle_rule_content_t *content); void oss_lifecycle_rule_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_lifecycle_rule_content_t *content); void oss_lifecycle_rule_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *lifecycle_rule_list); int oss_lifecycle_rules_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *lifecycle_rule_list); void oss_lifecycle_rule_date_parse(aos_pool_t *p, mxml_node_t * xml_node, oss_lifecycle_rule_date_t *rule_date); void oss_lifecycle_rule_tag_parse(aos_pool_t *p, mxml_node_t * xml_node, oss_tag_content_t *tag); /** * @brief parse delete objects contents from xml body **/ void oss_delete_objects_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *object_list); void oss_object_key_parse(aos_pool_t *p, mxml_node_t * xml_node, oss_object_key_t *content); int oss_delete_objects_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *object_list); /** * @brief build body for create live channel **/ char *build_create_live_channel_xml(aos_pool_t *p, oss_live_channel_configuration_t *config); void build_create_live_channel_body(aos_pool_t *p, oss_live_channel_configuration_t *config, aos_list_t *body); /** * @brief parse create live channel contents from xml body **/ void oss_publish_url_parse(aos_pool_t *p, mxml_node_t *node, oss_live_channel_publish_url_t *content); void oss_play_url_parse(aos_pool_t *p, mxml_node_t *node, oss_live_channel_play_url_t *content); void oss_publish_urls_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *publish_xml_list); void oss_play_urls_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *play_xml_list); void oss_create_live_channel_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *publish_xml_path, aos_list_t *publish_url_list, const char *play_xml_path, aos_list_t *play_url_list); int oss_create_live_channel_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *publish_url_list, aos_list_t *play_url_list); /** * @brief parse live channel info content from xml body **/ void oss_live_channel_info_target_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_live_channel_target_t *target); void oss_live_channel_info_content_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, oss_live_channel_configuration_t *info); int oss_live_channel_info_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_live_channel_configuration_t *info); /** * @brief parse live channel stat content from xml body **/ void oss_live_channel_stat_video_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_video_stat_t *video_stat); void oss_live_channel_stat_audio_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_audio_stat_t *audio_stat); void oss_live_channel_stat_content_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, oss_live_channel_stat_t *stat); int oss_live_channel_stat_parse_from_body(aos_pool_t *p, aos_list_t *bc, oss_live_channel_stat_t *stat); /** * @brief parse live channel from xml body for list list channel **/ void oss_list_live_channel_content_parse(aos_pool_t *p, mxml_node_t *xml_node, oss_live_channel_content_t *content); void oss_list_live_channel_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *live_channel_list); int oss_list_live_channel_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *live_channel_list, aos_string_t *next_marker, int *truncated); /** * @brief parse live channel history content from xml body **/ void oss_live_channel_history_content_parse(aos_pool_t *p, mxml_node_t * xml_node, oss_live_record_content_t *content); void oss_live_channel_history_contents_parse(aos_pool_t *p, mxml_node_t *root, const char *xml_path, aos_list_t *live_record_list); int oss_live_channel_history_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *live_record_list); /** * @brief build body for select object **/ void oss_build_select_object_body(aos_pool_t *p, const aos_string_t *expression, const oss_select_object_params_t *params, aos_list_t *body); void oss_build_create_select_object_meta_body(aos_pool_t *p, const oss_select_object_meta_params_t *params, aos_list_t *body); /** * @brief build body for object tagging **/ void build_object_tagging_body(aos_pool_t *p, aos_list_t *tag_list, aos_list_t *body); int oss_get_tagging_parse_from_body(aos_pool_t *p, aos_list_t *bc, aos_list_t *tag_list); /** * @brief build body for restore object **/ void oss_build_restore_object_body(aos_pool_t *p, oss_tier_type_e tier, int day, aos_list_t *body); OSS_CPP_END #endif ================================================ FILE: oss_c_sdk.sln ================================================  Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oss_c_sdk", "oss_c_sdk\oss_c_sdk.vcxproj", "{921A4B95-8106-45C1-95A7-814AE964C2C3}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oss_c_sdk_test", "oss_c_sdk_test\oss_c_sdk_test.vcxproj", "{6373CC30-480D-4FC2-9EB5-2E9835DBB1C4}" ProjectSection(ProjectDependencies) = postProject {921A4B95-8106-45C1-95A7-814AE964C2C3} = {921A4B95-8106-45C1-95A7-814AE964C2C3} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oss_c_sdk_sample", "oss_c_sdk_sample\oss_c_sdk_sample.vcxproj", "{0B918A52-C5E1-4976-A205-F257C0D0B102}" ProjectSection(ProjectDependencies) = postProject {921A4B95-8106-45C1-95A7-814AE964C2C3} = {921A4B95-8106-45C1-95A7-814AE964C2C3} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {921A4B95-8106-45C1-95A7-814AE964C2C3}.Debug|Win32.ActiveCfg = Debug|Win32 {921A4B95-8106-45C1-95A7-814AE964C2C3}.Debug|Win32.Build.0 = Debug|Win32 {921A4B95-8106-45C1-95A7-814AE964C2C3}.Debug|x64.ActiveCfg = Debug|x64 {921A4B95-8106-45C1-95A7-814AE964C2C3}.Debug|x64.Build.0 = Debug|x64 {921A4B95-8106-45C1-95A7-814AE964C2C3}.Release|Win32.ActiveCfg = Release|Win32 {921A4B95-8106-45C1-95A7-814AE964C2C3}.Release|Win32.Build.0 = Release|Win32 {921A4B95-8106-45C1-95A7-814AE964C2C3}.Release|x64.ActiveCfg = Release|x64 {921A4B95-8106-45C1-95A7-814AE964C2C3}.Release|x64.Build.0 = Release|x64 {6373CC30-480D-4FC2-9EB5-2E9835DBB1C4}.Debug|Win32.ActiveCfg = Debug|Win32 {6373CC30-480D-4FC2-9EB5-2E9835DBB1C4}.Debug|Win32.Build.0 = Debug|Win32 {6373CC30-480D-4FC2-9EB5-2E9835DBB1C4}.Debug|x64.ActiveCfg = Debug|x64 {6373CC30-480D-4FC2-9EB5-2E9835DBB1C4}.Debug|x64.Build.0 = Debug|x64 {6373CC30-480D-4FC2-9EB5-2E9835DBB1C4}.Release|Win32.ActiveCfg = Release|Win32 {6373CC30-480D-4FC2-9EB5-2E9835DBB1C4}.Release|Win32.Build.0 = Release|Win32 {6373CC30-480D-4FC2-9EB5-2E9835DBB1C4}.Release|x64.ActiveCfg = Release|x64 {6373CC30-480D-4FC2-9EB5-2E9835DBB1C4}.Release|x64.Build.0 = Release|x64 {0B918A52-C5E1-4976-A205-F257C0D0B102}.Debug|Win32.ActiveCfg = Debug|Win32 {0B918A52-C5E1-4976-A205-F257C0D0B102}.Debug|Win32.Build.0 = Debug|Win32 {0B918A52-C5E1-4976-A205-F257C0D0B102}.Debug|x64.ActiveCfg = Debug|x64 {0B918A52-C5E1-4976-A205-F257C0D0B102}.Debug|x64.Build.0 = Debug|x64 {0B918A52-C5E1-4976-A205-F257C0D0B102}.Release|Win32.ActiveCfg = Release|Win32 {0B918A52-C5E1-4976-A205-F257C0D0B102}.Release|Win32.Build.0 = Release|Win32 {0B918A52-C5E1-4976-A205-F257C0D0B102}.Release|x64.ActiveCfg = Release|x64 {0B918A52-C5E1-4976-A205-F257C0D0B102}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal ================================================ FILE: oss_c_sdk_sample/CMakeLists.txt ================================================ project (oss_c_sdk_sample) include_directories(${CMAKE_SOURCE_DIR}) set(OSS_SAMPLE_SOURCE_FILES oss_sample_util.c oss_config.c main.c oss_put_object_sample.c oss_append_object_sample.c oss_get_object_sample.c oss_head_object_sample.c oss_delete_object_sample.c oss_multipart_upload_sample.c oss_crc_sample.c oss_image_sample.c oss_progress_sample.c oss_callback_sample.c oss_list_object_sample.c oss_resumable_sample.c oss_get_object_meta_sample.c oss_put_object_acl_sample.c oss_get_object_acl_sample.c oss_select_object_sample.c) include_directories (${APR_INCLUDE_DIR}) include_directories (${APR_UTIL_INCLUDE_DIR}) include_directories (${MINIXML_INCLUDE_DIR}) include_directories (${CURL_INCLUDE_DIR}) include_directories ("${CMAKE_SOURCE_DIR}/oss_c_sdk") add_executable(oss_c_sdk_sample ${OSS_SAMPLE_SOURCE_FILES}) if (CMAKE_HOST_WIN32) target_link_libraries(oss_c_sdk_sample ws2_32) else() find_library(APR_LIBRARY apr-1 PATHS /usr/local/apr/lib/) find_library(APR_UTIL_LIBRARY aprutil-1 PATHS /usr/local/apr/lib/) find_library(MINIXML_LIBRARY mxml) find_library(CURL_LIBRARY curl) find_library(PTHREAD_LIBRARY pthread) target_link_libraries(oss_c_sdk_sample ${PTHREAD_LIBRARY}) endif() target_link_libraries(oss_c_sdk_sample oss_c_sdk) target_link_libraries(oss_c_sdk_sample ${APR_UTIL_LIBRARY}) target_link_libraries(oss_c_sdk_sample ${APR_LIBRARY}) target_link_libraries(oss_c_sdk_sample ${MINIXML_LIBRARY}) target_link_libraries(oss_c_sdk_sample ${CURL_LIBRARY}) ================================================ FILE: oss_c_sdk_sample/main.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" extern void append_object_sample(); extern void delete_object_sample(); extern void put_object_sample(); extern void get_object_sample(); extern void head_object_sample(); extern void list_object_sample(); extern void multipart_object_sample(); extern void callback_sample(); extern void progress_sample(); extern void crc_sample(); extern void image_sample(); extern void resumable_upload_sample(); extern void resumable_download_sample(); extern void select_object_sample(); int main(int argc, char *argv[]) { if (aos_http_io_initialize(NULL, 0) != AOSE_OK) { exit(1); } put_object_sample(); append_object_sample(); get_object_sample(); head_object_sample(); list_object_sample(); multipart_object_sample(); delete_object_sample(); callback_sample(); progress_sample(); crc_sample(); image_sample(); resumable_upload_sample(); resumable_download_sample(); select_object_sample(); aos_http_io_deinitialize(); system("pause"); return 0; } ================================================ FILE: oss_c_sdk_sample/oss_append_object_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void append_object_from_buffer() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; int64_t position = 0; aos_table_t *headers1 = NULL; aos_table_t *headers2 = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; aos_list_t buffer; aos_buf_t *content = NULL; char *next_append_position = NULL; char *object_type = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers1 = aos_table_make(p, 0); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); oss_delete_object(options, &bucket, &object, NULL); s = oss_head_object(options, &bucket, &object, headers1, &resp_headers); if (aos_status_is_ok(s)) { object_type = (char*)(apr_table_get(resp_headers, OSS_OBJECT_TYPE)); if (0 != strncmp(OSS_OBJECT_TYPE_APPENDABLE, object_type, strlen(OSS_OBJECT_TYPE_APPENDABLE))) { printf("object[%s]'s type[%s] is not Appendable\n", OBJECT_NAME, object_type); aos_pool_destroy(p); return; } next_append_position = (char*)(apr_table_get(resp_headers, OSS_NEXT_APPEND_POSITION)); position = aos_atoi64(next_append_position); } headers2 = aos_table_make(p, 0); aos_list_init(&buffer); content = aos_buf_pack(p, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); s = oss_append_object_from_buffer(options, &bucket, &object, position, &buffer, headers2, &resp_headers); if (aos_status_is_ok(s)) { printf("append object from buffer succeeded\n"); } else { printf("append object from buffer failed\n"); } aos_pool_destroy(p); } void append_object_from_file() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; aos_table_t *headers1 = NULL; aos_table_t *headers2 = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; char *filename = __FILE__; aos_status_t *s = NULL; aos_string_t file; int64_t position = 0; char *next_append_position = NULL; char *object_type = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers1 = aos_table_make(options->pool, 0); headers2 = aos_table_make(options->pool, 0); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_str_set(&file, filename); s = oss_head_object(options, &bucket, &object, headers1, &resp_headers); if(aos_status_is_ok(s)) { object_type = (char*)(apr_table_get(resp_headers, OSS_OBJECT_TYPE)); if (0 != strncmp(OSS_OBJECT_TYPE_APPENDABLE, object_type, strlen(OSS_OBJECT_TYPE_APPENDABLE))) { printf("object[%s]'s type[%s] is not Appendable\n", OBJECT_NAME, object_type); aos_pool_destroy(p); return; } next_append_position = (char*)(apr_table_get(resp_headers, OSS_NEXT_APPEND_POSITION)); position = aos_atoi64(next_append_position); } s = oss_append_object_from_file(options, &bucket, &object, position, &file, headers2, &resp_headers); if (aos_status_is_ok(s)) { printf("append object from file succeeded\n"); } else { printf("append object from file failed\n"); } aos_pool_destroy(p); } void append_object_sample() { append_object_from_buffer(); append_object_from_file(); } ================================================ FILE: oss_c_sdk_sample/oss_callback_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void put_object_from_buffer_with_callback() { aos_pool_t *p = NULL; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; aos_list_t buffer; aos_buf_t *content; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; char b64_buf[1024]; int b64_len; /* JSON format */ char *callback = "{" "\"callbackUrl\":\"http://callback.oss-demo.com:23450\"," "\"callbackHost\":\"oss-cn-hangzhou.aliyuncs.com\"," "\"callbackBody\":\"bucket=${bucket}&object=${object}&size=${size}&mimeType=${mimeType}\"," "\"callbackBodyType\":\"application/x-www-form-urlencoded\"" "}"; /* init sample */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_list_init(&resp_body); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); /* put call into header */ b64_len = aos_base64_encode((unsigned char*)callback, strlen(callback), b64_buf); b64_buf[b64_len] = '\0'; headers = aos_table_make(p, 1); apr_table_set(headers, OSS_CALLBACK, b64_buf); /* test put object */ s = oss_do_put_object_from_buffer(options, &bucket, &object, &buffer, headers, NULL, NULL, &resp_headers, &resp_body); if (aos_status_is_ok(s)) { printf("put object from buffer succeeded\n"); } else { printf("put object from buffer failed\n"); } /* get buffer len */ len = aos_buf_list_len(&resp_body); buf = (char *)aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; /* copy buffer content to memory */ aos_list_for_each_entry(aos_buf_t, content, &resp_body, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } aos_pool_destroy(p); } void multipart_from_buffer_with_callback() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t buffer; oss_list_upload_part_params_t *params = NULL; aos_string_t upload_id; aos_list_t complete_part_list; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_list_part_content_t *part_content1 = NULL; oss_complete_part_content_t *complete_content1 = NULL; int part_num = 1; aos_list_t resp_body; aos_buf_t *content; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; char b64_buf[1024]; int b64_len; /* JSON format */ char *callback = "{" "\"callbackUrl\":\"http://callback.oss-demo.com:23450\"," "\"callbackHost\":\"oss-cn-hangzhou.aliyuncs.com\"," "\"callbackBody\":\"bucket=${bucket}&object=${object}&size=${size}&mimeType=${mimeType}\"," "\"callbackBodyType\":\"application/x-www-form-urlencoded\"" "}"; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); /* put call into header */ b64_len = aos_base64_encode((unsigned char*)callback, strlen(callback), b64_buf); b64_buf[b64_len] = '\0'; headers = aos_table_make(p, 3); apr_table_set(headers, OSS_CALLBACK, b64_buf); apr_table_set(headers, OSS_CALLBACK, b64_buf); apr_table_set(headers, OSS_CALLBACK, b64_buf); /* init mulitipart */ s = oss_init_multipart_upload(options, &bucket, &object, &upload_id, NULL, &resp_headers); if (aos_status_is_ok(s)) { printf("Init multipart upload succeeded, upload_id:%.*s\n", upload_id.len, upload_id.data); } else { printf("Init multipart upload failed\n"); aos_pool_destroy(p); return; } /* upload part */ aos_list_init(&buffer); make_random_body(p, 2, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num++, &buffer, NULL); if (aos_status_is_ok(s)) { printf("Multipart upload part from file succeeded\n"); } else { printf("Multipart upload part from file failed\n"); aos_pool_destroy(p); return; } aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num++, &buffer, NULL); if (aos_status_is_ok(s)) { printf("Multipart upload part from file succeeded\n"); } else { printf("Multipart upload part from file failed\n"); aos_pool_destroy(p); return; } /* list part */ params = oss_create_list_upload_part_params(p); params->max_ret = 1; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, NULL); if (aos_status_is_ok(s)) { printf("List multipart succeeded\n"); } else { printf("List multipart failed\n"); aos_pool_destroy(p); return; } aos_list_for_each_entry(oss_list_part_content_t, part_content1, ¶ms->part_list, node) { complete_content1 = oss_create_complete_part_content(p); aos_str_set(&complete_content1->part_number, part_content1->part_number.data); aos_str_set(&complete_content1->etag, part_content1->etag.data); aos_list_add_tail(&complete_content1->node, &complete_part_list); } /* complete multipart */ s = oss_do_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, headers, NULL, &resp_headers, &resp_body); if (aos_status_is_ok(s)) { printf("Complete multipart upload from file succeeded, upload_id:%.*s\n", upload_id.len, upload_id.data); } else { printf("Complete multipart upload from file failed\n"); printf("%d, %s, %s, %s\n", s->code, s->error_code, s->error_msg, s->req_id); } /* get buffer len */ len = aos_buf_list_len(&resp_body); buf = (char *)aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; /* copy buffer content to memory */ aos_list_for_each_entry(aos_buf_t, content, &resp_body, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } aos_pool_destroy(p); } void callback_sample() { put_object_from_buffer_with_callback(); multipart_from_buffer_with_callback(); } ================================================ FILE: oss_c_sdk_sample/oss_config.c ================================================ #include "oss_config.h" const char OSS_ENDPOINT[] = ""; const char ACCESS_KEY_ID[] = ""; const char ACCESS_KEY_SECRET[] = ""; const char BUCKET_NAME[] = ""; const char OBJECT_NAME[] = ""; const char MULTIPART_UPLOAD_FILE_PATH[] = ""; //surfix must be '/', only used for dir relative sample const char DIR_NAME[] = "dir/"; ================================================ FILE: oss_c_sdk_sample/oss_config.h ================================================ #ifndef OSS_TEST_CONFIG_H #define OSS_TEST_CONFIG_H #include "oss_define.h" OSS_CPP_START extern const char OSS_ENDPOINT[]; extern const char ACCESS_KEY_ID[]; extern const char ACCESS_KEY_SECRET[]; extern const char BUCKET_NAME[]; extern const char OBJECT_NAME[]; extern const char DIR_NAME[]; extern const char MULTIPART_UPLOAD_FILE_PATH[]; OSS_CPP_END #endif ================================================ FILE: oss_c_sdk_sample/oss_crc_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void append_object_from_buffer_with_crc() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *str = "Time is a bird for ever on the wing."; aos_status_t *s = NULL; int is_cname = 0; int64_t position = 0; uint64_t initcrc = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; aos_list_t buffer; aos_buf_t *content = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_list_init(&resp_body); /* append object */ aos_list_init(&buffer); content = aos_buf_pack(p, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); oss_delete_object(options, &bucket, &object, NULL); s = oss_do_append_object_from_buffer(options, &bucket, &object, position, initcrc, &buffer, headers, NULL, NULL, &resp_headers, &resp_body); if (aos_status_is_ok(s)) { printf("crc: append object from buffer succeeded\n"); } else { printf("crc: append object from buffer failed\n"); } position = aos_atoi64((char*)(apr_table_get(resp_headers, OSS_NEXT_APPEND_POSITION))); initcrc = aos_atoui64((char*)(apr_table_get(resp_headers, OSS_HASH_CRC64_ECMA))); /* append object */ s = oss_do_append_object_from_buffer(options, &bucket, &object, position, initcrc, &buffer, NULL, NULL, NULL, NULL, NULL); /* delete object */ s= oss_delete_object(options, &bucket, &object, NULL); aos_pool_destroy(p); } void append_object_from_file_with_crc() { aos_pool_t *p = NULL; char *object_name = "oss_append_object.txt"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; int64_t position = 0; uint64_t initcrc = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, __FILE__); /* append object */ s = oss_do_append_object_from_file(options, &bucket, &object, position, initcrc, &filename, headers, NULL, NULL, &resp_headers, &resp_body); if (aos_status_is_ok(s)) { printf("crc: append object from file succeeded\n"); } else { printf("crc: append object from file failed\n"); } position = aos_atoi64((char*)(apr_table_get(resp_headers, OSS_NEXT_APPEND_POSITION))); initcrc = aos_atoui64((char*)(apr_table_get(resp_headers, OSS_HASH_CRC64_ECMA))); /* append object */ s = oss_do_append_object_from_file(options, &bucket, &object, position, initcrc, &filename, NULL, NULL, NULL, NULL, NULL); if (aos_status_is_ok(s)) { printf("crc: append object from file succeeded\n"); } else { printf("crc: append object from file failed\n"); } /* delete object */ s= oss_delete_object(options, &bucket, &object, NULL); aos_pool_destroy(p); } void disable_crc() { aos_pool_t *p = NULL; char *str = "Sow nothing, reap nothing."; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; oss_request_options_t *options = NULL; aos_list_t resp_body; aos_list_t buffer; aos_buf_t *content; /* init test*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_list_init(&resp_body); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); options->ctl->options->enable_crc = AOS_FALSE; /* put object */ s = oss_put_object_from_buffer(options, &bucket, &object, &buffer, NULL, NULL); if (aos_status_is_ok(s)) { printf("put object from buffer succeeded\n"); } else { printf("put object from buffer failed\n"); } aos_pool_destroy(p); /* get object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); options->ctl->options->enable_crc = AOS_FALSE; s = oss_get_object_to_buffer(options, &bucket, &object, NULL, NULL, &buffer, NULL); if (aos_status_is_ok(s)) { printf("get object to buffer succeeded\n"); } else { printf("get object to buffer failed\n"); } aos_pool_destroy(p); } void crc_sample() { /* ˵CRCУ鹦Ĭϴ򿪣ϴĬCRCУ飻append_objectҪָϴappendصCRC */ append_object_from_buffer_with_crc(); append_object_from_file_with_crc(); disable_crc(); } ================================================ FILE: oss_c_sdk_sample/oss_delete_object_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void delete_object() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); s = oss_delete_object(options, &bucket, &object, &resp_headers); if (aos_status_is_ok(s)) { printf("delete object succeeded\n"); } else { printf("delete object failed\n"); } aos_pool_destroy(p); } void delete_objects() { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; aos_status_t *s = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; char *object_name1 = "oss_sample_object1"; char *object_name2 = "oss_sample_object2"; oss_object_key_t *content1 = NULL; oss_object_key_t *content2 = NULL; aos_list_t object_list; aos_list_t deleted_object_list; int is_quiet = AOS_TRUE; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_list_init(&object_list); aos_list_init(&deleted_object_list); content1 = oss_create_oss_object_key(p); aos_str_set(&content1->key, object_name1); aos_list_add_tail(&content1->node, &object_list); content2 = oss_create_oss_object_key(p); aos_str_set(&content2->key, object_name2); aos_list_add_tail(&content2->node, &object_list); s = oss_delete_objects(options, &bucket, &object_list, is_quiet, &resp_headers, &deleted_object_list); aos_pool_destroy(p); if (aos_status_is_ok(s)) { printf("delete objects succeeded\n"); } else { printf("delete objects failed\n"); } } void delete_object_sample() { delete_object(); delete_objects(); } ================================================ FILE: oss_c_sdk_sample/oss_get_object_acl_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void get_object_acl(){ aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t oss_acl; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); s = oss_get_object_acl(options, &bucket, &object, &oss_acl, &resp_headers); if (aos_status_is_ok(s)) { printf("get object acl success!\n"); } else { printf("get object acl failed!\n"); } aos_pool_destroy(p); } void get_object_acl_sample(){ get_object_acl(); } ================================================ FILE: oss_c_sdk_sample/oss_get_object_meta_sample.c ================================================ #include "aos_string.h" #include "aos_status.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" #include void get_object_meta() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; char *content_length_str = NULL; char *object_type = NULL; int64_t content_length = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); s = oss_get_object_meta(options, &bucket, &object, &resp_headers); if (aos_status_is_ok(s)) { content_length_str = (char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH); if (content_length_str != NULL) { content_length = atol(content_length_str); } object_type = (char*)apr_table_get(resp_headers, OSS_OBJECT_TYPE); printf("get object meta succeeded, object type:%s, content length:%"APR_INT64_T_FMT"\n", object_type, content_length); } else { printf("req:%s, get object meta failed\n", s->req_id); } aos_pool_destroy(p); } void get_object_meta_sample() { get_object_meta(); } ================================================ FILE: oss_c_sdk_sample/oss_get_object_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void get_object_to_buffer() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_buf_t *content = NULL; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_list_init(&buffer); s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to buffer succeeded\n"); } else { printf("get object to buffer failed\n"); } //get buffer len aos_list_for_each_entry(aos_buf_t, content, &buffer, node) { len += aos_buf_size(content); } buf = aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; //copy buffer content to memory aos_list_for_each_entry(aos_buf_t, content, &buffer, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } aos_pool_destroy(p); } void get_object_to_local_file() { aos_pool_t *p = NULL; aos_string_t bucket; char *download_filename = "get_object_to_local_file.txt"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t file; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); headers = aos_table_make(p, 0); aos_str_set(&file, download_filename); s = oss_get_object_to_file(options, &bucket, &object, headers, params, &file, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to local file succeeded\n"); } else { printf("get object to local file failed\n"); } aos_pool_destroy(p); } void get_object_to_buffer_with_range() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_buf_t *content = NULL; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_list_init(&buffer); headers = aos_table_make(p, 1); /* RangeȡļָΧbytes=20-10020͵100ַ */ apr_table_set(headers, "Range", "bytes=20-100"); s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to buffer succeeded\n"); } else { printf("get object to buffer failed\n"); } //get buffer len aos_list_for_each_entry(aos_buf_t, content, &buffer, node) { len += aos_buf_size(content); } buf = aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; //copy buffer content to memory aos_list_for_each_entry(aos_buf_t, content, &buffer, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } aos_pool_destroy(p); } void get_object_to_local_file_with_range() { aos_pool_t *p = NULL; aos_string_t bucket; char *download_filename = "get_object_to_local_file.txt"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t file; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_str_set(&file, download_filename); headers = aos_table_make(p, 1); /* RangeȡļָΧbytes=20-10020͵100ַ */ apr_table_set(headers, "Range", "bytes=20-100"); s = oss_get_object_to_file(options, &bucket, &object, headers, params, &file, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to local file succeeded\n"); } else { printf("get object to local file failed\n"); } aos_pool_destroy(p); } void get_object_by_signed_url() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; aos_string_t url; int is_cname = 0; aos_http_request_t *request = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; aos_list_t buffer; aos_status_t *s = NULL; char *signed_url = NULL; int64_t expires_time; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); // create request request = aos_http_request_create(p); request->method = HTTP_GET; // create headers headers = aos_table_make(options->pool, 0); // set value aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_list_init(&buffer); // expires time expires_time = apr_time_now() / 1000000 + 120; // generate signed url for put signed_url = oss_gen_signed_url(options, &bucket, &object, expires_time, request); aos_str_set(&url, signed_url); printf("signed get url : %s\n", signed_url); // put object by signed url s = oss_get_object_to_buffer_by_url(options, &url, headers, params, &buffer, &resp_headers); if (aos_status_is_ok(s)) { printf("get object by signed url succeeded\n"); } else { printf("get object by signed url failed\n"); } aos_pool_destroy(p); } void get_oss_dir_to_local_dir() { aos_pool_t *parent_pool = NULL; aos_string_t bucket; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_list_object_params_t *params = NULL; aos_pool_create(&parent_pool, NULL); options = oss_request_options_create(parent_pool); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); params = oss_create_list_object_params(parent_pool); aos_str_set(¶ms->prefix, DIR_NAME); params->truncated = 1; while (params->truncated) { aos_pool_t *list_object_pool = NULL; aos_table_t *list_object_resp_headers = NULL; oss_list_object_content_t *list_content = NULL; aos_pool_create(&list_object_pool, parent_pool); options->pool = list_object_pool; s = oss_list_object(options, &bucket, params, &list_object_resp_headers); if (!aos_status_is_ok(s)) { aos_error_log("list objects of dir[%s] fail\n", DIR_NAME); aos_status_dup(parent_pool, s); aos_pool_destroy(list_object_pool); options->pool = parent_pool; return; } aos_list_for_each_entry(oss_list_object_content_t, list_content, ¶ms->object_list, node) { if ('/' == list_content->key.data[strlen(list_content->key.data) - 1]) { apr_dir_make_recursive(list_content->key.data, APR_OS_DEFAULT, parent_pool); } else { aos_string_t object; aos_pool_t *get_object_pool = NULL; aos_table_t *headers = NULL; aos_table_t *query_params = NULL; aos_table_t *get_object_resp_headers = NULL; aos_str_set(&object, list_content->key.data); aos_pool_create(&get_object_pool, parent_pool); options->pool = get_object_pool; s = oss_get_object_to_file(options, &bucket, &object, headers, query_params, &object, &get_object_resp_headers); if (!aos_status_is_ok(s)) { aos_error_log("get object[%s] fail\n", object.data); } aos_pool_destroy(get_object_pool); options->pool = list_object_pool; } } aos_list_init(¶ms->object_list); if (params->next_marker.data) { aos_str_set(¶ms->marker, params->next_marker.data); } aos_pool_destroy(list_object_pool); } if (aos_status_is_ok(s)) { printf("get dir succeeded\n"); } else { printf("get dir failed\n"); } aos_pool_destroy(parent_pool); } void get_object_sample() { get_object_to_buffer(); get_object_to_local_file(); get_object_to_buffer_with_range(); get_object_to_local_file_with_range(); get_object_by_signed_url(); get_oss_dir_to_local_dir(); } ================================================ FILE: oss_c_sdk_sample/oss_head_object_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void head_object() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; char *content_length_str = NULL; char *object_type = NULL; int64_t content_length = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); headers = aos_table_make(p, 0); s = oss_head_object(options, &bucket, &object, headers, &resp_headers); if (aos_status_is_ok(s)) { content_length_str = (char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH); if (content_length_str != NULL) { content_length = atol(content_length_str); } object_type = (char*)apr_table_get(resp_headers, OSS_OBJECT_TYPE); printf("head object succeeded, object type:%s, content length:%"APR_INT64_T_FMT"\n", object_type, content_length); } else { printf("head object failed\n"); } aos_pool_destroy(p); } static void get_object_meta() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; char *content_length_str = NULL; char *object_type = NULL; int64_t content_length = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); s = oss_get_object_meta(options, &bucket, &object, &resp_headers); if (aos_status_is_ok(s)) { content_length_str = (char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH); if (content_length_str != NULL) { content_length = atol(content_length_str); } object_type = (char*)apr_table_get(resp_headers, OSS_OBJECT_TYPE); printf("get object meta succeeded, object type:%s, content_length:%"APR_INT64_T_FMT"\n", object_type, content_length); } else { printf("get object meta failed\n"); } aos_pool_destroy(p); } void head_object_sample() { head_object(); get_object_meta(); } ================================================ FILE: oss_c_sdk_sample/oss_image_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" #if defined(WIN32) static char *image_file = "../oss_c_sdk_test/example.jpg"; #else static char *image_file = "oss_c_sdk_test/example.jpg"; #endif static char *sample_image = "example.jpg"; static void put_sample_image(); void image_resize() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t filename; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, sample_image); aos_str_set(&filename, "example-new.jpg"); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/resize,m_fixed,w_100,h_100"); /* get processed image to file */ s = oss_get_object_to_file(options, &bucket, &object, headers, params, &filename, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to file succeeded\n"); } else { printf("get object to file failed\n"); } aos_pool_destroy(p); } void image_crop() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t filename; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, sample_image); aos_str_set(&filename, "example-new.jpg"); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/crop,w_100,h_100,x_100,y_100,r_1"); /* get processed image to file */ s = oss_get_object_to_file(options, &bucket, &object, headers, params, &filename, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to file succeeded\n"); } else { printf("get object to file failed\n"); } aos_pool_destroy(p); } void image_rotate() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t filename; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, sample_image); aos_str_set(&filename, "example-new.jpg"); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/rotate,90"); /* get processed image to file */ s = oss_get_object_to_file(options, &bucket, &object, headers, params, &filename, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to file succeeded\n"); } else { printf("get object to file failed\n"); } aos_pool_destroy(p); } void image_sharpen() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t filename; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, sample_image); aos_str_set(&filename, "example-new.jpg"); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/sharpen,100"); /* get processed image to file */ s = oss_get_object_to_file(options, &bucket, &object, headers, params, &filename, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to file succeeded\n"); } else { printf("get object to file failed\n"); } aos_pool_destroy(p); } void image_watermark() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t filename; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, sample_image); aos_str_set(&filename, "example-new.jpg"); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/watermark,text_SGVsbG8g5Zu-54mH5pyN5YqhIQ"); /* get processed image to file */ s = oss_get_object_to_file(options, &bucket, &object, headers, params, &filename, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to file succeeded\n"); } else { printf("get object to file failed\n"); } aos_pool_destroy(p); } void image_format() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t filename; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, sample_image); aos_str_set(&filename, "example-new.png"); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/format,png"); /* get processed image to file */ s = oss_get_object_to_file(options, &bucket, &object, headers, params, &filename, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to file succeeded\n"); } else { printf("get object to file failed\n"); } aos_pool_destroy(p); } void image_info() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_buf_t *content = NULL; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, sample_image); aos_list_init(&buffer); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/info"); /* test get object to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); if (aos_status_is_ok(s)) { printf("put object from file succeeded\n"); } else { printf("put object from file failed\n"); } /* get buffer len */ len = aos_buf_list_len(&buffer); buf = (char *)aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; /* copy buffer content to memory */ aos_list_for_each_entry(aos_buf_t, content, &buffer, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } printf("image info:%s\n", buf); aos_pool_destroy(p); } void image_tones() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_buf_t *content = NULL; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, sample_image); aos_list_init(&buffer); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/average-hue"); /* test get object to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); if (aos_status_is_ok(s)) { printf("put object from file succeeded\n"); } else { printf("put object from file failed\n"); } /* get buffer len */ len = aos_buf_list_len(&buffer); buf = (char *)aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; /* copy buffer content to memory */ aos_list_for_each_entry(aos_buf_t, content, &buffer, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } printf("image tone:%s\n", buf); aos_pool_destroy(p); } void put_example_image() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, sample_image); aos_str_set(&filename, image_file); s = oss_put_object_from_file(options, &bucket, &object, &filename, headers, &resp_headers); if (aos_status_is_ok(s)) { printf("put object from file succeeded\n"); } else { printf("put object from file failed\n"); } aos_pool_destroy(p); } /** * ϴʾͼƬ */ void put_sample_image() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, sample_image); aos_str_set(&filename, image_file); s = oss_put_object_from_file(options, &bucket, &object, &filename, headers, &resp_headers); if (aos_status_is_ok(s)) { printf("put object from file succeeded\n"); } else { printf("put object from file failed\n"); } aos_pool_destroy(p); } void image_sample() { put_sample_image(); image_resize(); image_crop(); image_rotate(); image_sharpen(); image_watermark(); image_format(); image_info(); image_tones(); } ================================================ FILE: oss_c_sdk_sample/oss_list_object_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void list_object() { aos_pool_t *p = NULL; aos_string_t bucket; oss_request_options_t *options = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_list_object_params_t *params = NULL; oss_list_object_content_t *content = NULL; int size = 0; char *line = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); params = oss_create_list_object_params(p); aos_str_set(&bucket, BUCKET_NAME); s = oss_list_object(options, &bucket, params, NULL); if (!aos_status_is_ok(s)) { printf("list object failed\n"); return; } printf("Object\tSize\tLastModified\n"); aos_list_for_each_entry(oss_list_object_content_t, content, ¶ms->object_list, node) { ++size; line = apr_psprintf(p, "%.*s\t%.*s\t%.*s\n", content->key.len, content->key.data, content->size.len, content->size.data, content->last_modified.len, content->last_modified.data); printf("%s", line); } printf("Total %d\n", size); aos_pool_destroy(p); printf("List object ok\n"); } void list_all_objects() { aos_pool_t *p = NULL; aos_string_t bucket; oss_request_options_t *options = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_list_object_params_t *params = NULL; oss_list_object_content_t *content = NULL; int size = 0; char *line = NULL; char *prefix = "mingdi"; char *nextMarker = ""; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); params = oss_create_list_object_params(p); params->max_ret = 10; aos_str_set(¶ms->prefix, prefix); aos_str_set(¶ms->marker, nextMarker); printf("Object\tSize\tLastModified\n"); do { s = oss_list_object(options, &bucket, params, NULL); if (!aos_status_is_ok(s)) { printf("list object failed\n"); return; } aos_list_for_each_entry(oss_list_object_content_t, content, ¶ms->object_list, node) { ++size; line = apr_psprintf(p, "%.*s\t%.*s\t%.*s\n", content->key.len, content->key.data, content->size.len, content->size.data, content->last_modified.len, content->last_modified.data); printf("%s", line); } nextMarker = apr_psprintf(p, "%.*s", params->next_marker.len, params->next_marker.data); aos_str_set(¶ms->marker, nextMarker); aos_list_init(¶ms->object_list); aos_list_init(¶ms->common_prefix_list); } while (params->truncated == AOS_TRUE); printf("Total %d\n", size); aos_pool_destroy(p); printf("List object ok\n"); } void list_objects_by_delimiter() { aos_pool_t *p = NULL; aos_string_t bucket; oss_request_options_t *options = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_list_object_params_t *params = NULL; oss_list_object_content_t *content = NULL; oss_list_object_common_prefix_t *common_prefix = NULL; int size = 0; char *line = NULL; char *prefix = ""; char *nextMarker = ""; char *delimiter = "/"; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); params = oss_create_list_object_params(p); params->max_ret = 10; aos_str_set(¶ms->prefix, prefix); aos_str_set(¶ms->marker, nextMarker); aos_str_set(¶ms->delimiter, delimiter); do { s = oss_list_object(options, &bucket, params, NULL); if (!aos_status_is_ok(s)) { printf("list object failed\n"); return; } size = 0; aos_list_for_each_entry(oss_list_object_content_t, content, ¶ms->object_list, node) { ++size; line = apr_psprintf(p, "%.*s\t%.*s\t%.*s\n", content->key.len, content->key.data, content->size.len, content->size.data, content->last_modified.len, content->last_modified.data); printf("object:%s", line); } size = 0; aos_list_for_each_entry(oss_list_object_common_prefix_t, common_prefix, ¶ms->common_prefix_list, node) { ++size; line = apr_psprintf(p, "%.*s\n", common_prefix->prefix.len, common_prefix->prefix.data); printf("common_prefix:%s", line); } nextMarker = apr_psprintf(p, "%.*s", params->next_marker.len, params->next_marker.data); aos_str_set(¶ms->marker, nextMarker); aos_list_init(¶ms->object_list); aos_list_init(¶ms->common_prefix_list); } while (params->truncated == AOS_TRUE); aos_pool_destroy(p); printf("List object ok\n"); } void list_object_sample() { list_object(); list_all_objects(); list_objects_by_delimiter(); } ================================================ FILE: oss_c_sdk_sample/oss_multipart_upload_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void multipart_upload_file_from_buffer() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *complete_headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; aos_string_t upload_id; aos_status_t *s = NULL; aos_list_t buffer; oss_list_upload_part_params_t *params = NULL; aos_list_t complete_part_list; oss_list_part_content_t *part_content = NULL; oss_complete_part_content_t *complete_part_content = NULL; int part_num1 = 1; int part_num2 = 2; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(p, 1); complete_headers = aos_table_make(p, 1); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, "multipart-key.1"); //init mulitipart s = oss_init_multipart_upload(options, &bucket, &object, &upload_id, headers, &resp_headers); if (aos_status_is_ok(s)) { printf("Init multipart upload succeeded, upload_id:%.*s\n", upload_id.len, upload_id.data); } else { printf("Init multipart upload failed\n"); aos_pool_destroy(p); return; } //upload part aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num1, &buffer, &resp_headers); if (aos_status_is_ok(s)) { printf("Upload multipart part succeeded\n"); } else { printf("Upload multipart part failed\n"); aos_pool_destroy(p); return; } aos_list_init(&buffer); make_random_body(p, 10, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num2, &buffer, &resp_headers); if (aos_status_is_ok(s)) { printf("Upload multipart part succeeded\n"); } else { printf("Upload multipart part failed\n"); aos_pool_destroy(p); return; } //list part params = oss_create_list_upload_part_params(p); params->max_ret = 1000; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, &resp_headers); if (aos_status_is_ok(s)) { printf("List multipart succeeded\n"); } else { printf("List multipart failed\n"); aos_pool_destroy(p); return; } aos_list_for_each_entry(oss_list_part_content_t, part_content, ¶ms->part_list, node) { complete_part_content = oss_create_complete_part_content(p); aos_str_set(&complete_part_content->part_number, part_content->part_number.data); aos_str_set(&complete_part_content->etag, part_content->etag.data); aos_list_add_tail(&complete_part_content->node, &complete_part_list); } //complete multipart apr_table_add(complete_headers, OSS_CONTENT_TYPE, "video/MP2T"); s = oss_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, complete_headers, &resp_headers); if (aos_status_is_ok(s)) { printf("Complete multipart upload succeeded, upload_id:%.*s\n", upload_id.len, upload_id.data); } else { printf("Complete multipart upload failed\n"); } aos_pool_destroy(p); } void multipart_upload_file_from_file() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *complete_headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; aos_string_t upload_id; oss_upload_file_t *upload_file = NULL; aos_status_t *s = NULL; oss_list_upload_part_params_t *params = NULL; aos_list_t complete_part_list; oss_list_part_content_t *part_content = NULL; oss_complete_part_content_t *complete_part_content = NULL; int part_num = 1; int64_t pos = 0; int64_t file_length = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(p, 1); complete_headers = aos_table_make(p, 1); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, "multipart-key.2"); //init mulitipart s = oss_init_multipart_upload(options, &bucket, &object, &upload_id, headers, &resp_headers); if (aos_status_is_ok(s)) { printf("Init multipart upload succeeded, upload_id:%.*s\n", upload_id.len, upload_id.data); } else { printf("Init multipart upload failed\n"); aos_pool_destroy(p); return; } //upload part from file file_length = get_file_size(MULTIPART_UPLOAD_FILE_PATH); while(pos < file_length) { upload_file = oss_create_upload_file(p); aos_str_set(&upload_file->filename, MULTIPART_UPLOAD_FILE_PATH); upload_file->file_pos = pos; pos += 100 * 1024; upload_file->file_last = pos < file_length ? pos : file_length; //200k s = oss_upload_part_from_file(options, &bucket, &object, &upload_id, part_num++, upload_file, &resp_headers); if (aos_status_is_ok(s)) { printf("Multipart upload part from file succeeded\n"); } else { printf("Multipart upload part from file failed\n"); } } //list part params = oss_create_list_upload_part_params(p); params->max_ret = 1000; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, &resp_headers); if (aos_status_is_ok(s)) { printf("List multipart succeeded\n"); } else { printf("List multipart failed\n"); aos_pool_destroy(p); return; } aos_list_for_each_entry(oss_list_part_content_t, part_content, ¶ms->part_list, node) { complete_part_content = oss_create_complete_part_content(p); aos_str_set(&complete_part_content->part_number, part_content->part_number.data); aos_str_set(&complete_part_content->etag, part_content->etag.data); aos_list_add_tail(&complete_part_content->node, &complete_part_list); } //complete multipart s = oss_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, complete_headers, &resp_headers); if (aos_status_is_ok(s)) { printf("Complete multipart upload from file succeeded, upload_id:%.*s\n", upload_id.len, upload_id.data); } else { printf("Complete multipart upload from file failed\n"); } aos_pool_destroy(p); } void abort_multipart_upload() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; aos_string_t upload_id; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(p, 1); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); s = oss_init_multipart_upload(options, &bucket, &object, &upload_id, headers, &resp_headers); if (aos_status_is_ok(s)) { printf("Init multipart upload succeeded, upload_id:%.*s\n", upload_id.len, upload_id.data); } else { printf("Init multipart upload failed\n"); aos_pool_destroy(p); return; } s = oss_abort_multipart_upload(options, &bucket, &object, &upload_id, &resp_headers); if (aos_status_is_ok(s)) { printf("Abort multipart upload succeeded, upload_id::%.*s\n", upload_id.len, upload_id.data); } else { printf("Abort multipart upload failed\n"); } aos_pool_destroy(p); } void multipart_object_sample() { multipart_upload_file_from_buffer(); multipart_upload_file_from_file(); abort_multipart_upload(); } ================================================ FILE: oss_c_sdk_sample/oss_progress_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void put_and_get_from_buffer_with_progress() { aos_pool_t *p = NULL; char *str = "oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; aos_table_t *params = NULL; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; aos_list_t buffer; aos_buf_t *content; /* init test*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_list_init(&resp_body); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); /* test put object */ s = oss_do_put_object_from_buffer(options, &bucket, &object, &buffer, headers, params, percentage, &resp_headers, &resp_body); if (aos_status_is_ok(s)) { printf("put object from buffer succeeded\n"); } else { printf("put object from buffer failed\n"); aos_pool_destroy(p); return; } aos_pool_destroy(p); /* test get object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); s = oss_do_get_object_to_buffer(options, &bucket, &object, NULL, NULL, &buffer, percentage, NULL); if (aos_status_is_ok(s)) { printf("get object to buffer succeeded\n"); } else { printf("get object to buffer failed\n"); } aos_pool_destroy(p); } void put_and_get_from_file_with_progress() { aos_pool_t *p = NULL; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_string_t filename; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; char *download_filename = "get_object_to_local_file.txt"; /* init test*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_str_set(&filename, __FILE__); aos_list_init(&resp_body); /* put object */ s = oss_do_put_object_from_file(options, &bucket, &object, &filename, NULL, NULL, percentage, &resp_headers, &resp_body); if (aos_status_is_ok(s)) { printf("put object from file succeeded\n"); } else { printf("put object from file failed\n"); aos_pool_destroy(p); return; } aos_pool_destroy(p); /* get object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&filename, download_filename); s = oss_do_get_object_to_file(options, &bucket, &object, NULL, NULL, &filename, percentage, NULL); if (aos_status_is_ok(s)) { printf("get object to file succeeded\n"); } else { printf("get object to file failed\n"); } aos_pool_destroy(p); } void append_object_with_progress() { aos_pool_t *p = NULL; char *object_name = "oss_append_object.ts"; char *str = "oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_table_t *headers = NULL; aos_table_t *params = NULL; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; uint64_t initcrc = 0; aos_list_t resp_body; aos_list_t buffer; aos_buf_t *content; /* init test*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); /* append object from buffer */ s = oss_do_append_object_from_buffer(options, &bucket, &object, 0, initcrc, &buffer, headers, params, percentage, &resp_headers, &resp_body); if (aos_status_is_ok(s)) { printf("progress: append object from buffer succeeded\n"); } else { printf("progress: append object from buffer failed\n"); aos_pool_destroy(p); return; } aos_pool_destroy(p); /* append object from file*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&filename, __FILE__); initcrc = aos_atoui64((char*)(apr_table_get(resp_headers, OSS_HASH_CRC64_ECMA))); s = oss_do_append_object_from_file(options, &bucket, &object, strlen(str), initcrc, &filename, NULL, NULL, percentage, &resp_headers, &resp_body); if (aos_status_is_ok(s)) { printf("progress: append object from file succeeded\n"); } else { printf("progress: append object from file failed\n"); } oss_delete_object(options, &bucket, &object, NULL); aos_pool_destroy(p); } void multipart_upload_from_buffer_with_progress() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t buffer; oss_list_upload_part_params_t *params = NULL; aos_string_t upload_id; aos_list_t complete_part_list; oss_list_part_content_t *part_content1 = NULL; oss_complete_part_content_t *complete_content1 = NULL; int part_num = 1; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); // init mulitipart s = oss_init_multipart_upload(options, &bucket, &object, &upload_id, NULL, NULL); if (aos_status_is_ok(s)) { printf("Init multipart upload succeeded, upload_id:%.*s\n", upload_id.len, upload_id.data); } else { printf("Init multipart upload failed\n"); aos_pool_destroy(p); return; } // upload part aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_do_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num++, &buffer, percentage, NULL, NULL, NULL, NULL); if (aos_status_is_ok(s)) { printf("Upload multipart part succeeded\n"); } else { printf("Upload multipart part failed\n"); aos_pool_destroy(p); return; } aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_do_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num++, &buffer, percentage, NULL, NULL, NULL, NULL); if (aos_status_is_ok(s)) { printf("Upload multipart part succeeded\n"); } else { printf("Upload multipart part failed\n"); aos_pool_destroy(p); return; } // list part params = oss_create_list_upload_part_params(p); params->max_ret = 1; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, NULL); aos_list_for_each_entry(oss_list_part_content_t, part_content1, ¶ms->part_list, node) { complete_content1 = oss_create_complete_part_content(p); aos_str_set(&complete_content1->part_number, part_content1->part_number.data); aos_str_set(&complete_content1->etag, part_content1->etag.data); aos_list_add_tail(&complete_content1->node, &complete_part_list); } // complete multipart s = oss_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, NULL, NULL); if (aos_status_is_ok(s)) { printf("Complete multipart upload succeeded, upload_id:%.*s\n", upload_id.len, upload_id.data); } else { printf("Complete multipart upload failed\n"); } aos_pool_destroy(p); } void multipart_upload_from_file_with_progress() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; oss_list_upload_part_params_t *params = NULL; aos_string_t upload_id; aos_list_t complete_part_list; oss_upload_file_t *upload_file = NULL; oss_list_part_content_t *part_content1 = NULL; oss_complete_part_content_t *complete_content1 = NULL; int part_num = 1; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); upload_file = oss_create_upload_file(p); aos_str_set(&upload_file->filename, __FILE__); // init mulitipart s = oss_init_multipart_upload(options, &bucket, &object, &upload_id, NULL, NULL); if (aos_status_is_ok(s)) { printf("Init multipart upload succeeded, upload_id:%.*s\n", upload_id.len, upload_id.data); } else { printf("Init multipart upload failed\n"); aos_pool_destroy(p); return; } // upload part upload_file->file_pos = 0; upload_file->file_last = 1024; s = oss_do_upload_part_from_file(options, &bucket, &object, &upload_id, part_num++, upload_file, percentage, NULL, NULL, NULL, NULL); if (aos_status_is_ok(s)) { printf("Upload multipart part succeeded\n"); } else { printf("Upload multipart part failed\n"); aos_pool_destroy(p); return; } // list part params = oss_create_list_upload_part_params(p); params->max_ret = 1; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, NULL); aos_list_for_each_entry(oss_list_part_content_t, part_content1, ¶ms->part_list, node) { complete_content1 = oss_create_complete_part_content(p); aos_str_set(&complete_content1->part_number, part_content1->part_number.data); aos_str_set(&complete_content1->etag, part_content1->etag.data); aos_list_add_tail(&complete_content1->node, &complete_part_list); } // complete multipart s = oss_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, NULL, NULL); if (aos_status_is_ok(s)) { printf("Complete multipart upload succeeded, upload_id:%.*s\n", upload_id.len, upload_id.data); } else { printf("Complete multipart upload failed\n"); } aos_pool_destroy(p); } void progress_sample() { put_and_get_from_buffer_with_progress(); put_and_get_from_file_with_progress(); append_object_with_progress(); multipart_upload_from_buffer_with_progress(); multipart_upload_from_file_with_progress(); } ================================================ FILE: oss_c_sdk_sample/oss_put_object_acl_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void put_object_acl(){ aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_acl_e oss_acl = OSS_ACL_DEFAULT; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); s = oss_put_object_acl(options, &bucket, &object, oss_acl, &resp_headers); if (aos_status_is_ok(s)) { printf("put object acl success!\n"); } else { printf("put object acl failed!\n"); } aos_pool_destroy(p); } void put_object_acl_sample(){ put_object_acl(); } ================================================ FILE: oss_c_sdk_sample/oss_put_object_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void put_object_from_buffer() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; aos_list_t buffer; aos_buf_t *content = NULL; char *str = "test oss c sdk"; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); s = oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, &resp_headers); if (aos_status_is_ok(s)) { printf("put object from buffer succeeded\n"); } else { printf("put object from buffer failed\n"); } aos_pool_destroy(p); } void put_object_from_buffer_with_md5() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; aos_list_t buffer; unsigned char *md5 = NULL; char *buf = NULL; int64_t buf_len; char *b64_value = NULL; int b64_len; aos_buf_t *content = NULL; char *str = "test oss c sdk"; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(p, 2); apr_table_set(headers, "x-oss-meta-author", "oss"); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); //add Content-MD5 buf_len = aos_buf_list_len(&buffer); buf = aos_buf_list_content(options->pool, &buffer); md5 = aos_md5(options->pool, buf, (apr_size_t)buf_len); b64_value = aos_pcalloc(options->pool, 50); b64_len = aos_base64_encode(md5, 20, b64_value); b64_value[b64_len] = '\0'; apr_table_set(headers, OSS_CONTENT_MD5, b64_value); s = oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, &resp_headers); if (aos_status_is_ok(s)) { printf("put object from buffer with md5 succeeded\n"); } else { printf("put object from buffer with md5 failed\n"); } aos_pool_destroy(p); } void put_object_from_file() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; char *filename = __FILE__; aos_status_t *s = NULL; aos_string_t file; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(options->pool, 1); apr_table_set(headers, OSS_CONTENT_TYPE, "image/jpeg"); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_str_set(&file, filename); s = oss_put_object_from_file(options, &bucket, &object, &file, headers, &resp_headers); if (aos_status_is_ok(s)) { printf("put object from file succeeded\n"); } else { printf("put object from file failed, code:%d, error_code:%s, error_msg:%s, request_id:%s\n", s->code, s->error_code, s->error_msg, s->req_id); } aos_pool_destroy(p); } void put_object_by_signed_url() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; aos_string_t url; int is_cname = 0; aos_http_request_t *request = NULL; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; char *filename = __FILE__; aos_status_t *s = NULL; aos_string_t file; char *signed_url = NULL; int64_t expires_time; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); // create request request = aos_http_request_create(p); request->method = HTTP_PUT; // create headers headers = aos_table_make(options->pool, 0); // set value aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, OBJECT_NAME); aos_str_set(&file, filename); // expires time expires_time = apr_time_now() / 1000000 + 120; // generate signed url for put signed_url = oss_gen_signed_url(options, &bucket, &object, expires_time, request); aos_str_set(&url, signed_url); printf("signed put url : %s\n", signed_url); // put object by signed url s = oss_put_object_from_file_by_url(options, &url, &file, headers, &resp_headers); if (aos_status_is_ok(s)) { printf("put object by signed url succeeded\n"); } else { printf("put object by signed url failed\n"); } aos_pool_destroy(p); } void create_dir() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(options->pool, 0); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, DIR_NAME); aos_list_init(&buffer); s = oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, &resp_headers); if (aos_status_is_ok(s)) { printf("create dir succeeded\n"); } else { printf("create dir failed\n"); } aos_pool_destroy(p); } void put_object_to_dir() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; char *filename = __FILE__; char *key = NULL; aos_status_t *s = NULL; aos_string_t file; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(options->pool, 0); aos_str_set(&bucket, BUCKET_NAME); key = (char*)malloc(strlen(DIR_NAME) + strlen(OBJECT_NAME) + 1); strcpy(key, DIR_NAME); strcat(key, OBJECT_NAME); aos_str_set(&object, key); aos_str_set(&file, filename); s = oss_put_object_from_file(options, &bucket, &object, &file, headers, &resp_headers); if (aos_status_is_ok(s)) { printf("put object to dir succeeded\n"); } else { printf("put object to dir failed\n"); } free(key); aos_pool_destroy(p); } void put_object_sample() { put_object_from_buffer(); put_object_from_file(); put_object_by_signed_url(); create_dir(); put_object_to_dir(); } ================================================ FILE: oss_c_sdk_sample/oss_resumable_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void resumable_upload_with_multi_threads() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, "my_key_1.zip"); aos_str_set(&filename, "local_big_file.zip"); aos_list_init(&resp_body); // upload clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); if (aos_status_is_ok(s)) { printf("upload succeeded\n"); } else { printf("upload failed\n"); } aos_pool_destroy(p); } void resumable_upload_with_resumable() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, "my_key_2.zip"); aos_str_set(&filename, "local_big_file.zip"); aos_list_init(&resp_body); // upload clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); if (aos_status_is_ok(s)) { printf("upload succeeded\n"); } else { printf("upload failed\n"); } aos_pool_destroy(p); } void resumable_upload_sample() { resumable_upload_with_multi_threads(); resumable_upload_with_resumable(); } void resumable_download_with_multi_threads() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, "my_key_1.zip"); aos_str_set(&filename, "local_big_file_1.zip"); // download clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); if (aos_status_is_ok(s)) { printf("download succeeded\n"); } else { printf("download failed\n"); } aos_pool_destroy(p); } void resumable_download_with_resumable() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, BUCKET_NAME); aos_str_set(&object, "my_key_2.zip"); aos_str_set(&filename, "local_big_file_2.zip"); // download clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); if (aos_status_is_ok(s)) { printf("download succeeded\n"); } else { printf("download failed\n"); } aos_pool_destroy(p); } void resumable_download_sample() { resumable_download_with_multi_threads(); resumable_download_with_resumable(); } ================================================ FILE: oss_c_sdk_sample/oss_sample_util.c ================================================ #include #include #include "oss_config.h" #include "oss_api.h" #include "oss_sample_util.h" void make_rand_string(aos_pool_t *p, int len, aos_string_t *data) { char *str = NULL; int i = 0; str = (char *)aos_palloc(p, len + 1); for ( ; i < len; i++) { str[i] = rand() % 128; } str[len] = '\0'; aos_str_set(data, str); } aos_buf_t *make_random_buf(aos_pool_t *p, int len) { int bytes; aos_buf_t *b; aos_string_t str; make_rand_string(p, 16, &str); b = aos_create_buf(p, len); while (b->last < b->end) { bytes = b->end - b->last; bytes = aos_min(bytes, 16); memcpy(b->last, str.data, bytes); b->last += bytes; } return b; } void make_random_body(aos_pool_t *p, int count, aos_list_t *bc) { int i = 0; int len; aos_buf_t *b; srand((int)time(0)); for (; i < count; ++i) { len = 1 + (int)(4096.0*rand() / (RAND_MAX+1.0)); b = make_random_buf(p, len); aos_list_add_tail(&b->node, bc); } } void init_sample_config(oss_config_t *config, int is_cname) { aos_str_set(&config->endpoint, OSS_ENDPOINT); aos_str_set(&config->access_key_id, ACCESS_KEY_ID); aos_str_set(&config->access_key_secret, ACCESS_KEY_SECRET); config->is_cname = is_cname; } void init_sample_request_options(oss_request_options_t *options, int is_cname) { options->config = oss_config_create(options->pool); init_sample_config(options->config, is_cname); options->ctl = aos_http_controller_create(options->pool, 0); } int64_t get_file_size(const char *file_path) { int64_t filesize = -1; struct stat statbuff; if(stat(file_path, &statbuff) < 0){ return filesize; } else { filesize = statbuff.st_size; } return filesize; } void percentage(int64_t consumed_bytes, int64_t total_bytes) { assert(total_bytes >= consumed_bytes); printf("%%%" APR_INT64_T_FMT "\n", consumed_bytes * 100 / total_bytes); } ================================================ FILE: oss_c_sdk_sample/oss_sample_util.h ================================================ #ifndef OSS_SAMPLE_UTIL_H #define OSS_SAMPLE_UTIL_H #include "aos_http_io.h" #include "aos_string.h" #include "aos_transport.h" #include "oss_define.h" OSS_CPP_START void make_rand_string(aos_pool_t *p, int len, aos_string_t *data); aos_buf_t *make_random_buf(aos_pool_t *p, int len); void make_random_body(aos_pool_t *p, int count, aos_list_t *bc); void init_sample_config(oss_config_t *config, int is_cname); void init_sample_request_options(oss_request_options_t *options, int is_cname); int64_t get_file_size(const char *file_path); void percentage(int64_t consumed_bytes, int64_t total_bytes); OSS_CPP_END #endif ================================================ FILE: oss_c_sdk_sample/oss_select_object_sample.c ================================================ #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_api.h" #include "oss_config.h" #include "oss_sample_util.h" void select_object_to_buffer() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; oss_select_object_params_t *select_params = NULL; aos_string_t select_sql; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, "oss-select"); aos_str_set(&object, "city_sample_data.csv"); aos_list_init(&buffer); aos_str_set(&select_sql, "select * from ossobject limit 10"); select_params = oss_create_select_object_params(p); s = oss_select_object_to_buffer(options, &bucket, &object, &select_sql, select_params, &buffer, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to buffer succeeded\n"); } else { printf("get object to buffer failed\n"); } aos_pool_destroy(p); } void select_object_to_file() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_select_object_params_t *select_params = NULL; aos_string_t filename; aos_string_t select_sql; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, "oss-select"); aos_str_set(&object, "city_sample_data.csv"); aos_str_set(&filename, "city_sample_data_part.csv"); aos_str_set(&select_sql, "select * from ossobject limit 10"); select_params = oss_create_select_object_params(p); s = oss_select_object_to_file(options, &bucket, &object, &select_sql, select_params, &filename, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to buffer succeeded\n"); } else { printf("get object to buffer failed\n"); } aos_pool_destroy(p); } void create_select_object_meta() { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_select_object_meta_params_t *meta_params = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_sample_request_options(options, is_cname); aos_str_set(&bucket, "oss-select"); aos_str_set(&object, "city_sample_data.csv"); meta_params = oss_create_select_object_meta_params(p); s = oss_create_select_object_meta(options, &bucket, &object, meta_params, &resp_headers); if (aos_status_is_ok(s)) { printf("get object to buffer succeeded\n"); } else { printf("get object to buffer failed\n"); } aos_pool_destroy(p); } void select_object_sample() { select_object_to_buffer(); select_object_to_file(); create_select_object_meta(); } ================================================ FILE: oss_c_sdk_test/CMakeLists.txt ================================================ project (oss_c_sdk_test) include_directories(${CMAKE_SOURCE_DIR}) configure_file ( "${PROJECT_SOURCE_DIR}/test.h.in" "${PROJECT_SOURCE_DIR}/test.h" ) set(SAMPLE_SOURCE_FILES CuTest.c oss_test_util.c oss_config.c test_oss_bucket.c test_oss_object.c test_oss_multipart.c test_oss_live.c test_oss_image.c test_oss_progress.c test_oss_callback.c test_oss_crc.c cjson_utils.c cjson.c test_oss_proxy.c test_oss_resumable.c test_aos.c test_all.c test_oss_select_object.c test_oss_object_tagging.c test_oss_xml.c test_oss_https.c test_oss_sign.c) # find_path(APR_INCLUDE_DIR apr-1/apr_time.h) # find_path(APR_UTIL_INCLUDE_DIR apr/include/apr-1/apr_md5.h) # find_path(MINIXML_INCLUDE_DIR mxml.h) # find_path(CURL_INCLUDE_DIR curl/curl.h) include_directories (${APR_INCLUDE_DIR}) include_directories (${APR_UTIL_INCLUDE_DIR}) include_directories (${MINIXML_INCLUDE_DIR}) include_directories (${CURL_INCLUDE_DIR}) include_directories ("${CMAKE_SOURCE_DIR}/oss_c_sdk") add_executable(oss_c_sdk_test ${SAMPLE_SOURCE_FILES}) if (CMAKE_HOST_WIN32) target_link_libraries(oss_c_sdk_test ws2_32) else() find_library(APR_LIBRARY apr-1 PATHS /usr/local/apr/lib/) find_library(APR_UTIL_LIBRARY aprutil-1 PATHS /usr/local/apr/lib/) find_library(MINIXML_LIBRARY mxml) find_library(CURL_LIBRARY curl) find_library(PTHREAD_LIBRARY pthread) find_library(MATH_LIBRARY m) target_link_libraries(oss_c_sdk_test ${PTHREAD_LIBRARY}) target_link_libraries(oss_c_sdk_test ${MATH_LIBRARY}) endif() target_link_libraries(oss_c_sdk_test oss_c_sdk) target_link_libraries(oss_c_sdk_test ${APR_UTIL_LIBRARY}) target_link_libraries(oss_c_sdk_test ${APR_LIBRARY}) target_link_libraries(oss_c_sdk_test ${MINIXML_LIBRARY}) target_link_libraries(oss_c_sdk_test ${CURL_LIBRARY}) ================================================ FILE: oss_c_sdk_test/CuTest-README.txt ================================================ Originally obtained from "http://cutest.sourceforge.net/" version 1.4. HOW TO USE You can use CuTest to create unit tests to drive your development in the style of Extreme Programming. You can also add unit tests to existing code to ensure that it works as you suspect. Your unit tests are an investment. They let you to change your code and add new features confidently without worrying about accidentally breaking earlier features. LICENSING Copyright (c) 2003 Asim Jalis This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. GETTING STARTED To add unit testing to your C code the only files you need are CuTest.c and CuTest.h. CuTestTest.c and AllTests.c have been included to provide an example of how to write unit tests and then how to aggregate them into suites and into a single AllTests.c file. Suites allow you to put group tests into logical sets. AllTests.c combines all the suites and runs them. You should not have to look inside CuTest.c. Looking in CuTestTest.c and AllTests.c (for example usage) should be sufficient. After downloading the sources, run your compiler to create an executable called AllTests.exe. For example, if you are using Windows with the cl.exe compiler you would type: cl.exe AllTests.c CuTest.c CuTestTest.c AllTests.exe This will run all the unit tests associated with CuTest and print the output on the console. You can replace cl.exe with gcc or your favorite compiler in the command above. DETAILED EXAMPLE Here is a more detailed example. We will work through a simple test first exercise. The goal is to create a library of string utilities. First, lets write a function that converts a null-terminated string to all upper case. Ensure that CuTest.c and CuTest.h are accessible from your C project. Next, create a file called StrUtil.c with these contents: #include "CuTest.h" char* StrToUpper(char* str) { return str; } void TestStrToUpper(CuTest *tc) { char* input = strdup("hello world"); char* actual = StrToUpper(input); char* expected = "HELLO WORLD"; CuAssertStrEquals(tc, expected, actual); } CuSuite* StrUtilGetSuite() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, TestStrToUpper); return suite; } Create another file called AllTests.c with these contents: #include "CuTest.h" CuSuite* StrUtilGetSuite(); void RunAllTests(void) { CuString *output = CuStringNew(); CuSuite* suite = CuSuiteNew(); CuSuiteAddSuite(suite, StrUtilGetSuite()); CuSuiteRun(suite); CuSuiteSummary(suite, output); CuSuiteDetails(suite, output); printf("%s\n", output->buffer); } int main(void) { RunAllTests(); } Then type this on the command line: gcc AllTests.c CuTest.c StrUtil.c to compile. You can replace gcc with your favorite compiler. CuTest should be portable enough to handle all Windows and Unix compilers. Then to run the tests type: a.out This will print an error because we haven't implemented the StrToUpper function correctly. We are just returning the string without changing it to upper case. char* StrToUpper(char* str) { return str; } Rewrite this as follows: char* StrToUpper(char* str) { char* p; for (p = str ; *p ; ++p) *p = toupper(*p); return str; } Recompile and run the tests again. The test should pass this time. WHAT TO DO NEXT At this point you might want to write more tests for the StrToUpper function. Here are some ideas: TestStrToUpper_EmptyString : pass in "" TestStrToUpper_UpperCase : pass in "HELLO WORLD" TestStrToUpper_MixedCase : pass in "HELLO world" TestStrToUpper_Numbers : pass in "1234 hello" As you write each one of these tests add it to StrUtilGetSuite function. If you don't the tests won't be run. Later as you write other functions and write tests for them be sure to include those in StrUtilGetSuite also. The StrUtilGetSuite function should include all the tests in StrUtil.c Over time you will create another file called FunkyStuff.c containing other functions unrelated to StrUtil. Follow the same pattern. Create a FunkyStuffGetSuite function in FunkyStuff.c. And add FunkyStuffGetSuite to AllTests.c. The framework is designed in the way it is so that it is easy to organize a lot of tests. THE BIG PICTURE Each individual test corresponds to a CuTest. These are grouped to form a CuSuite. CuSuites can hold CuTests or other CuSuites. AllTests.c collects all the CuSuites in the program into a single CuSuite which it then runs as a single CuSuite. The project is open source so feel free to take a peek under the hood at the CuTest.c file to see how it works. CuTestTest.c contains tests for CuTest.c. So CuTest tests itself. Since AllTests.c has a main() you will need to exclude this when you are building your product. Here is a nicer way to do this if you want to avoid messing with multiple builds. Remove the main() in AllTests.c. Note that it just calls RunAllTests(). Instead we'll call this directly from the main program. Now in the main() of the actual program check to see if the command line option "--test" was passed. If it was then I call RunAllTests() from AllTests.c. Otherwise run the real program. Shipping the tests with the code can be useful. If you customers complain about a problem you can ask them to run the unit tests and send you the output. This can help you to quickly isolate the piece of your system that is malfunctioning in the customer's environment. CuTest offers a rich set of CuAssert functions. Here is a list: void CuAssert(CuTest* tc, char* message, int condition); void CuAssertTrue(CuTest* tc, int condition); void CuAssertStrEquals(CuTest* tc, char* expected, char* actual); void CuAssertIntEquals(CuTest* tc, int expected, int actual); void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual); void CuAssertPtrNotNull(CuTest* tc, void* pointer); The project is open source and so you can add other more powerful asserts to make your tests easier to write and more concise. AUTOMATING TEST SUITE GENERATION make-tests.sh will grep through all the .c files in the current directory and generate the code to run all the tests contained in them. Using this script you don't have to worry about writing AllTests.c or dealing with any of the other suite code. CREDITS [02.23.2003] Dave Glowacki has added (1) file name and line numbers to the error messages, (2) AssertDblEquals for doubles, (3) AssertEquals_Msg version of all the AssertEquals to pass in optional message which is printed out on assert failure. ================================================ FILE: oss_c_sdk_test/CuTest.c ================================================ /* * Copyright (c) 2003 Asim Jalis * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any * damages arising from the use of this software. * * Permission is granted to anyone to use this software for any * purpose, including commercial applications, and to alter it and * redistribute it freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you * must not claim that you wrote the original software. If you use * this software in a product, an acknowledgment in the product * documentation would be appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and * must not be misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source * distribution. *-------------------------------------------------------------------------* * * Originally obtained from "http://cutest.sourceforge.net/" version 1.4. * * See CuTest.h for a list of serf-specific modifications. */ #include #include #include #include #include #include #include "CuTest.h" /*-------------------------------------------------------------------------* * CuStr *-------------------------------------------------------------------------*/ char* CuStrAlloc(int size) { char* newStr = (char*) malloc( sizeof(char) * (size) ); return newStr; } char* CuStrCopy(const char* old) { int len = strlen(old); char* newStr = CuStrAlloc(len + 1); strcpy(newStr, old); return newStr; } /*-------------------------------------------------------------------------* * CuString *-------------------------------------------------------------------------*/ void CuStringInit(CuString* str) { str->length = 0; str->size = STRING_MAX; str->buffer = (char*) malloc(sizeof(char) * str->size); str->buffer[0] = '\0'; } CuString* CuStringNew(void) { CuString* str = (CuString*) malloc(sizeof(CuString)); str->length = 0; str->size = STRING_MAX; str->buffer = (char*) malloc(sizeof(char) * str->size); str->buffer[0] = '\0'; return str; } void CuStringFree(CuString *str) { free(str->buffer); free(str); } void CuStringResize(CuString* str, int newSize) { str->buffer = (char*) realloc(str->buffer, sizeof(char) * newSize); str->size = newSize; } void CuStringAppend(CuString* str, const char* text) { int length; if (text == NULL) { text = "NULL"; } length = strlen(text); if (str->length + length + 1 >= str->size) CuStringResize(str, str->length + length + 1 + STRING_INC); str->length += length; strcat(str->buffer, text); } void CuStringAppendChar(CuString* str, char ch) { char text[2]; text[0] = ch; text[1] = '\0'; CuStringAppend(str, text); } void CuStringAppendFormat(CuString* str, const char* format, ...) { va_list argp; char buf[HUGE_STRING_LEN]; va_start(argp, format); vsprintf(buf, format, argp); va_end(argp); CuStringAppend(str, buf); } void CuStringInsert(CuString* str, const char* text, int pos) { int length = strlen(text); if (pos > str->length) pos = str->length; if (str->length + length + 1 >= str->size) CuStringResize(str, str->length + length + 1 + STRING_INC); memmove(str->buffer + pos + length, str->buffer + pos, (str->length - pos) + 1); str->length += length; memcpy(str->buffer + pos, text, length); } /*-------------------------------------------------------------------------* * CuTest *-------------------------------------------------------------------------*/ void CuTestInit(CuTest* t, const char* name, TestFunction function) { t->name = CuStrCopy(name); t->failed = 0; t->ran = 0; t->message = NULL; t->function = function; t->jumpBuf = NULL; t->setup = NULL; t->teardown = NULL; t->testBaton = NULL; } CuTest* CuTestNew(const char* name, TestFunction function) { CuTest* tc = CU_ALLOC(CuTest); CuTestInit(tc, name, function); return tc; } void CuTestFree(CuTest* tc) { free(tc->name); free(tc); } void CuTestRun(CuTest* tc) { jmp_buf buf; tc->jumpBuf = &buf; if (tc->setup) tc->testBaton = tc->setup(tc); if (setjmp(buf) == 0) { tc->ran = 1; (tc->function)(tc); } if (tc->teardown) tc->teardown(tc->testBaton); tc->jumpBuf = 0; } static void CuFailInternal(CuTest* tc, const char* file, int line, CuString* string) { char buf[HUGE_STRING_LEN]; sprintf(buf, "%s:%d: ", file, line); CuStringInsert(string, buf, 0); tc->failed = 1; tc->message = string->buffer; if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0); } void CuFail_Line(CuTest* tc, const char* file, int line, const char* message2, const char* message) { CuString string; CuStringInit(&string); if (message2 != NULL) { CuStringAppend(&string, message2); CuStringAppend(&string, ": "); } CuStringAppend(&string, message); CuFailInternal(tc, file, line, &string); } void CuAssert_Line(CuTest* tc, const char* file, int line, const char* message, int condition) { if (condition) return; CuFail_Line(tc, file, line, NULL, message); } void CuAssertStrnEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, const char* expected, size_t explen, const char* actual) { CuString string; if ((explen == 0) || (expected == NULL && actual == NULL) || (expected != NULL && actual != NULL && strncmp(expected, actual, explen) == 0)) { return; } CuStringInit(&string); if (message != NULL) { CuStringAppend(&string, message); CuStringAppend(&string, ": "); } CuStringAppend(&string, "expected <"); CuStringAppend(&string, expected); CuStringAppend(&string, "> but was <"); CuStringAppend(&string, actual); CuStringAppend(&string, ">"); CuFailInternal(tc, file, line, &string); } void CuAssertStrEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, const char* expected, const char* actual) { CuString string; if ((expected == NULL && actual == NULL) || (expected != NULL && actual != NULL && strcmp(expected, actual) == 0)) { return; } CuStringInit(&string); if (message != NULL) { CuStringAppend(&string, message); CuStringAppend(&string, ": "); } CuStringAppend(&string, "expected <"); CuStringAppend(&string, expected); CuStringAppend(&string, "> but was <"); CuStringAppend(&string, actual); CuStringAppend(&string, ">"); CuFailInternal(tc, file, line, &string);} void CuAssertIntEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, int expected, int actual) { char buf[STRING_MAX]; if (expected == actual) return; sprintf(buf, "expected <%d> but was <%d>", expected, actual); CuFail_Line(tc, file, line, message, buf); } void CuAssertDblEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, double expected, double actual, double delta) { char buf[STRING_MAX]; if (fabs(expected - actual) <= delta) return; sprintf(buf, "expected <%lf> but was <%lf>", expected, actual); CuFail_Line(tc, file, line, message, buf); } void CuAssertPtrEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, void* expected, void* actual) { char buf[STRING_MAX]; if (expected == actual) return; sprintf(buf, "expected pointer <0x%p> but was <0x%p>", expected, actual); CuFail_Line(tc, file, line, message, buf); } /*-------------------------------------------------------------------------* * CuSuite *-------------------------------------------------------------------------*/ void CuSuiteInit(CuSuite* testSuite) { testSuite->count = 0; testSuite->failCount = 0; testSuite->setup = NULL; testSuite->teardown = NULL; } CuSuite* CuSuiteNew(void) { CuSuite* testSuite = CU_ALLOC(CuSuite); CuSuiteInit(testSuite); return testSuite; } void CuSuiteFree(CuSuite *testSuite) { free(testSuite); } void CuSuiteFreeDeep(CuSuite *testSuite) { int i; for (i = 0 ; i < testSuite->count ; ++i) { CuTest* testCase = testSuite->list[i]; CuTestFree(testCase); } free(testSuite); } void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase) { assert(testSuite->count < MAX_TEST_CASES); testSuite->list[testSuite->count] = testCase; testSuite->count++; /* CuSuiteAdd is called twice per test, don't reset the callbacks if already set. */ if (!testCase->setup) testCase->setup = testSuite->setup; if (!testCase->teardown) testCase->teardown = testSuite->teardown; } void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2) { int i; for (i = 0 ; i < testSuite2->count ; ++i) { CuTest* testCase = testSuite2->list[i]; CuSuiteAdd(testSuite, testCase); } } void CuSuiteRun(CuSuite* testSuite) { int i; for (i = 0 ; i < testSuite->count ; ++i) { CuTest* testCase = testSuite->list[i]; CuTestRun(testCase); if (testCase->failed) { testSuite->failCount += 1; } } } void CuSuiteSummary(CuSuite* testSuite, CuString* summary) { int i; for (i = 0 ; i < testSuite->count ; ++i) { CuTest* testCase = testSuite->list[i]; CuStringAppend(summary, testCase->failed ? "F" : "."); } CuStringAppend(summary, "\n\n"); } void CuSuiteDetails(CuSuite* testSuite, CuString* details) { int i; int failCount = 0; if (testSuite->failCount == 0) { int passCount = testSuite->count - testSuite->failCount; const char* testWord = passCount == 1 ? "test" : "tests"; CuStringAppendFormat(details, "OK (%d %s)\n", passCount, testWord); } else { if (testSuite->failCount == 1) CuStringAppend(details, "There was 1 failure:\n"); else CuStringAppendFormat(details, "There were %d failures:\n", testSuite->failCount); for (i = 0 ; i < testSuite->count ; ++i) { CuTest* testCase = testSuite->list[i]; if (testCase->failed) { failCount++; CuStringAppendFormat(details, "%d) %s: %s\n", failCount, testCase->name, testCase->message); } } CuStringAppend(details, "\n!!!FAILURES!!!\n"); CuStringAppendFormat(details, "Runs: %d ", testSuite->count); CuStringAppendFormat(details, "Passes: %d ", testSuite->count - testSuite->failCount); CuStringAppendFormat(details, "Fails: %d\n", testSuite->failCount); } } void CuSuiteSetSetupTeardownCallbacks(CuSuite* testSuite, TestCallback setup, TestCallback teardown) { testSuite->setup = setup; testSuite->teardown = teardown; } ================================================ FILE: oss_c_sdk_test/CuTest.h ================================================ /* * Copyright (c) 2003 Asim Jalis * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any * damages arising from the use of this software. * * Permission is granted to anyone to use this software for any * purpose, including commercial applications, and to alter it and * redistribute it freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you * must not claim that you wrote the original software. If you use * this software in a product, an acknowledgment in the product * documentation would be appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and * must not be misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source * distribution. *-------------------------------------------------------------------------* * * Originally obtained from "http://cutest.sourceforge.net/" version 1.4. * * Modified for serf as follows * 4) added CuSuiteSetSetupTeardownCallbacks to set a constructor and * destructor per test suite, run for each test. * 3) added CuAssertStrnEquals(), CuAssertStrnEquals_Msg() and * CuAssertStrnEquals_LineMsg() * 2) removed const from struct CuTest.name * 1) added CuStringFree(), CuTestFree(), CuSuiteFree(), and * CuSuiteFreeDeep() * 0) reformatted the whitespace (doh!) */ #ifndef CU_TEST_H #define CU_TEST_H #include #include #include #include #include #ifndef WIN32 #include "test.h" #endif /* CuString */ char* CuStrAlloc(int size); char* CuStrCopy(const char* old); #define CU_ALLOC(TYPE) ((TYPE*) malloc(sizeof(TYPE))) #define HUGE_STRING_LEN 8192 #define STRING_MAX 256 #define STRING_INC 256 typedef struct { int length; int size; char* buffer; } CuString; void CuStringInit(CuString* str); CuString* CuStringNew(void); void CuStringFree(CuString *str); void CuStringRead(CuString* str, const char* path); void CuStringAppend(CuString* str, const char* text); void CuStringAppendChar(CuString* str, char ch); void CuStringAppendFormat(CuString* str, const char* format, ...); void CuStringInsert(CuString* str, const char* text, int pos); void CuStringResize(CuString* str, int newSize); /* CuTest */ typedef struct CuTest CuTest; typedef void (*TestFunction)(CuTest *); typedef void *(*TestCallback)(void *baton); struct CuTest { char* name; TestFunction function; int failed; int ran; const char* message; jmp_buf *jumpBuf; TestCallback setup; TestCallback teardown; void *testBaton; }; void CuTestInit(CuTest* t, const char* name, TestFunction function); CuTest* CuTestNew(const char* name, TestFunction function); void CuTestFree(CuTest* tc); void CuTestRun(CuTest* tc); /* Internal versions of assert functions -- use the public versions */ void CuFail_Line(CuTest* tc, const char* file, int line, const char* message2, const char* message); void CuAssert_Line(CuTest* tc, const char* file, int line, const char* message, int condition); void CuAssertStrEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, const char* expected, const char* actual); void CuAssertStrnEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, const char* expected, size_t explen, const char* actual); void CuAssertIntEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, int expected, int actual); void CuAssertDblEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, double expected, double actual, double delta); void CuAssertPtrEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, void* expected, void* actual); /* public assert functions */ #define CuFail(tc, ms) CuFail_Line( (tc), __FILE__, __LINE__, NULL, (ms)) #define CuAssert(tc, ms, cond) CuAssert_Line((tc), __FILE__, __LINE__, (ms), (cond)) #define CuAssertTrue(tc, cond) CuAssert_Line((tc), __FILE__, __LINE__, "assert failed", (cond)) #define CuAssertStrEquals(tc,ex,ac) CuAssertStrEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac)) #define CuAssertStrEquals_Msg(tc,ms,ex,ac) CuAssertStrEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac)) #define CuAssertStrnEquals(tc,ex,exlen,ac) CuAssertStrnEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(exlen),(ac)) #define CuAssertStrnEquals_Msg(tc,ms,ex,exlen,ac) CuAssertStrnEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(exlen),(ac)) #define CuAssertIntEquals(tc,ex,ac) CuAssertIntEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac)) #define CuAssertIntEquals_Msg(tc,ms,ex,ac) CuAssertIntEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac)) #define CuAssertDblEquals(tc,ex,ac,dl) CuAssertDblEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac),(dl)) #define CuAssertDblEquals_Msg(tc,ms,ex,ac,dl) CuAssertDblEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac),(dl)) #define CuAssertPtrEquals(tc,ex,ac) CuAssertPtrEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac)) #define CuAssertPtrEquals_Msg(tc,ms,ex,ac) CuAssertPtrEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac)) #define CuAssertPtrNotNull(tc,p) CuAssert_Line((tc),__FILE__,__LINE__,"null pointer unexpected",(p != NULL)) #define CuAssertPtrNotNullMsg(tc,msg,p) CuAssert_Line((tc),__FILE__,__LINE__,(msg),(p != NULL)) /* CuSuite */ #define MAX_TEST_CASES 1024 #define SUITE_ADD_TEST(SUITE,TEST) CuSuiteAdd(SUITE, CuTestNew(#TEST, TEST)) typedef struct { int count; CuTest* list[MAX_TEST_CASES]; int failCount; TestCallback setup; TestCallback teardown; void *testBaton; } CuSuite; void CuSuiteInit(CuSuite* testSuite); CuSuite* CuSuiteNew(void); void CuSuiteFree(CuSuite *testSuite); void CuSuiteFreeDeep(CuSuite *testSuite); void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase); void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2); void CuSuiteRun(CuSuite* testSuite); void CuSuiteSummary(CuSuite* testSuite, CuString* summary); void CuSuiteDetails(CuSuite* testSuite, CuString* details); void CuSuiteSetSetupTeardownCallbacks(CuSuite* testSuite, TestCallback setup, TestCallback teardown); #endif /* CU_TEST_H */ ================================================ FILE: oss_c_sdk_test/ca-certificates.crt ================================================ -----BEGIN CERTIFICATE----- MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UE AwwNQUNFRElDT00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00x CzAJBgNVBAYTAkVTMB4XDTA4MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEW MBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZF RElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKC AgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHkWLn7 09gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7 XBZXehuDYAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5P Grjm6gSSrj0RuVFCPYewMYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAK t0SdE3QrwqXrIhWYENiLxQSfHY9g5QYbm8+5eaA9oiM/Qj9r+hwDezCNzmzAv+Yb X79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbkHQl/Sog4P75n/TSW9R28 MHTLOO7VbKvU/PQAtwBbhT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Q2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE 38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1 MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8 eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa zq+r1feqCapgvdzZX99yqWATXg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6+YI5HYg84gd1GuEP sTC8cTLSOv76oYnzQyzWcsR5pxVIBcDYLXIC48s9Fmq6ybgREOJJhcyWR2AFJS7v dVkz9UcZFu/abF8HyKZQth3LZjQl/GaD68W2MEH4RkRiqMEMVObqTFoo5q7Gt/5/ O5aoLu7HaD7dAD0prypjq1/uSSotxdz70cbT0ZdWUoa2lOvUYFG3/B6bzAKb1B+P +UqPti4oOxfMxaYF49LTtcYDyeFIQpvLP+QX4P4NAZUJurgNceQJcHdC2E3hQqlg g9cXiUPS1N2nGLar1CQlh7XU4vwuImm9rWgs/3K1mKoGnOcqarihk3bOsPN/nOHg T7jYhkalMwIsJWE3KpLIrIF0aGOHM3a9BX9e1dUCbb2v/ypaqknsmHlHU5H2DjRa yaXG67Ljxay2oHA1u8hRadDytaIybrw/oDc5fHE2pgXfDBLkFqfF1stjo5VwP+YE o2A= -----END CERTIFICATE----- ================================================ FILE: oss_c_sdk_test/cjson.c ================================================ /* Copyright (c) 2009 Dave Gamble Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* cJSON */ /* JSON parser in C. */ #include #include #include #include #include #include #include #include "cjson.h" #ifdef WIN32 #pragma warning(disable:4996) #endif static const char *global_ep; const char *cJSON_GetErrorPtr(void) {return global_ep;} static int cJSON_strcasecmp(const char *s1,const char *s2) { if (!s1) return (s1==s2)?0:1;if (!s2) return 1; for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) if(*s1 == 0) return 0; return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2); } static void *(*cJSON_malloc)(size_t sz) = malloc; static void (*cJSON_free)(void *ptr) = free; static char* cJSON_strdup(const char* str) { size_t len; char* copy; len = strlen(str) + 1; if (!(copy = (char*)cJSON_malloc(len))) return 0; memcpy(copy,str,len); return copy; } void cJSON_InitHooks(cJSON_Hooks* hooks) { if (!hooks) { /* Reset hooks */ cJSON_malloc = malloc; cJSON_free = free; return; } cJSON_malloc = (hooks->malloc_fn)?hooks->malloc_fn:malloc; cJSON_free = (hooks->free_fn)?hooks->free_fn:free; } /* Internal constructor. */ static cJSON *cJSON_New_Item(void) { cJSON* node = (cJSON*)cJSON_malloc(sizeof(cJSON)); if (node) memset(node,0,sizeof(cJSON)); return node; } /* Delete a cJSON structure. */ void cJSON_Delete(cJSON *c) { cJSON *next; while (c) { next=c->next; if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child); if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring); if (!(c->type&cJSON_StringIsConst) && c->string) cJSON_free(c->string); cJSON_free(c); c=next; } } /* Parse the input text to generate a number, and populate the result into item. */ static const char *parse_number(cJSON *item,const char *num) { double n=0,sign=1,scale=0;int subscale=0,signsubscale=1; if (*num=='-') sign=-1,num++; /* Has sign? */ if (*num=='0') num++; /* is zero */ if (*num>='1' && *num<='9') do n=(n*10.0)+(*num++ -'0'); while (*num>='0' && *num<='9'); /* Number? */ if (*num=='.' && num[1]>='0' && num[1]<='9') {num++; do n=(n*10.0)+(*num++ -'0'),scale--; while (*num>='0' && *num<='9');} /* Fractional part? */ if (*num=='e' || *num=='E') /* Exponent? */ { num++;if (*num=='+') num++; else if (*num=='-') signsubscale=-1,num++; /* With sign? */ while (*num>='0' && *num<='9') subscale=(subscale*10)+(*num++ - '0'); /* Number? */ } n=sign*n*pow(10.0,(scale+subscale*signsubscale)); /* number = +/- number.fraction * 10^+/- exponent */ item->valuedouble=n; item->valueint=(int)n; item->type=cJSON_Number; return num; } static int pow2gt (int x) { --x; x|=x>>1; x|=x>>2; x|=x>>4; x|=x>>8; x|=x>>16; return x+1; } typedef struct {char *buffer; int length; int offset; } printbuffer; static char* ensure(printbuffer *p,int needed) { char *newbuffer;int newsize; if (!p || !p->buffer) return 0; needed+=p->offset; if (needed<=p->length) return p->buffer+p->offset; newsize=pow2gt(needed); newbuffer=(char*)cJSON_malloc(newsize); if (!newbuffer) {cJSON_free(p->buffer);p->length=0,p->buffer=0;return 0;} if (newbuffer) memcpy(newbuffer,p->buffer,p->length); cJSON_free(p->buffer); p->length=newsize; p->buffer=newbuffer; return newbuffer+p->offset; } static int update(printbuffer *p) { char *str; if (!p || !p->buffer) return 0; str=p->buffer+p->offset; return p->offset+strlen(str); } /* Render the number nicely from the given item into a string. */ static char *print_number(cJSON *item,printbuffer *p) { char *str=0; double d=item->valuedouble; if (d==0) { if (p) str=ensure(p,2); else str=(char*)cJSON_malloc(2); /* special case for 0. */ if (str) strcpy(str,"0"); } else if (fabs(((double)item->valueint)-d)<=DBL_EPSILON && d<=INT_MAX && d>=INT_MIN) { if (p) str=ensure(p,21); else str=(char*)cJSON_malloc(21); /* 2^64+1 can be represented in 21 chars. */ if (str) sprintf(str,"%d",item->valueint); } else { if (p) str=ensure(p,64); else str=(char*)cJSON_malloc(64); /* This is a nice tradeoff. */ if (str) { if (d*0!=0) sprintf(str,"null"); /* This checks for NaN and Infinity */ else if (fabs(floor(d)-d)<=DBL_EPSILON && fabs(d)<1.0e60) sprintf(str,"%.0f",d); else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%e",d); else sprintf(str,"%f",d); } } return str; } static unsigned parse_hex4(const char *str) { unsigned h=0; if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0; h=h<<4;str++; if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0; h=h<<4;str++; if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0; h=h<<4;str++; if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0; return h; } /* Parse the input text into an unescaped cstring, and populate item. */ static const unsigned char firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; static const char *parse_string(cJSON *item,const char *str,const char **ep) { const char *ptr=str+1,*end_ptr=str+1;char *ptr2;char *out;int len=0;unsigned uc,uc2; if (*str!='\"') {*ep=str;return 0;} /* not a string! */ while (*end_ptr!='\"' && *end_ptr && ++len) if (*end_ptr++ == '\\') end_ptr++; /* Skip escaped quotes. */ out=(char*)cJSON_malloc(len+1); /* This is how long we need for the string, roughly. */ if (!out) return 0; item->valuestring=out; /* assign here so out will be deleted during cJSON_Delete() later */ item->type=cJSON_String; ptr=str+1;ptr2=out; while (ptr < end_ptr) { if (*ptr!='\\') *ptr2++=*ptr++; else { ptr++; switch (*ptr) { case 'b': *ptr2++='\b'; break; case 'f': *ptr2++='\f'; break; case 'n': *ptr2++='\n'; break; case 'r': *ptr2++='\r'; break; case 't': *ptr2++='\t'; break; case 'u': /* transcode utf16 to utf8. */ uc=parse_hex4(ptr+1);ptr+=4; /* get the unicode char. */ if (ptr >= end_ptr) {*ep=str;return 0;} /* invalid */ if ((uc>=0xDC00 && uc<=0xDFFF) || uc==0) {*ep=str;return 0;} /* check for invalid. */ if (uc>=0xD800 && uc<=0xDBFF) /* UTF16 surrogate pairs. */ { if (ptr+6 > end_ptr) {*ep=str;return 0;} /* invalid */ if (ptr[1]!='\\' || ptr[2]!='u') {*ep=str;return 0;} /* missing second-half of surrogate. */ uc2=parse_hex4(ptr+3);ptr+=6; if (uc2<0xDC00 || uc2>0xDFFF) {*ep=str;return 0;} /* invalid second-half of surrogate. */ uc=0x10000 + (((uc&0x3FF)<<10) | (uc2&0x3FF)); } len=4;if (uc<0x80) len=1;else if (uc<0x800) len=2;else if (uc<0x10000) len=3; ptr2+=len; switch (len) { case 4: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6; case 3: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6; case 2: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6; case 1: *--ptr2 =(uc | firstByteMark[len]); } ptr2+=len; break; default: *ptr2++=*ptr; break; } ptr++; } } *ptr2=0; if (*ptr=='\"') ptr++; return ptr; } /* Render the cstring provided to an escaped version that can be printed. */ static char *print_string_ptr(const char *str,printbuffer *p) { const char *ptr;char *ptr2,*out;int len=0,flag=0;unsigned char token; if (!str) { if (p) out=ensure(p,3); else out=(char*)cJSON_malloc(3); if (!out) return 0; strcpy(out,"\"\""); return out; } for (ptr=str;*ptr;ptr++) flag|=((*ptr>0 && *ptr<32)||(*ptr=='\"')||(*ptr=='\\'))?1:0; if (!flag) { len=ptr-str; if (p) out=ensure(p,len+3); else out=(char*)cJSON_malloc(len+3); if (!out) return 0; ptr2=out;*ptr2++='\"'; strcpy(ptr2,str); ptr2[len]='\"'; ptr2[len+1]=0; return out; } ptr=str;while ((token=*ptr) && ++len) {if (strchr("\"\\\b\f\n\r\t",token)) len++; else if (token<32) len+=5;ptr++;} if (p) out=ensure(p,len+3); else out=(char*)cJSON_malloc(len+3); if (!out) return 0; ptr2=out;ptr=str; *ptr2++='\"'; while (*ptr) { if ((unsigned char)*ptr>31 && *ptr!='\"' && *ptr!='\\') *ptr2++=*ptr++; else { *ptr2++='\\'; switch (token=*ptr++) { case '\\': *ptr2++='\\'; break; case '\"': *ptr2++='\"'; break; case '\b': *ptr2++='b'; break; case '\f': *ptr2++='f'; break; case '\n': *ptr2++='n'; break; case '\r': *ptr2++='r'; break; case '\t': *ptr2++='t'; break; default: sprintf(ptr2,"u%04x",token);ptr2+=5; break; /* escape and print */ } } } *ptr2++='\"';*ptr2++=0; return out; } /* Invote print_string_ptr (which is useful) on an item. */ static char *print_string(cJSON *item,printbuffer *p) {return print_string_ptr(item->valuestring,p);} /* Predeclare these prototypes. */ static const char *parse_value(cJSON *item,const char *value,const char **ep); static char *print_value(cJSON *item,int depth,int fmt,printbuffer *p); static const char *parse_array(cJSON *item,const char *value,const char **ep); static char *print_array(cJSON *item,int depth,int fmt,printbuffer *p); static const char *parse_object(cJSON *item,const char *value,const char **ep); static char *print_object(cJSON *item,int depth,int fmt,printbuffer *p); /* Utility to jump whitespace and cr/lf */ static const char *skip(const char *in) {while (in && *in && (unsigned char)*in<=32) in++; return in;} /* Parse an object - create a new root, and populate. */ cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated) { const char *end=0,**ep=return_parse_end?return_parse_end:&global_ep; cJSON *c=cJSON_New_Item(); *ep=0; if (!c) return 0; /* memory fail */ end=parse_value(c,skip(value),ep); if (!end) {cJSON_Delete(c);return 0;} /* parse failure. ep is set. */ /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ if (require_null_terminated) {end=skip(end);if (*end) {cJSON_Delete(c);*ep=end;return 0;}} if (return_parse_end) *return_parse_end=end; return c; } /* Default options for cJSON_Parse */ cJSON *cJSON_Parse(const char *value) {return cJSON_ParseWithOpts(value,0,0);} /* Render a cJSON item/entity/structure to text. */ char *cJSON_Print(cJSON *item) {return print_value(item,0,1,0);} char *cJSON_PrintUnformatted(cJSON *item) {return print_value(item,0,0,0);} char *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt) { printbuffer p; p.buffer=(char*)cJSON_malloc(prebuffer); p.length=prebuffer; p.offset=0; return print_value(item,0,fmt,&p); } /* Parser core - when encountering text, process appropriately. */ static const char *parse_value(cJSON *item,const char *value,const char **ep) { if (!value) return 0; /* Fail on null. */ if (!strncmp(value,"null",4)) { item->type=cJSON_NULL; return value+4; } if (!strncmp(value,"false",5)) { item->type=cJSON_False; return value+5; } if (!strncmp(value,"true",4)) { item->type=cJSON_True; item->valueint=1; return value+4; } if (*value=='\"') { return parse_string(item,value,ep); } if (*value=='-' || (*value>='0' && *value<='9')) { return parse_number(item,value); } if (*value=='[') { return parse_array(item,value,ep); } if (*value=='{') { return parse_object(item,value,ep); } *ep=value;return 0; /* failure. */ } /* Render a value to text. */ static char *print_value(cJSON *item,int depth,int fmt,printbuffer *p) { char *out=0; if (!item) return 0; if (p) { switch ((item->type)&255) { case cJSON_NULL: {out=ensure(p,5); if (out) strcpy(out,"null"); break;} case cJSON_False: {out=ensure(p,6); if (out) strcpy(out,"false"); break;} case cJSON_True: {out=ensure(p,5); if (out) strcpy(out,"true"); break;} case cJSON_Number: out=print_number(item,p);break; case cJSON_String: out=print_string(item,p);break; case cJSON_Array: out=print_array(item,depth,fmt,p);break; case cJSON_Object: out=print_object(item,depth,fmt,p);break; } } else { switch ((item->type)&255) { case cJSON_NULL: out=cJSON_strdup("null"); break; case cJSON_False: out=cJSON_strdup("false");break; case cJSON_True: out=cJSON_strdup("true"); break; case cJSON_Number: out=print_number(item,0);break; case cJSON_String: out=print_string(item,0);break; case cJSON_Array: out=print_array(item,depth,fmt,0);break; case cJSON_Object: out=print_object(item,depth,fmt,0);break; } } return out; } /* Build an array from input text. */ static const char *parse_array(cJSON *item,const char *value,const char **ep) { cJSON *child; if (*value!='[') {*ep=value;return 0;} /* not an array! */ item->type=cJSON_Array; value=skip(value+1); if (*value==']') return value+1; /* empty array. */ item->child=child=cJSON_New_Item(); if (!item->child) return 0; /* memory fail */ value=skip(parse_value(child,skip(value),ep)); /* skip any spacing, get the value. */ if (!value) return 0; while (*value==',') { cJSON *new_item; if (!(new_item=cJSON_New_Item())) return 0; /* memory fail */ child->next=new_item;new_item->prev=child;child=new_item; value=skip(parse_value(child,skip(value+1),ep)); if (!value) return 0; /* memory fail */ } if (*value==']') return value+1; /* end of array */ *ep=value;return 0; /* malformed. */ } /* Render an array to text */ static char *print_array(cJSON *item,int depth,int fmt,printbuffer *p) { char **entries; char *out=0,*ptr,*ret;int len=5; cJSON *child=item->child; int numentries=0,i=0,fail=0; size_t tmplen=0; /* How many entries in the array? */ while (child) numentries++,child=child->next; /* Explicitly handle numentries==0 */ if (!numentries) { if (p) out=ensure(p,3); else out=(char*)cJSON_malloc(3); if (out) strcpy(out,"[]"); return out; } if (p) { /* Compose the output array. */ i=p->offset; ptr=ensure(p,1);if (!ptr) return 0; *ptr='['; p->offset++; child=item->child; while (child && !fail) { print_value(child,depth+1,fmt,p); p->offset=update(p); if (child->next) {len=fmt?2:1;ptr=ensure(p,len+1);if (!ptr) return 0;*ptr++=',';if(fmt)*ptr++=' ';*ptr=0;p->offset+=len;} child=child->next; } ptr=ensure(p,2);if (!ptr) return 0; *ptr++=']';*ptr=0; out=(p->buffer)+i; } else { /* Allocate an array to hold the values for each */ entries=(char**)cJSON_malloc(numentries*sizeof(char*)); if (!entries) return 0; memset(entries,0,numentries*sizeof(char*)); /* Retrieve all the results: */ child=item->child; while (child && !fail) { ret=print_value(child,depth+1,fmt,0); entries[i++]=ret; if (ret) len+=strlen(ret)+2+(fmt?1:0); else fail=1; child=child->next; } /* If we didn't fail, try to malloc the output string */ if (!fail) out=(char*)cJSON_malloc(len); /* If that fails, we fail. */ if (!out) fail=1; /* Handle failure. */ if (fail) { for (i=0;itype=cJSON_Object; value=skip(value+1); if (*value=='}') return value+1; /* empty array. */ item->child=child=cJSON_New_Item(); if (!item->child) return 0; value=skip(parse_string(child,skip(value),ep)); if (!value) return 0; child->string=child->valuestring;child->valuestring=0; if (*value!=':') {*ep=value;return 0;} /* fail! */ value=skip(parse_value(child,skip(value+1),ep)); /* skip any spacing, get the value. */ if (!value) return 0; while (*value==',') { cJSON *new_item; if (!(new_item=cJSON_New_Item())) return 0; /* memory fail */ child->next=new_item;new_item->prev=child;child=new_item; value=skip(parse_string(child,skip(value+1),ep)); if (!value) return 0; child->string=child->valuestring;child->valuestring=0; if (*value!=':') {*ep=value;return 0;} /* fail! */ value=skip(parse_value(child,skip(value+1),ep)); /* skip any spacing, get the value. */ if (!value) return 0; } if (*value=='}') return value+1; /* end of array */ *ep=value;return 0; /* malformed. */ } /* Render an object to text. */ static char *print_object(cJSON *item,int depth,int fmt,printbuffer *p) { char **entries=0,**names=0; char *out=0,*ptr,*ret,*str;int len=7,i=0,j; cJSON *child=item->child; int numentries=0,fail=0; size_t tmplen=0; /* Count the number of entries. */ while (child) numentries++,child=child->next; /* Explicitly handle empty object case */ if (!numentries) { if (p) out=ensure(p,fmt?depth+4:3); else out=(char*)cJSON_malloc(fmt?depth+4:3); if (!out) return 0; ptr=out;*ptr++='{'; if (fmt) {*ptr++='\n';for (i=0;ioffset; len=fmt?2:1; ptr=ensure(p,len+1); if (!ptr) return 0; *ptr++='{'; if (fmt) *ptr++='\n'; *ptr=0; p->offset+=len; child=item->child;depth++; while (child) { if (fmt) { ptr=ensure(p,depth); if (!ptr) return 0; for (j=0;joffset+=depth; } print_string_ptr(child->string,p); p->offset=update(p); len=fmt?2:1; ptr=ensure(p,len); if (!ptr) return 0; *ptr++=':';if (fmt) *ptr++='\t'; p->offset+=len; print_value(child,depth,fmt,p); p->offset=update(p); len=(fmt?1:0)+(child->next?1:0); ptr=ensure(p,len+1); if (!ptr) return 0; if (child->next) *ptr++=','; if (fmt) *ptr++='\n';*ptr=0; p->offset+=len; child=child->next; } ptr=ensure(p,fmt?(depth+1):2); if (!ptr) return 0; if (fmt) for (i=0;ibuffer)+i; } else { /* Allocate space for the names and the objects */ entries=(char**)cJSON_malloc(numentries*sizeof(char*)); if (!entries) return 0; names=(char**)cJSON_malloc(numentries*sizeof(char*)); if (!names) {cJSON_free(entries);return 0;} memset(entries,0,sizeof(char*)*numentries); memset(names,0,sizeof(char*)*numentries); /* Collect all the results into our arrays: */ child=item->child;depth++;if (fmt) len+=depth; while (child && !fail) { names[i]=str=print_string_ptr(child->string,0); entries[i++]=ret=print_value(child,depth,fmt,0); if (str && ret) len+=strlen(ret)+strlen(str)+2+(fmt?2+depth:0); else fail=1; child=child->next; } /* Try to allocate the output string */ if (!fail) out=(char*)cJSON_malloc(len); if (!out) fail=1; /* Handle failure */ if (fail) { for (i=0;ichild;int i=0;while(c)i++,c=c->next;return i;} cJSON *cJSON_GetArrayItem(cJSON *array,int item) {cJSON *c=array?array->child:0;while (c && item>0) item--,c=c->next; return c;} cJSON *cJSON_GetObjectItem(cJSON *object,const char *string) {cJSON *c=object?object->child:0;while (c && cJSON_strcasecmp(c->string,string)) c=c->next; return c;} int cJSON_HasObjectItem(cJSON *object,const char *string) {return cJSON_GetObjectItem(object,string)?1:0;} /* Utility for array list handling. */ static void suffix_object(cJSON *prev,cJSON *item) {prev->next=item;item->prev=prev;} /* Utility for handling references. */ static cJSON *create_reference(cJSON *item) {cJSON *ref=cJSON_New_Item();if (!ref) return 0;memcpy(ref,item,sizeof(cJSON));ref->string=0;ref->type|=cJSON_IsReference;ref->next=ref->prev=0;return ref;} /* Add item to array/object. */ void cJSON_AddItemToArray(cJSON *array, cJSON *item) {cJSON *c=array->child;if (!item) return; if (!c) {array->child=item;} else {while (c && c->next) c=c->next; suffix_object(c,item);}} void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item) {if (!item) return; if (item->string) cJSON_free(item->string);item->string=cJSON_strdup(string);cJSON_AddItemToArray(object,item);} void cJSON_AddItemToObjectCS(cJSON *object,const char *string,cJSON *item) {if (!item) return; if (!(item->type&cJSON_StringIsConst) && item->string) cJSON_free(item->string);item->string=(char*)string;item->type|=cJSON_StringIsConst;cJSON_AddItemToArray(object,item);} void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) {cJSON_AddItemToArray(array,create_reference(item));} void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));} cJSON *cJSON_DetachItemFromArray(cJSON *array,int which) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return 0; if (c->prev) c->prev->next=c->next;if (c->next) c->next->prev=c->prev;if (c==array->child) array->child=c->next;c->prev=c->next=0;return c;} void cJSON_DeleteItemFromArray(cJSON *array,int which) {cJSON_Delete(cJSON_DetachItemFromArray(array,which));} cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string) {int i=0;cJSON *c=object->child;while (c && cJSON_strcasecmp(c->string,string)) i++,c=c->next;if (c) return cJSON_DetachItemFromArray(object,i);return 0;} void cJSON_DeleteItemFromObject(cJSON *object,const char *string) {cJSON_Delete(cJSON_DetachItemFromObject(object,string));} /* Replace array/object items with new ones. */ void cJSON_InsertItemInArray(cJSON *array,int which,cJSON *newitem) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) {cJSON_AddItemToArray(array,newitem);return;} newitem->next=c;newitem->prev=c->prev;c->prev=newitem;if (c==array->child) array->child=newitem; else newitem->prev->next=newitem;} void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return; newitem->next=c->next;newitem->prev=c->prev;if (newitem->next) newitem->next->prev=newitem; if (c==array->child) array->child=newitem; else newitem->prev->next=newitem;c->next=c->prev=0;cJSON_Delete(c);} void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem){int i=0;cJSON *c=object->child;while(c && cJSON_strcasecmp(c->string,string))i++,c=c->next;if(c){newitem->string=cJSON_strdup(string);cJSON_ReplaceItemInArray(object,i,newitem);}} /* Create basic types: */ cJSON *cJSON_CreateNull(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_NULL;return item;} cJSON *cJSON_CreateTrue(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_True;return item;} cJSON *cJSON_CreateFalse(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_False;return item;} cJSON *cJSON_CreateBool(int b) {cJSON *item=cJSON_New_Item();if(item)item->type=b?cJSON_True:cJSON_False;return item;} cJSON *cJSON_CreateNumber(double num) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_Number;item->valuedouble=num;item->valueint=(int)num;}return item;} cJSON *cJSON_CreateString(const char *string) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_String;item->valuestring=cJSON_strdup(string);if(!item->valuestring){cJSON_Delete(item);return 0;}}return item;} cJSON *cJSON_CreateArray(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Array;return item;} cJSON *cJSON_CreateObject(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Object;return item;} /* Create Arrays: */ cJSON *cJSON_CreateIntArray(const int *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && ichild=n;else suffix_object(p,n);p=n;}return a;} cJSON *cJSON_CreateFloatArray(const float *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && ichild=n;else suffix_object(p,n);p=n;}return a;} cJSON *cJSON_CreateDoubleArray(const double *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && ichild=n;else suffix_object(p,n);p=n;}return a;} cJSON *cJSON_CreateStringArray(const char **strings,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && ichild=n;else suffix_object(p,n);p=n;}return a;} /* Duplication */ cJSON *cJSON_Duplicate(cJSON *item,int recurse) { cJSON *newitem,*cptr,*nptr=0,*newchild; /* Bail on bad ptr */ if (!item) return 0; /* Create new item */ newitem=cJSON_New_Item(); if (!newitem) return 0; /* Copy over all vars */ newitem->type=item->type&(~cJSON_IsReference),newitem->valueint=item->valueint,newitem->valuedouble=item->valuedouble; if (item->valuestring) {newitem->valuestring=cJSON_strdup(item->valuestring); if (!newitem->valuestring) {cJSON_Delete(newitem);return 0;}} if (item->string) {newitem->string=cJSON_strdup(item->string); if (!newitem->string) {cJSON_Delete(newitem);return 0;}} /* If non-recursive, then we're done! */ if (!recurse) return newitem; /* Walk the ->next chain for the child. */ cptr=item->child; while (cptr) { newchild=cJSON_Duplicate(cptr,1); /* Duplicate (with recurse) each item in the ->next chain */ if (!newchild) {cJSON_Delete(newitem);return 0;} if (nptr) {nptr->next=newchild,newchild->prev=nptr;nptr=newchild;} /* If newitem->child already set, then crosswire ->prev and ->next and move on */ else {newitem->child=newchild;nptr=newchild;} /* Set newitem->child and move to it */ cptr=cptr->next; } return newitem; } void cJSON_Minify(char *json) { char *into=json; while (*json) { if (*json==' ') json++; else if (*json=='\t') json++; /* Whitespace characters. */ else if (*json=='\r') json++; else if (*json=='\n') json++; else if (*json=='/' && json[1]=='/') while (*json && *json!='\n') json++; /* double-slash comments, to end of line. */ else if (*json=='/' && json[1]=='*') {while (*json && !(*json=='*' && json[1]=='/')) json++;json+=2;} /* multiline comments. */ else if (*json=='\"'){*into++=*json++;while (*json && *json!='\"'){if (*json=='\\') *into++=*json++;*into++=*json++;}*into++=*json++;} /* string literals, which are \" sensitive. */ else *into++=*json++; /* All other characters. */ } *into=0; /* and null-terminate. */ } ================================================ FILE: oss_c_sdk_test/cjson.h ================================================ /* Copyright (c) 2009 Dave Gamble Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef cJSON__h #define cJSON__h #ifdef __cplusplus extern "C" { #endif /* cJSON Types: */ #define cJSON_False (1 << 0) #define cJSON_True (1 << 1) #define cJSON_NULL (1 << 2) #define cJSON_Number (1 << 3) #define cJSON_String (1 << 4) #define cJSON_Array (1 << 5) #define cJSON_Object (1 << 6) #define cJSON_IsReference 256 #define cJSON_StringIsConst 512 /* The cJSON structure: */ typedef struct cJSON { struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ int type; /* The type of the item, as above. */ char *valuestring; /* The item's string, if type==cJSON_String */ int valueint; /* The item's number, if type==cJSON_Number */ double valuedouble; /* The item's number, if type==cJSON_Number */ char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ } cJSON; typedef struct cJSON_Hooks { void *(*malloc_fn)(size_t sz); void (*free_fn)(void *ptr); } cJSON_Hooks; /* Supply malloc, realloc and free functions to cJSON */ extern void cJSON_InitHooks(cJSON_Hooks* hooks); /* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */ extern cJSON *cJSON_Parse(const char *value); /* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */ extern char *cJSON_Print(cJSON *item); /* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */ extern char *cJSON_PrintUnformatted(cJSON *item); /* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ extern char *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt); /* Delete a cJSON entity and all subentities. */ extern void cJSON_Delete(cJSON *c); /* Returns the number of items in an array (or object). */ extern int cJSON_GetArraySize(cJSON *array); /* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */ extern cJSON *cJSON_GetArrayItem(cJSON *array,int item); /* Get item "string" from object. Case insensitive. */ extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string); extern int cJSON_HasObjectItem(cJSON *object,const char *string); /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ extern const char *cJSON_GetErrorPtr(void); /* These calls create a cJSON item of the appropriate type. */ extern cJSON *cJSON_CreateNull(void); extern cJSON *cJSON_CreateTrue(void); extern cJSON *cJSON_CreateFalse(void); extern cJSON *cJSON_CreateBool(int b); extern cJSON *cJSON_CreateNumber(double num); extern cJSON *cJSON_CreateString(const char *string); extern cJSON *cJSON_CreateArray(void); extern cJSON *cJSON_CreateObject(void); /* These utilities create an Array of count items. */ extern cJSON *cJSON_CreateIntArray(const int *numbers,int count); extern cJSON *cJSON_CreateFloatArray(const float *numbers,int count); extern cJSON *cJSON_CreateDoubleArray(const double *numbers,int count); extern cJSON *cJSON_CreateStringArray(const char **strings,int count); /* Append item to the specified array/object. */ extern void cJSON_AddItemToArray(cJSON *array, cJSON *item); extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item); extern void cJSON_AddItemToObjectCS(cJSON *object,const char *string,cJSON *item); /* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object */ /* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item); /* Remove/Detatch items from Arrays/Objects. */ extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which); extern void cJSON_DeleteItemFromArray(cJSON *array,int which); extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string); extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string); /* Update array items. */ extern void cJSON_InsertItemInArray(cJSON *array,int which,cJSON *newitem); /* Shifts pre-existing items to the right. */ extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem); extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); /* Duplicate a cJSON item */ extern cJSON *cJSON_Duplicate(cJSON *item,int recurse); /* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will need to be released. With recurse!=0, it will duplicate any children connected to the item. The item->next and ->prev pointers are always zero on return from Duplicate. */ /* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ /* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error. If not, then cJSON_GetErrorPtr() does the job. */ extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated); extern void cJSON_Minify(char *json); /* Macros for creating things quickly. */ #define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull()) #define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue()) #define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse()) #define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b)) #define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n)) #define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s)) /* When assigning an integer value, it needs to be propagated to valuedouble too. */ #define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) #define cJSON_SetNumberValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) /* Macro for iterating over an array */ #define cJSON_ArrayForEach(pos, head) for(pos = (head)->child; pos != NULL; pos = pos->next) #ifdef __cplusplus } #endif #endif ================================================ FILE: oss_c_sdk_test/cjson_utils.c ================================================ #include #include #include #include #include "cjson_utils.h" #ifdef WIN32 #pragma warning(disable:4996) #endif static int cJSONUtils_strcasecmp(const char *s1,const char *s2) { if (!s1) return (s1==s2)?0:1;if (!s2) return 1; for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) if(*s1 == 0) return 0; return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2); } /* JSON Pointer implementation: */ static int cJSONUtils_Pstrcasecmp(const char *a,const char *e) { if (!a || !e) return (a==e)?0:1; for (;*a && *e && *e!='/';a++,e++) { if (*e=='~') {if (!(e[1]=='0' && *a=='~') && !(e[1]=='1' && *a=='/')) return 1; else e++;} else if (tolower(*a)!=tolower(*e)) return 1; } if ((*e!=0 && *e!='/') != (*a!=0)) return 1; return 0; } static int cJSONUtils_PointerEncodedstrlen(const char *s) {int l=0;for (;*s;s++,l++) if (*s=='~' || *s=='/') l++;return l;} static void cJSONUtils_PointerEncodedstrcpy(char *d,const char *s) { for (;*s;s++) { if (*s=='/') {*d++='~';*d++='1';} else if (*s=='~') {*d++='~';*d++='0';} else *d++=*s; } *d=0; } char *cJSONUtils_FindPointerFromObjectTo(cJSON *object,cJSON *target) { int type=object->type,c=0;cJSON *obj=0; if (object==target) return strdup(""); for (obj=object->child;obj;obj=obj->next,c++) { char *found=cJSONUtils_FindPointerFromObjectTo(obj,target); if (found) { if (type==cJSON_Array) { char *ret=(char*)malloc(strlen(found)+23); sprintf(ret,"/%d%s",c,found); free(found); return ret; } else if (type==cJSON_Object) { char *ret=(char*)malloc(strlen(found)+cJSONUtils_PointerEncodedstrlen(obj->string)+2); *ret='/';cJSONUtils_PointerEncodedstrcpy(ret+1,obj->string); strcat(ret,found); free(found); return ret; } free(found); return 0; } } return 0; } cJSON *cJSONUtils_GetPointer(cJSON *object,const char *pointer) { while (*pointer++=='/' && object) { if (object->type==cJSON_Array) { int which=0; while (*pointer>='0' && *pointer<='9') which=(10*which) + *pointer++ - '0'; if (*pointer && *pointer!='/') return 0; object=cJSON_GetArrayItem(object,which); } else if (object->type==cJSON_Object) { object=object->child; while (object && cJSONUtils_Pstrcasecmp(object->string,pointer)) object=object->next; /* GetObjectItem. */ while (*pointer && *pointer!='/') pointer++; } else return 0; } return object; } /* JSON Patch implementation. */ static void cJSONUtils_InplaceDecodePointerString(char *string) { char *s2=string; for (;*string;s2++,string++) *s2=(*string!='~')?(*string):((*(++string)=='0')?'~':'/'); *s2=0; } static cJSON *cJSONUtils_PatchDetach(cJSON *object,const char *path) { char *parentptr=0,*childptr=0;cJSON *parent=0,*ret=0; parentptr=strdup(path); childptr=strrchr(parentptr,'/'); if (childptr) *childptr++=0; parent=cJSONUtils_GetPointer(object,parentptr); cJSONUtils_InplaceDecodePointerString(childptr); if (!parent) ret=0; /* Couldn't find object to remove child from. */ else if (parent->type==cJSON_Array) ret=cJSON_DetachItemFromArray(parent,atoi(childptr)); else if (parent->type==cJSON_Object) ret=cJSON_DetachItemFromObject(parent,childptr); free(parentptr); return ret; } static int cJSONUtils_Compare(cJSON *a,cJSON *b) { if (a->type!=b->type) return -1; /* mismatched type. */ switch (a->type) { case cJSON_Number: return (a->valueint!=b->valueint || a->valuedouble!=b->valuedouble)?-2:0; /* numeric mismatch. */ case cJSON_String: return (strcmp(a->valuestring,b->valuestring)!=0)?-3:0; /* string mismatch. */ case cJSON_Array: for (a=a->child,b=b->child;a && b;a=a->next,b=b->next) {int err=cJSONUtils_Compare(a,b);if (err) return err;} return (a || b)?-4:0; /* array size mismatch. */ case cJSON_Object: cJSONUtils_SortObject(a); cJSONUtils_SortObject(b); a=a->child,b=b->child; while (a && b) { int err; if (cJSONUtils_strcasecmp(a->string,b->string)) return -6; /* missing member */ err=cJSONUtils_Compare(a,b);if (err) return err; a=a->next,b=b->next; } return (a || b)?-5:0; /* object length mismatch */ default: break; } return 0; } static int cJSONUtils_ApplyPatch(cJSON *object,cJSON *patch) { cJSON *op=0,*path=0,*value=0,*parent=0;int opcode=0;char *parentptr=0,*childptr=0; op=cJSON_GetObjectItem(patch,"op"); path=cJSON_GetObjectItem(patch,"path"); if (!op || !path) return 2; /* malformed patch. */ if (!strcmp(op->valuestring,"add")) opcode=0; else if (!strcmp(op->valuestring,"remove")) opcode=1; else if (!strcmp(op->valuestring,"replace"))opcode=2; else if (!strcmp(op->valuestring,"move")) opcode=3; else if (!strcmp(op->valuestring,"copy")) opcode=4; else if (!strcmp(op->valuestring,"test")) return cJSONUtils_Compare(cJSONUtils_GetPointer(object,path->valuestring),cJSON_GetObjectItem(patch,"value")); else return 3; /* unknown opcode. */ if (opcode==1 || opcode==2) /* Remove/Replace */ { cJSON_Delete(cJSONUtils_PatchDetach(object,path->valuestring)); /* Get rid of old. */ if (opcode==1) return 0; /* For Remove, this is job done. */ } if (opcode==3 || opcode==4) /* Copy/Move uses "from". */ { cJSON *from=cJSON_GetObjectItem(patch,"from"); if (!from) return 4; /* missing "from" for copy/move. */ if (opcode==3) value=cJSONUtils_PatchDetach(object,from->valuestring); if (opcode==4) value=cJSONUtils_GetPointer(object,from->valuestring); if (!value) return 5; /* missing "from" for copy/move. */ if (opcode==4) value=cJSON_Duplicate(value,1); if (!value) return 6; /* out of memory for copy/move. */ } else /* Add/Replace uses "value". */ { value=cJSON_GetObjectItem(patch,"value"); if (!value) return 7; /* missing "value" for add/replace. */ value=cJSON_Duplicate(value,1); if (!value) return 8; /* out of memory for add/replace. */ } /* Now, just add "value" to "path". */ parentptr=strdup(path->valuestring); childptr=strrchr(parentptr,'/'); if (childptr) *childptr++=0; parent=cJSONUtils_GetPointer(object,parentptr); cJSONUtils_InplaceDecodePointerString(childptr); /* add, remove, replace, move, copy, test. */ if (!parent) {free(parentptr); cJSON_Delete(value); return 9;} /* Couldn't find object to add to. */ else if (parent->type==cJSON_Array) { if (!strcmp(childptr,"-")) cJSON_AddItemToArray(parent,value); else cJSON_InsertItemInArray(parent,atoi(childptr),value); } else if (parent->type==cJSON_Object) { cJSON_DeleteItemFromObject(parent,childptr); cJSON_AddItemToObject(parent,childptr,value); } else { cJSON_Delete(value); } free(parentptr); return 0; } int cJSONUtils_ApplyPatches(cJSON *object,cJSON *patches) { int err; if (patches->type!=cJSON_Array) return 1; /* malformed patches. */ if (patches) patches=patches->child; while (patches) { if ((err=cJSONUtils_ApplyPatch(object,patches))) return err; patches=patches->next; } return 0; } static void cJSONUtils_GeneratePatch(cJSON *patches,const char *op,const char *path,const char *suffix,cJSON *val) { cJSON *patch=cJSON_CreateObject(); cJSON_AddItemToObject(patch,"op",cJSON_CreateString(op)); if (suffix) { char *newpath=(char*)malloc(strlen(path)+cJSONUtils_PointerEncodedstrlen(suffix)+2); cJSONUtils_PointerEncodedstrcpy(newpath+sprintf(newpath,"%s/",path),suffix); cJSON_AddItemToObject(patch,"path",cJSON_CreateString(newpath)); free(newpath); } else cJSON_AddItemToObject(patch,"path",cJSON_CreateString(path)); if (val) cJSON_AddItemToObject(patch,"value",cJSON_Duplicate(val,1)); cJSON_AddItemToArray(patches,patch); } void cJSONUtils_AddPatchToArray(cJSON *array,const char *op,const char *path,cJSON *val) {cJSONUtils_GeneratePatch(array,op,path,0,val);} static void cJSONUtils_CompareToPatch(cJSON *patches,const char *path,cJSON *from,cJSON *to) { if (from->type!=to->type) {cJSONUtils_GeneratePatch(patches,"replace",path,0,to); return; } switch (from->type) { case cJSON_Number: if (from->valueint!=to->valueint || from->valuedouble!=to->valuedouble) cJSONUtils_GeneratePatch(patches,"replace",path,0,to); return; case cJSON_String: if (strcmp(from->valuestring,to->valuestring)!=0) cJSONUtils_GeneratePatch(patches,"replace",path,0,to); return; case cJSON_Array: { int c;char *newpath=(char*)malloc(strlen(path)+23); /* Allow space for 64bit int. */ for (c=0,from=from->child,to=to->child;from && to;from=from->next,to=to->next,c++){ sprintf(newpath,"%s/%d",path,c); cJSONUtils_CompareToPatch(patches,newpath,from,to); } for (;from;from=from->next,c++) {sprintf(newpath,"%d",c); cJSONUtils_GeneratePatch(patches,"remove",path,newpath,0); } for (;to;to=to->next,c++) cJSONUtils_GeneratePatch(patches,"add",path,"-",to); free(newpath); return; } case cJSON_Object: { cJSON *a,*b; cJSONUtils_SortObject(from); cJSONUtils_SortObject(to); a=from->child,b=to->child; while (a || b) { int diff=(!a)?1:(!b)?-1:cJSONUtils_strcasecmp(a->string,b->string); if (!diff) { char *newpath=(char*)malloc(strlen(path)+cJSONUtils_PointerEncodedstrlen(a->string)+2); cJSONUtils_PointerEncodedstrcpy(newpath+sprintf(newpath,"%s/",path),a->string); cJSONUtils_CompareToPatch(patches,newpath,a,b); free(newpath); a=a->next; b=b->next; } else if (diff<0) {cJSONUtils_GeneratePatch(patches,"remove",path,a->string,0); a=a->next;} else {cJSONUtils_GeneratePatch(patches,"add",path,b->string,b); b=b->next;} } return; } default: break; } } cJSON* cJSONUtils_GeneratePatches(cJSON *from,cJSON *to) { cJSON *patches=cJSON_CreateArray(); cJSONUtils_CompareToPatch(patches,"",from,to); return patches; } static cJSON *cJSONUtils_SortList(cJSON *list) { cJSON *first=list,*second=list,*ptr=list; if (!list || !list->next) return list; /* One entry is sorted already. */ while (ptr && ptr->next && cJSONUtils_strcasecmp(ptr->string,ptr->next->string)<0) ptr=ptr->next; /* Test for list sorted. */ if (!ptr || !ptr->next) return list; /* Leave sorted lists unmodified. */ ptr=list; while (ptr) {second=second->next;ptr=ptr->next;if (ptr) ptr=ptr->next;} /* Walk two pointers to find the middle. */ if (second && second->prev) second->prev->next=0; /* Split the lists */ first=cJSONUtils_SortList(first); /* Recursively sort the sub-lists. */ second=cJSONUtils_SortList(second); list=ptr=0; while (first && second) /* Merge the sub-lists */ { if (cJSONUtils_strcasecmp(first->string,second->string)<0) { if (!list) list=ptr=first; else {ptr->next=first;first->prev=ptr;ptr=first;} first=first->next; } else { if (!list) list=ptr=second; else {ptr->next=second;second->prev=ptr;ptr=second;} second=second->next; } } if (first) { if (!list) return first; ptr->next=first; first->prev=ptr; } /* Append any tails. */ if (second) { if (!list) return second; ptr->next=second; second->prev=ptr; } return list; } void cJSONUtils_SortObject(cJSON *object) {object->child=cJSONUtils_SortList(object->child);} cJSON* cJSONUtils_MergePatch(cJSON *target, cJSON *patch) { if (!patch || patch->type != cJSON_Object) {cJSON_Delete(target);return cJSON_Duplicate(patch,1);} if (!target || target->type != cJSON_Object) {cJSON_Delete(target);target=cJSON_CreateObject();} patch=patch->child; while (patch) { if (patch->type == cJSON_NULL) cJSON_DeleteItemFromObject(target,patch->string); else { cJSON *replaceme=cJSON_DetachItemFromObject(target,patch->string); cJSON_AddItemToObject(target,patch->string,cJSONUtils_MergePatch(replaceme,patch)); } patch=patch->next; } return target; } cJSON *cJSONUtils_GenerateMergePatch(cJSON *from,cJSON *to) { cJSON *patch=0; if (!to) return cJSON_CreateNull(); if (to->type!=cJSON_Object || !from || from->type!=cJSON_Object) return cJSON_Duplicate(to,1); cJSONUtils_SortObject(from); cJSONUtils_SortObject(to); from=from->child;to=to->child; patch=cJSON_CreateObject(); while (from || to) { int compare=from?(to?strcmp(from->string,to->string):-1):1; if (compare<0) { cJSON_AddItemToObject(patch,from->string,cJSON_CreateNull()); from=from->next; } else if (compare>0) { cJSON_AddItemToObject(patch,to->string,cJSON_Duplicate(to,1)); to=to->next; } else { if (cJSONUtils_Compare(from,to)) cJSON_AddItemToObject(patch,to->string,cJSONUtils_GenerateMergePatch(from,to)); from=from->next;to=to->next; } } if (!patch->child) {cJSON_Delete(patch);return 0;} return patch; } ================================================ FILE: oss_c_sdk_test/cjson_utils.h ================================================ #include "cjson.h" /* Implement RFC6901 (https://tools.ietf.org/html/rfc6901) JSON Pointer spec. */ cJSON *cJSONUtils_GetPointer(cJSON *object,const char *pointer); /* Implement RFC6902 (https://tools.ietf.org/html/rfc6902) JSON Patch spec. */ cJSON* cJSONUtils_GeneratePatches(cJSON *from,cJSON *to); void cJSONUtils_AddPatchToArray(cJSON *array,const char *op,const char *path,cJSON *val); /* Utility for generating patch array entries. */ int cJSONUtils_ApplyPatches(cJSON *object,cJSON *patches); /* Returns 0 for success. */ /* // Note that ApplyPatches is NOT atomic on failure. To implement an atomic ApplyPatches, use: //int cJSONUtils_AtomicApplyPatches(cJSON **object, cJSON *patches) //{ // cJSON *modme=cJSON_Duplicate(*object,1); // int error=cJSONUtils_ApplyPatches(modme,patches); // if (!error) {cJSON_Delete(*object);*object=modme;} // else cJSON_Delete(modme); // return error; //} // Code not added to library since this strategy is a LOT slower. */ /* Implement RFC7386 (https://tools.ietf.org/html/rfc7396) JSON Merge Patch spec. */ cJSON* cJSONUtils_MergePatch(cJSON *target, cJSON *patch); /* target will be modified by patch. return value is new ptr for target. */ cJSON *cJSONUtils_GenerateMergePatch(cJSON *from,cJSON *to); /* generates a patch to move from -> to */ char *cJSONUtils_FindPointerFromObjectTo(cJSON *object,cJSON *target); /* Given a root object and a target object, construct a pointer from one to the other. */ void cJSONUtils_SortObject(cJSON *object); /* Sorts the members of the object into alphabetical order. */ ================================================ FILE: oss_c_sdk_test/oss_config.c ================================================ #include "oss_config.h" char* TEST_OSS_ENDPOINT = NULL; char* TEST_REGION = NULL; char* TEST_ACCESS_KEY_ID = NULL; char* TEST_ACCESS_KEY_SECRET = NULL; char* TEST_BUCKET_NAME = NULL; char* TEST_CALLBACK_URL = NULL; ================================================ FILE: oss_c_sdk_test/oss_config.h ================================================ #ifndef OSS_TEST_CONFIG_H #define OSS_TEST_CONFIG_H #include "oss_define.h" OSS_CPP_START extern char* TEST_OSS_ENDPOINT; extern char* TEST_REGION; extern char* TEST_ACCESS_KEY_ID; extern char* TEST_ACCESS_KEY_SECRET; extern char* TEST_BUCKET_NAME; extern char* TEST_CALLBACK_URL; OSS_CPP_END #endif ================================================ FILE: oss_c_sdk_test/oss_test_util.c ================================================ #include #include "oss_config.h" #include "oss_api.h" #include "oss_test_util.h" #include "cjson.h" char bucket_prefix[64]; void make_rand_string(aos_pool_t *p, int len, aos_string_t *data) { char *str = NULL; int i = 0; str = (char *)aos_palloc(p, len + 1); for ( ; i < len; i++) { str[i] = 'a' + rand() % 32; } str[len] = '\0'; aos_str_set(data, str); } aos_buf_t *make_random_buf(aos_pool_t *p, int len) { int bytes; aos_buf_t *b; aos_string_t str; make_rand_string(p, 16, &str); b = aos_create_buf(p, len); while (b->last < b->end) { bytes = b->end - b->last; bytes = aos_min(bytes, 16); memcpy(b->last, str.data, bytes); b->last += bytes; } return b; } void make_random_body(aos_pool_t *p, int count, aos_list_t *bc) { int i = 0; int len; aos_buf_t *b; srand((int)time(0)); for (; i < count; ++i) { len = 1 + (int)(4096.0*rand() / (RAND_MAX+1.0)); b = make_random_buf(p, len); aos_list_add_tail(&b->node, bc); } } int make_random_file(aos_pool_t *p, const char *filename, int len) { apr_file_t *file; aos_string_t str; apr_size_t nbytes; int ret; if ((ret = apr_file_open(&file, filename, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE | APR_GREAD, p)) != APR_SUCCESS) { return ret; } make_rand_string(p, len, &str); nbytes = len; ret = apr_file_write(file, str.data, &nbytes); apr_file_close(file); return ret; } int fill_test_file(aos_pool_t *p, const char *filename, const char *content) { apr_file_t *file; apr_size_t nbytes; int ret; if ((ret = apr_file_open(&file, filename, APR_CREATE | APR_WRITE | APR_TRUNCATE, APR_UREAD | APR_UWRITE | APR_GREAD, p)) != APR_SUCCESS) { return ret; } nbytes = strlen(content); ret = apr_file_write(file, content, &nbytes); apr_file_close(file); return ret; } void init_test_config(oss_config_t *config, int is_cname) { aos_str_set(&config->endpoint, TEST_OSS_ENDPOINT); aos_str_set(&config->access_key_id, TEST_ACCESS_KEY_ID); aos_str_set(&config->access_key_secret, TEST_ACCESS_KEY_SECRET); aos_str_set(&config->region, TEST_REGION); config->signature_version = 1; config->is_cname = is_cname; } void init_test_request_options(oss_request_options_t *options, int is_cname) { options->config = oss_config_create(options->pool); init_test_config(options->config, is_cname); options->ctl = aos_http_controller_create(options->pool, 0); options->ctl->options = aos_http_request_options_create(options->pool); options->ctl->options->verify_ssl = AOS_FALSE; } aos_status_t * create_test_bucket(const oss_request_options_t *options, const char *bucket_name, oss_acl_e oss_acl) { aos_string_t bucket; aos_table_t *resp_headers; aos_status_t * s; aos_str_set(&bucket, bucket_name); s = oss_create_bucket(options, &bucket, oss_acl, &resp_headers); return s; } aos_status_t * create_test_bucket_with_storage_class(const oss_request_options_t *options, const char *bucket_name, oss_acl_e oss_acl, oss_storage_class_type_e storage_class) { aos_string_t bucket; aos_table_t *resp_headers; aos_status_t * s; aos_str_set(&bucket, bucket_name); s = oss_create_bucket_with_storage_class(options, &bucket, oss_acl, storage_class, &resp_headers); return s; } aos_status_t *create_test_object(const oss_request_options_t *options, const char *bucket_name, const char *object_name, const char *data, aos_table_t *headers) { aos_string_t bucket; aos_string_t object; aos_table_t *resp_headers; aos_list_t buffer; aos_buf_t *content; aos_status_t * s; test_object_base(); aos_list_init(&buffer); content = aos_buf_pack(options->pool, data, strlen(data)); aos_list_add_tail(&content->node, &buffer); s = oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, &resp_headers); return s; } aos_status_t *create_test_object_from_file(const oss_request_options_t *options, const char *bucket_name, const char *object_name, const char *filename, aos_table_t *headers) { aos_string_t bucket; aos_string_t object; aos_string_t file; aos_table_t *resp_headers; aos_status_t * s; test_object_base(); aos_str_set(&file, filename); s = oss_put_object_from_file(options, &bucket, &object, &file, headers, &resp_headers); return s; } aos_status_t *delete_test_object(const oss_request_options_t *options, const char *bucket_name, const char *object_name) { aos_string_t bucket; aos_string_t object; aos_table_t *resp_headers; aos_status_t * s; test_object_base(); s = oss_delete_object(options, &bucket, &object, &resp_headers); return s; } aos_status_t *delete_test_object_by_prefix(const oss_request_options_t *options, const char *bucket_name, const char *object_name_prefix) { aos_string_t bucket; aos_status_t * s = NULL; oss_list_object_params_t *params = NULL; oss_list_object_content_t *content = NULL; char *nextMarker = ""; aos_str_set(&bucket, bucket_name); params = oss_create_list_object_params(options->pool); params->max_ret = 100; aos_str_set(¶ms->prefix, object_name_prefix); aos_str_set(¶ms->marker, nextMarker); do { s = oss_list_object(options, &bucket, params, NULL); if (!aos_status_is_ok(s)) { return s; } aos_list_for_each_entry(oss_list_object_content_t, content, ¶ms->object_list, node) { char object_name[128]; sprintf(object_name, "%.*s", content->key.len, content->key.data); s = delete_test_object(options, bucket_name, object_name); if (!aos_status_is_ok(s)) { return s; } } nextMarker = apr_psprintf(options->pool, "%.*s", params->next_marker.len, params->next_marker.data); aos_str_set(¶ms->marker, nextMarker); aos_list_init(¶ms->object_list); aos_list_init(¶ms->common_prefix_list); } while (params->truncated == AOS_TRUE); if (s == NULL) { s = aos_status_create(options->pool); aos_status_set(s, AOSE_OK, NULL, NULL); } return s; } void clean_bucket(const oss_request_options_t *options, const char* bucket_name) { aos_table_t *resp_headers = NULL; oss_list_multipart_upload_params_t *list_upload_params = NULL; oss_list_live_channel_params_t *live_channel_params = NULL; aos_string_t bucket; // delete all objects delete_test_object_by_prefix(options, bucket_name, ""); // upload aos_str_set(&bucket, bucket_name); list_upload_params = oss_create_list_multipart_upload_params(options->pool); do { aos_status_t *s; oss_list_multipart_upload_content_t *upload_content; aos_list_init(&list_upload_params->upload_list); s = oss_list_multipart_upload(options, &bucket, list_upload_params, &resp_headers); if (!aos_status_is_ok(s)) { break; } aos_list_for_each_entry(oss_list_multipart_upload_content_t, upload_content, &list_upload_params->upload_list, node) { abort_test_multipart_upload(options, bucket_name, upload_content->key.data, &upload_content->upload_id); } if (!list_upload_params->truncated) { break; } aos_str_set(&list_upload_params->key_marker, list_upload_params->next_key_marker.data); aos_str_set(&list_upload_params->upload_id_marker, list_upload_params->next_upload_id_marker.data); } while (1); // live channel live_channel_params = oss_create_list_live_channel_params(options->pool); do { aos_status_t *s; oss_live_channel_content_t *live_chan; aos_list_init(&live_channel_params->live_channel_list); s = oss_list_live_channel(options, &bucket, live_channel_params, NULL); if (!aos_status_is_ok(s)) { break; } aos_list_for_each_entry(oss_live_channel_content_t, live_chan, &live_channel_params->live_channel_list, node) { printf("live_chan->name.data:%s\n", live_chan->name.data); oss_delete_live_channel(options, &bucket, &live_chan->name, NULL); } if (!live_channel_params->truncated) { break; } aos_str_set(&live_channel_params->marker, live_channel_params->next_marker.data); } while (1); /* delete test bucket */ oss_delete_bucket(options, &bucket, &resp_headers); //printf("clean bucket %s done\n", bucket_name); } void clean_bucket_by_prefix(const char* prefix) { //printf("clean_bucket_by_prefix:%s\n", prefix); aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_list_buckets_params_t *params = NULL; oss_list_bucket_content_t *content = NULL; /* list all buckets */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); params = oss_create_list_buckets_params(p); params->max_keys = 100; aos_str_set(¶ms->prefix, prefix); s = oss_list_bucket(options, params, &resp_headers); if (!aos_status_is_ok(s)) { return; } aos_list_for_each_entry(oss_list_bucket_content_t, content, ¶ms->bucket_list, node) { clean_bucket(options, content->name.data); } aos_pool_destroy(p); } aos_status_t *init_test_multipart_upload(const oss_request_options_t *options, const char *bucket_name, const char *object_name, aos_string_t *upload_id) { aos_string_t bucket; aos_string_t object; aos_table_t *headers; aos_table_t *resp_headers; aos_status_t *s; test_object_base(); headers = aos_table_make(options->pool, 5); s = oss_init_multipart_upload(options, &bucket, &object, upload_id, headers, &resp_headers); return s; } aos_status_t *abort_test_multipart_upload(const oss_request_options_t *options, const char *bucket_name, const char *object_name, aos_string_t *upload_id) { aos_string_t bucket; aos_string_t object; aos_table_t *resp_headers; aos_status_t *s; test_object_base(); s = oss_abort_multipart_upload(options, &bucket, &object, upload_id, &resp_headers); return s; } aos_status_t *create_test_live_channel(const oss_request_options_t *options, const char *bucket_name, const char *live_channel) { aos_list_t publish_url_list; aos_list_t play_url_list; oss_live_channel_configuration_t *config = NULL; aos_string_t bucket; aos_string_t channel_id; aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&channel_id, live_channel); aos_list_init(&publish_url_list); aos_list_init(&play_url_list); config = oss_create_live_channel_configuration_content(options->pool); aos_str_set(&config->name, live_channel); aos_str_set(&config->description, "live channel description"); return oss_create_live_channel(options, &bucket, config, &publish_url_list, &play_url_list, NULL); } aos_status_t *delete_test_live_channel(const oss_request_options_t *options, const char *bucket_name, const char *live_channel) { aos_string_t bucket; aos_string_t channel_id; aos_str_set(&bucket, bucket_name); aos_str_set(&channel_id, live_channel); return oss_delete_live_channel(options, &bucket, &channel_id, NULL); } aos_status_t *get_image_info(const oss_request_options_t *options, const char *bucket_name, const char *object_name, image_info_t *info) { aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_list_init(&buffer); aos_str_set(&bucket, bucket_name); aos_str_set(&object, object_name); /* test get object to buffer */ params = aos_table_make(options->pool, 1); apr_table_set(params, OSS_PROCESS, "image/info"); s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); if (aos_status_is_ok(s)) { aos_buf_t *content = NULL; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; cJSON * root = NULL; cJSON * item = NULL; /* get buffer len */ len = aos_buf_list_len(&buffer); buf = (char *)aos_pcalloc(options->pool, (apr_size_t)(len + 1)); buf[len] = '\0'; /* copy buffer content to memory */ aos_list_for_each_entry(aos_buf_t, content, &buffer, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } /* parse image info from json */ root = cJSON_Parse(buf); item = cJSON_GetObjectItem(root, "ImageHeight"); item = cJSON_GetObjectItem(item, "value"); info->height = atol(item->valuestring); item = cJSON_GetObjectItem(root, "ImageWidth"); item = cJSON_GetObjectItem(item, "value"); info->width = atol(item->valuestring); item = cJSON_GetObjectItem(root, "FileSize"); item = cJSON_GetObjectItem(item, "value"); info->size = atol(item->valuestring); item = cJSON_GetObjectItem(root, "Format"); item = cJSON_GetObjectItem(item, "value"); apr_snprintf(info->format, 64, "%s", item->valuestring); cJSON_Delete(root); } return s; } char* gen_test_signed_url(const oss_request_options_t *options, const char *bucket_name, const char *object_name, int64_t expires, aos_http_request_t *req) { aos_string_t bucket; aos_string_t object; char *signed_url = NULL; aos_str_set(&bucket, bucket_name); aos_str_set(&object, object_name); signed_url = oss_gen_signed_url(options, &bucket, &object, expires, req); return signed_url; } unsigned long get_file_size(const char *file_path) { unsigned long filesize = -1; struct stat statbuff; if(stat(file_path, &statbuff) < 0){ return filesize; } else { filesize = statbuff.st_size; } return filesize; } char *decrypt(const char *encrypted_str, aos_pool_t *pool) { char *res_str = NULL; int i = 0; if (encrypted_str == NULL) { return NULL; } res_str = (char *)aos_palloc(pool, strlen(encrypted_str) + 1); while (*encrypted_str != '\0') { res_str[i] = 0x6a ^ *encrypted_str; encrypted_str++; i++; } res_str[i] = '\0'; return res_str; } void progress_callback(int64_t consumed_bytes, int64_t total_bytes) { assert(total_bytes >= consumed_bytes); } void percentage(int64_t consumed_bytes, int64_t total_bytes) { assert(total_bytes >= consumed_bytes); } char * get_text_file_data(aos_pool_t *pool, const char *filepath) { apr_status_t s; apr_file_t *thefile; apr_finfo_t finfo; apr_size_t nread = 0; apr_off_t offset = 0; char *buf = NULL; s = apr_file_open(&thefile, filepath, APR_READ, APR_UREAD | APR_GREAD, pool); if (s != APR_SUCCESS) { return NULL; } s = apr_file_info_get(&finfo, APR_FINFO_SIZE | APR_FINFO_MTIME, thefile); if (s != APR_SUCCESS) { apr_file_close(thefile); return NULL; } nread = (apr_size_t)finfo.size; buf = aos_pcalloc(pool, nread + 1); apr_file_seek(thefile, APR_SET, &offset); apr_file_read(thefile, buf, &nread); buf[nread] = '\0'; apr_file_close(thefile); return buf; } char *get_test_file_path() { static int flag = 0; static char path[1024]; #if defined(WIN32) char ch = '\\'; #else char ch = '/'; #endif if (!flag) { char *filepath = __FILE__; char * pos = strrchr(filepath, ch); if (pos) { int len = (int)(pos - filepath + 1); sprintf(path, "%.*s", len, filepath); } else { sprintf(path, "oss_c_sdk_test%c", ch); } flag = 1; } return path; } char *get_test_bucket_name(aos_pool_t *p, const char* suffix) { return apr_psprintf(p, "%s-%s-bucket", bucket_prefix, suffix); } void set_test_bucket_prefix(const char* prefix) { sprintf(bucket_prefix, "%s", prefix); } ================================================ FILE: oss_c_sdk_test/oss_test_util.h ================================================ #ifndef OSS_TEST_UTIL_H #define OSS_TEST_UTIL_H #include "CuTest.h" #include "aos_http_io.h" #include "aos_string.h" #include "aos_transport.h" #include "aos_status.h" #include "oss_define.h" OSS_CPP_START typedef struct { long height; long width; long size; char format[64]; } image_info_t; #define test_object_base() do { \ aos_str_set(&bucket, bucket_name); \ aos_str_set(&object, object_name); \ } while(0) #define TEST_CASE_LOG_OPEN #ifdef TEST_CASE_LOG_OPEN #define TEST_CASE_LOG(fmt,...) do { printf("%s:%d "fmt,__FUNCTION__,__LINE__,##__VA_ARGS__); fflush (stdout); } while (0) #else #define TEST_CASE_LOG(fmt,...) #endif void make_rand_string(aos_pool_t *p, int len, aos_string_t *data); aos_buf_t *make_random_buf(aos_pool_t *p, int len); void make_random_body(aos_pool_t *p, int count, aos_list_t *bc); int make_random_file(aos_pool_t *p, const char *filename, int len); int fill_test_file(aos_pool_t *p, const char *filename, const char *content); void init_test_config(oss_config_t *config, int is_cname); void init_test_request_options(oss_request_options_t *options, int is_cname); aos_status_t * create_test_bucket(const oss_request_options_t *options, const char *bucket_name, oss_acl_e oss_acl); aos_status_t * create_test_bucket_with_storage_class(const oss_request_options_t *options, const char *bucket_name, oss_acl_e oss_acl, oss_storage_class_type_e storage_class_tp); aos_status_t *create_test_object(const oss_request_options_t *options, const char *bucket_name, const char *object_name, const char *data, aos_table_t *headers); aos_status_t *create_test_object_from_file(const oss_request_options_t *options, const char *bucket_name, const char *object_name, const char *filename, aos_table_t *headers); aos_status_t *delete_test_object(const oss_request_options_t *options, const char *bucket_name, const char *object_name); aos_status_t *delete_test_object_by_prefix(const oss_request_options_t *options, const char *bucket_name, const char *object_name_prefix); aos_status_t *init_test_multipart_upload(const oss_request_options_t *options, const char *bucket_name, const char *object_name, aos_string_t *upload_id); aos_status_t *abort_test_multipart_upload(const oss_request_options_t *options, const char *bucket_name, const char *object_name, aos_string_t *upload_id); aos_status_t *create_test_live_channel(const oss_request_options_t *options, const char *bucket_name, const char *live_channel); aos_status_t *delete_test_live_channel(const oss_request_options_t *options, const char *bucket_name, const char *live_channel); aos_status_t *get_image_info(const oss_request_options_t *options, const char *bucket_name, const char *object_name, image_info_t *info); char *gen_test_signed_url(const oss_request_options_t *options, const char *bucket_name, const char *object_name, int64_t expires, aos_http_request_t *req); unsigned long get_file_size(const char *file_path); char *decrypt(const char *encrypted_str, aos_pool_t *pool); void percentage(int64_t consumed_bytes, int64_t total_bytes); void progress_callback(int64_t consumed_bytes, int64_t total_bytes); char * get_text_file_data(aos_pool_t *pool, const char *filepath); char *get_test_file_path(); char *get_test_bucket_name(aos_pool_t *p, const char* suffix); void set_test_bucket_prefix(const char*prefix); void clean_bucket_by_prefix(const char* prefix); OSS_CPP_END #endif ================================================ FILE: oss_c_sdk_test/sample_data.csv ================================================ Year,StateAbbr,StateDesc,CityName,GeographicLevel,DataSource,Category,UniqueID,Measure,Data_Value_Unit,DataValueTypeID,Data_Value_Type,Data_Value,Low_Confidence_Limit,High_Confidence_Limit,Data_Value_Footnote_Symbol,Data_Value_Footnote,PopulationCount,GeoLocation,CategoryID,MeasureId,CityFIPS,TractFIPS,Short_Question_Text 2015,US,United States,,US,BRFSS,Prevention,59,Current lack of health insurance among adults aged 18–64 Years,%,AgeAdjPrv,Age-adjusted prevalence,15.4,15.1,15.7,,,308745538,,PREVENT,ACCESS2,,,Health Insurance 2015,US,United States,,US,BRFSS,Prevention,59,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,14.8,14.5,15.0,,,308745538,,PREVENT,ACCESS2,,,Health Insurance 2015,US,United States,,US,BRFSS,Health Outcomes,59,Arthritis among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,22.5,22.3,22.7,,,308745538,,HLTHOUT,ARTHRITIS,,,Arthritis 2015,US,United States,,US,BRFSS,Health Outcomes,59,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,24.7,24.5,24.9,,,308745538,,HLTHOUT,ARTHRITIS,,,Arthritis 2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Binge drinking among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,17.2,16.9,17.4,,,308745538,,UNHBEH,BINGE,,,Binge Drinking 2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.3,16.1,16.5,,,308745538,,UNHBEH,BINGE,,,Binge Drinking 2015,US,United States,,US,BRFSS,Health Outcomes,59,High blood pressure among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,29.4,29.2,29.7,,,308745538,,HLTHOUT,BPHIGH,,,High Blood Pressure 2015,US,United States,,US,BRFSS,Health Outcomes,59,High blood pressure among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.9,31.6,32.2,,,308745538,,HLTHOUT,BPHIGH,,,High Blood Pressure 2015,US,United States,,US,BRFSS,Prevention,59,Taking medicine for high blood pressure control among adults aged >=18 Years with high blood pressure,%,AgeAdjPrv,Age-adjusted prevalence,57.7,57.1,58.4,,,308745538,,PREVENT,BPMED,,,Taking BP Medication 2015,US,United States,,US,BRFSS,Prevention,59,Taking medicine for high blood pressure control among adults aged >=18 Years with high blood pressure,%,CrdPrv,Crude prevalence,77.2,76.8,77.7,,,308745538,,PREVENT,BPMED,,,Taking BP Medication 2015,US,United States,,US,BRFSS,Health Outcomes,59,Cancer (excluding skin cancer) among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,6.0,5.9,6.1,,,308745538,,HLTHOUT,CANCER,,,Cancer (except skin) 2015,US,United States,,US,BRFSS,Health Outcomes,59,Cancer (excluding skin cancer) among adults aged >=18 Years,%,CrdPrv,Crude prevalence,6.6,6.5,6.8,,,308745538,,HLTHOUT,CANCER,,,Cancer (except skin) 2015,US,United States,,US,BRFSS,Health Outcomes,59,Current asthma among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,8.7,8.6,8.9,,,308745538,,HLTHOUT,CASTHMA,,,Current Asthma 2015,US,United States,,US,BRFSS,Health Outcomes,59,Current asthma among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.8,8.6,9.0,,,308745538,,HLTHOUT,CASTHMA,,,Current Asthma 2015,US,United States,,US,BRFSS,Health Outcomes,59,Coronary heart disease among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,5.6,5.5,5.8,,,308745538,,HLTHOUT,CHD,,,Coronary Heart Disease 2015,US,United States,,US,BRFSS,Health Outcomes,59,Coronary heart disease among adults aged >=18 Years,%,CrdPrv,Crude prevalence,6.3,6.2,6.5,,,308745538,,HLTHOUT,CHD,,,Coronary Heart Disease 2015,US,United States,,US,BRFSS,Prevention,59,Visits to doctor for routine checkup within the past Year among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,68.6,68.3,68.9,,,308745538,,PREVENT,CHECKUP,,,Annual Checkup 2015,US,United States,,US,BRFSS,Prevention,59,Visits to doctor for routine checkup within the past Year among adults aged >=18 Years,%,CrdPrv,Crude prevalence,70.0,69.7,70.3,,,308745538,,PREVENT,CHECKUP,,,Annual Checkup 2015,US,United States,,US,BRFSS,Prevention,59,Cholesterol screening among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,75.2,74.9,75.5,,,308745538,,PREVENT,CHOLSCREEN,,,Cholesterol Screening 2015,US,United States,,US,BRFSS,Prevention,59,Cholesterol screening among adults aged >=18 Years,%,CrdPrv,Crude prevalence,77.0,76.7,77.3,,,308745538,,PREVENT,CHOLSCREEN,,,Cholesterol Screening 2014,US,United States,,US,BRFSS,Prevention,59,"Fecal occult blood test, sigmoidoscopy, or colonoscopy among adults aged 50–75 Years",%,AgeAdjPrv,Age-adjusted prevalence,64.0,63.5,64.5,,,308745538,,PREVENT,COLON_SCREEN,,,Colorectal Cancer Screening 2014,US,United States,,US,BRFSS,Prevention,59,"Fecal occult blood test, sigmoidoscopy, or colonoscopy among adults aged 50–75 Years",%,CrdPrv,Crude prevalence,63.7,63.3,64.1,,,308745538,,PREVENT,COLON_SCREEN,,,Colorectal Cancer Screening 2015,US,United States,,US,BRFSS,Health Outcomes,59,Chronic obstructive pulmonary disease among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,5.7,5.6,5.9,,,308745538,,HLTHOUT,COPD,,,COPD 2015,US,United States,,US,BRFSS,Health Outcomes,59,Chronic obstructive pulmonary disease among adults aged >=18 Years,%,CrdPrv,Crude prevalence,6.3,6.2,6.4,,,308745538,,HLTHOUT,COPD,,,COPD 2015,US,United States,,US,BRFSS,Health Outcomes,59,Physical health not good for >=14 days among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,11.5,11.3,11.7,,,308745538,,HLTHOUT,PHLTH,,,Physical Health 2014,US,United States,,US,BRFSS,Prevention,59,"Older adult men aged >=65 Years who are up to date on a core set of clinical preventive services: Flu shot past Year, PPV shot ever, Colorectal cancer screening",%,AgeAdjPrv,Age-adjusted prevalence,32.9,32.1,33.6,,,308745538,,PREVENT,COREM,,,Core preventive services for older men 2014,US,United States,,US,BRFSS,Prevention,59,"Older adult men aged >=65 Years who are up to date on a core set of clinical preventive services: Flu shot past Year, PPV shot ever, Colorectal cancer screening",%,CrdPrv,Crude prevalence,32.3,31.5,33.0,,,308745538,,PREVENT,COREM,,,Core preventive services for older men 2014,US,United States,,US,BRFSS,Prevention,59,"Older adult women aged >=65 Years who are up to date on a core set of clinical preventive services: Flu shot past Year, PPV shot ever, Colorectal cancer screening, and Mammogram past 2 Years",%,AgeAdjPrv,Age-adjusted prevalence,30.7,30.2,31.4,,,308745538,,PREVENT,COREW,,,Core preventive services for older women 2014,US,United States,,US,BRFSS,Prevention,59,"Older adult women aged >=65 Years who are up to date on a core set of clinical preventive services: Flu shot past Year, PPV shot ever, Colorectal cancer screening, and Mammogram past 2 Years",%,CrdPrv,Crude prevalence,30.7,30.1,31.3,,,308745538,,PREVENT,COREW,,,Core preventive services for older women 2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Current smoking among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,17.1,16.8,17.3,,,308745538,,UNHBEH,CSMOKING,,,Current Smoking 2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Current smoking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.8,16.6,17.0,,,308745538,,UNHBEH,CSMOKING,,,Current Smoking 2014,US,United States,,US,BRFSS,Prevention,59,Visits to dentist or dental clinic among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,64.1,63.8,64.4,,,308745538,,PREVENT,DENTAL,,,Dental Visit 2014,US,United States,,US,BRFSS,Prevention,59,Visits to dentist or dental clinic among adults aged >=18 Years,%,CrdPrv,Crude prevalence,64.4,64.1,64.7,,,308745538,,PREVENT,DENTAL,,,Dental Visit 2015,US,United States,,US,BRFSS,Health Outcomes,59,Diagnosed diabetes among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,9.3,9.2,9.5,,,308745538,,HLTHOUT,DIABETES,,,Diabetes 2015,US,United States,,US,BRFSS,Health Outcomes,59,Diagnosed diabetes among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.4,10.3,10.6,,,308745538,,HLTHOUT,DIABETES,,,Diabetes 2015,US,United States,,US,BRFSS,Health Outcomes,59,High cholesterol among adults aged >=18 Years who have been screened in the past 5 Years,%,AgeAdjPrv,Age-adjusted prevalence,31.1,30.8,31.4,,,308745538,,HLTHOUT,HIGHCHOL,,,High Cholesterol 2015,US,United States,,US,BRFSS,Health Outcomes,59,High cholesterol among adults aged >=18 Years who have been screened in the past 5 Years,%,CrdPrv,Crude prevalence,37.1,36.8,37.4,,,308745538,,HLTHOUT,HIGHCHOL,,,High Cholesterol 2015,US,United States,,US,BRFSS,Health Outcomes,59,Chronic kidney disease among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,2.5,2.4,2.6,,,308745538,,HLTHOUT,KIDNEY,,,Chronic Kidney Disease 2015,US,United States,,US,BRFSS,Health Outcomes,59,Chronic kidney disease among adults aged >=18 Years,%,CrdPrv,Crude prevalence,2.7,2.6,2.8,,,308745538,,HLTHOUT,KIDNEY,,,Chronic Kidney Disease 2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,No leisure-time physical activity among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,25.5,25.2,25.8,,,308745538,,UNHBEH,LPA,,,Physical Inactivity 2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,No leisure-time physical activity among adults aged >=18 Years,%,CrdPrv,Crude prevalence,25.9,25.6,26.1,,,308745538,,UNHBEH,LPA,,,Physical Inactivity 2014,US,United States,,US,BRFSS,Prevention,59,Mammography use among women aged 50–74 Years,%,AgeAdjPrv,Age-adjusted prevalence,75.5,75.1,75.9,,,308745538,,PREVENT,MAMMOUSE,,,Mammography 2014,US,United States,,US,BRFSS,Prevention,59,Mammography use among women aged 50–74 Years,%,CrdPrv,Crude prevalence,75.8,75.4,76.2,,,308745538,,PREVENT,MAMMOUSE,,,Mammography 2015,US,United States,,US,BRFSS,Health Outcomes,59,Mental health not good for >=14 days among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,11.6,11.4,11.8,,,308745538,,HLTHOUT,MHLTH,,,Mental Health 2015,US,United States,,US,BRFSS,Health Outcomes,59,Mental health not good for >=14 days among adults aged >=18 Years,%,CrdPrv,Crude prevalence,11.4,11.3,11.6,,,308745538,,HLTHOUT,MHLTH,,,Mental Health 2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Obesity among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,28.7,28.4,29.0,,,308745538,,UNHBEH,OBESITY,,,Obesity 2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Obesity among adults aged >=18 Years,%,CrdPrv,Crude prevalence,28.8,28.6,29.1,,,308745538,,UNHBEH,OBESITY,,,Obesity 2014,US,United States,,US,BRFSS,Prevention,59,Papanicolaou smear use among adult women aged 21–65 Years,%,AgeAdjPrv,Age-adjusted prevalence,81.1,80.6,81.6,,,308745538,,PREVENT,PAPTEST,,,Pap Smear Test 2014,US,United States,,US,BRFSS,Prevention,59,Papanicolaou smear use among adult women aged 21–65 Years,%,CrdPrv,Crude prevalence,81.8,81.3,82.2,,,308745538,,PREVENT,PAPTEST,,,Pap Smear Test 2015,US,United States,,US,BRFSS,Health Outcomes,59,Physical health not good for >=14 days among adults aged >=18 Years,%,CrdPrv,Crude prevalence,12.0,11.8,12.2,,,308745538,,HLTHOUT,PHLTH,,,Physical Health 2014,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Sleeping less than 7 hours among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,35.1,34.8,35.5,,,308745538,,UNHBEH,SLEEP,,,Sleep < 7 hours 2014,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Sleeping less than 7 hours among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.8,34.5,35.1,,,308745538,,UNHBEH,SLEEP,,,Sleep < 7 hours 2015,US,United States,,US,BRFSS,Health Outcomes,59,Stroke among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,2.8,2.7,2.8,,,308745538,,HLTHOUT,STROKE,,,Stroke 2015,US,United States,,US,BRFSS,Health Outcomes,59,Stroke among adults aged >=18 Years,%,CrdPrv,Crude prevalence,3.0,3.0,3.1,,,308745538,,HLTHOUT,STROKE,,,Stroke 2014,US,United States,,US,BRFSS,Health Outcomes,59,All teeth lost among adults aged >=65 Years,%,AgeAdjPrv,Age-adjusted prevalence,15.4,15.0,15.8,,,308745538,,HLTHOUT,TEETHLOST,,,Teeth Loss 2014,US,United States,,US,BRFSS,Health Outcomes,59,All teeth lost among adults aged >=65 Years,%,CrdPrv,Crude prevalence,14.9,14.6,15.3,,,308745538,,HLTHOUT,TEETHLOST,,,Teeth Loss 2015,AL,Alabama,Birmingham,City,BRFSS,Prevention,0107000,Current lack of health insurance among adults aged 18–64 Years,%,AgeAdjPrv,Age-adjusted prevalence,19.8,19.5,20.2,,,212237,"(33.5275663773, -86.7988174678)",PREVENT,ACCESS2,0107000,,Health Insurance 2015,AL,Alabama,Birmingham,City,BRFSS,Prevention,0107000,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,19.6,19.2,20.0,,,212237,"(33.5275663773, -86.7988174678)",PREVENT,ACCESS2,0107000,,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000100,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,23.9,21.2,27.2,,,3042,"(33.5794328326, -86.7228323926)",PREVENT,ACCESS2,0107000,01073000100,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000300,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,28.8,25.4,32.4,,,2735,"(33.5428208686, -86.752433978)",PREVENT,ACCESS2,0107000,01073000300,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000400,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.1,22.6,29.9,,,3338,"(33.5632449633, -86.7640474064)",PREVENT,ACCESS2,0107000,01073000400,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,28.1,24.6,32.0,,,2864,"(33.5442404594, -86.7749130719)",PREVENT,ACCESS2,0107000,01073000500,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000700,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,31.8,27.0,36.7,,,2577,"(33.5525406139, -86.8016893706)",PREVENT,ACCESS2,0107000,01073000700,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000800,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,22.4,19.1,26.1,,,3859,"(33.549697789, -86.8330944744)",PREVENT,ACCESS2,0107000,01073000800,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001100,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,16.8,13.7,20.5,,,5354,"(33.5429143325, -86.8756782852)",PREVENT,ACCESS2,0107000,01073001100,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,24.6,22.2,27.2,,,2876,"(33.5278767706, -86.8604161686)",PREVENT,ACCESS2,0107000,01073001200,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001400,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,22.0,18.4,25.7,,,2181,"(33.5261497258, -86.835146606)",PREVENT,ACCESS2,0107000,01073001400,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.3,23.1,29.4,,,3189,"(33.5298727342, -86.8197191685)",PREVENT,ACCESS2,0107000,01073001500,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001600,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.8,22.9,30.8,,,3390,"(33.5372993423, -86.8036590482)",PREVENT,ACCESS2,0107000,01073001600,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001902,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.9,24.1,29.8,,,1894,"(33.5532050997, -86.7429801603)",PREVENT,ACCESS2,0107000,01073001902,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002000,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,24.4,20.8,28.2,,,3885,"(33.5541574106, -86.7167229915)",PREVENT,ACCESS2,0107000,01073002000,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002100,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.5,18.1,25.0,,,3186,"(33.5650015942, -86.7101024766)",PREVENT,ACCESS2,0107000,01073002100,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.7,18.7,25.0,,,2630,"(33.5521301205, -86.7276759508)",PREVENT,ACCESS2,0107000,01073002200,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002303,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,27.0,23.7,30.7,,,2936,"(33.5383153207, -86.7270445428)",PREVENT,ACCESS2,0107000,01073002303,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002305,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,9.9,8.2,12.1,,,2952,"(33.5333415976, -86.7479566084)",PREVENT,ACCESS2,0107000,01073002305,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002306,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,9.5,8.1,11.2,,,3257,"(33.5213873564, -86.7490031289)",PREVENT,ACCESS2,0107000,01073002306,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002400,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,25.1,22.4,27.8,,,3629,"(33.5260748309, -86.7830315488)",PREVENT,ACCESS2,0107000,01073002400,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002700,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,20.7,16.8,24.9,,,3992,"(33.5176008419, -86.8106887452)",PREVENT,ACCESS2,0107000,01073002700,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002900,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,25.7,21.5,29.9,,,2064,"(33.5132498864, -86.83004749)",PREVENT,ACCESS2,0107000,01073002900,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003001,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.4,15.3,22.4,,,3779,"(33.5125158094, -86.8577164946)",PREVENT,ACCESS2,0107000,01073003001,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003002,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.3,21.7,31.3,,,2203,"(33.512258109, -86.8441439907)",PREVENT,ACCESS2,0107000,01073003002,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003100,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,23.2,20.2,26.7,,,3637,"(33.5059655756, -86.8745506086)",PREVENT,ACCESS2,0107000,01073003100,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,28.7,25.0,32.8,,,931,"(33.5094018502, -86.8859081961)",PREVENT,ACCESS2,0107000,01073003200,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003300,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,22.2,19.1,25.7,,,947,"(33.5171261108, -86.8913819749)",PREVENT,ACCESS2,0107000,01073003300,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003400,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.8,23.0,30.9,,,2477,"(33.5052229234, -86.9014844656)",PREVENT,ACCESS2,0107000,01073003400,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,22.3,19.1,25.7,,,2780,"(33.5065714011, -86.9195910063)",PREVENT,ACCESS2,0107000,01073003500,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003600,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,17.0,14.5,19.6,,,4683,"(33.48476397, -86.8981392947)",PREVENT,ACCESS2,0107000,01073003600,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003700,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.6,19.2,23.9,,,5063,"(33.4969018589, -86.8907729426)",PREVENT,ACCESS2,0107000,01073003700,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003802,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,19.0,16.7,21.6,,,5409,"(33.4785707794, -86.890000907)",PREVENT,ACCESS2,0107000,01073003802,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003803,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,20.9,17.7,24.2,,,4199,"(33.485945214, -86.869692186)",PREVENT,ACCESS2,0107000,01073003803,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003900,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,29.9,26.9,33.0,,,1783,"(33.4989959327, -86.8647600038)",PREVENT,ACCESS2,0107000,01073003900,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004000,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,25.8,21.4,30.3,,,3772,"(33.4953246015, -86.8516232073)",PREVENT,ACCESS2,0107000,01073004000,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,23.4,20.8,26.1,,,2341,"(33.5007439361, -86.8270720379)",PREVENT,ACCESS2,0107000,01073004200,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,22.7,19.3,27.4,,,5003,"(33.5041857556, -86.8033798346)",PREVENT,ACCESS2,0107000,01073004500,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004701,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,10.6,8.6,13.4,,,3480,"(33.5075242148, -86.7836675838)",PREVENT,ACCESS2,0107000,01073004701,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004702,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,7.1,6.1,8.7,,,2944,"(33.5119902661, -86.7694550989)",PREVENT,ACCESS2,0107000,01073004702,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004800,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,8.7,7.3,10.3,,,1861,"(33.4989064008, -86.78269914)",PREVENT,ACCESS2,0107000,01073004800,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004901,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,11.0,9.1,13.2,,,1167,"(33.4971595645, -86.7917440668)",PREVENT,ACCESS2,0107000,01073004901,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004902,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,15.2,12.5,18.5,,,3146,"(33.4935824043, -86.8009294603)",PREVENT,ACCESS2,0107000,01073004902,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005000,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,17.9,15.4,20.7,,,3482,"(33.4866689795, -86.8173262831)",PREVENT,ACCESS2,0107000,01073005000,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005101,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,30.5,26.5,34.4,,,1507,"(33.4945909008, -86.834763936)",PREVENT,ACCESS2,0107000,01073005101,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005103,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,17.5,14.4,20.7,,,2587,"(33.485714885, -86.8327817467)",PREVENT,ACCESS2,0107000,01073005103,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005104,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,24.9,21.3,28.9,,,2881,"(33.4749941816, -86.8335421747)",PREVENT,ACCESS2,0107000,01073005104,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,20.2,16.4,24.2,,,3740,"(33.4806708775, -86.8508671514)",PREVENT,ACCESS2,0107000,01073005200,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005302,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,12.8,10.9,15.1,,,3463,"(33.5766456449, -86.6965590316)",PREVENT,ACCESS2,0107000,01073005302,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.5,22.9,30.7,,,1824,"(33.5670293898, -86.8005567213)",PREVENT,ACCESS2,0107000,01073005500,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005600,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,12.3,10.0,15.0,,,4367,"(33.5200981234, -86.7272063198)",PREVENT,ACCESS2,0107000,01073005600,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005701,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.9,15.7,22.3,,,2372,"(33.4629543329, -86.8898406628)",PREVENT,ACCESS2,0107000,01073005701,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005702,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,19.8,16.4,23.3,,,3413,"(33.4698691385, -86.874290602)",PREVENT,ACCESS2,0107000,01073005702,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005800,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,19.3,16.4,22.3,,,4216,"(33.479062325, -86.8128063089)",PREVENT,ACCESS2,0107000,01073005800,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005903,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,15.9,13.9,18.0,,,4933,"(33.597162309, -86.6766736351)",PREVENT,ACCESS2,0107000,01073005903,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005905,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.4,18.2,24.7,,,5039,"(33.603988456, -86.7008123418)",PREVENT,ACCESS2,0107000,01073005905,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005907,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,12.5,10.3,14.9,,,1975,"(33.6142861501, -86.6691996417)",PREVENT,ACCESS2,0107000,01073005907,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005908,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,20.9,18.1,23.7,,,1621,"(33.6182924432, -86.6801483084)",PREVENT,ACCESS2,0107000,01073005908,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005909,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,14.4,11.8,17.5,,,2524,"(33.611811773, -86.7214221514)",PREVENT,ACCESS2,0107000,01073005909,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005910,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,14.7,12.6,17.1,,,4612,"(33.6299017499, -86.7194311229)",PREVENT,ACCESS2,0107000,01073005910,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.8,18.2,25.9,,,114,"(33.4363786806, -86.9128923072)",PREVENT,ACCESS2,0107000,01073010500,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010701,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.5,14.4,23.6,,,74,"(33.473886155, -86.8146487762)",PREVENT,ACCESS2,0107000,01073010701,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010706,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,13.5,11.0,16.3,,,1528,"(33.4443709442, -86.8405352645)",PREVENT,ACCESS2,0107000,01073010706,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010801,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,5.2,4.4,6.3,,,168,"(33.514097853, -86.7466971362)",PREVENT,ACCESS2,0107000,01073010801,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010802,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,5.0,3.9,6.5,,,172,"(33.4885493477, -86.780843024)",PREVENT,ACCESS2,0107000,01073010802,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010803,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,11.3,9.0,14.0,,,514,"(33.5229093892, -86.7102618642)",PREVENT,ACCESS2,0107000,01073010803,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010805,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,7.3,5.5,9.9,,,86,"(33.4952792472, -86.6987184974)",PREVENT,ACCESS2,0107000,01073010805,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011104,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,13.6,11.4,16.1,,,1688,"(33.6159436433, -86.6557892507)",PREVENT,ACCESS2,0107000,01073011104,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011107,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,42,"(33.5804845249, -86.6301110961)",PREVENT,ACCESS2,0107000,01073011107,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011108,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,9,"(33.6050742596, -86.6316729386)",PREVENT,ACCESS2,0107000,01073011108,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011207,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,17.7,15.1,20.6,,,815,"(33.6718848706, -86.6772510465)",PREVENT,ACCESS2,0107000,01073011207,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011209,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,20.2,17.2,24.2,,,1062,"(33.6557189992, -86.7050698349)",PREVENT,ACCESS2,0107000,01073011209,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011210,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.5,17.0,26.7,,,1385,"(33.6641893755, -86.6956170686)",PREVENT,ACCESS2,0107000,01073011210,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011803,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.1,15.4,21.3,,,928,"(33.6252575173, -86.6998610409)",PREVENT,ACCESS2,0107000,01073011803,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011804,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.3,15.2,21.9,,,1157,"(33.6474916175, -86.7042974424)",PREVENT,ACCESS2,0107000,01073011804,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011901,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,6,"(33.6355414646, -86.736946691)",PREVENT,ACCESS2,0107000,01073011901,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011904,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,14.4,12.1,16.8,,,1915,"(33.593140185, -86.7357930541)",PREVENT,ACCESS2,0107000,01073011904,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012001,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,14.5,12.5,16.7,,,304,"(33.5919486112, -86.864384068)",PREVENT,ACCESS2,0107000,01073012001,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012002,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,44,"(33.5859234197, -86.8357007188)",PREVENT,ACCESS2,0107000,01073012002,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,23,"(33.5967441904, -87.0879396857)",PREVENT,ACCESS2,0107000,01073012200,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012302,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,12.7,10.6,15.2,,,144,"(33.5542816352, -87.0544691416)",PREVENT,ACCESS2,0107000,01073012302,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012305,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,12.5,10.2,15.1,,,403,"(33.4695358064, -86.96831739)",PREVENT,ACCESS2,0107000,01073012305,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012401,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,11.4,8.9,14.2,,,1066,"(33.5571951048, -86.8777935049)",PREVENT,ACCESS2,0107000,01073012401,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012402,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,16.7,14.6,19.0,,,418,"(33.549984172, -86.8994543327)",PREVENT,ACCESS2,0107000,01073012402,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.0,17.6,24.4,,,410,"(33.529160486, -86.9346476445)",PREVENT,ACCESS2,0107000,01073012500,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012602,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,17.5,15.7,19.6,,,371,"(33.570164674, -86.666430582)",PREVENT,ACCESS2,0107000,01073012602,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012701,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,44,"(33.5484078071, -86.6323773455)",PREVENT,ACCESS2,0107000,01073012701,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012703,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,11.3,8.6,14.9,,,498,"(33.4681180943, -86.6671888213)",PREVENT,ACCESS2,0107000,01073012703,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012704,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,8.9,6.8,11.5,,,113,"(33.5034195908, -86.6180983403)",PREVENT,ACCESS2,0107000,01073012704,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012803,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,8.6,6.7,11.2,,,1261,"(33.4439425865, -86.7212936938)",PREVENT,ACCESS2,0107000,01073012803,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012910,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,9,"(33.4345805042, -86.7263292059)",PREVENT,ACCESS2,0107000,01073012910,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073013002,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.3,17.1,25.6,,,1514,"(33.46604181, -86.8567287797)",PREVENT,ACCESS2,0107000,01073013002,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073013100,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.8,18.8,24.9,,,4424,"(33.44880214, -86.8878401579)",PREVENT,ACCESS2,0107000,01073013100,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073013300,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,23.5,19.5,27.5,,,1782,"(33.4396443569, -86.9248768665)",PREVENT,ACCESS2,0107000,01073013300,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073013901,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.0,14.8,21.7,,,952,"(33.4729384906, -86.9547337648)",PREVENT,ACCESS2,0107000,01073013901,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073014302,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,10.0,8.3,12.1,,,2778,"(33.4244658829, -86.8841474217)",PREVENT,ACCESS2,0107000,01073014302,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073014413,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,7.6,5.9,9.8,,,397,"(33.4226593117, -86.8508620751)",PREVENT,ACCESS2,0107000,01073014413,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01117030213,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,9.3,7.7,11.4,,,644,"(33.4395975193, -86.6735959359)",PREVENT,ACCESS2,0107000,01117030213,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01117030217,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,16,"(33.4556995763, -86.6520208639)",PREVENT,ACCESS2,0107000,01117030217,Health Insurance 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01117030303,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,9.9,8.1,12.0,,,968,"(33.4258661239, -86.713819356)",PREVENT,ACCESS2,0107000,01117030303,Health Insurance 2015,AL,Alabama,Birmingham,City,BRFSS,Health Outcomes,0107000,Arthritis among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,31.0,30.8,31.1,,,212237,"(33.5275663773, -86.7988174678)",HLTHOUT,ARTHRITIS,0107000,,Arthritis 2015,AL,Alabama,Birmingham,City,BRFSS,Health Outcomes,0107000,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,30.9,30.8,31.1,,,212237,"(33.5275663773, -86.7988174678)",HLTHOUT,ARTHRITIS,0107000,,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000100,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.5,31.5,33.6,,,3042,"(33.5794328326, -86.7228323926)",HLTHOUT,ARTHRITIS,0107000,01073000100,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000300,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.3,30.0,32.4,,,2735,"(33.5428208686, -86.752433978)",HLTHOUT,ARTHRITIS,0107000,01073000300,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000400,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.6,33.2,35.9,,,3338,"(33.5632449633, -86.7640474064)",HLTHOUT,ARTHRITIS,0107000,01073000400,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.8,36.3,39.2,,,2864,"(33.5442404594, -86.7749130719)",HLTHOUT,ARTHRITIS,0107000,01073000500,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000700,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,38.5,37.1,39.9,,,2577,"(33.5525406139, -86.8016893706)",HLTHOUT,ARTHRITIS,0107000,01073000700,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000800,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,38.0,36.5,39.3,,,3859,"(33.549697789, -86.8330944744)",HLTHOUT,ARTHRITIS,0107000,01073000800,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001100,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.0,32.4,35.5,,,5354,"(33.5429143325, -86.8756782852)",HLTHOUT,ARTHRITIS,0107000,01073001100,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.5,35.4,37.6,,,2876,"(33.5278767706, -86.8604161686)",HLTHOUT,ARTHRITIS,0107000,01073001200,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001400,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.1,35.6,38.6,,,2181,"(33.5261497258, -86.835146606)",HLTHOUT,ARTHRITIS,0107000,01073001400,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,35.2,34.0,36.4,,,3189,"(33.5298727342, -86.8197191685)",HLTHOUT,ARTHRITIS,0107000,01073001500,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001600,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,39.9,38.4,41.3,,,3390,"(33.5372993423, -86.8036590482)",HLTHOUT,ARTHRITIS,0107000,01073001600,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001902,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,35.1,34.0,36.1,,,1894,"(33.5532050997, -86.7429801603)",HLTHOUT,ARTHRITIS,0107000,01073001902,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002000,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.3,34.9,37.7,,,3885,"(33.5541574106, -86.7167229915)",HLTHOUT,ARTHRITIS,0107000,01073002000,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002100,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,33.1,31.8,34.3,,,3186,"(33.5650015942, -86.7101024766)",HLTHOUT,ARTHRITIS,0107000,01073002100,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.4,31.2,33.6,,,2630,"(33.5521301205, -86.7276759508)",HLTHOUT,ARTHRITIS,0107000,01073002200,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002303,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,33.4,32.2,34.6,,,2936,"(33.5383153207, -86.7270445428)",HLTHOUT,ARTHRITIS,0107000,01073002303,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002305,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,22.3,21.3,23.3,,,2952,"(33.5333415976, -86.7479566084)",HLTHOUT,ARTHRITIS,0107000,01073002305,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002306,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,26.9,25.9,27.9,,,3257,"(33.5213873564, -86.7490031289)",HLTHOUT,ARTHRITIS,0107000,01073002306,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002400,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.0,30.0,31.9,,,3629,"(33.5260748309, -86.7830315488)",HLTHOUT,ARTHRITIS,0107000,01073002400,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002700,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,27.2,25.9,28.5,,,3992,"(33.5176008419, -86.8106887452)",HLTHOUT,ARTHRITIS,0107000,01073002700,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002900,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,38.7,37.0,40.3,,,2064,"(33.5132498864, -86.83004749)",HLTHOUT,ARTHRITIS,0107000,01073002900,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003001,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,24.3,23.6,25.0,,,3779,"(33.5125158094, -86.8577164946)",HLTHOUT,ARTHRITIS,0107000,01073003001,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003002,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,40.9,39.1,42.7,,,2203,"(33.512258109, -86.8441439907)",HLTHOUT,ARTHRITIS,0107000,01073003002,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003100,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.1,32.7,35.4,,,3637,"(33.5059655756, -86.8745506086)",HLTHOUT,ARTHRITIS,0107000,01073003100,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,39.0,37.6,40.3,,,931,"(33.5094018502, -86.8859081961)",HLTHOUT,ARTHRITIS,0107000,01073003200,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003300,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,38.6,37.3,39.9,,,947,"(33.5171261108, -86.8913819749)",HLTHOUT,ARTHRITIS,0107000,01073003300,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003400,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.3,34.9,37.7,,,2477,"(33.5052229234, -86.9014844656)",HLTHOUT,ARTHRITIS,0107000,01073003400,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.8,31.5,34.0,,,2780,"(33.5065714011, -86.9195910063)",HLTHOUT,ARTHRITIS,0107000,01073003500,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003600,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,33.4,32.1,34.7,,,4683,"(33.48476397, -86.8981392947)",HLTHOUT,ARTHRITIS,0107000,01073003600,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003700,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.2,30.1,32.1,,,5063,"(33.4969018589, -86.8907729426)",HLTHOUT,ARTHRITIS,0107000,01073003700,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003802,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.1,31.0,33.2,,,5409,"(33.4785707794, -86.890000907)",HLTHOUT,ARTHRITIS,0107000,01073003802,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003803,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.0,34.5,37.3,,,4199,"(33.485945214, -86.869692186)",HLTHOUT,ARTHRITIS,0107000,01073003803,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003900,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.9,31.8,33.9,,,1783,"(33.4989959327, -86.8647600038)",HLTHOUT,ARTHRITIS,0107000,01073003900,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004000,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.8,36.4,39.3,,,3772,"(33.4953246015, -86.8516232073)",HLTHOUT,ARTHRITIS,0107000,01073004000,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.6,35.5,37.7,,,2341,"(33.5007439361, -86.8270720379)",HLTHOUT,ARTHRITIS,0107000,01073004200,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,15.1,14.4,15.8,,,5003,"(33.5041857556, -86.8033798346)",HLTHOUT,ARTHRITIS,0107000,01073004500,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004701,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,23.7,22.5,24.9,,,3480,"(33.5075242148, -86.7836675838)",HLTHOUT,ARTHRITIS,0107000,01073004701,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004702,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,27.0,25.9,28.1,,,2944,"(33.5119902661, -86.7694550989)",HLTHOUT,ARTHRITIS,0107000,01073004702,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004800,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,30.1,29.0,31.2,,,1861,"(33.4989064008, -86.78269914)",HLTHOUT,ARTHRITIS,0107000,01073004800,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004901,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,22.1,21.2,23.0,,,1167,"(33.4971595645, -86.7917440668)",HLTHOUT,ARTHRITIS,0107000,01073004901,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004902,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,18.4,17.5,19.4,,,3146,"(33.4935824043, -86.8009294603)",HLTHOUT,ARTHRITIS,0107000,01073004902,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005000,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,19.6,18.7,20.4,,,3482,"(33.4866689795, -86.8173262831)",HLTHOUT,ARTHRITIS,0107000,01073005000,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005101,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.6,35.3,37.8,,,1507,"(33.4945909008, -86.834763936)",HLTHOUT,ARTHRITIS,0107000,01073005101,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005103,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,40.1,38.6,41.7,,,2587,"(33.485714885, -86.8327817467)",HLTHOUT,ARTHRITIS,0107000,01073005103,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005104,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,18.9,18.0,19.8,,,2881,"(33.4749941816, -86.8335421747)",HLTHOUT,ARTHRITIS,0107000,01073005104,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.9,36.1,39.7,,,3740,"(33.4806708775, -86.8508671514)",HLTHOUT,ARTHRITIS,0107000,01073005200,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005302,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,33.2,31.8,34.5,,,3463,"(33.5766456449, -86.6965590316)",HLTHOUT,ARTHRITIS,0107000,01073005302,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.7,35.4,37.9,,,1824,"(33.5670293898, -86.8005567213)",HLTHOUT,ARTHRITIS,0107000,01073005500,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005600,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.8,30.3,33.2,,,4367,"(33.5200981234, -86.7272063198)",HLTHOUT,ARTHRITIS,0107000,01073005600,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005701,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,35.8,34.1,37.3,,,2372,"(33.4629543329, -86.8898406628)",HLTHOUT,ARTHRITIS,0107000,01073005701,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005702,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.8,36.0,39.3,,,3413,"(33.4698691385, -86.874290602)",HLTHOUT,ARTHRITIS,0107000,01073005702,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005800,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,18.4,17.7,19.1,,,4216,"(33.479062325, -86.8128063089)",HLTHOUT,ARTHRITIS,0107000,01073005800,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005903,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.2,31.1,33.3,,,4933,"(33.597162309, -86.6766736351)",HLTHOUT,ARTHRITIS,0107000,01073005903,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005905,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.2,32.9,35.4,,,5039,"(33.603988456, -86.7008123418)",HLTHOUT,ARTHRITIS,0107000,01073005905,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005907,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,30.1,28.9,31.3,,,1975,"(33.6142861501, -86.6691996417)",HLTHOUT,ARTHRITIS,0107000,01073005907,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005908,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.5,31.5,33.5,,,1621,"(33.6182924432, -86.6801483084)",HLTHOUT,ARTHRITIS,0107000,01073005908,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005909,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,28.0,26.5,29.4,,,2524,"(33.611811773, -86.7214221514)",HLTHOUT,ARTHRITIS,0107000,01073005909,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005910,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,28.0,26.8,29.1,,,4612,"(33.6299017499, -86.7194311229)",HLTHOUT,ARTHRITIS,0107000,01073005910,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,41.3,39.4,43.1,,,114,"(33.4363786806, -86.9128923072)",HLTHOUT,ARTHRITIS,0107000,01073010500,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010701,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,15.1,14.0,16.3,,,74,"(33.473886155, -86.8146487762)",HLTHOUT,ARTHRITIS,0107000,01073010701,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010706,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,15.3,14.6,16.0,,,1528,"(33.4443709442, -86.8405352645)",HLTHOUT,ARTHRITIS,0107000,01073010706,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010801,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,24.9,23.9,26.2,,,168,"(33.514097853, -86.7466971362)",HLTHOUT,ARTHRITIS,0107000,01073010801,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010802,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,33.2,31.7,35.0,,,172,"(33.4885493477, -86.780843024)",HLTHOUT,ARTHRITIS,0107000,01073010802,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010803,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,23.8,22.6,25.0,,,514,"(33.5229093892, -86.7102618642)",HLTHOUT,ARTHRITIS,0107000,01073010803,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010805,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.0,30.1,34.0,,,86,"(33.4952792472, -86.6987184974)",HLTHOUT,ARTHRITIS,0107000,01073010805,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011104,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,29.8,28.5,31.1,,,1688,"(33.6159436433, -86.6557892507)",HLTHOUT,ARTHRITIS,0107000,01073011104,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011107,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,42,"(33.5804845249, -86.6301110961)",HLTHOUT,ARTHRITIS,0107000,01073011107,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011108,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,9,"(33.6050742596, -86.6316729386)",HLTHOUT,ARTHRITIS,0107000,01073011108,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011207,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,25.3,24.3,26.2,,,815,"(33.6718848706, -86.6772510465)",HLTHOUT,ARTHRITIS,0107000,01073011207,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011209,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,27.2,26.1,28.3,,,1062,"(33.6557189992, -86.7050698349)",HLTHOUT,ARTHRITIS,0107000,01073011209,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011210,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,23.8,22.3,25.3,,,1385,"(33.6641893755, -86.6956170686)",HLTHOUT,ARTHRITIS,0107000,01073011210,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011803,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,28.2,27.0,29.4,,,928,"(33.6252575173, -86.6998610409)",HLTHOUT,ARTHRITIS,0107000,01073011803,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011804,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,25.8,24.6,27.0,,,1157,"(33.6474916175, -86.7042974424)",HLTHOUT,ARTHRITIS,0107000,01073011804,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011901,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,6,"(33.6355414646, -86.736946691)",HLTHOUT,ARTHRITIS,0107000,01073011901,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011904,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.8,33.3,36.3,,,1915,"(33.593140185, -86.7357930541)",HLTHOUT,ARTHRITIS,0107000,01073011904,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012001,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,44.8,42.9,46.6,,,304,"(33.5919486112, -86.864384068)",HLTHOUT,ARTHRITIS,0107000,01073012001,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012002,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,44,"(33.5859234197, -86.8357007188)",HLTHOUT,ARTHRITIS,0107000,01073012002,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,23,"(33.5967441904, -87.0879396857)",HLTHOUT,ARTHRITIS,0107000,01073012200,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012302,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,26.3,25.2,27.5,,,144,"(33.5542816352, -87.0544691416)",HLTHOUT,ARTHRITIS,0107000,01073012302,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012305,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,30.5,28.6,32.2,,,403,"(33.4695358064, -86.96831739)",HLTHOUT,ARTHRITIS,0107000,01073012305,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012401,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,27.4,25.6,29.4,,,1066,"(33.5571951048, -86.8777935049)",HLTHOUT,ARTHRITIS,0107000,01073012401,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012402,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.9,30.8,33.0,,,418,"(33.549984172, -86.8994543327)",HLTHOUT,ARTHRITIS,0107000,01073012402,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.9,36.5,39.4,,,410,"(33.529160486, -86.9346476445)",HLTHOUT,ARTHRITIS,0107000,01073012500,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012602,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,35.4,34.5,36.3,,,371,"(33.570164674, -86.666430582)",HLTHOUT,ARTHRITIS,0107000,01073012602,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012701,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,44,"(33.5484078071, -86.6323773455)",HLTHOUT,ARTHRITIS,0107000,01073012701,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012703,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,14.8,13.8,15.9,,,498,"(33.4681180943, -86.6671888213)",HLTHOUT,ARTHRITIS,0107000,01073012703,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012704,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,27.0,25.2,29.0,,,113,"(33.5034195908, -86.6180983403)",HLTHOUT,ARTHRITIS,0107000,01073012704,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012803,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,11.9,11.1,12.7,,,1261,"(33.4439425865, -86.7212936938)",HLTHOUT,ARTHRITIS,0107000,01073012803,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012910,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,9,"(33.4345805042, -86.7263292059)",HLTHOUT,ARTHRITIS,0107000,01073012910,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073013002,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,41.0,39.1,42.9,,,1514,"(33.46604181, -86.8567287797)",HLTHOUT,ARTHRITIS,0107000,01073013002,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073013100,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,38.7,37.5,39.9,,,4424,"(33.44880214, -86.8878401579)",HLTHOUT,ARTHRITIS,0107000,01073013100,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073013300,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,39.2,37.6,40.7,,,1782,"(33.4396443569, -86.9248768665)",HLTHOUT,ARTHRITIS,0107000,01073013300,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073013901,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,35.0,33.4,36.6,,,952,"(33.4729384906, -86.9547337648)",HLTHOUT,ARTHRITIS,0107000,01073013901,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073014302,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,19.0,18.1,19.8,,,2778,"(33.4244658829, -86.8841474217)",HLTHOUT,ARTHRITIS,0107000,01073014302,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073014413,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,17.7,16.9,18.6,,,397,"(33.4226593117, -86.8508620751)",HLTHOUT,ARTHRITIS,0107000,01073014413,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01117030213,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,20.3,19.1,21.5,,,644,"(33.4395975193, -86.6735959359)",HLTHOUT,ARTHRITIS,0107000,01117030213,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01117030217,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,16,"(33.4556995763, -86.6520208639)",HLTHOUT,ARTHRITIS,0107000,01117030217,Arthritis 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01117030303,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,12.8,12.1,13.6,,,968,"(33.4258661239, -86.713819356)",HLTHOUT,ARTHRITIS,0107000,01117030303,Arthritis 2015,AL,Alabama,Birmingham,City,BRFSS,Unhealthy Behaviors,0107000,Binge drinking among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,11.2,11.1,11.3,,,212237,"(33.5275663773, -86.7988174678)",UNHBEH,BINGE,0107000,,Binge Drinking 2015,AL,Alabama,Birmingham,City,BRFSS,Unhealthy Behaviors,0107000,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,11.3,11.3,11.4,,,212237,"(33.5275663773, -86.7988174678)",UNHBEH,BINGE,0107000,,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000100,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.1,9.7,10.5,,,3042,"(33.5794328326, -86.7228323926)",UNHBEH,BINGE,0107000,01073000100,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000300,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.8,10.3,11.2,,,2735,"(33.5428208686, -86.752433978)",UNHBEH,BINGE,0107000,01073000300,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000400,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.5,9.0,10.0,,,3338,"(33.5632449633, -86.7640474064)",UNHBEH,BINGE,0107000,01073000400,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000500,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.6,8.1,9.0,,,2864,"(33.5442404594, -86.7749130719)",UNHBEH,BINGE,0107000,01073000500,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000700,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,7.4,6.9,7.9,,,2577,"(33.5525406139, -86.8016893706)",UNHBEH,BINGE,0107000,01073000700,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000800,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.9,8.5,9.3,,,3859,"(33.549697789, -86.8330944744)",UNHBEH,BINGE,0107000,01073000800,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001100,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.6,9.2,10.1,,,5354,"(33.5429143325, -86.8756782852)",UNHBEH,BINGE,0107000,01073001100,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001200,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.4,9.1,9.7,,,2876,"(33.5278767706, -86.8604161686)",UNHBEH,BINGE,0107000,01073001200,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001400,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.9,8.5,9.3,,,2181,"(33.5261497258, -86.835146606)",UNHBEH,BINGE,0107000,01073001400,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001500,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.4,9.1,9.8,,,3189,"(33.5298727342, -86.8197191685)",UNHBEH,BINGE,0107000,01073001500,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001600,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.2,7.7,8.6,,,3390,"(33.5372993423, -86.8036590482)",UNHBEH,BINGE,0107000,01073001600,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001902,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.3,8.9,9.8,,,1894,"(33.5532050997, -86.7429801603)",UNHBEH,BINGE,0107000,01073001902,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002000,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.1,8.7,9.6,,,3885,"(33.5541574106, -86.7167229915)",UNHBEH,BINGE,0107000,01073002000,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002100,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.0,9.6,10.6,,,3186,"(33.5650015942, -86.7101024766)",UNHBEH,BINGE,0107000,01073002100,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002200,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.1,9.7,10.6,,,2630,"(33.5521301205, -86.7276759508)",UNHBEH,BINGE,0107000,01073002200,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002303,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.9,8.5,9.4,,,2936,"(33.5383153207, -86.7270445428)",UNHBEH,BINGE,0107000,01073002303,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002305,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.3,15.8,16.7,,,2952,"(33.5333415976, -86.7479566084)",UNHBEH,BINGE,0107000,01073002305,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002306,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,15.6,15.2,16.1,,,3257,"(33.5213873564, -86.7490031289)",UNHBEH,BINGE,0107000,01073002306,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002400,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,11.1,10.8,11.5,,,3629,"(33.5260748309, -86.7830315488)",UNHBEH,BINGE,0107000,01073002400,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002700,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,13.6,13.0,14.2,,,3992,"(33.5176008419, -86.8106887452)",UNHBEH,BINGE,0107000,01073002700,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002900,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.3,7.8,8.8,,,2064,"(33.5132498864, -86.83004749)",UNHBEH,BINGE,0107000,01073002900,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003001,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,14.3,13.3,15.3,,,3779,"(33.5125158094, -86.8577164946)",UNHBEH,BINGE,0107000,01073003001,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003002,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,7.4,7.0,7.8,,,2203,"(33.512258109, -86.8441439907)",UNHBEH,BINGE,0107000,01073003002,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003100,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.5,9.1,10.0,,,3637,"(33.5059655756, -86.8745506086)",UNHBEH,BINGE,0107000,01073003100,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003200,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,7.6,7.3,8.0,,,931,"(33.5094018502, -86.8859081961)",UNHBEH,BINGE,0107000,01073003200,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003300,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.4,8.0,8.9,,,947,"(33.5171261108, -86.8913819749)",UNHBEH,BINGE,0107000,01073003300,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002305,Obesity among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.7,30.4,33.0,,,2952,"(33.5333415976, -86.7479566084)",UNHBEH,OBESITY,0107000,01073002305,Obesity 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003400,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.8,8.3,9.3,,,2477,"(33.5052229234, -86.9014844656)",UNHBEH,BINGE,0107000,01073003400,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003500,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.0,9.5,10.5,,,2780,"(33.5065714011, -86.9195910063)",UNHBEH,BINGE,0107000,01073003500,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003600,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.9,9.4,10.3,,,4683,"(33.48476397, -86.8981392947)",UNHBEH,BINGE,0107000,01073003600,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003700,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.3,9.9,10.7,,,5063,"(33.4969018589, -86.8907729426)",UNHBEH,BINGE,0107000,01073003700,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003802,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.3,9.9,10.7,,,5409,"(33.4785707794, -86.890000907)",UNHBEH,BINGE,0107000,01073003802,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003803,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.2,8.7,9.7,,,4199,"(33.485945214, -86.869692186)",UNHBEH,BINGE,0107000,01073003803,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003900,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.5,9.1,9.8,,,1783,"(33.4989959327, -86.8647600038)",UNHBEH,BINGE,0107000,01073003900,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004000,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.5,8.0,9.0,,,3772,"(33.4953246015, -86.8516232073)",UNHBEH,BINGE,0107000,01073004000,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004200,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.1,8.8,9.4,,,2341,"(33.5007439361, -86.8270720379)",UNHBEH,BINGE,0107000,01073004200,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004500,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,13.8,12.9,14.8,,,5003,"(33.5041857556, -86.8033798346)",UNHBEH,BINGE,0107000,01073004500,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004701,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.4,15.7,17.2,,,3480,"(33.5075242148, -86.7836675838)",UNHBEH,BINGE,0107000,01073004701,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004702,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,15.3,14.9,15.7,,,2944,"(33.5119902661, -86.7694550989)",UNHBEH,BINGE,0107000,01073004702,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004800,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,14.1,13.7,14.5,,,1861,"(33.4989064008, -86.78269914)",UNHBEH,BINGE,0107000,01073004800,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004901,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,17.0,16.4,17.7,,,1167,"(33.4971595645, -86.7917440668)",UNHBEH,BINGE,0107000,01073004901,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004902,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.3,15.6,17.1,,,3146,"(33.4935824043, -86.8009294603)",UNHBEH,BINGE,0107000,01073004902,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073005000,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.1,15.6,16.7,,,3482,"(33.4866689795, -86.8173262831)",UNHBEH,BINGE,0107000,01073005000,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073005101,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,7.9,7.5,8.3,,,1507,"(33.4945909008, -86.834763936)",UNHBEH,BINGE,0107000,01073005101,Binge Drinking 2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073005103,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,7.7,7.4,8.0,,,2587,"(33.485714885, -86.8327817467)",UNHBEH,BINGE,0107000,01073005103,Binge Drinking ================================================ FILE: oss_c_sdk_test/test.h.in ================================================ #define TEST_DIR "@PROJECT_SOURCE_DIR@" ================================================ FILE: oss_c_sdk_test/test_all.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_http_io.h" #include "oss_config.h" #include "apr_env.h" #include "aos_string.h" extern CuSuite *test_oss_bucket(); extern CuSuite *test_oss_object(); extern CuSuite *test_oss_multipart(); extern CuSuite *test_oss_live(); extern CuSuite *test_oss_image(); extern CuSuite *test_oss_progress(); extern CuSuite *test_oss_callback(); extern CuSuite *test_oss_crc(); extern CuSuite *test_aos(); extern CuSuite *test_oss_proxy(); extern CuSuite *test_oss_resumable(); extern CuSuite *test_oss_select_object(); extern CuSuite *test_oss_object_tagging(); extern CuSuite *test_oss_xml(); extern CuSuite *test_oss_https(); extern CuSuite* test_oss_sign(); extern void set_test_bucket_prefix(const char*prefix); extern void clean_bucket_by_prefix(const char* prefix); static const struct testlist { const char *testname; CuSuite *(*func)(); } tests[] = { {"test_oss_bucket", test_oss_bucket}, {"test_oss_object", test_oss_object}, {"test_oss_multipart", test_oss_multipart}, {"test_oss_live", test_oss_live}, {"test_oss_image", test_oss_image}, {"test_oss_progress", test_oss_progress}, {"test_oss_callback", test_oss_callback}, {"test_oss_crc", test_oss_crc}, {"test_oss_proxy", test_oss_proxy}, {"test_oss_resumable", test_oss_resumable}, {"test_aos", test_aos}, {"test_oss_select_object", test_oss_select_object }, {"test_oss_object_tagging", test_oss_object_tagging }, {"test_oss_xml", test_oss_xml }, {"test_oss_https", test_oss_https }, {"test_oss_sign", test_oss_sign }, {"LastTest", NULL} }; static char *CFG_FILE_PATH = ""; static char BUCKET_PREIFX[64]; int has_cfg_info() { return (TEST_OSS_ENDPOINT && TEST_ACCESS_KEY_ID && TEST_ACCESS_KEY_SECRET); } void load_cfg_from_env() { char *str = NULL; apr_env_get(&str, "OSS_TEST_ENDPOINT", aos_global_pool); if (str) { TEST_OSS_ENDPOINT = str; } str = NULL; apr_env_get(&str, "OSS_TEST_REGION", aos_global_pool); if (str) { TEST_REGION = str; } str = NULL; apr_env_get(&str, "OSS_TEST_ACCESS_KEY_ID", aos_global_pool); if (str) { TEST_ACCESS_KEY_ID = str; } str = NULL; apr_env_get(&str, "OSS_TEST_ACCESS_KEY_SECRET", aos_global_pool); if (str) { TEST_ACCESS_KEY_SECRET = str; } str = NULL; apr_env_get(&str, "OSS_TEST_CALLBACK_URL", aos_global_pool); if (str) { TEST_CALLBACK_URL = str; } } void load_cfg_from_file() { apr_file_t *file; apr_status_t s; char buffer[256]; char *ptr; if (has_cfg_info()) return; s = apr_file_open(&file, CFG_FILE_PATH, APR_READ, APR_UREAD | APR_GREAD, aos_global_pool); if (s != APR_SUCCESS) return; while (apr_file_gets(buffer, 256, file) == APR_SUCCESS) { aos_string_t str; ptr = strchr(buffer, '='); if (!ptr) { continue; } if (!strncmp(buffer, "AccessKeyId", 11)) { aos_str_set(&str, ptr + 1); aos_trip_space_and_cntrl(&str); aos_unquote_str(&str); TEST_ACCESS_KEY_ID = aos_pstrdup(aos_global_pool, &str); } else if (!strncmp(buffer, "AccessKeySecret", 15)) { aos_str_set(&str, ptr + 1); aos_trip_space_and_cntrl(&str); aos_unquote_str(&str); TEST_ACCESS_KEY_SECRET = aos_pstrdup(aos_global_pool, &str); } else if (!strncmp(buffer, "Endpoint", 8)) { aos_str_set(&str, ptr + 1); aos_trip_space_and_cntrl(&str); aos_unquote_str(&str); TEST_OSS_ENDPOINT = aos_pstrdup(aos_global_pool, &str); } else if (!strncmp(buffer, "Region", 6)) { aos_str_set(&str, ptr + 1); aos_trip_space_and_cntrl(&str); aos_unquote_str(&str); TEST_REGION = aos_pstrdup(aos_global_pool, &str); } else if (!strncmp(buffer, "CallbackServer", 14)) { aos_str_set(&str, ptr + 1); aos_trip_space_and_cntrl(&str); aos_unquote_str(&str); TEST_CALLBACK_URL = aos_pstrdup(aos_global_pool, &str); } } apr_file_close(file); } int init_test_env() { /*Get from env*/ load_cfg_from_env(); /*Get from file*/ load_cfg_from_file(); /*gen bucket prefix*/ sprintf(BUCKET_PREIFX, "test-c-sdk-%"APR_TIME_T_FMT, apr_time_now()/1000); set_test_bucket_prefix(BUCKET_PREIFX); return has_cfg_info(); } void deinit_test_env() { clean_bucket_by_prefix(BUCKET_PREIFX); } int run_all_tests(int argc, char *argv[]) { int i; int exit_code; int list_provided = 0; CuSuite* suite = NULL; int j; int found; CuSuite *st = NULL; CuString *output = NULL; for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-v")) { continue; } if (!strcmp(argv[i], "-l")) { for (i = 0; tests[i].func != NULL; i++) { printf("%s\n", tests[i].testname); } exit(0); } if (!strcmp(argv[i], "-oss_cfg")) { aos_string_t str; aos_str_set(&str, argv[i + 1]); aos_strip_space(&str); CFG_FILE_PATH = aos_pstrdup(aos_global_pool, &str); i++; continue; } if (!strcmp(argv[i], "-d")) { aos_log_set_level(AOS_LOG_DEBUG); continue; } if (argv[i][0] == '-') { fprintf(stderr, "invalid option: `%s'\n", argv[i]); exit(1); } list_provided = 1; } if (!init_test_env()) { fprintf(stderr, "One of AK, SK or Endpoint is not configured.\n"); exit(1); } suite = CuSuiteNew(); if (!list_provided) { /* add everything */ for (i = 0; tests[i].func != NULL; i++) { st = tests[i].func(); CuSuiteAddSuite(suite, st); CuSuiteFree(st); } } else { /* add only the tests listed */ for (i = 1; i < argc; i++) { found = 0; if (argv[i][0] == '-') { if (!strcmp(argv[i], "-oss_cfg")) { i++; } continue; } for (j = 0; tests[j].func != NULL; j++) { if (!strcmp(argv[i], tests[j].testname)) { CuSuiteAddSuite(suite, tests[j].func()); found = 1; } } if (!found) { fprintf(stderr, "invalid test name: `%s'\n", argv[i]); exit(1); } } } output = CuStringNew(); CuSuiteRun(suite); CuSuiteSummary(suite, output); CuSuiteDetails(suite, output); printf("%s\n", output->buffer); exit_code = suite->failCount > 0 ? 1 : 0; CuSuiteFreeDeep(suite); CuStringFree(output); deinit_test_env(); return exit_code; } int main(int argc, char *argv[]) { int exit_code = -1; if (aos_http_io_initialize(NULL, 0) != AOSE_OK) { exit(1); } aos_log_set_print(aos_log_print_default); aos_log_set_format(aos_log_format_default); aos_log_set_level(AOS_LOG_OFF); exit_code = run_all_tests(argc, argv); //aos_http_io_deinitialize last aos_http_io_deinitialize(); return exit_code; } ================================================ FILE: oss_c_sdk_test/test_aos.c ================================================ #include "CuTest.h" #include "apr_portable.h" #include "apr_file_info.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_xml.h" #include "oss_util.c" #include "aos_transport.c" #include "oss_test_util.h" #include "aos_buf.h" #include "aos_http_io.h" #include "aos_fstack.h" static char test_file[1024]; void test_aos_setup(CuTest *tc) { sprintf(test_file, "%sBingWallpaper-2017-01-19.jpg", get_test_file_path()); } /* * oss_xml.c */ void test_get_xml_doc_with_empty_aos_list(CuTest *tc) { int ret; mxml_node_t *xml_node; aos_list_t bc; aos_list_init(&bc); ret = get_xmldoc(&bc, &xml_node); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); printf("test_get_xml_doc_with_empty_aos_list ok\n"); } /* * aos_list.h */ void test_aos_list_movelist_with_empty_list(CuTest *tc) { aos_list_t list; aos_list_t new_list; aos_list_init(&list); aos_list_movelist(&list, &new_list); CuAssertTrue(tc, new_list.prev == &new_list); CuAssertTrue(tc, new_list.next == &new_list); printf("test_aos_list_movelist_with_empty_list ok\n"); } /* * oss_util.c */ void test_starts_with_failed(CuTest *tc) { int ret; aos_string_t str; aos_str_set(&str, "hangzhou.city"); ret = starts_with(&str, "xixi"); CuAssertIntEquals(tc, 0, ret); printf("test_starts_with_failed ok\n"); } void test_is_valid_ip(CuTest *tc) { int ret; ret = is_valid_ip("140.205.63.8"); CuAssertIntEquals(tc, 1, ret); ret = is_valid_ip("0.0.0.0"); CuAssertIntEquals(tc, 0, ret); ret = is_valid_ip(NULL); CuAssertIntEquals(tc, 0, ret); ret = is_valid_ip(""); CuAssertIntEquals(tc, 0, ret); printf("test_is_valid_ip ok\n"); } void test_oss_config_resolve(CuTest *tc) { aos_pool_t *p; oss_config_t config; aos_http_controller_t *ctl; aos_pool_create(&p, NULL); ctl = aos_http_controller_create(p, 0); ctl->options = aos_http_request_options_create(p); config.proxy_user.data = NULL; config.proxy_passwd.data = NULL; config.proxy_host.data = NULL; oss_config_resolve(p, &config, ctl); config.proxy_host.data = "192.168.1.1"; config.proxy_host.len = strlen("192.168.1.1"); config.proxy_port = 0; oss_config_resolve(p, &config, ctl); CuAssertStrEquals(tc, "192.168.1.1", ctl->options->proxy_host); config.proxy_user.data = NULL; config.proxy_passwd.data = NULL; oss_config_resolve(p, &config, ctl); CuAssertStrEquals(tc, NULL, ctl->options->proxy_auth); config.proxy_user.data = "test"; config.proxy_user.len = 4; config.proxy_passwd.data = NULL; oss_config_resolve(p, &config, ctl); CuAssertStrEquals(tc, NULL, ctl->options->proxy_auth); config.proxy_user.data = "test"; config.proxy_user.len = 4; config.proxy_passwd.data = "test"; config.proxy_passwd.len = 4; oss_config_resolve(p, &config, ctl); CuAssertStrEquals(tc, "test:test", ctl->options->proxy_auth); aos_pool_destroy(p); printf("test_oss_config_resolve ok\n"); } void test_oss_request_options_create_with_null_pool(CuTest *tc) { oss_request_options_t *option; option = oss_request_options_create(NULL); CuAssertTrue(tc, NULL != option); aos_pool_destroy(option->pool); printf("test_oss_request_options_create_with_null_pool ok\n"); } void test_oss_get_service_uri(CuTest *tc) { aos_pool_t *p; oss_request_options_t *option; aos_http_request_t *req; aos_pool_create(&p, NULL); option = oss_request_options_create(p); req = aos_http_request_create(p); init_test_request_options(option, 0); option->config->is_cname = 0; option->config->endpoint.data = "192.168.1.1"; option->config->endpoint.len = 11; oss_get_service_uri(option, req); CuAssertStrEquals(tc, "192.168.1.1", req->host); option->config->is_cname = 1; option->config->endpoint.data = "192.168.1.1"; option->config->endpoint.len = 11; oss_get_service_uri(option, req); CuAssertStrEquals(tc, "192.168.1.1", req->host); aos_pool_destroy(p); printf("test_oss_get_service_uri ok\n"); } void test_oss_get_rtmp_uri(CuTest *tc) { aos_pool_t *p; oss_request_options_t *option; aos_http_request_t *req; aos_string_t bucketname; aos_string_t channelid; aos_pool_create(&p, NULL); option = oss_request_options_create(p); req = aos_http_request_create(p); init_test_request_options(option, 0); option->config->endpoint.data = "http://192.168.1.1"; option->config->endpoint.len = 18; bucketname.data = "test"; bucketname.len = 4; channelid.data = "test"; channelid.len = 4; oss_get_rtmp_uri(option, &bucketname, &channelid, req); CuAssertStrEquals(tc, "192.168.1.1", req->host); option->config->is_cname = 1; oss_get_rtmp_uri(option, &bucketname, &channelid, req); CuAssertStrEquals(tc, "192.168.1.1", req->host); aos_pool_destroy(p); printf("test_oss_get_rtmp_uri ok\n"); } void test_oss_write_request_body_from_file(CuTest *tc) { aos_pool_t *p; aos_string_t filename; aos_http_request_t req; int ret; aos_pool_create(&p, NULL); filename.data = ""; filename.len = 0; ret = oss_write_request_body_from_file(p, &filename, &req); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, ret); aos_pool_destroy(p); printf("test_oss_write_request_body_from_file ok\n"); } void test_oss_write_request_body_from_upload_file(CuTest *tc) { aos_pool_t *p; oss_upload_file_t upload_file; aos_http_request_t req; int ret; aos_pool_create(&p, NULL); upload_file.filename.data = ""; upload_file.filename.len = 0; upload_file.file_pos = 0; upload_file.file_last = 100; ret = oss_write_request_body_from_upload_file(p, &upload_file, &req); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, ret); aos_pool_destroy(p); printf("test_oss_write_request_body_from_upload_file ok\n"); } void test_oss_init_read_response_body_to_file(CuTest *tc) { aos_pool_t *p; aos_string_t filename; aos_http_response_t resp; int ret; aos_pool_create(&p, NULL); filename.data = ""; filename.len = 0; ret = oss_init_read_response_body_to_file(p, &filename, &resp); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, ret); aos_pool_destroy(p); printf("test_oss_init_read_response_body_to_file ok\n"); } void test_oss_create_bucket_info(CuTest *tc) { aos_pool_t *p; oss_bucket_info_t *info; aos_pool_create(&p, NULL); info = oss_create_bucket_info(p); CuAssertTrue(tc, info != NULL); aos_pool_destroy(p); printf("test_oss_create_bucket_info ok\n"); } void test_oss_get_part_size(CuTest *tc) { int64_t file_size = 49999; int64_t part_size = 2; oss_get_part_size(file_size, &part_size); CuAssertIntEquals(tc, 5, (int)part_size); printf("test_oss_get_part_size ok\n"); } void test_part_sort_cmp(CuTest *tc) { oss_upload_part_t part1; oss_upload_part_t part2; int ret; part1.part_num = 2; part2.part_num = 1; ret = part_sort_cmp(&part1, &part2); CuAssertIntEquals(tc, 1, ret); printf("test_part_sort_cmp ok\n"); } void test_set_content_type(CuTest *tc) { aos_pool_t *p; aos_table_t *headers; aos_pool_create(&p, NULL); headers = aos_table_make(p, 1); set_content_type(NULL, NULL, headers); aos_pool_destroy(p); printf("test_set_content_type ok\n"); } void test_oss_check_crc_consistent(CuTest *tc) { aos_pool_t *p; aos_table_t *headers; aos_status_t s; int ret; aos_pool_create(&p, NULL); headers = aos_table_make(p, 1); ret = oss_check_crc_consistent(0, headers, &s); CuAssertIntEquals(tc, 0, ret); aos_pool_destroy(p); printf("test_oss_check_crc_consistent ok\n"); } void test_oss_get_object_uri_with_cname(CuTest *tc) { aos_pool_t *p; oss_request_options_t *options; aos_string_t bucket; aos_string_t object; aos_http_request_t req; aos_pool_create(&p, NULL); options = oss_request_options_create(p); options->config = oss_config_create(options->pool); options->config->is_cname = 1; aos_str_set(&options->config->endpoint, "img.abc.com"); aos_str_set(&bucket, "bucket-1"); aos_str_set(&object, "key-2"); oss_get_object_uri(options, &bucket, &object, &req); CuAssertStrEquals(tc, "", req.proto); CuAssertStrEquals(tc, "key-2", req.uri); CuAssertStrEquals(tc, "img.abc.com", req.host); aos_pool_destroy(p); printf("test_oss_get_object_uri_with_cname ok\n"); } void test_oss_get_object_uri_with_ip(CuTest *tc) { aos_pool_t *p; oss_request_options_t *options; aos_string_t bucket; aos_string_t object; aos_http_request_t req; aos_pool_create(&p, NULL); options = oss_request_options_create(p); options->config = oss_config_create(options->pool); options->config->is_cname = 0; aos_str_set(&options->config->endpoint, "http://140.205.63.8"); aos_str_set(&bucket, "bucket-1"); aos_str_set(&object, "key-2"); oss_get_object_uri(options, &bucket, &object, &req); CuAssertStrEquals(tc, "http://", req.proto); CuAssertStrEquals(tc, "bucket-1/key-2", req.uri); CuAssertStrEquals(tc, "140.205.63.8", req.host); aos_pool_destroy(p); printf("test_oss_get_object_uri_with_ip ok\n"); } void test_oss_get_bucket_uri_with_ip(CuTest *tc) { aos_pool_t *p; oss_request_options_t *options; aos_string_t bucket; aos_http_request_t req; aos_pool_create(&p, NULL); options = oss_request_options_create(p); options->config = oss_config_create(options->pool); options->config->is_cname = 0; aos_str_set(&options->config->endpoint, "140.205.63.8"); aos_str_set(&bucket, "bucket-1"); oss_get_bucket_uri(options, &bucket, &req); CuAssertStrEquals(tc, "", req.proto); CuAssertStrEquals(tc, "bucket-1", req.uri); CuAssertStrEquals(tc, "140.205.63.8", req.host); CuAssertStrEquals(tc, "bucket-1", req.resource); aos_pool_destroy(p); printf("test_oss_get_bucket_uri_with_ip ok\n"); } void test_oss_get_bucket_uri_with_cname(CuTest *tc) { aos_pool_t *p; oss_request_options_t *options; aos_string_t bucket; aos_http_request_t req; aos_pool_create(&p, NULL); options = oss_request_options_create(p); options->config = oss_config_create(options->pool); options->config->is_cname = 1; aos_str_set(&options->config->endpoint, "https://img.abc.com"); aos_str_set(&bucket, "bucket-1"); oss_get_bucket_uri(options, &bucket, &req); CuAssertStrEquals(tc, "https://", req.proto); CuAssertStrEquals(tc, "bucket-1", req.uri); CuAssertStrEquals(tc, "img.abc.com", req.host); CuAssertStrEquals(tc, "bucket-1/", req.resource); aos_pool_destroy(p); printf("test_oss_get_bucket_uri_with_cname ok\n"); } void test_oss_temp_file_rename(CuTest *tc) { aos_pool_t *p; int ret; aos_status_t s; ret = oss_temp_file_rename(NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, -1, ret); aos_pool_create(&p, NULL); s.code = 400; ret = oss_temp_file_rename(&s, "test-path", NULL, p); #if defined(WIN32) CuAssertIntEquals(tc, 720002, ret); #else CuAssertIntEquals(tc, 2, ret); #endif aos_pool_destroy(p); printf("test_oss_temp_file_rename ok\n"); } void test_oss_init_select_object_read_response_body(CuTest *tc) { int ret; aos_pool_t *p; aos_http_response_t resp; aos_pool_create(&p, NULL); ret = oss_init_select_object_read_response_body(NULL, NULL); CuAssertIntEquals(tc, AOSE_OK, ret); ret = oss_init_select_object_read_response_body(p, NULL); CuAssertIntEquals(tc, AOSE_OK, ret); resp.type = BODY_IN_CALLBACK; ret = oss_init_select_object_read_response_body(p, &resp); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("test_oss_init_select_object_read_response_body ok\n"); } void test_oss_check_select_object_status(CuTest *tc) { aos_http_response_t resp; oss_check_select_object_status(NULL, NULL); oss_check_select_object_status(&resp, NULL); printf("test_oss_check_select_object_status ok\n"); } void test_oss_check_create_select_object_meta_status(CuTest *tc) { aos_http_response_t resp; oss_check_create_select_object_meta_status(NULL, NULL, NULL); oss_check_create_select_object_meta_status(&resp, NULL, NULL); printf("oss_check_create_select_object_meta_status ok\n"); } void test_oss_init_create_select_object_meta_read_response_body(CuTest *tc) { aos_http_response_t resp; aos_pool_t *p; aos_pool_create(&p, NULL); oss_init_create_select_object_meta_read_response_body(NULL, NULL); oss_init_create_select_object_meta_read_response_body(p, NULL); resp.type = BODY_IN_CALLBACK; oss_init_create_select_object_meta_read_response_body(p, &resp); aos_pool_destroy(p); printf("test_oss_init_create_select_object_meta_read_response_body ok\n"); } void test_aos_log_format_default(CuTest *tc) { /* * check is coredump */ aos_log_format_default(AOS_LOG_INFO, "/tmp/a", 10, "fun1", "%d-%d", 1, 2); printf("test_aos_log_format_default ok\n"); } void test_aos_log_print_default_with_null_file(CuTest *tc) { /* * check is coredump */ apr_file_t *thefile = NULL; aos_pool_t *p; aos_stderr_file = NULL; aos_log_print_default("abc", 3); aos_pool_create(&p, NULL); apr_file_open(&thefile, "stderr_log_file", APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); CuAssertTrue(tc, thefile != NULL); aos_stderr_file = thefile; aos_log_print_default("abc", 3); apr_file_close(thefile); aos_stderr_file = NULL; aos_pool_destroy(p); printf("test_aos_log_print_default_with_null_file ok\n"); } /* * aos_transport */ void test_aos_curl_code_to_status(CuTest *tc) { int code = aos_curl_code_to_status(CURLE_OUT_OF_MEMORY); CuAssertIntEquals(tc, AOSE_OUT_MEMORY, code); code = aos_curl_code_to_status(CURLE_COULDNT_RESOLVE_PROXY); CuAssertIntEquals(tc, AOSE_NAME_LOOKUP_ERROR, code); code = aos_curl_code_to_status(CURLE_COULDNT_RESOLVE_HOST); CuAssertIntEquals(tc, AOSE_NAME_LOOKUP_ERROR, code); code = aos_curl_code_to_status(CURLE_COULDNT_CONNECT); CuAssertIntEquals(tc, AOSE_FAILED_CONNECT, code); code = aos_curl_code_to_status(CURLE_WRITE_ERROR); CuAssertIntEquals(tc, AOSE_CONNECTION_FAILED, code); code = aos_curl_code_to_status(CURLE_OPERATION_TIMEDOUT); CuAssertIntEquals(tc, AOSE_CONNECTION_FAILED, code); code = aos_curl_code_to_status(CURLE_PARTIAL_FILE); CuAssertIntEquals(tc, AOSE_OK, code); code = aos_curl_code_to_status(CURLE_SSL_CACERT); CuAssertIntEquals(tc, AOSE_FAILED_VERIFICATION, code); code = aos_curl_code_to_status(CURLE_FTP_WEIRD_PASV_REPLY); CuAssertIntEquals(tc, AOSE_INTERNAL_ERROR, code); printf("test_aos_curl_code_to_status ok\n"); } /* * aos_string.h */ void test_aos_unquote_str(CuTest *tc) { aos_string_t str; char buff[3]; aos_str_set(&str, "\"abc\""); aos_unquote_str(&str); CuAssertStrnEquals(tc, "abc", strlen("abc"), str.data); CuAssertIntEquals(tc, 3, str.len); aos_str_set(&str, ""); aos_unquote_str(&str); buff[0] = 'A'; buff[1] = 'a'; buff[2] = '\0'; aos_str_set(&str, buff); aos_string_tolower(&str); CuAssertStrnEquals(tc, "aa", strlen("aa"), str.data); printf("test_aos_unquote_str ok\n"); } void test_aos_ends_with(CuTest *tc) { int ret; aos_string_t str; aos_string_t suffix; aos_str_set(&str, "abc.mn.qp"); aos_str_set(&suffix, ".qp"); ret = aos_ends_with(&str, &suffix); CuAssertIntEquals(tc, 1, ret); aos_str_set(&suffix, ".mn"); ret = aos_ends_with(&str, &suffix); CuAssertIntEquals(tc, 0, ret); ret = aos_ends_with(&str, NULL); CuAssertIntEquals(tc, 0, ret); ret = aos_ends_with(NULL, NULL); CuAssertIntEquals(tc, 0, ret); aos_str_set(&suffix, "abc.mn.qp.adfda"); ret = aos_ends_with(&str, &suffix); CuAssertIntEquals(tc, 0, ret); printf("test_aos_ends_with ok\n"); } void test_aos_string_is_empty(CuTest *tc) { aos_string_t str; int ret; //empty ret = aos_string_is_empty(NULL); CuAssertIntEquals(tc, 1, ret); str.len = 0; ret = aos_string_is_empty(&str); CuAssertIntEquals(tc, 1, ret); str.data = NULL; str.len = 1; ret = aos_string_is_empty(&str); CuAssertIntEquals(tc, 1, ret); str.data = ""; str.len = 1; ret = aos_string_is_empty(&str); CuAssertIntEquals(tc, 1, ret); ret = aos_is_null_string(NULL); CuAssertIntEquals(tc, 1, ret); str.data = NULL; str.len = 1; ret = aos_is_null_string(&str); CuAssertIntEquals(tc, 1, ret); str.data = ""; str.len = 0; ret = aos_is_null_string(&str); CuAssertIntEquals(tc, 1, ret); printf("test_aos_ends_with ok\n"); } /* * aos_util.h */ void test_aos_url_encode_failed(CuTest *tc) { int ret; char *dest; dest = (char*)malloc(1024); ret = aos_url_encode(dest, "/mingdi-hz-3/./xxx/./ddd/", 1); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, ret); free(dest); printf("test_aos_url_encode_failed ok\n"); } void test_aos_url_encode_with_blank_char(CuTest *tc) { int ret; char *source; char *dest; source = "abc.xx.com/a b~"; dest = (char*)malloc(20); ret = aos_url_encode(dest, source, strlen(source)); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertStrEquals(tc, "abc.xx.com%2Fa%20b~", dest); free(dest); printf("test_aos_url_encode_with_blank_char ok\n"); } void test_aos_url_encode_ex_with_blank_char(CuTest *tc) { int ret; char *source; char *dest; source = "abc.xx.com/a b~//123/"; dest = (char*)malloc(100); ret = aos_url_encode_ex(dest, source, strlen(source), 0); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertStrEquals(tc, "abc.xx.com%2Fa%20b~%2F%2F123%2F", dest); ret = aos_url_encode_ex(dest, source, strlen(source), 1); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertStrEquals(tc, "abc.xx.com/a%20b~//123/", dest); free(dest); printf("test_aos_url_encode_ex_with_blank_char ok\n"); } void test_aos_url_decode_with_percent(CuTest *tc) { int ret; char *in; char *out; in = "abc.xx.com/a%20b"; out = (char*)malloc(20); ret = aos_url_decode(in, out); CuAssertIntEquals(tc, 0, ret); ret = aos_url_decode(NULL, out); CuAssertIntEquals(tc, 0, ret); free(out); printf("test_aos_url_decode_with_percent ok\n"); } void test_aos_url_decode_with_add(CuTest *tc) { int ret; char *in; char *out; in = "abc.xx.com/a+b"; out = (char*)malloc(20); ret = aos_url_decode(in, out); CuAssertIntEquals(tc, 0, ret); free(out); printf("test_aos_url_decode_with_add ok\n"); } void test_aos_url_decode_failed(CuTest *tc) { int ret; char *in; char *out; in = "abc.xx.com/a%xb"; out = (char*)malloc(20); ret = aos_url_decode(in, out); CuAssertIntEquals(tc, -1, ret); free(out); printf("test_aos_url_decode_failed ok\n"); } /* *aos_status.c */ void test_aos_should_retry(CuTest *tc) { aos_status_t s; aos_status_set(&s, 500, "", ""); CuAssertIntEquals(tc, 1, aos_should_retry(&s)); aos_status_set(&s, 505, "", ""); CuAssertIntEquals(tc, 1, aos_should_retry(&s)); aos_status_set(&s, 400, "", ""); CuAssertIntEquals(tc, 0, aos_should_retry(&s)); aos_status_set(&s, -992, "-992", ""); CuAssertIntEquals(tc, 1, aos_should_retry(&s)); aos_status_set(&s, -995, "-995", ""); CuAssertIntEquals(tc, 1, aos_should_retry(&s)); aos_status_set(&s, -998, "-998", ""); CuAssertIntEquals(tc, 1, aos_should_retry(&s)); aos_status_set(&s, -986, "-986", ""); CuAssertIntEquals(tc, 1, aos_should_retry(&s)); aos_status_set(&s, -993, "-993", ""); CuAssertIntEquals(tc, 0, aos_should_retry(&s)); aos_status_set(&s, 0, "0", "NULL"); CuAssertIntEquals(tc, 0, aos_should_retry(&s)); CuAssertIntEquals(tc, 0, aos_should_retry(NULL)); aos_status_set(&s, 200, "", ""); CuAssertIntEquals(tc, 0, aos_should_retry(&s)); aos_status_set(&s, 200, NULL, NULL); CuAssertIntEquals(tc, 0, aos_should_retry(&s)); printf("test_aos_should_retry ok\n"); } void test_aos_status_parse_from_body_fail(CuTest *tc) { aos_pool_t *p; aos_status_t *s; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "invalid"; char *without_error_xml = "\n" ""; char *without_code_xml = "\n" "aaaaa"; char *without_message_xml = "\n" "aaaaa"; aos_pool_create(&p, NULL); s = aos_status_parse_from_body(p, NULL, 200, NULL); CuAssertTrue(tc, s->code == 200); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); s = aos_status_parse_from_body(p, &buffer, 400, NULL); CuAssertStrEquals(tc, s->error_code, (char *)AOS_UNKNOWN_ERROR_CODE); aos_list_init(&buffer); content = aos_buf_pack(p, without_error_xml, strlen(without_error_xml)); aos_list_add_tail(&content->node, &buffer); s = aos_status_parse_from_body(p, &buffer, 400, NULL); CuAssertStrEquals(tc, s->error_code, (char *)AOS_UNKNOWN_ERROR_CODE); aos_list_init(&buffer); content = aos_buf_pack(p, without_code_xml, strlen(without_code_xml)); aos_list_add_tail(&content->node, &buffer); s = aos_status_parse_from_body(p, &buffer, 400, NULL); CuAssertTrue(tc, s->error_code == NULL); aos_list_init(&buffer); content = aos_buf_pack(p, without_message_xml, strlen(without_message_xml)); aos_list_add_tail(&content->node, &buffer); s = aos_status_parse_from_body(p, &buffer, 400, NULL); CuAssertTrue(tc, s->error_msg == NULL); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_aos_strtoll(CuTest *tc) { int64_t val = 0; char *endptr = NULL; val = aos_strtoll("0", NULL, 10); CuAssertTrue(tc, val == 0); val = aos_strtoll("9223372036854775807", NULL, 10); CuAssertTrue(tc, val == 9223372036854775807); val = aos_strtoll("+9223372036854775807", NULL, 10); CuAssertTrue(tc, val == 9223372036854775807); val = aos_strtoll("-9223372036854775808", NULL, 10); CuAssertTrue(tc, val == INT64_MIN); val = aos_strtoll("-92233720368547758080", NULL, 10); CuAssertTrue(tc, val == INT64_MIN); val = aos_strtoll("9223372036854775809", NULL, 10); CuAssertTrue(tc, val == INT64_MAX); val = aos_strtoll("2147483648ABC", &endptr, 10); CuAssertTrue(tc, val == 2147483648); CuAssertStrEquals(tc, endptr, "ABC"); val = aos_strtoll(" 1234", NULL, 0); CuAssertTrue(tc, val == 1234); //hex val = aos_strtoll("0x1234Ac", NULL, 0); CuAssertTrue(tc, val == 1193132); val = aos_strtoll("0X1234", NULL, 0); CuAssertTrue(tc, val == 4660); val = aos_strtoll("0x1234", NULL, 16); CuAssertTrue(tc, val == 4660); val = aos_strtoll("0X1234", NULL, 16); CuAssertTrue(tc, val == 4660); //Oct val = aos_strtoll("01234", NULL, 0); CuAssertTrue(tc, val == 668); val = aos_atoi64("0"); CuAssertTrue(tc, val == 0); val = aos_atoi64("9223372036854775807"); CuAssertTrue(tc, val == 9223372036854775807); val = aos_atoi64("-9223372036854775808"); CuAssertTrue(tc, val == INT64_MIN); printf("%s ok\n", __FUNCTION__); } void test_aos_strtoull(CuTest *tc) { uint64_t val = 0; char *endptr = NULL; val = aos_strtoull("0", NULL, 10); CuAssertTrue(tc, val == 0); val = aos_strtoull("9223372036854775807", NULL, 10); CuAssertTrue(tc, val == 9223372036854775807); val = aos_strtoull("+922337203685477580", NULL, 10); CuAssertTrue(tc, val == 922337203685477580); val = aos_strtoull("18446744073709551615", NULL, 10); CuAssertTrue(tc, val == UINT64_MAX); val = aos_strtoull("2147483648ABC", &endptr, 10); CuAssertTrue(tc, val == 2147483648); CuAssertStrEquals(tc, endptr, "ABC"); val = aos_strtoull(" 1234", NULL, 0); CuAssertTrue(tc, val == 1234); //hex val = aos_strtoull("0x1234Ac", NULL, 0); CuAssertTrue(tc, val == 1193132); val = aos_strtoull("0X1234", NULL, 0); CuAssertTrue(tc, val == 4660); val = aos_strtoull("0x1234", NULL, 16); CuAssertTrue(tc, val == 4660); val = aos_strtoull("0X1234", NULL, 16); CuAssertTrue(tc, val == 4660); //Oct val = aos_strtoull("01234", NULL, 0); CuAssertTrue(tc, val == 668); val = aos_atoui64("0"); CuAssertTrue(tc, val == 0); val = aos_atoui64("9223372036854775807"); CuAssertTrue(tc, val == 9223372036854775807); val = aos_atoui64("18446744073709551615"); CuAssertTrue(tc, val == UINT64_MAX); printf("%s ok\n", __FUNCTION__); } void test_aos_base64_encode(CuTest *tc) { char buff[32]; int ret; memset(buff, 0, 32); ret = aos_base64_encode((unsigned char *)"abc", 3, buff); CuAssertStrEquals(tc, "YWJj", buff); CuAssertTrue(tc, ret == 4); ret = aos_base64_encode((unsigned char *)"abcd", 4, buff); CuAssertStrEquals(tc, "YWJjZA==", buff); CuAssertTrue(tc, ret == 8); ret = aos_base64_encode((unsigned char *)"abcde", 5, buff); CuAssertStrEquals(tc, "YWJjZGU=", buff); CuAssertTrue(tc, ret == 8); memset(buff, 0, 32); ret = aos_base64_encode((unsigned char *)"", 0, buff); CuAssertStrEquals(tc, "", buff); CuAssertTrue(tc, ret == 0); memset(buff, 0, 32); ret = aos_base64_encode((unsigned char *)"A", 1, buff); CuAssertStrEquals(tc, "QQ==", buff); CuAssertTrue(tc, ret == 4); printf("%s ok\n", __FUNCTION__); } void test_oss_get_file_info(CuTest *tc) { aos_pool_t *p; apr_finfo_t finfo; aos_string_t filepath; apr_status_t s; aos_pool_create(&p, NULL); aos_str_set(&filepath, test_file); s = oss_get_file_info(&filepath, p, &finfo); CuAssertIntEquals(tc, AOSE_OK, s); CuAssertTrue(tc, finfo.size == 769686); CuAssertTrue(tc, finfo.mtime > 1484755200000000L); // negative aos_str_set(&filepath, ""); s = oss_get_file_info(&filepath, p, &finfo); CuAssertTrue(tc, AOSE_OK != s); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } /* * aos_buf.c */ void test_aos_open_file_for_read(CuTest *tc) { aos_pool_t *p; aos_file_buf_t *fb; apr_status_t s; aos_pool_create(&p, NULL); fb = aos_create_file_buf(p); s = aos_open_file_for_read(p, test_file, fb); CuAssertIntEquals(tc, AOSE_OK, s); CuAssertTrue(tc, fb->file_pos == 0); CuAssertTrue(tc, fb->file_last == 769686); apr_file_close(fb->file); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_aos_create_buf_fail(CuTest *tc) { aos_pool_t *p = NULL; aos_buf_t *buff; aos_pool_create(&p, NULL); buff = aos_create_buf(p, -100); CuAssertTrue(tc, buff == NULL); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_aos_open_file_for_read_fail(CuTest *tc) { aos_pool_t *p; aos_file_buf_t *fb; apr_status_t s; aos_pool_create(&p, NULL); fb = aos_create_file_buf(p); s = aos_open_file_for_read(p, "invalid-path", fb); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s); #if !defined(WIN32) s = aos_open_file_for_read(p, NULL, fb); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s); #endif aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_aos_open_file_for_range_read_fail(CuTest *tc) { aos_pool_t *p; aos_file_buf_t *fb; apr_status_t s; aos_pool_create(&p, NULL); fb = aos_create_file_buf(p); s = aos_open_file_for_range_read(p, test_file, 769696, 769686, fb); CuAssertIntEquals(tc, AOSE_OK, s); CuAssertTrue(tc, fb->file_pos == 769686); CuAssertTrue(tc, fb->file_last == 769686); apr_file_close(fb->file); s = aos_open_file_for_range_read(p, "invalid-path", 769696, 769686, fb); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_aos_open_file_for_write_fail(CuTest *tc) { aos_pool_t *p; aos_file_buf_t *fb; apr_status_t s; aos_pool_create(&p, NULL); fb = aos_create_file_buf(p); s = aos_open_file_for_write(p, "g:/invalid-path", fb); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s); #if !defined(WIN32) s = aos_open_file_for_write(p, NULL, fb); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s); #endif aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_aos_open_file_for_write_notrunc_fail(CuTest *tc) { aos_pool_t *p; aos_file_buf_t *fb; apr_status_t s; aos_pool_create(&p, NULL); fb = aos_create_file_buf(p); s = aos_open_file_for_write_notrunc(p, "g:/invalid-path", fb); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s); s = aos_open_file_for_write_notrunc(p, "", fb); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s); #if !defined(WIN32) s = aos_open_file_for_write_notrunc(p, NULL, fb); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s); #endif aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_aos_buf_append_string_fail(CuTest *tc) { aos_buf_append_string(NULL, NULL, NULL, -1); printf("%s ok\n", __FUNCTION__); } /* *aos_http_io.c */ void test_aos_request_get_release(CuTest *tc) { CURL * handle[AOS_REQUEST_STACK_SIZE + 2]; int i; for (i = 0; i < AOS_REQUEST_STACK_SIZE + 2; i++) { handle[i] = aos_request_get(); } for (i = 0; i < AOS_REQUEST_STACK_SIZE + 2; i++) { request_release(handle[i]); } printf("%s ok\n", __FUNCTION__); } void test_aos_http_controller_create(CuTest *tc) { aos_pool_t *p = NULL; aos_http_controller_t * ctr = NULL; ctr = aos_http_controller_create(p, 0); CuAssertTrue(tc, p == NULL); CuAssertTrue(tc, ctr != NULL); CuAssertTrue(tc, ctr->pool != NULL); aos_pool_destroy(ctr->pool); CuAssertTrue(tc, ctr->options->verify_ssl == AOS_TRUE); CuAssertTrue(tc, ctr->options->ca_file == NULL); CuAssertTrue(tc, ctr->options->ca_path == NULL); printf("%s ok\n", __FUNCTION__); } void test_aos_read_http_body_file_fail(CuTest *tc) { aos_pool_t *p = NULL; aos_http_request_t *req; aos_file_buf_t *fb; int ret; apr_file_t *thefile; char buffer[16]; aos_pool_create(&p, NULL); fb = aos_create_file_buf(p); req = aos_http_request_create(p); CuAssertTrue(tc, req != NULL); CuAssertTrue(tc, fb != NULL); ret = aos_read_http_body_file(req, NULL, 0); CuAssertTrue(tc, ret == AOSE_INVALID_ARGUMENT); req->file_buf = fb; ret = aos_read_http_body_file(req, NULL, 0); CuAssertTrue(tc, ret == AOSE_INVALID_ARGUMENT); req->file_buf = aos_create_file_buf(p); apr_file_open(&thefile, "test_file_to_read", APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); CuAssertTrue(tc, thefile != NULL); req->file_buf->file = thefile; apr_file_close(thefile); req->file_buf->file_pos = 0; req->file_buf->file_last = 2; ret = aos_read_http_body_file(req, buffer, 1); CuAssertTrue(tc, ret == AOSE_FILE_READ_ERROR); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_aos_write_http_body_file_fail(CuTest *tc) { aos_pool_t *p = NULL; aos_http_response_t *resp; int ret; apr_file_t *thefile; aos_pool_create(&p, NULL); resp = aos_http_response_create(p); CuAssertTrue(tc, resp != NULL); ret = aos_write_http_body_file(resp, NULL, 0); CuAssertTrue(tc, resp->file_buf != NULL); CuAssertTrue(tc, ret == AOSE_INVALID_ARGUMENT); resp->file_path = "g:/invalid-path"; ret = aos_write_http_body_file(resp, NULL, 0); CuAssertTrue(tc, ret == AOSE_OPEN_FILE_ERROR); resp->file_buf = aos_create_file_buf(p); apr_file_open(&thefile, "test_file_to_write", APR_CREATE | APR_WRITE, APR_UREAD | APR_UWRITE | APR_GREAD, p); CuAssertTrue(tc, thefile != NULL); resp->file_buf->file = thefile; apr_file_close(thefile); ret = aos_write_http_body_file(resp, NULL, 0); CuAssertTrue(tc, ret == AOSE_FILE_WRITE_ERROR); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } /* * aos_util.c */ void test_aos_parse_xml_body_fail(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; mxml_node_t *root; char *invalid_xml = "invalid"; int ret; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = aos_parse_xml_body(&buffer, &root); CuAssertIntEquals(tc, AOSE_INTERNAL_ERROR, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_aos_http_method_to_string(CuTest *tc) { const char *msg = NULL; msg = aos_http_method_to_string((http_method_e)10); CuAssertStrEquals(tc, "UNKNOWN", msg); printf("%s ok\n", __FUNCTION__); } static void fstack_func1_pt(void *a) { } static void fstack_func2_pt() { } static int fstack_func3_pt(void *a) { return 0; } static int fstack_func4_pt() { return 0; } void test_aos_fstack(CuTest *tc) { aos_pool_t *p; aos_array_header_t *header; aos_fstack_item_t *item; aos_func_u func_u; aos_pool_create(&p, NULL); header = aos_fstack_create(p, 5); CuAssertTrue(tc, header != NULL); func_u.func1 = fstack_func1_pt; aos_fstack_push(header, NULL, func_u, 1); func_u.func2 = fstack_func2_pt; aos_fstack_push(header, NULL, func_u, 2); func_u.func3 = fstack_func3_pt; aos_fstack_push(header, NULL, func_u, 3); func_u.func4 = fstack_func4_pt; aos_fstack_push(header, NULL, func_u, 4); aos_fstack_push(header, NULL, func_u, 5); item = aos_fstack_pop(header); CuAssertTrue(tc, item != NULL); CuAssertTrue(tc, item->order == 5); item = aos_fstack_pop(header); CuAssertTrue(tc, item != NULL); CuAssertTrue(tc, item->order == 4); item = aos_fstack_pop(header); CuAssertTrue(tc, item != NULL); CuAssertTrue(tc, item->order == 3); item = aos_fstack_pop(header); CuAssertTrue(tc, item != NULL); CuAssertTrue(tc, item->order == 2); item = aos_fstack_pop(header); CuAssertTrue(tc, item != NULL); CuAssertTrue(tc, item->order == 1); item = aos_fstack_pop(header); CuAssertTrue(tc, item == NULL); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_oss_create_api_result_content(CuTest *tc) { aos_pool_t *p; void *ret_void; aos_pool_create(&p, NULL); ret_void = oss_create_api_result_content(p, -10); CuAssertTrue(tc, ret_void == NULL); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_string_to_sign_negative(CuTest *tc) { aos_pool_t *p; int ret; aos_string_t canon_res; aos_table_t *headers; aos_table_t *params; aos_string_t signstr; char special_query[AOS_MAX_QUERY_ARG_LEN+1]; char special_header[AOS_MAX_HEADER_LEN + 1]; aos_pool_create(&p, NULL); aos_str_set(&canon_res, ""); headers = aos_table_make(p, 1); params = aos_table_make(p, 1); apr_table_set(headers, OSS_CONTENT_TYPE, "image/jpeg"); ret = oss_get_string_to_sign(p, HTTP_GET, &canon_res, headers, params, &signstr); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, ret); aos_str_set(&canon_res, ""); headers = aos_table_make(p, 1); params = aos_table_make(p, 1); apr_table_set(headers, OSS_CANNONICALIZED_HEADER_DATE, "Fri, 06 Sep 2019 08:54:24 GMT"); ret = oss_get_string_to_sign(p, HTTP_GET, &canon_res, headers, NULL, &signstr); CuAssertIntEquals(tc, AOSE_OK, ret); //long params aos_str_set(&canon_res, ""); headers = aos_table_make(p, 1); params = aos_table_make(p, 1); apr_table_set(headers, OSS_CANNONICALIZED_HEADER_DATE, "Fri, 06 Sep 2019 08:54:24 GMT"); memset(special_query, 0x30, AOS_MAX_QUERY_ARG_LEN); special_query[AOS_MAX_QUERY_ARG_LEN] = '\0'; apr_table_set(params, "x-oss-process", special_query); ret = oss_get_string_to_sign(p, HTTP_GET, &canon_res, headers, params, &signstr); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, ret); //user meta header too many aos_str_set(&canon_res, ""); headers = aos_table_make(p, 1); params = aos_table_make(p, 1); apr_table_set(headers, OSS_CANNONICALIZED_HEADER_DATE, "Fri, 06 Sep 2019 08:54:24 GMT"); memset(special_header, 0x30, AOS_MAX_HEADER_LEN); special_header[AOS_MAX_HEADER_LEN] = '\0'; apr_table_set(headers, "x-oss-meta-user1", special_header); ret = oss_get_string_to_sign(p, HTTP_GET, &canon_res, headers, params, &signstr); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_sign_request_negative(CuTest *tc) { aos_pool_t *p; oss_config_t config; aos_http_request_t *req; int ret; char special_res[AOS_MAX_URI_LEN + 1]; aos_pool_create(&p, NULL); req = aos_http_request_create(p); memset(special_res, 0x30, AOS_MAX_URI_LEN); special_res[AOS_MAX_URI_LEN] = '\0'; req->resource = special_res; ret = oss_sign_request(req, &config); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_get_oss_request_signature_negative(CuTest *tc) { aos_pool_t *p; oss_request_options_t *option; aos_http_request_t *req; char special_query[AOS_MAX_QUERY_ARG_LEN + 1]; int ret; aos_string_t expires; aos_string_t signature; aos_pool_create(&p, NULL); option = oss_request_options_create(p); req = aos_http_request_create(p); req->headers = aos_table_make(p, 1); req->query_params = aos_table_make(p, 1); init_test_request_options(option, 0); memset(special_query, 0x30, AOS_MAX_QUERY_ARG_LEN); special_query[AOS_MAX_QUERY_ARG_LEN] = '\0'; apr_table_set(req->query_params, "x-oss-process", special_query); aos_str_set(&expires, "12343"); ret = get_oss_request_signature(option, req, &expires, &signature); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_signed_url_negative(CuTest *tc) { aos_pool_t *p; oss_request_options_t *option; aos_http_request_t *req; char special_query[AOS_MAX_QUERY_ARG_LEN + 1]; char speical_path[AOS_MAX_URI_LEN + 1]; int ret; aos_string_t expires; aos_string_t signed_url; aos_pool_create(&p, NULL); memset(special_query, 0x30, AOS_MAX_QUERY_ARG_LEN); special_query[AOS_MAX_QUERY_ARG_LEN] = '\0'; memset(speical_path, 0x30, AOS_MAX_URI_LEN); speical_path[AOS_MAX_URI_LEN] = '\0'; aos_str_set(&expires, "12343"); option = oss_request_options_create(p); req = aos_http_request_create(p); req->query_params = aos_table_make(p, 1); init_test_request_options(option, 0); if (option->config->signature_version != 4) { apr_table_set(req->query_params, "x-oss-process", special_query); ret = oss_get_signed_url(option, req, &expires, &signed_url); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, ret); } /* init_test_request_options(option, 0); req = aos_http_request_create(p); //req->resource = "TEST"; ret = oss_get_signed_url(option, req, &expires, &signed_url); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, ret); //aos_str_set(&option->config->sts_token, "test"); aos_str_set(&option->config->endpoint, ""); req->query_params = aos_table_make(p, 1); req->uri = speical_path; ret = oss_get_signed_url(option, req, &expires, &signed_url); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, ret); aos_pool_destroy(p); */ printf("%s ok\n", __FUNCTION__); } static void test_oss_get_rtmp_signed_url_negative(CuTest *tc) { aos_pool_t *p; oss_request_options_t *option; aos_http_request_t *req; char special_query[AOS_MAX_QUERY_ARG_LEN + 1]; int ret; aos_string_t expires; aos_string_t play_list_name; aos_string_t signed_url; aos_table_t *params; aos_pool_create(&p, NULL); memset(special_query, 0x30, AOS_MAX_QUERY_ARG_LEN); special_query[AOS_MAX_QUERY_ARG_LEN] = '\0'; aos_str_set(&expires, "12343"); aos_str_set(&play_list_name, "test"); option = oss_request_options_create(p); req = aos_http_request_create(p); init_test_request_options(option, 0); apr_table_set(req->query_params, "x-oss-process", special_query); params = aos_table_make(p, 1); apr_table_set(params, "x-oss-param1", "test1"); apr_table_set(params, "x-oss-param2", "test2"); req->uri = "test"; ret = oss_get_rtmp_signed_url(option, req, &expires, &play_list_name, params, &signed_url); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_is_valid_bucket_name(CuTest *tc) { int i; aos_string_t name; char *invalid_name_list[] = { "a", "1", "!", "aa", "12", "a1", "a!", "1!", "aAa", "1A1", "a!a", "FengChao@123", "-a123", "a_123", "a123-", "1234567890123456789012345678901234567890123456789012345678901234", "" }; for (i = 0; i < sizeof(invalid_name_list) / sizeof(invalid_name_list[0]); i++) { aos_str_set(&name, invalid_name_list[i]); CuAssertIntEquals(tc, 0, oss_is_valid_bucket_name(&name)); } aos_str_null(&name); CuAssertIntEquals(tc, 0, oss_is_valid_bucket_name(&name)); CuAssertIntEquals(tc, 0, oss_is_valid_bucket_name(NULL)); aos_str_set(&name, "valid-bucket-name-1234"); CuAssertIntEquals(tc, 1, oss_is_valid_bucket_name(&name)); printf("%s ok\n", __FUNCTION__); } static void test_oss_is_valid_object_name(CuTest *tc) { aos_string_t name; aos_str_set(&name, ""); CuAssertIntEquals(tc, 0, oss_is_valid_object_name(&name)); aos_str_null(&name); CuAssertIntEquals(tc, 0, oss_is_valid_object_name(&name)); CuAssertIntEquals(tc, 0, oss_is_valid_object_name(NULL)); aos_str_set(&name, "?"); CuAssertIntEquals(tc, 1, oss_is_valid_object_name(&name)); //ex aos_str_set(&name, ""); CuAssertIntEquals(tc, 0, oss_is_valid_object_name_ex(&name, 1)); aos_str_null(&name); CuAssertIntEquals(tc, 0, oss_is_valid_object_name_ex(&name, 1)); CuAssertIntEquals(tc, 0, oss_is_valid_object_name_ex(&name, 1)); aos_str_set(&name, "?"); CuAssertIntEquals(tc, 0, oss_is_valid_object_name_ex(&name, 1)); aos_str_set(&name, "?123"); CuAssertIntEquals(tc, 0, oss_is_valid_object_name_ex(&name, 1)); aos_str_set(&name, ""); CuAssertIntEquals(tc, 0, oss_is_valid_object_name_ex(&name, 0)); aos_str_null(&name); CuAssertIntEquals(tc, 0, oss_is_valid_object_name_ex(&name, 0)); CuAssertIntEquals(tc, 0, oss_is_valid_object_name_ex(&name, 0)); aos_str_set(&name, "?"); CuAssertIntEquals(tc, 1, oss_is_valid_object_name_ex(&name, 0)); aos_str_set(&name, "?123"); CuAssertIntEquals(tc, 1, oss_is_valid_object_name_ex(&name, 0)); printf("%s ok\n", __FUNCTION__); } static void test_oss_preprocess_endpoint(CuTest *tc) { int i; aos_string_t name; char *endpoints[] = { "www.test.com/abc", "www.test.com/abc?test=1", "www.test.com/abc?test=1#segment", "www.test.com?test=1#segment", "www.test.com#abc", "www.test.com" }; char *ip_endpoints[] = { "192.168.1.1:8080/abc", "192.168.1.1:8080/abc?test=1", "192.168.1.1:8080?test=1#segment", "192.168.1.1:8080" }; char *ip_endpoints2[] = { "192.168.1.1/abc", "192.168.1.1/abc?test=1", "192.168.1.1?test=1#segment", "192.168.1.1" }; for (i = 0; i < sizeof(endpoints) / sizeof(endpoints[0]); i++) { aos_str_set(&name, endpoints[i]); oss_preprocess_endpoint(&name); CuAssertIntEquals(tc, strlen("www.test.com"), name.len); CuAssertIntEquals(tc, 0, strncmp("www.test.com", name.data, name.len)); } CuAssertIntEquals(tc, 6, i); for (i = 0; i < sizeof(ip_endpoints) / sizeof(ip_endpoints[0]); i++) { aos_str_set(&name, ip_endpoints[i]); oss_preprocess_endpoint(&name); CuAssertIntEquals(tc, strlen("192.168.1.1:8080"), name.len); CuAssertIntEquals(tc, 0, strncmp("192.168.1.1:8080", name.data, name.len)); } CuAssertIntEquals(tc, 4, i); for (i = 0; i < sizeof(ip_endpoints2) / sizeof(ip_endpoints2[0]); i++) { aos_str_set(&name, ip_endpoints2[i]); oss_preprocess_endpoint(&name); CuAssertIntEquals(tc, strlen("192.168.1.1"), name.len); CuAssertIntEquals(tc, 0, strncmp("192.168.1.1", name.data, name.len)); } CuAssertIntEquals(tc, 4, i); aos_str_set(&name, ""); oss_preprocess_endpoint(&name); CuAssertIntEquals(tc, 0, name.len); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_host_from_authority(CuTest *tc) { aos_pool_t *p; oss_request_options_t *option; int i; aos_string_t name; char *value; char *authoritys[] = { "www.test.com:8192", "www.test.com", "test:test@www.test.com:80", "test:test@www.test.com", }; char *ip_authoritys[] = { "192.168.1.1:8192", "192.168.1.1", "test:test@192.168.1.1:8192", "test:test@192.168.1.1", }; aos_pool_create(&p, NULL); option = oss_request_options_create(p); for (i = 0; i < sizeof(authoritys) / sizeof(authoritys[0]); i++) { aos_str_set(&name, authoritys[i]); value = oss_get_host_from_authority(option, &name); CuAssertStrEquals(tc, value, "www.test.com"); } CuAssertIntEquals(tc, 4, i); for (i = 0; i < sizeof(ip_authoritys) / sizeof(ip_authoritys[0]); i++) { aos_str_set(&name, ip_authoritys[i]); value = oss_get_host_from_authority(option, &name); CuAssertStrEquals(tc, value, "192.168.1.1"); } CuAssertIntEquals(tc, 4, i); aos_str_set(&name, ""); value = oss_get_host_from_authority(option, &name); CuAssertPtrEquals(tc, value, NULL); value = oss_get_host_from_authority(option, NULL); CuAssertPtrEquals(tc, value, NULL); printf("%s ok\n", __FUNCTION__); } void test_oss_fill_read_response_header(CuTest *tc) { aos_table_t *headers; oss_fill_read_response_header(NULL, &headers); printf("%s ok\n", __FUNCTION__); } static void test_oss_is_valid_host(CuTest *tc) { int i; const char *valid_host[] = { "www.test.com:8192", "www.test.com", "test:test@www.test.com:80", "test:test@www.test.com", "192.168.1.1:8192", "192.168.1.1", "test:test@192.168.1.1:8192", "test:test@192.168.1.1", "www.test-inc_CN.com", "a" }; const char *invalid_host[] = { "www.test.com#www.test.cn:8192", "test:test@www.test.com#www.test.cn:8192", "www.test.com#www.test.cn", "www.test.com\\www.test.cn", "", ":", "@:", NULL }; for (i = 0; i < sizeof(valid_host) / sizeof(valid_host[0]); i++) { CuAssertIntEquals(tc, 1, oss_is_valid_host(valid_host[i])); } CuAssertIntEquals(tc, 10, i); for (i = 0; i < sizeof(invalid_host) / sizeof(invalid_host[0]); i++) { CuAssertIntEquals(tc, 0, oss_is_valid_host(invalid_host[i])); } CuAssertIntEquals(tc, 8, i); printf("%s ok\n", __FUNCTION__); } CuSuite *test_aos() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_aos_setup); SUITE_ADD_TEST(suite, test_get_xml_doc_with_empty_aos_list); SUITE_ADD_TEST(suite, test_aos_list_movelist_with_empty_list); SUITE_ADD_TEST(suite, test_starts_with_failed); SUITE_ADD_TEST(suite, test_is_valid_ip); SUITE_ADD_TEST(suite, test_oss_config_resolve); SUITE_ADD_TEST(suite, test_oss_request_options_create_with_null_pool); SUITE_ADD_TEST(suite, test_oss_get_service_uri); SUITE_ADD_TEST(suite, test_oss_get_rtmp_uri); SUITE_ADD_TEST(suite, test_oss_write_request_body_from_file); SUITE_ADD_TEST(suite, test_oss_write_request_body_from_upload_file); SUITE_ADD_TEST(suite, test_oss_init_read_response_body_to_file); SUITE_ADD_TEST(suite, test_oss_create_bucket_info); SUITE_ADD_TEST(suite, test_oss_get_part_size); SUITE_ADD_TEST(suite, test_part_sort_cmp); SUITE_ADD_TEST(suite, test_set_content_type); SUITE_ADD_TEST(suite, test_oss_check_crc_consistent); SUITE_ADD_TEST(suite, test_oss_get_object_uri_with_cname); SUITE_ADD_TEST(suite, test_oss_get_object_uri_with_ip); SUITE_ADD_TEST(suite, test_oss_get_bucket_uri_with_cname); SUITE_ADD_TEST(suite, test_oss_get_bucket_uri_with_ip); SUITE_ADD_TEST(suite, test_oss_temp_file_rename); SUITE_ADD_TEST(suite, test_oss_init_select_object_read_response_body); SUITE_ADD_TEST(suite, test_oss_check_select_object_status); SUITE_ADD_TEST(suite, test_oss_check_create_select_object_meta_status); SUITE_ADD_TEST(suite, test_oss_init_create_select_object_meta_read_response_body); SUITE_ADD_TEST(suite, test_aos_log_format_default); SUITE_ADD_TEST(suite, test_aos_log_print_default_with_null_file); SUITE_ADD_TEST(suite, test_aos_curl_code_to_status); SUITE_ADD_TEST(suite, test_aos_unquote_str); SUITE_ADD_TEST(suite, test_aos_ends_with); SUITE_ADD_TEST(suite, test_aos_string_is_empty); SUITE_ADD_TEST(suite, test_aos_url_encode_failed); SUITE_ADD_TEST(suite, test_aos_url_encode_with_blank_char); SUITE_ADD_TEST(suite, test_aos_url_encode_ex_with_blank_char); SUITE_ADD_TEST(suite, test_aos_url_decode_with_percent); SUITE_ADD_TEST(suite, test_aos_url_decode_with_add); SUITE_ADD_TEST(suite, test_aos_url_decode_failed); SUITE_ADD_TEST(suite, test_aos_should_retry); SUITE_ADD_TEST(suite, test_aos_status_parse_from_body_fail); SUITE_ADD_TEST(suite, test_aos_strtoll); SUITE_ADD_TEST(suite, test_aos_strtoull); SUITE_ADD_TEST(suite, test_aos_base64_encode); SUITE_ADD_TEST(suite, test_oss_get_file_info); SUITE_ADD_TEST(suite, test_aos_open_file_for_read); SUITE_ADD_TEST(suite, test_aos_create_buf_fail); SUITE_ADD_TEST(suite, test_aos_open_file_for_read_fail); SUITE_ADD_TEST(suite, test_aos_open_file_for_range_read_fail); SUITE_ADD_TEST(suite, test_aos_open_file_for_write_fail); SUITE_ADD_TEST(suite, test_aos_open_file_for_write_notrunc_fail); SUITE_ADD_TEST(suite, test_aos_buf_append_string_fail); SUITE_ADD_TEST(suite, test_aos_request_get_release); SUITE_ADD_TEST(suite, test_aos_http_controller_create); SUITE_ADD_TEST(suite, test_aos_read_http_body_file_fail); SUITE_ADD_TEST(suite, test_aos_write_http_body_file_fail); SUITE_ADD_TEST(suite, test_aos_parse_xml_body_fail); SUITE_ADD_TEST(suite, test_aos_http_method_to_string); SUITE_ADD_TEST(suite, test_aos_fstack); SUITE_ADD_TEST(suite, test_oss_create_api_result_content); SUITE_ADD_TEST(suite, test_oss_get_string_to_sign_negative); SUITE_ADD_TEST(suite, test_oss_sign_request_negative); SUITE_ADD_TEST(suite, test_get_oss_request_signature_negative); SUITE_ADD_TEST(suite, test_oss_get_signed_url_negative); SUITE_ADD_TEST(suite, test_oss_get_rtmp_signed_url_negative); SUITE_ADD_TEST(suite, test_oss_is_valid_bucket_name); SUITE_ADD_TEST(suite, test_oss_preprocess_endpoint); SUITE_ADD_TEST(suite, test_oss_fill_read_response_header); SUITE_ADD_TEST(suite, test_oss_get_host_from_authority); SUITE_ADD_TEST(suite, test_oss_is_valid_host); SUITE_ADD_TEST(suite, test_oss_is_valid_object_name); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_bucket.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" void test_bucket_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; char *object_name1 = "oss_test_object1"; char *object_name2 = "oss_test_object2"; char *object_name3 = "oss_tmp1/"; char *object_name4 = "oss_tmp2/"; char *object_name5 = "oss_tmp3/"; char *object_name6 = "oss_tmp3/1"; char *str = "test c oss sdk"; aos_table_t *headers1 = NULL; aos_table_t *headers2 = NULL; aos_table_t *headers3 = NULL; aos_table_t *headers4 = NULL; aos_table_t *headers5 = NULL; int i = 0; //set bucket name TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "bucket"); //set log level, default AOS_LOG_WARN aos_log_set_level(AOS_LOG_WARN); //set log output, default stderr aos_log_set_output(NULL); //create test bucket aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); TEST_CASE_LOG("create test bucket success!\n"); //create test object headers1 = aos_table_make(p, 0); headers2 = aos_table_make(p, 0); headers3 = aos_table_make(p, 0); headers4 = aos_table_make(p, 0); headers5 = aos_table_make(p, 0); create_test_object(options, TEST_BUCKET_NAME, object_name1, str, headers1); create_test_object(options, TEST_BUCKET_NAME, object_name2, str, headers2); create_test_object(options, TEST_BUCKET_NAME, object_name3, str, headers3); create_test_object(options, TEST_BUCKET_NAME, object_name4, str, headers4); create_test_object(options, TEST_BUCKET_NAME, object_name5, str, headers5); for (i = 0; i < 1100; i++) { char *obj_name = apr_psprintf(p, "%s/%d.txt", object_name6, i); create_test_object(options, TEST_BUCKET_NAME, obj_name, str, NULL); } aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_bucket_cleanup(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t prefix; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); // delete objects aos_str_set(&prefix, "oss_test_object"); oss_delete_objects_by_prefix(options, &bucket, &prefix); aos_str_set(&prefix, "oss_tmp1"); oss_delete_objects_by_prefix(options, &bucket, &prefix); aos_str_set(&prefix, "oss_tmp2"); oss_delete_objects_by_prefix(options, &bucket, &prefix); aos_str_set(&prefix, "oss_tmp3"); oss_delete_objects_by_prefix(options, &bucket, &prefix); // delete all objects prefix.data = NULL; prefix.len = 0; oss_delete_objects_by_prefix(options, &bucket, &prefix); /* delete test bucket */ aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); aos_pool_destroy(p); } void test_create_bucket(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); oss_acl = OSS_ACL_PRIVATE; //create the same bucket twice with same bucket acl s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); //create the same bucket with different bucket acl oss_acl = OSS_ACL_PUBLIC_READ; s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); aos_pool_destroy(p); printf("test_create_bucket ok\n"); } void test_create_bucket_with_storage_class(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; aos_string_t bucket; aos_table_t *resp_headers = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; oss_storage_class_type_e storage_class_tp = OSS_STORAGE_CLASS_IA; char IA_BUCKET_NAME[128] = {0}; apr_snprintf(IA_BUCKET_NAME, 127, "%s-ia", TEST_BUCKET_NAME); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, IA_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(5)); //create the bucket with storage class s = create_test_bucket_with_storage_class(options, IA_BUCKET_NAME, oss_acl, storage_class_tp); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); //create the same bucket again with different storage class s = create_test_bucket_with_storage_class(options, IA_BUCKET_NAME, oss_acl, OSS_STORAGE_CLASS_ARCHIVE); // 409: BucketAlreadyExists Cannot modify existing bucket's storage class CuAssertIntEquals(tc, 409, s->code); //create the same bucket again with different storage class s = create_test_bucket_with_storage_class(options, IA_BUCKET_NAME, oss_acl, OSS_STORAGE_CLASS_STANDARD); // 409: BucketAlreadyExists Cannot modify existing bucket's storage class CuAssertIntEquals(tc, 409, s->code); //delete bucket aos_str_set(&bucket, IA_BUCKET_NAME); s = oss_delete_bucket(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_delete_bucket(CuTest *tc) { aos_pool_t *p = NULL; aos_status_t *s = NULL; aos_string_t bucket; oss_acl_e oss_acl; int is_cname = 0; oss_request_options_t *options; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); oss_acl = OSS_ACL_PUBLIC_READ; s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); //delete bucket not empty s = oss_delete_bucket(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 409, s->code); CuAssertStrEquals(tc, "BucketNotEmpty", s->error_code); CuAssertTrue(tc, s->req_id != NULL); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_delete_bucket ok\n"); } void test_put_bucket_acl(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_acl_e oss_acl; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); oss_acl = OSS_ACL_PUBLIC_READ_WRITE; s = oss_put_bucket_acl(options, &bucket, oss_acl, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_put_bucket_acl ok\n"); } /* only object has OSS_ACL_DEFAULT acl, it will return 400 while put bucket acl to OSS_ACL_DEFAULT */ void test_put_bucket_acl_invalid_acl(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_acl_e oss_acl; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); oss_acl = OSS_ACL_DEFAULT; s = oss_put_bucket_acl(options, &bucket, oss_acl, &resp_headers); CuAssertIntEquals(tc, 400, s->code); CuAssertPtrNotNull(tc, resp_headers); CuAssertStrEquals(tc, "InvalidArgument", s->error_code); aos_pool_destroy(p); printf("test_put_bucket_acl_invalid_acl ok\n"); } void test_get_bucket_acl(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t oss_acl; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_get_bucket_acl(options, &bucket, &oss_acl, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, "public-read-write", oss_acl.data); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_get_bucket_acl(options, &bucket, &oss_acl, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("test_get_bucket_acl ok\n"); } void test_get_bucket_location(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t oss_location; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_get_bucket_location(options, &bucket, &oss_location, &resp_headers); CuAssertIntEquals(tc, 200, s->code); TEST_CASE_LOG("endpoint: %s, location: %s\n", TEST_OSS_ENDPOINT, oss_location.data); CuAssertIntEquals(tc, 1, oss_location.len != 0); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_get_bucket_location(options, &bucket, &oss_location, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_get_bucket_info(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_bucket_info_t bucket_info; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_get_bucket_info(options, &bucket, &bucket_info, &resp_headers); CuAssertIntEquals(tc, 200, s->code); TEST_CASE_LOG("endpoint: %s, location: %s\n", TEST_OSS_ENDPOINT, bucket_info.location.data); TEST_CASE_LOG("user id %s, name %s, \n", bucket_info.owner_id.data, bucket_info.owner_name.data); CuAssertTrue(tc, bucket_info.location.len != 0); CuAssertTrue(tc, bucket_info.acl.len != 0); CuAssertTrue(tc, bucket_info.created_date.len != 0); CuAssertTrue(tc, bucket_info.extranet_endpoint.len != 0); CuAssertTrue(tc, bucket_info.intranet_endpoint.len != 0); CuAssertTrue(tc, bucket_info.owner_id.len != 0); CuAssertTrue(tc, bucket_info.owner_name.len != 0); CuAssertStrEquals(tc, bucket_info.storage_class.data, "Standard"); CuAssertPtrNotNull(tc, resp_headers); aos_str_set(&bucket, "impossibleexistbucket"); s = oss_get_bucket_info(options, &bucket, &bucket_info, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_get_bucket_stat(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_bucket_stat_t bucket_stat; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_get_bucket_stat(options, &bucket, &bucket_stat, &resp_headers); CuAssertIntEquals(tc, 200, s->code); TEST_CASE_LOG("storage %d, object count %d, multipart upload count %d\n", \ (int)bucket_stat.storage_in_bytes, (int)bucket_stat.object_count, (int)bucket_stat.multipart_upload_count); CuAssertTrue(tc, bucket_stat.object_count > 0); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_get_bucket_stat(options, &bucket, &bucket_stat, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_head_bucket(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; char *oss_location = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_head_bucket(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); oss_location = (char*)(apr_table_get(resp_headers, OSS_CANNONICALIZED_HEADER_REGION)); TEST_CASE_LOG("region is %s\n", oss_location); CuAssertPtrNotNull(tc, oss_location); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_get_bucket_storage_capacity(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; long oss_storage_capacity = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_get_bucket_storage_capacity(options, &bucket, &oss_storage_capacity, &resp_headers); TEST_CASE_LOG("get storage capacity %ld\n", oss_storage_capacity); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_get_bucket_storage_capacity(options, &bucket, &oss_storage_capacity, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_put_bucket_storage_capacity(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; long oss_storage_capacity = 0; long capacity = 100; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_put_bucket_storage_capacity(options, &bucket, capacity, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); TEST_CASE_LOG("set capacity %ld success\n", capacity); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_get_bucket_storage_capacity(options, &bucket, &oss_storage_capacity, &resp_headers); TEST_CASE_LOG("get storage capacity %ld\n", oss_storage_capacity); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, capacity, oss_storage_capacity); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_put_bucket_storage_capacity(options, &bucket, -1, &resp_headers); if (s->error_msg) { printf("%s %s\n", s->error_msg, s->error_code); } CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_put_bucket_storage_capacity ok\n"); } void test_put_bucket_logging(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_logging_config_content_t *content; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); content = oss_create_logging_rule_content(p); aos_str_set(&content->target_bucket, TEST_BUCKET_NAME); aos_str_set(&content->prefix, "my-log-"); s = oss_put_bucket_logging(options, &bucket, content, &resp_headers); if (s->error_msg) { printf("%s %s\n", s->error_msg, s->error_code); } CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_get_bucket_logging(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_logging_config_content_t *content = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); content = oss_create_logging_rule_content(p); s = oss_get_bucket_logging(options, &bucket, content, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); CuAssertStrEquals(tc, TEST_BUCKET_NAME, content->target_bucket.data); CuAssertStrEquals(tc, "my-log-", content->prefix.data); TEST_CASE_LOG("%s: bucket:%s, prefix:%s\n", __FUNCTION__, content->target_bucket.data, content->prefix.data); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_get_bucket_logging(options, &bucket, content, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_delete_bucket_logging(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_logging_config_content_t *content = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_delete_bucket_logging(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 204, s->code); CuAssertPtrNotNull(tc, resp_headers); options = oss_request_options_create(p); init_test_request_options(options, is_cname); content = oss_create_logging_rule_content(p); s = oss_get_bucket_logging(options, &bucket, content, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); CuAssertStrEquals(tc, "", content->target_bucket.data); CuAssertStrEquals(tc, "", content->prefix.data); TEST_CASE_LOG("%s: bucket:%s, prefix:%s\n", __FUNCTION__, content->target_bucket.data, content->prefix.data); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_list_object(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_list_object_params_t *params = NULL; oss_list_object_content_t *content = NULL; int size = 0; char *key = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); params = oss_create_list_object_params(p); params->max_ret = 1; params->truncated = 0; aos_str_set(¶ms->prefix, "oss_test_object"); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_list_object(options, &bucket, params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 1, params->truncated); CuAssertStrEquals(tc, "oss_test_object1", params->next_marker.data); CuAssertPtrNotNull(tc, resp_headers); aos_list_for_each_entry(oss_list_object_content_t, content, ¶ms->object_list, node) { ++size; key = apr_psprintf(p, "%.*s", content->key.len, content->key.data); CuAssertStrEquals(tc, "Standard", content->storage_class.data); CuAssertStrEquals(tc, "Normal", content->type.data); } CuAssertIntEquals(tc, 1 ,size); CuAssertStrEquals(tc, "oss_test_object1", key); size = 0; resp_headers = NULL; aos_list_init(¶ms->object_list); aos_str_set(¶ms->marker, params->next_marker.data); s = oss_list_object(options, &bucket, params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 0, params->truncated); aos_list_for_each_entry(oss_list_object_content_t, content, ¶ms->object_list, node) { ++size; key = apr_psprintf(p, "%.*s", content->key.len, content->key.data); } CuAssertIntEquals(tc, 1 ,size); CuAssertStrEquals(tc, "oss_test_object2", key); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_list_object(options, &bucket, params, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("test_list_object ok\n"); } void test_list_buckets(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_list_buckets_params_t *params = NULL; oss_list_bucket_content_t *content = NULL; int size = 0; TEST_CASE_LOG("begin test\n"); /* list all buckets */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); params = oss_create_list_buckets_params(p); params->max_keys = 100; s = oss_list_bucket(options, params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_list_for_each_entry(oss_list_bucket_content_t, content, ¶ms->bucket_list, node) { ++size; } TEST_CASE_LOG("Get %d buckets total\n", size); CuAssertIntEquals(tc, 1 , size > 0); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_list_buckets_with_invalid_prefix(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_list_buckets_params_t *params = NULL; /* list bucket one by one */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); params = oss_create_list_buckets_params(p); params->max_keys = 1; aos_str_set(¶ms->prefix, "impossibleMatch"); s = oss_list_bucket(options, params, &resp_headers); CuAssertIntEquals(tc, 400, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_list_buckets_with_iterator(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_list_buckets_params_t *params = NULL; oss_list_bucket_content_t *content = NULL; oss_acl_e oss_acl; int match_num = 0; int size = 0; aos_string_t bucket; char BUCKET_NAME2[128] = {0}; apr_snprintf(BUCKET_NAME2, 127, "%s-test-itor", TEST_BUCKET_NAME); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); oss_acl = OSS_ACL_PRIVATE; //create the second bucket to iterate s = create_test_bucket(options, BUCKET_NAME2, oss_acl); if (s->error_code) { TEST_CASE_LOG("bucket name %s, %s %s\n", BUCKET_NAME2, s->error_code, s->error_msg); } CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); /* list bucket one by one */ params = oss_create_list_buckets_params(p); params->max_keys = 1; s = oss_list_bucket(options, params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); aos_list_for_each_entry(oss_list_bucket_content_t, content, ¶ms->bucket_list, node) { TEST_CASE_LOG("Get bucket %s\n", content->name.data); if (!strcmp(content->name.data, TEST_BUCKET_NAME) || !strcmp(content->name.data, BUCKET_NAME2) ) { match_num++; } size++; } CuAssertIntEquals(tc, 1, size); while (params->truncated) { aos_list_init(¶ms->bucket_list); aos_str_set(¶ms->marker, params->next_marker.data); params->max_keys = 10; TEST_CASE_LOG("marker:%s, next marker: %s\n", params->marker.data, params->next_marker.data); s = oss_list_bucket(options, params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); aos_list_for_each_entry(oss_list_bucket_content_t, content, ¶ms->bucket_list, node) { TEST_CASE_LOG("Get bucket %s\n", content->name.data); if (!strcmp(content->name.data, TEST_BUCKET_NAME) || !strcmp(content->name.data, BUCKET_NAME2) ) { match_num++; } size++; } CuAssertIntEquals(tc, 1, size > 1); if (size > 100) { if (match_num != 2) { TEST_CASE_LOG("not found expect bucket within %d buckets", size); match_num = 2; } break; } } CuAssertIntEquals(tc, 2, match_num); //delete bucket aos_str_set(&bucket, BUCKET_NAME2); s = oss_delete_bucket(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_list_object_with_delimiter(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_list_object_params_t *params = NULL; oss_list_object_common_prefix_t *common_prefix = NULL; int size = 0; char *prefix = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); params = oss_create_list_object_params(p); params->max_ret = 5; params->truncated = 0; aos_str_set(¶ms->prefix, "oss_tmp"); aos_str_set(¶ms->delimiter, "/"); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_list_object(options, &bucket, params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 0, params->truncated); CuAssertPtrNotNull(tc, resp_headers); aos_list_for_each_entry(oss_list_object_common_prefix_t, common_prefix, ¶ms->common_prefix_list, node) { ++size; prefix = apr_psprintf(p, "%.*s", common_prefix->prefix.len, common_prefix->prefix.data); if (size == 1) { CuAssertStrEquals(tc, "oss_tmp1/", prefix); } else if (size == 2) { CuAssertStrEquals(tc, "oss_tmp2/", prefix); } } CuAssertIntEquals(tc, 3, size); aos_pool_destroy(p); printf("test_list_object_with_delimiter ok\n"); } void test_lifecycle(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t lifecycle_rule_list; oss_lifecycle_rule_content_t *invalid_rule_content = NULL; oss_lifecycle_rule_content_t *rule_content = NULL; oss_lifecycle_rule_content_t *rule_content1 = NULL; oss_lifecycle_rule_content_t *rule_content2 = NULL; oss_lifecycle_rule_content_t *rule_content3 = NULL; oss_lifecycle_rule_content_t *rule_content4 = NULL; int size = 0; char *rule_id = NULL; char *prefix = NULL; char *status = NULL; int days = INT_MAX; char* date = NULL; char* created_before_date = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); //put invalid lifecycle rule aos_list_init(&lifecycle_rule_list); invalid_rule_content = oss_create_lifecycle_rule_content(p); aos_str_set(&invalid_rule_content->id, ""); aos_str_set(&invalid_rule_content->prefix, "pre"); aos_list_add_tail(&invalid_rule_content->node, &lifecycle_rule_list); s = oss_put_bucket_lifecycle(options, &bucket, &lifecycle_rule_list, &resp_headers); CuAssertIntEquals(tc, 400, s->code); CuAssertPtrNotNull(tc, resp_headers); //put lifecycle resp_headers = NULL; aos_list_init(&lifecycle_rule_list); rule_content1 = oss_create_lifecycle_rule_content(p); aos_str_set(&rule_content1->id, "1"); aos_str_set(&rule_content1->prefix, "pre1"); aos_str_set(&rule_content1->status, "Enabled"); rule_content1->days = 1; rule_content2 = oss_create_lifecycle_rule_content(p); aos_str_set(&rule_content2->id, "2"); aos_str_set(&rule_content2->prefix, "pre2"); aos_str_set(&rule_content2->status, "Enabled"); aos_str_set(&rule_content2->date, "2022-10-11T00:00:00.000Z"); rule_content3 = oss_create_lifecycle_rule_content(p); aos_str_set(&rule_content3->id, "3"); aos_str_set(&rule_content3->prefix, "pre3"); aos_str_set(&rule_content3->status, "Enabled"); aos_str_set(&rule_content3->created_before_date, "2017-10-11T00:00:00.000Z"); rule_content3->abort_multipart_upload_dt.days=1; rule_content4 = oss_create_lifecycle_rule_content(p); aos_str_set(&rule_content4->id, "4"); aos_str_set(&rule_content4->prefix, "pre4"); aos_str_set(&rule_content4->status, "Enabled"); aos_str_set(&rule_content4->created_before_date, "2017-10-11T00:00:00.000Z"); aos_str_set(&rule_content4->abort_multipart_upload_dt.created_before_date, "2012-10-11T00:00:00.000Z"); aos_list_add_tail(&rule_content1->node, &lifecycle_rule_list); aos_list_add_tail(&rule_content2->node, &lifecycle_rule_list); aos_list_add_tail(&rule_content3->node, &lifecycle_rule_list); aos_list_add_tail(&rule_content4->node, &lifecycle_rule_list); s = oss_put_bucket_lifecycle(options, &bucket, &lifecycle_rule_list, &resp_headers); if (s->error_msg) { TEST_CASE_LOG("%s %s\n", s->error_msg, s->error_code); } CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); //get lifecycle resp_headers = NULL; aos_list_init(&lifecycle_rule_list); s = oss_get_bucket_lifecycle(options, &bucket, &lifecycle_rule_list, &resp_headers); if (s->error_msg) { printf("%s %s", s->error_msg, s->error_code); } CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_list_for_each_entry(oss_lifecycle_rule_content_t, rule_content, &lifecycle_rule_list, node) { if (size == 0) { rule_id = apr_psprintf(p, "%.*s", rule_content->id.len, rule_content->id.data); CuAssertStrEquals(tc, "1", rule_id); prefix = apr_psprintf(p, "%.*s", rule_content->prefix.len, rule_content->prefix.data); CuAssertStrEquals(tc, "pre1", prefix); date = apr_psprintf(p, "%.*s", rule_content->date.len, rule_content->date.data); CuAssertStrEquals(tc, "", date); status = apr_psprintf(p, "%.*s", rule_content->status.len, rule_content->status.data); CuAssertStrEquals(tc, "Enabled", status); days = rule_content->days; CuAssertIntEquals(tc, 1, days); } else if (size == 1){ rule_id = apr_psprintf(p, "%.*s", rule_content->id.len, rule_content->id.data); CuAssertStrEquals(tc, "2", rule_id); prefix = apr_psprintf(p, "%.*s", rule_content->prefix.len, rule_content->prefix.data); CuAssertStrEquals(tc, "pre2", prefix); date = apr_psprintf(p, "%.*s", rule_content->date.len, rule_content->date.data); CuAssertStrEquals(tc, "2022-10-11T00:00:00.000Z", date); status = apr_psprintf(p, "%.*s", rule_content->status.len, rule_content->status.data); CuAssertStrEquals(tc, "Enabled", status); days = rule_content->days; CuAssertIntEquals(tc, INT_MAX, days); } else if (size == 2) { rule_id = apr_psprintf(p, "%.*s", rule_content->id.len, rule_content->id.data); CuAssertStrEquals(tc, "3", rule_id); prefix = apr_psprintf(p, "%.*s", rule_content->prefix.len, rule_content->prefix.data); CuAssertStrEquals(tc, "pre3", prefix); date = apr_psprintf(p, "%.*s", rule_content->date.len, rule_content->date.data); CuAssertStrEquals(tc, "", date); created_before_date = apr_psprintf(p, "%.*s", rule_content->created_before_date.len, rule_content->created_before_date.data); CuAssertStrEquals(tc, "2017-10-11T00:00:00.000Z", created_before_date); days = rule_content->abort_multipart_upload_dt.days; CuAssertIntEquals(tc, 1, days); status = apr_psprintf(p, "%.*s", rule_content->status.len, rule_content->status.data); CuAssertStrEquals(tc, "Enabled", status); days = rule_content->days; CuAssertIntEquals(tc, INT_MAX, days); } else if (size == 3) { rule_id = apr_psprintf(p, "%.*s", rule_content->id.len, rule_content->id.data); CuAssertStrEquals(tc, "4", rule_id); prefix = apr_psprintf(p, "%.*s", rule_content->prefix.len, rule_content->prefix.data); CuAssertStrEquals(tc, "pre4", prefix); created_before_date = apr_psprintf(p, "%.*s", rule_content->created_before_date.len, rule_content->created_before_date.data); CuAssertStrEquals(tc, "2017-10-11T00:00:00.000Z", created_before_date); created_before_date = apr_psprintf(p, "%.*s", rule_content->abort_multipart_upload_dt.created_before_date.len, rule_content->abort_multipart_upload_dt.created_before_date.data); CuAssertStrEquals(tc, "2012-10-11T00:00:00.000Z", created_before_date); days = rule_content->abort_multipart_upload_dt.days; CuAssertIntEquals(tc, INT_MAX, days); status = apr_psprintf(p, "%.*s", rule_content->status.len, rule_content->status.data); CuAssertStrEquals(tc, "Enabled", status); days = rule_content->days; CuAssertIntEquals(tc, INT_MAX, days); } ++size; } CuAssertIntEquals(tc, 4 ,size); //delete lifecycle resp_headers = NULL; s = oss_delete_bucket_lifecycle(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 204, s->code); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_delete_bucket_lifecycle(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 404, s->code); resp_headers = NULL; aos_list_init(&lifecycle_rule_list); s = oss_get_bucket_lifecycle(options, &bucket, &lifecycle_rule_list, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("test_lifecycle ok\n"); } void test_put_bucket_website(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_website_config_t website_config; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&website_config.suffix_str, "index.html"); aos_str_set(&website_config.key_str, ""); s = oss_put_bucket_website(options, &bucket, &website_config, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_str_set(&website_config.key_str, "errorDocument.html"); s = oss_put_bucket_website(options, &bucket, &website_config, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_get_bucket_website(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_website_config_t website_config; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_get_bucket_website(options, &bucket, &website_config, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, "index.html", website_config.suffix_str.data); CuAssertStrEquals(tc, "errorDocument.html", website_config.key_str.data); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_get_bucket_website(options, &bucket, &website_config, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_delete_bucket_website(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_delete_bucket_website(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 204, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_put_bucket_referer(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_referer_config_t referer_config; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_list_init(&referer_config.referer_list); oss_create_and_add_refer(p, &referer_config, "http://www.aliyun.com"); oss_create_and_add_refer(p, &referer_config, "https://www.aliyun.com"); referer_config.allow_empty_referer = 0; s = oss_put_bucket_referer(options, &bucket, &referer_config, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); referer_config.allow_empty_referer = 1; s = oss_put_bucket_referer(options, &bucket, &referer_config, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_get_bucket_referer(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_referer_config_t referer_config; oss_referer_t *referer; int match_num = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_list_init(&referer_config.referer_list); s = oss_get_bucket_referer(options, &bucket, &referer_config, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 1, referer_config.allow_empty_referer); aos_list_for_each_entry(oss_referer_t, referer, &referer_config.referer_list, node) { TEST_CASE_LOG("get referer %s\n", referer->referer.data); if (!strcmp(referer->referer.data, "http://www.aliyun.com") || !strcmp(referer->referer.data, "https://www.aliyun.com")) { match_num++; } } CuAssertIntEquals(tc, 2, match_num); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_get_bucket_referer(options, &bucket, &referer_config, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_put_bucket_cors(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t cors_rule_list; oss_cors_rule_t *cors_rule1 = NULL, *cors_rule2 = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_list_init(&cors_rule_list); cors_rule1 = oss_create_cors_rule(p); aos_list_add_tail(&cors_rule1->node, &cors_rule_list); oss_create_sub_cors_rule(p, &cors_rule1->allowed_origin_list, "allowed_origin_1_1"); oss_create_sub_cors_rule(p, &cors_rule1->allowed_origin_list, "allowed_origin_2_1"); oss_create_sub_cors_rule(p, &cors_rule1->allowed_method_list, "PUT"); oss_create_sub_cors_rule(p, &cors_rule1->allowed_method_list, "GET"); oss_create_sub_cors_rule(p, &cors_rule1->allowed_head_list, "Authorization"); oss_create_sub_cors_rule(p, &cors_rule1->expose_head_list, "expose_head_1_1"); oss_create_sub_cors_rule(p, &cors_rule1->expose_head_list, "expose_head_2_1"); cors_rule2 = oss_create_cors_rule(p); aos_list_add_tail(&cors_rule2->node, &cors_rule_list); oss_create_sub_cors_rule(p, &cors_rule2->allowed_origin_list, "allowed_origin_2_1"); oss_create_sub_cors_rule(p, &cors_rule2->allowed_origin_list, "allowed_origin_2_2"); oss_create_sub_cors_rule(p, &cors_rule2->allowed_method_list, "PUT"); oss_create_sub_cors_rule(p, &cors_rule2->allowed_method_list, "GET"); oss_create_sub_cors_rule(p, &cors_rule2->allowed_head_list, "Authorization"); oss_create_sub_cors_rule(p, &cors_rule2->expose_head_list, "expose_head_2_1"); oss_create_sub_cors_rule(p, &cors_rule2->expose_head_list, "expose_head_2_2"); s = oss_put_bucket_cors(options, &bucket, &cors_rule_list, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); cors_rule1->max_age_seconds = 100000; s = oss_put_bucket_cors(options, &bucket, &cors_rule_list, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_get_bucket_cors(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t cors_rule_list; oss_cors_rule_t *cors_rule = NULL; oss_sub_cors_rule_t *sub_cors_rule = NULL; int size = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_list_init(&cors_rule_list); s = oss_get_bucket_cors(options, &bucket, &cors_rule_list, &resp_headers); CuAssertIntEquals(tc, 200, s->code); aos_list_for_each_entry(oss_cors_rule_t, cors_rule, &cors_rule_list, node) { TEST_CASE_LOG("%d\n", cors_rule->max_age_seconds); aos_list_for_each_entry(oss_sub_cors_rule_t, sub_cors_rule, &cors_rule->allowed_origin_list, node) { int is_match_put_before = !strncmp("allowed_origin", sub_cors_rule->rule.data, 14); CuAssertIntEquals(tc, 1, is_match_put_before); TEST_CASE_LOG("%s\n", sub_cors_rule->rule.data); } aos_list_for_each_entry(oss_sub_cors_rule_t, sub_cors_rule, &cors_rule->allowed_method_list, node) { int is_match_put_before = strcmp("PUT", sub_cors_rule->rule.data) || strcmp("GET", sub_cors_rule->rule.data); CuAssertIntEquals(tc, 1, is_match_put_before); TEST_CASE_LOG("%s\n", sub_cors_rule->rule.data); } aos_list_for_each_entry(oss_sub_cors_rule_t, sub_cors_rule, &cors_rule->allowed_head_list, node) { CuAssertStrEquals(tc, "authorization", sub_cors_rule->rule.data); TEST_CASE_LOG("%s\n", sub_cors_rule->rule.data); } aos_list_for_each_entry(oss_sub_cors_rule_t, sub_cors_rule, &cors_rule->expose_head_list, node) { int is_match_put_before = !strncmp("expose_head", sub_cors_rule->rule.data, 11); CuAssertIntEquals(tc, 1, is_match_put_before); TEST_CASE_LOG("%s\n", sub_cors_rule->rule.data); } size++; } CuAssertIntEquals(tc, 2, size); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_get_bucket_cors(options, &bucket, &cors_rule_list, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_delete_bucket_cors(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_delete_bucket_cors(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 204, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_delete_objects_quiet(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; aos_status_t *s = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; char *object_name1 = "oss_test_object1"; char *object_name2 = "oss_test_object2"; oss_object_key_t *content1 = NULL; oss_object_key_t *content2 = NULL; aos_list_t object_list; aos_list_t deleted_object_list; int is_quiet = 1; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_list_init(&object_list); aos_list_init(&deleted_object_list); content1 = oss_create_oss_object_key(p); aos_str_set(&content1->key, object_name1); aos_list_add_tail(&content1->node, &object_list); content2 = oss_create_oss_object_key(p); aos_str_set(&content2->key, object_name2); aos_list_add_tail(&content2->node, &object_list); s = oss_delete_objects(options, &bucket, &object_list, is_quiet, &resp_headers, &deleted_object_list); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_delete_objects(options, &bucket, &object_list, is_quiet, &resp_headers, &deleted_object_list); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("test_delete_objects_quiet ok\n"); } void test_delete_objects_not_quiet(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; aos_status_t *s = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; char *object_name1 = "oss_tmp1/"; char *object_name2 = "oss_tmp2/"; oss_object_key_t *content = NULL; oss_object_key_t *content1 = NULL; oss_object_key_t *content2 = NULL; aos_list_t object_list; aos_list_t deleted_object_list; int is_quiet = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_list_init(&object_list); aos_list_init(&deleted_object_list); content1 = oss_create_oss_object_key(p); aos_str_set(&content1->key, object_name1); aos_list_add_tail(&content1->node, &object_list); content2 = oss_create_oss_object_key(p); aos_str_set(&content2->key, object_name2); aos_list_add_tail(&content2->node, &object_list); s = oss_delete_objects(options, &bucket, &object_list, is_quiet, &resp_headers, &deleted_object_list); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_list_for_each_entry(oss_object_key_t, content, &deleted_object_list, node) { printf("Deleted key:%.*s\n", content->key.len, content->key.data); } aos_pool_destroy(p); printf("test_delete_objects_not_quiet ok\n"); } void test_delete_objects_by_prefix(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_string_t bucket; aos_status_t *s = NULL; aos_string_t prefix; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); // delete none aos_str_set(&prefix, "oss_tmp3/2"); s = oss_delete_objects_by_prefix(options, &bucket, &prefix); CuAssertIntEquals(tc, 200, s->code); // delete one object aos_str_set(&prefix, "oss_tmp3/1/0.txt"); s = oss_delete_objects_by_prefix(options, &bucket, &prefix); CuAssertIntEquals(tc, 200, s->code); // delete multi-objects aos_str_set(&prefix, "oss_tmp3/1"); s = oss_delete_objects_by_prefix(options, &bucket, &prefix); CuAssertIntEquals(tc, 200, s->code); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_delete_objects_by_prefix(options, &bucket, &prefix); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("test_delete_object_by_prefix ok\n"); } void test_oss_head_bucket(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_head_bucket(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_head_bucket(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_bucket_invalid_parameter(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; int i; char *invalid_name_list[] = { "a", "1", "!", "aa", "12", "a1", "a!", "1!", "aAa", "1A1", "a!a", "FengChao@123", "-a123", "a_123", "a123-", "1234567890123456789012345678901234567890123456789012345678901234", "" }; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); for (i = 0; i < sizeof(invalid_name_list) / sizeof(invalid_name_list[0]); i++) { aos_string_t bucket; aos_status_t *s = NULL; aos_table_t *resp_headers = NULL; aos_str_set(&bucket, invalid_name_list[i]); s = oss_create_bucket(options, &bucket, OSS_ACL_DEFAULT, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_create_bucket_with_storage_class(options, &bucket, OSS_ACL_DEFAULT, OSS_STORAGE_CLASS_STANDARD, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_delete_bucket(options, &bucket, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_bucket_acl(options, &bucket, OSS_ACL_DEFAULT, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_bucket_acl(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_head_bucket(options, &bucket, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_bucket_location(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_bucket_info(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_bucket_stat(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_bucket_referer(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_bucket_storage_capacity(options, &bucket, 1024L, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_bucket_storage_capacity(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_list_object(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_bucket_logging(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_bucket_logging(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_delete_bucket_logging(options, &bucket, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_bucket_lifecycle(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_bucket_cors(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_bucket_cors(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_delete_bucket_cors(options, &bucket, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_bucket_referer(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_bucket_website(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_bucket_website(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_delete_bucket_website(options, &bucket, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_bucket_lifecycle(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_delete_bucket_lifecycle(options, &bucket, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_delete_objects(options, &bucket, NULL, 0, &resp_headers, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_delete_objects_by_prefix(options, &bucket, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); } aos_pool_destroy(p); printf("test_bucket_invalid_parameter ok\n"); } CuSuite *test_oss_bucket() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_bucket_setup); SUITE_ADD_TEST(suite, test_create_bucket); SUITE_ADD_TEST(suite, test_get_bucket_info); SUITE_ADD_TEST(suite, test_get_bucket_stat); SUITE_ADD_TEST(suite, test_put_bucket_website); SUITE_ADD_TEST(suite, test_get_bucket_website); SUITE_ADD_TEST(suite, test_delete_bucket_website); SUITE_ADD_TEST(suite, test_put_bucket_referer); SUITE_ADD_TEST(suite, test_get_bucket_referer); SUITE_ADD_TEST(suite, test_put_bucket_logging); SUITE_ADD_TEST(suite, test_get_bucket_logging); SUITE_ADD_TEST(suite, test_delete_bucket_logging); SUITE_ADD_TEST(suite, test_put_bucket_cors); SUITE_ADD_TEST(suite, test_get_bucket_cors); SUITE_ADD_TEST(suite, test_delete_bucket_cors); SUITE_ADD_TEST(suite, test_get_bucket_location); SUITE_ADD_TEST(suite, test_put_bucket_storage_capacity); SUITE_ADD_TEST(suite, test_get_bucket_storage_capacity); SUITE_ADD_TEST(suite, test_list_buckets); SUITE_ADD_TEST(suite, test_list_buckets_with_invalid_prefix); SUITE_ADD_TEST(suite, test_list_buckets_with_iterator); SUITE_ADD_TEST(suite, test_put_bucket_acl); SUITE_ADD_TEST(suite, test_put_bucket_acl_invalid_acl); SUITE_ADD_TEST(suite, test_get_bucket_acl); SUITE_ADD_TEST(suite, test_delete_objects_by_prefix); SUITE_ADD_TEST(suite, test_list_object); SUITE_ADD_TEST(suite, test_list_object_with_delimiter); SUITE_ADD_TEST(suite, test_delete_bucket); SUITE_ADD_TEST(suite, test_lifecycle); SUITE_ADD_TEST(suite, test_delete_objects_quiet); SUITE_ADD_TEST(suite, test_delete_objects_not_quiet); SUITE_ADD_TEST(suite, test_create_bucket_with_storage_class); SUITE_ADD_TEST(suite, test_oss_head_bucket); SUITE_ADD_TEST(suite, test_bucket_invalid_parameter); SUITE_ADD_TEST(suite, test_bucket_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_callback.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" void test_callback_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "callback"); /* create test bucket */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); } void test_callback_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; char *object_name1 = "oss_test_cb_put_object.ts"; char *object_name2 = "oss_test_cb_multipart_object.ts"; //aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); /* delete test object */ delete_test_object(options, TEST_BUCKET_NAME, object_name1); delete_test_object(options, TEST_BUCKET_NAME, object_name2); /* delete test bucket */ aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, NULL); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } void test_callback_put_object_from_buffer(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_cb_put_object.ts"; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; aos_list_t buffer; aos_buf_t *content; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; char b64_buf[1024]; int b64_len; char callback[1024]; /* JSON format */ char *callback_fmt = "{" "\"callbackUrl\":\"%s\"," "\"callbackHost\":\"oss-cn-hangzhou.aliyuncs.com\"," "\"callbackBody\":\"bucket=${bucket}&object=${object}&size=${size}&mimeType=${mimeType}\"," "\"callbackBodyType\":\"application/x-www-form-urlencoded\"" "}"; aos_log_level_e oldLogLevel; oldLogLevel = aos_log_level; aos_log_set_level(AOS_LOG_DEBUG); sprintf(callback, callback_fmt, TEST_CALLBACK_URL); /* init test */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); /* put call into header */ b64_len = aos_base64_encode((unsigned char*)callback, strlen(callback), b64_buf); b64_buf[b64_len] = '\0'; headers = aos_table_make(p, 1); apr_table_set(headers, OSS_CALLBACK, b64_buf); /* test put object */ s = oss_do_put_object_from_buffer(options, &bucket, &object, &buffer, headers, NULL, NULL, &resp_headers, &resp_body); aos_log_set_level(oldLogLevel); CuAssertIntEquals(tc, 200, s->code); /* get buffer len */ len = aos_buf_list_len(&resp_body); buf = (char *)aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; /* copy buffer content to memory */ aos_list_for_each_entry(aos_buf_t, content, &resp_body, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } CuAssertStrEquals(tc, buf, "{\"Status\":\"OK\"}"); aos_pool_destroy(p); /* head object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); printf("test_callback_put_object_from_buffer ok\n"); } void test_callback_multipart_from_buffer(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_cb_multipart_object.ts"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t buffer; oss_list_upload_part_params_t *params = NULL; aos_string_t upload_id; aos_list_t complete_part_list; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_list_part_content_t *part_content1 = NULL; oss_complete_part_content_t *complete_content1 = NULL; int part_num = 1; aos_list_t resp_body; aos_buf_t *content; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; char b64_buf[1024]; int b64_len; char callback[1024]; /* JSON format */ char *callback_fmt = "{" "\"callbackUrl\":\"%s\"," "\"callbackHost\":\"oss-cn-hangzhou.aliyuncs.com\"," "\"callbackBody\":\"bucket=${bucket}&object=${object}&size=${size}&mimeType=${mimeType}\"," "\"callbackBodyType\":\"application/x-www-form-urlencoded\"" "}"; sprintf(callback, callback_fmt, TEST_CALLBACK_URL); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); /* put call into header */ b64_len = aos_base64_encode((unsigned char*)callback, strlen(callback), b64_buf); b64_buf[b64_len] = '\0'; headers = aos_table_make(p, 1); apr_table_set(headers, OSS_CALLBACK, b64_buf); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); //upload part aos_list_init(&buffer); make_random_body(p, 2, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num++, &buffer, NULL); CuAssertIntEquals(tc, 200, s->code); aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num++, &buffer, NULL); CuAssertIntEquals(tc, 200, s->code); //list part params = oss_create_list_upload_part_params(p); params->max_ret = 1; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, NULL); CuAssertIntEquals(tc, 200, s->code); aos_list_for_each_entry(oss_list_part_content_t, part_content1, ¶ms->part_list, node) { complete_content1 = oss_create_complete_part_content(p); aos_str_set(&complete_content1->part_number, part_content1->part_number.data); aos_str_set(&complete_content1->etag, part_content1->etag.data); aos_list_add_tail(&complete_content1->node, &complete_part_list); } //complete multipart s = oss_do_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, headers, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); /* get buffer len */ len = aos_buf_list_len(&resp_body); buf = (char *)aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; /* copy buffer content to memory */ aos_list_for_each_entry(aos_buf_t, content, &resp_body, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } CuAssertStrEquals(tc, buf, "{\"Status\":\"OK\"}"); aos_pool_destroy(p); printf("test_callback_multipart_from_buffer ok\n"); } CuSuite *test_oss_callback() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_callback_setup); SUITE_ADD_TEST(suite, test_callback_put_object_from_buffer); SUITE_ADD_TEST(suite, test_callback_multipart_from_buffer); SUITE_ADD_TEST(suite, test_callback_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_crc.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" #include "aos_crc64.h" void test_crc_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "crc"); /* create test bucket */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); } void test_crc_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; char *object_name1 = "oss_test_crc_put_object.txt"; char *object_name2 = "oss_test_crc_append_object.txt"; char *object_name3 = "oss_test_crc_multipart_object.txt"; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); /* delete test object */ delete_test_object(options, TEST_BUCKET_NAME, object_name1); delete_test_object(options, TEST_BUCKET_NAME, object_name2); delete_test_object(options, TEST_BUCKET_NAME, object_name3); /* delete test bucket */ aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } void test_crc_append_object_from_buffer(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_crc_append_object.txt"; aos_string_t bucket; aos_string_t object; char *str = "Time is a bird for ever on the wing."; aos_status_t *s = NULL; int is_cname = 0; int64_t position = 0; uint64_t initcrc = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; aos_list_t buffer; aos_buf_t *content = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); /* append object */ aos_list_init(&buffer); content = aos_buf_pack(p, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); oss_delete_object(options, &bucket, &object, NULL); s = oss_do_append_object_from_buffer(options, &bucket, &object, position, initcrc, &buffer, headers, NULL, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); position = aos_atoi64((char*)(apr_table_get(resp_headers, OSS_NEXT_APPEND_POSITION))); initcrc = aos_atoui64((char*)(apr_table_get(resp_headers, OSS_HASH_CRC64_ECMA))); /* append object */ s = oss_do_append_object_from_buffer(options, &bucket, &object, position, initcrc, &buffer, NULL, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, 200, s->code); /* delete object */ s= oss_delete_object(options, &bucket, &object, NULL); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("test_crc_append_object_from_buffer ok\n"); } void test_crc_append_object_from_file(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_crc_append_object.txt"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; int64_t position = 0; uint64_t initcrc = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); make_random_file(p, object_name, 10240); aos_str_set(&filename, object_name); oss_delete_object(options, &bucket, &object, NULL); /* append object */ s = oss_do_append_object_from_file(options, &bucket, &object, position, initcrc, &filename, headers, NULL, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); position = aos_atoi64((char*)(apr_table_get(resp_headers, OSS_NEXT_APPEND_POSITION))); initcrc = aos_atoui64((char*)(apr_table_get(resp_headers, OSS_HASH_CRC64_ECMA))); /* append object */ s = oss_do_append_object_from_file(options, &bucket, &object, position, initcrc, &filename, NULL, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, 200, s->code); /* delete object */ s= oss_delete_object(options, &bucket, &object, NULL); CuAssertIntEquals(tc, 204, s->code); apr_file_remove(object_name, p); aos_pool_destroy(p); printf("test_crc_append_object_from_file ok\n"); } void test_crc_disable_crc(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_crc_put_object.txt"; char *str = "Sow nothing, reap nothing."; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; oss_request_options_t *options = NULL; aos_list_t resp_body; aos_list_t buffer; aos_buf_t *content; /* init test*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); options->ctl->options->enable_crc = AOS_FALSE; /* test put object */ s = oss_put_object_from_buffer(options, &bucket, &object, &buffer, NULL, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); /* test get object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); options->ctl->options->enable_crc = AOS_FALSE; s = oss_get_object_to_buffer(options, &bucket, &object, NULL, NULL, &buffer, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); printf("test_crc_disable_crc ok\n"); } /* Test crc64() on vector[0..len-1] which should have CRC-64 crc. Also test crc64_combine() on vector[] split in two. */ static void crc64_combine_test(CuTest *tc, void *vector, size_t len, uint64_t crc) { uint64_t crc1, crc2; /* test crc64() */ crc1 = aos_crc64(0, vector, len); CuAssertTrue(tc, crc1 == crc); /* test crc64_combine() */ crc1 = aos_crc64(0, vector, (len + 1) >> 1); crc2 = aos_crc64(0, (char*)vector + ((len + 1) >> 1), len >> 1); crc1 = aos_crc64_combine(crc1, crc2, len >> 1); CuAssertTrue(tc, crc1 == crc); } void test_crc_combine(CuTest *tc) { char *str1 = "123456789"; size_t len1 = 9; uint64_t crc1 = UINT64_C(0x995dc9bbdf1939fa); char *str2 = "This is a test of the emergency broadcast system."; size_t len2 = 49; uint64_t crc2 = UINT64_C(0x27db187fc15bbc72); crc64_combine_test(tc, str1, len1, crc1); crc64_combine_test(tc, str2, len2, crc2); CuAssertTrue(tc, aos_crc64_combine(crc1, crc2, 0) == crc1); printf("test_crc_combine ok\n"); } void test_crc_negative(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_crc_append_object_neg.txt"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; int64_t position = 0; oss_request_options_t *options = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); make_random_file(p, object_name, 1024); aos_str_set(&filename, object_name); oss_delete_object(options, &bucket, &object, NULL); /* append object */ s = oss_do_append_object_from_file(options, &bucket, &object, position, 1, &filename, NULL, NULL, NULL, NULL, NULL); //CuAssertIntEquals(tc, 200, s->code); /* delete object */ s= oss_delete_object(options, &bucket, &object, NULL); CuAssertIntEquals(tc, 204, s->code); apr_file_remove(object_name, p); aos_pool_destroy(p); printf("test_crc_negative ok\n"); } void test_crc_big_endian(CuTest *tc) { char *str1 = "12345678"; char *str2 = "87654321"; char *str3 = "123456789"; uint64_t crc1; uint64_t crc2; crc1 = aos_crc64_test(0, str1, 8, 0); crc2 = aos_crc64_test(0, str2, 8, 1); // CuAssertTrue(tc, crc1 == crc2); crc1 = aos_crc64_test(0, str3, 9, 0); (void)(crc1); (void)(crc2); printf("test_crc_big_endian ok\n"); } CuSuite *test_oss_crc() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_crc_setup); SUITE_ADD_TEST(suite, test_crc_append_object_from_buffer); SUITE_ADD_TEST(suite, test_crc_append_object_from_file); SUITE_ADD_TEST(suite, test_crc_disable_crc); SUITE_ADD_TEST(suite, test_crc_combine); SUITE_ADD_TEST(suite, test_crc_negative); SUITE_ADD_TEST(suite, test_crc_big_endian); SUITE_ADD_TEST(suite, test_crc_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_https.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" #include "aos_crc64.h" static char ca_file[1024]; static char test_endpoint[1024]; void test_https_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "https"); /* create test bucket */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); sprintf(ca_file, "%sca-certificates.crt", get_test_file_path()); if (!strncasecmp("http://", TEST_OSS_ENDPOINT, 7)) { sprintf(test_endpoint, "https://%s", TEST_OSS_ENDPOINT + 7); } CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); } void test_https_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; char *object_name1 = "oss_test_https_put_object.txt"; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); /* delete test object */ delete_test_object(options, TEST_BUCKET_NAME, object_name1); /* delete test bucket */ aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } void init_test_https_request_options(oss_request_options_t *options, int is_cname) { options->config = oss_config_create(options->pool); aos_str_set(&options->config->endpoint, test_endpoint); aos_str_set(&options->config->access_key_id, TEST_ACCESS_KEY_ID); aos_str_set(&options->config->access_key_secret, TEST_ACCESS_KEY_SECRET); options->config->is_cname = is_cname; options->ctl = aos_http_controller_create(options->pool, 0); options->ctl->options = aos_http_request_options_create(options->pool); options->ctl->options->verify_ssl = AOS_TRUE; options->ctl->options->ca_file = ca_file; options->ctl->options->ca_path = get_test_file_path(); } void test_https_put_object_from_buffer(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_https_put_object.txt"; char *str = "Sow nothing, reap nothing."; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_list_t buffer; aos_buf_t *content; /* init test*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_https_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); headers = aos_table_make(p, 2); apr_table_set(headers, "Expect", ""); apr_table_set(headers, "Transfer-Encoding", ""); /* test put object */ s = oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); /* test get object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_https_request_options(options, is_cname); s = oss_get_object_to_buffer(options, &bucket, &object, NULL, NULL, &buffer, NULL); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, AOS_TRUE, options->ctl->options->verify_ssl); CuAssertStrEquals(tc, ca_file, options->ctl->options->ca_file); aos_pool_destroy(p); printf("test_https_put_object_from_buffer ok\n"); } void test_https_list_object(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_list_object_params_t *params = NULL; oss_list_object_content_t *content = NULL; int size = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_https_request_options(options, is_cname); params = oss_create_list_object_params(p); params->max_ret = 1; params->truncated = 0; aos_str_set(¶ms->prefix, "oss_test_https_"); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_list_object(options, &bucket, params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, AOS_TRUE, options->ctl->options->verify_ssl); CuAssertStrEquals(tc, ca_file, options->ctl->options->ca_file); aos_list_for_each_entry(oss_list_object_content_t, content, ¶ms->object_list, node) { ++size; } CuAssertIntEquals(tc, 1 ,size); printf("test_https_list_object ok\n"); } void test_https_list_object_negative(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_list_object_params_t *params = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_https_request_options(options, is_cname); options->ctl->options->ca_file = ""; options->ctl->options->ca_path = ""; params = oss_create_list_object_params(p); params->max_ret = 1; params->truncated = 0; aos_str_set(¶ms->prefix, "oss_test_https_"); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_list_object(options, &bucket, params, &resp_headers); CuAssertIntEquals(tc, -996, s->code); CuAssertStrEquals(tc, "Problem with the SSL CA cert (path? access rights?)", s->error_msg); CuAssertIntEquals(tc, AOS_TRUE, options->ctl->options->verify_ssl); printf("test_https_list_object_negative ok\n"); } CuSuite *test_oss_https() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_https_setup); SUITE_ADD_TEST(suite, test_https_put_object_from_buffer); SUITE_ADD_TEST(suite, test_https_list_object); SUITE_ADD_TEST(suite, test_https_list_object_negative); SUITE_ADD_TEST(suite, test_https_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_image.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "aos_transport.h" #include "aos_http_io.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" #include "apr_time.h" static char test_file[1024]; static char *original_image = "example.jpg"; static char *processed_image = "processed_example.jpg"; static void put_example_image(CuTest *tc); void test_image_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "image"); // create test bucket aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); sprintf(test_file, "%sexample.jpg", get_test_file_path()); aos_pool_destroy(p); } void test_image_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); /* delete test object */ delete_test_object(options, TEST_BUCKET_NAME, original_image); delete_test_object(options, TEST_BUCKET_NAME, processed_image); /* delete test bucket */ aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } void test_resize_image(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; image_info_t image_info; /* put original image */ put_example_image(tc); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, original_image); aos_list_init(&buffer); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/resize,m_fixed,w_100,h_100"); /* get processed image to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); aos_str_set(&object, processed_image); /* put processed image */ s= oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); /* check processed image */ s = get_image_info(options, TEST_BUCKET_NAME, processed_image, &image_info); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 100, image_info.height); CuAssertIntEquals(tc, 100, image_info.width); //CuAssertIntEquals(tc, 3347, image_info.size); CuAssertStrEquals(tc, "jpg", image_info.format); aos_pool_destroy(p); printf("test_resize_image ok\n"); } void test_crop_image(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; image_info_t image_info; /* put original image */ put_example_image(tc); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, original_image); aos_list_init(&buffer); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/crop,w_100,h_100,x_100,y_100,r_1"); /* get processed image to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); aos_str_set(&object, processed_image); /* put processed image */ s= oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); /* check processed image */ s = get_image_info(options, TEST_BUCKET_NAME, processed_image, &image_info); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 100, image_info.height); CuAssertIntEquals(tc, 100, image_info.width); CuAssertIntEquals(tc, 1969, image_info.size); CuAssertStrEquals(tc, "jpg", image_info.format); aos_pool_destroy(p); printf("test_crop_image ok\n"); } void test_rotate_image(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; image_info_t image_info; /* put original image */ put_example_image(tc); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, original_image); aos_list_init(&buffer); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/rotate,90"); /* get processed image to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); aos_str_set(&object, processed_image); /* put processed image */ s= oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); /* check processed image */ s = get_image_info(options, TEST_BUCKET_NAME, processed_image, &image_info); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 400, image_info.height); CuAssertIntEquals(tc, 267, image_info.width); CuAssertIntEquals(tc, 20998, image_info.size); CuAssertStrEquals(tc, "jpg", image_info.format); aos_pool_destroy(p); printf("test_rotate_image ok\n"); } void test_sharpen_image(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; image_info_t image_info; /* put original image */ put_example_image(tc); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, original_image); aos_list_init(&buffer); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/sharpen,100"); /* get processed image to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); aos_str_set(&object, processed_image); /* put processed image */ s= oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); /* check processed image */ s = get_image_info(options, TEST_BUCKET_NAME, processed_image, &image_info); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 267, image_info.height); CuAssertIntEquals(tc, 400, image_info.width); CuAssertIntEquals(tc, 23015, image_info.size); CuAssertStrEquals(tc, "jpg", image_info.format); aos_pool_destroy(p); printf("test_sharpen_image ok\n"); } void test_watermark_image(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; image_info_t image_info; /* put original image */ put_example_image(tc); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, original_image); aos_list_init(&buffer); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/watermark,text_SGVsbG8g5Zu-54mH5pyN5YqhIQ"); /* get processed image to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); aos_str_set(&object, processed_image); /* put processed image */ s= oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); /* check processed image */ s = get_image_info(options, TEST_BUCKET_NAME, processed_image, &image_info); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 267, image_info.height); CuAssertIntEquals(tc, 400, image_info.width); CuAssertStrEquals(tc, "jpg", image_info.format); aos_pool_destroy(p); printf("test_watermark_image ok\n"); } void test_format_image(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; image_info_t image_info; /* put original image */ put_example_image(tc); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, original_image); aos_list_init(&buffer); params = aos_table_make(p, 1); apr_table_set(params, OSS_PROCESS, "image/format,png"); /* get processed image to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); aos_str_set(&object, processed_image); /* put processed image */ s= oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); /* check processed image */ s = get_image_info(options, TEST_BUCKET_NAME, processed_image, &image_info); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 267, image_info.height); CuAssertIntEquals(tc, 400, image_info.width); CuAssertIntEquals(tc, 160733, image_info.size); CuAssertStrEquals(tc, "png", image_info.format); aos_pool_destroy(p); printf("test_format_image ok\n"); } void put_example_image(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; char *content_type = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, original_image); aos_str_set(&filename, test_file); s = oss_put_object_from_file(options, &bucket, &object, &filename, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); /* head object */ s = oss_head_object(options, &bucket, &object, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); content_type = (char*)(apr_table_get(resp_headers, OSS_CONTENT_TYPE)); CuAssertStrEquals(tc, "image/jpeg", content_type); aos_pool_destroy(p); } CuSuite *test_oss_image() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_image_setup); SUITE_ADD_TEST(suite, test_resize_image); SUITE_ADD_TEST(suite, test_crop_image); SUITE_ADD_TEST(suite, test_rotate_image); SUITE_ADD_TEST(suite, test_sharpen_image); SUITE_ADD_TEST(suite, test_watermark_image); SUITE_ADD_TEST(suite, test_format_image); SUITE_ADD_TEST(suite, test_image_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_live.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "aos_transport.h" #include "aos_http_io.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" #include "apr_time.h" void test_live_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "live"); //create test bucket aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); } void test_live_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); //delete test bucket aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } void test_create_live_channel_default(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t publish_url_list; aos_list_t play_url_list; oss_live_channel_configuration_t *config = NULL; oss_live_channel_configuration_t info; char *live_channel_name = "test_live_channel_create_def"; char *live_channel_desc = "my test live channel"; aos_string_t bucket; aos_string_t channel_name; oss_live_channel_publish_url_t *publish_url; oss_live_channel_play_url_t *play_url; char *content = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&channel_name, live_channel_name); config = oss_create_live_channel_configuration_content(options->pool); aos_str_set(&config->name, live_channel_name); aos_str_set(&config->description, live_channel_desc); // create aos_list_init(&publish_url_list); aos_list_init(&play_url_list); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_create_live_channel(options, &bucket, config, &publish_url_list, &play_url_list, NULL); CuAssertIntEquals(tc, 404, s->code); //valid bucketname aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_create_live_channel(options, &bucket, config, &publish_url_list, &play_url_list, NULL); CuAssertIntEquals(tc, 200, s->code); aos_list_for_each_entry(oss_live_channel_publish_url_t, publish_url, &publish_url_list, node) { content = apr_psprintf(p, "%.*s", publish_url->publish_url.len, publish_url->publish_url.data); CuAssertStrnEquals(tc, AOS_RTMP_PREFIX, strlen(AOS_RTMP_PREFIX), content); CuAssertIntEquals(tc, 1, aos_ends_with(&publish_url->publish_url, &channel_name)); } aos_list_for_each_entry(oss_live_channel_play_url_t, play_url, &play_url_list, node) { content = apr_psprintf(p, "%.*s", play_url->play_url.len, play_url->play_url.data); CuAssertStrnEquals(tc, AOS_HTTP_PREFIX, strlen(AOS_HTTP_PREFIX), content); CuAssertIntEquals(tc, 1, aos_ends_with(&play_url->play_url, &config->target.play_list_name)); } // get info s = oss_get_live_channel_info(options, &bucket, &channel_name, &info, NULL); CuAssertIntEquals(tc, 200, s->code); content = apr_psprintf(p, "%.*s", info.name.len, info.name.data); CuAssertStrEquals(tc, live_channel_name, content); content = apr_psprintf(p, "%.*s", info.description.len, info.description.data); CuAssertStrEquals(tc, live_channel_desc, content); content = apr_psprintf(p, "%.*s", info.status.len, info.status.data); CuAssertStrEquals(tc, LIVE_CHANNEL_STATUS_ENABLED, content); content = apr_psprintf(p, "%.*s", info.target.type.len, info.target.type.data); CuAssertStrEquals(tc, LIVE_CHANNEL_DEFAULT_TYPE, content); content = apr_psprintf(p, "%.*s", info.target.play_list_name.len, info.target.play_list_name.data); CuAssertStrEquals(tc, LIVE_CHANNEL_DEFAULT_PLAYLIST, content); CuAssertIntEquals(tc, LIVE_CHANNEL_DEFAULT_FRAG_DURATION, info.target.frag_duration); CuAssertIntEquals(tc, LIVE_CHANNEL_DEFAULT_FRAG_COUNT, info.target.frag_count); // delete s = oss_delete_live_channel(options, &bucket, &channel_name, NULL); CuAssertIntEquals(tc, 204, s->code); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_get_live_channel_info(options, &bucket, &channel_name, &info, NULL); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("test_create_live_channel_default ok\n"); } void test_create_live_channel(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t publish_url_list; aos_list_t play_url_list; oss_live_channel_configuration_t *config = NULL; oss_live_channel_configuration_t info; char *live_channel_name = "test_live_channel_create"; char *live_channel_desc = "my test live channel,<>{}=?//&"; aos_string_t bucket; aos_string_t channel_name; oss_live_channel_publish_url_t *publish_url; oss_live_channel_play_url_t *play_url; aos_table_t *resp_headers = NULL; char *content = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&channel_name, live_channel_name); config = oss_create_live_channel_configuration_content(options->pool); aos_str_set(&config->name, live_channel_name); aos_str_set(&config->description, live_channel_desc); aos_str_set(&config->status, LIVE_CHANNEL_STATUS_DISABLED); aos_str_set(&config->target.type, "HLS"); aos_str_set(&config->target.play_list_name, "myplay.m3u8"); config->target.frag_duration = 100; config->target.frag_count = 99; // create aos_list_init(&publish_url_list); aos_list_init(&play_url_list); s = oss_create_live_channel(options, &bucket, config, &publish_url_list, &play_url_list, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_list_for_each_entry(oss_live_channel_publish_url_t, publish_url, &publish_url_list, node) { content = apr_psprintf(p, "%.*s", publish_url->publish_url.len, publish_url->publish_url.data); CuAssertStrnEquals(tc, AOS_RTMP_PREFIX, strlen(AOS_RTMP_PREFIX), content); CuAssertIntEquals(tc, 1, aos_ends_with(&publish_url->publish_url, &channel_name)); } aos_list_for_each_entry(oss_live_channel_play_url_t, play_url, &play_url_list, node) { content = apr_psprintf(p, "%.*s", play_url->play_url.len, play_url->play_url.data); CuAssertStrnEquals(tc, AOS_HTTP_PREFIX, strlen(AOS_HTTP_PREFIX), content); CuAssertIntEquals(tc, 1, aos_ends_with(&play_url->play_url, &config->target.play_list_name)); } // get info s = oss_get_live_channel_info(options, &bucket, &channel_name, &info, NULL); CuAssertIntEquals(tc, 200, s->code); content = apr_psprintf(p, "%.*s", info.name.len, info.name.data); CuAssertStrEquals(tc, live_channel_name, content); content = apr_psprintf(p, "%.*s", info.description.len, info.description.data); CuAssertStrEquals(tc, live_channel_desc, content); content = apr_psprintf(p, "%.*s", info.status.len, info.status.data); CuAssertStrEquals(tc, LIVE_CHANNEL_STATUS_DISABLED, content); content = apr_psprintf(p, "%.*s", info.target.type.len, info.target.type.data); CuAssertStrEquals(tc, "HLS", content); content = apr_psprintf(p, "%.*s", info.target.play_list_name.len, info.target.play_list_name.data); CuAssertStrEquals(tc, "myplay.m3u8", content); CuAssertIntEquals(tc, 100, info.target.frag_duration); CuAssertIntEquals(tc, 99, info.target.frag_count); // delete s = oss_delete_live_channel(options, &bucket, &channel_name, NULL); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("test_create_live_channel ok\n"); } void test_get_live_channel_stat(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t publish_url_list; aos_list_t play_url_list; oss_live_channel_configuration_t *config = NULL; oss_live_channel_stat_t live_stat; char *live_channel_name = "test_live_channel_stat"; char *live_channel_desc = "my test live channel"; aos_string_t bucket; aos_string_t channel_name; char *content = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&channel_name, live_channel_name); config = oss_create_live_channel_configuration_content(options->pool); aos_str_set(&config->name, live_channel_name); aos_str_set(&config->description, live_channel_desc); // create aos_list_init(&publish_url_list); aos_list_init(&play_url_list); s = oss_create_live_channel(options, &bucket, config, &publish_url_list, &play_url_list, NULL); CuAssertIntEquals(tc, 200, s->code); // get stat s = oss_get_live_channel_stat(options, &bucket, &channel_name, &live_stat, NULL); CuAssertIntEquals(tc, 200, s->code); content = apr_psprintf(p, "%.*s", live_stat.pushflow_status.len, live_stat.pushflow_status.data); CuAssertStrEquals(tc, "Idle", content); s = oss_delete_live_channel(options, &bucket, &channel_name, NULL); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("test_get_live_channel_stat ok\n"); } void test_put_live_channel_status(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; aos_status_t *s = NULL; char *live_channel_name = "test_live_channel_status"; aos_string_t bucket; aos_string_t channel_name; aos_string_t channel_stutus; oss_live_channel_configuration_t info; char *content = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&channel_name, live_channel_name); // create s = create_test_live_channel(options, TEST_BUCKET_NAME, live_channel_name); CuAssertIntEquals(tc, 200, s->code); // put status aos_str_set(&channel_stutus, LIVE_CHANNEL_STATUS_DISABLED); s= oss_put_live_channel_status(options, &bucket, &channel_name, &channel_stutus, NULL); CuAssertIntEquals(tc, 200, s->code); // check by get info s = oss_get_live_channel_info(options, &bucket, &channel_name, &info, NULL); CuAssertIntEquals(tc, 200, s->code); content = apr_psprintf(p, "%.*s", info.name.len, info.name.data); CuAssertStrEquals(tc, live_channel_name, content); content = apr_psprintf(p, "%.*s", info.status.len, info.status.data); CuAssertStrEquals(tc, LIVE_CHANNEL_STATUS_DISABLED, content); // put status aos_str_set(&channel_stutus, LIVE_CHANNEL_STATUS_ENABLED); s= oss_put_live_channel_status(options, &bucket, &channel_name, &channel_stutus, NULL); CuAssertIntEquals(tc, 200, s->code); // check by get info s = oss_get_live_channel_info(options, &bucket, &channel_name, &info, NULL); CuAssertIntEquals(tc, 200, s->code); content = apr_psprintf(p, "%.*s", info.name.len, info.name.data); CuAssertStrEquals(tc, live_channel_name, content); content = apr_psprintf(p, "%.*s", info.status.len, info.status.data); CuAssertStrEquals(tc, LIVE_CHANNEL_STATUS_ENABLED, content); // delete s = oss_delete_live_channel(options, &bucket, &channel_name, NULL); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("test_put_live_channel_status ok\n"); } void test_delete_live_channel(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t publish_url_list; aos_list_t play_url_list; oss_live_channel_configuration_t *config = NULL; oss_live_channel_stat_t live_stat; char *live_channel_name = "test_live_channel_del"; char *live_channel_desc = "my test live channel"; aos_string_t bucket; aos_string_t channel_name; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&channel_name, live_channel_name); config = oss_create_live_channel_configuration_content(options->pool); aos_str_set(&config->name, live_channel_name); aos_str_set(&config->description, live_channel_desc); // create aos_list_init(&publish_url_list); aos_list_init(&play_url_list); s = oss_create_live_channel(options, &bucket, config, &publish_url_list, &play_url_list, NULL); CuAssertIntEquals(tc, 200, s->code); // get stat s = oss_get_live_channel_stat(options, &bucket, &channel_name, &live_stat, NULL); CuAssertIntEquals(tc, 200, s->code); // delete s = oss_delete_live_channel(options, &bucket, &channel_name, NULL); CuAssertIntEquals(tc, 204, s->code); // get stat s = oss_get_live_channel_stat(options, &bucket, &channel_name, &live_stat, NULL); CuAssertIntEquals(tc, 404, s->code); CuAssertStrEquals(tc, "NoSuchLiveChannel", s->error_code); aos_pool_destroy(p); printf("test_delete_live_channel ok\n"); } void test_list_live_channel(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_string_t bucket; oss_list_live_channel_params_t *params = NULL; oss_live_channel_content_t *live_chan; char *content = NULL; oss_live_channel_publish_url_t *publish_url; oss_live_channel_play_url_t *play_url; int channel_count = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); // create s = create_test_live_channel(options, TEST_BUCKET_NAME, "test_live_channel_list1"); CuAssertIntEquals(tc, 200, s->code); s = create_test_live_channel(options, TEST_BUCKET_NAME, "test_live_channel_list2"); CuAssertIntEquals(tc, 200, s->code); s = create_test_live_channel(options, TEST_BUCKET_NAME, "test_live_channel_list3"); CuAssertIntEquals(tc, 200, s->code); s = create_test_live_channel(options, TEST_BUCKET_NAME, "test_live_channel_list4"); CuAssertIntEquals(tc, 200, s->code); s = create_test_live_channel(options, TEST_BUCKET_NAME, "test_live_channel_list5"); CuAssertIntEquals(tc, 200, s->code); // list params = oss_create_list_live_channel_params(options->pool); aos_str_set(¶ms->prefix, "test_live_channel_list"); s = oss_list_live_channel(options, &bucket, params, NULL); CuAssertIntEquals(tc, 200, s->code); channel_count = 0; aos_list_for_each_entry(oss_live_channel_content_t, live_chan, ¶ms->live_channel_list, node) { channel_count++; content = apr_psprintf(p, "%.*s", live_chan->name.len, live_chan->name.data); CuAssertStrEquals(tc, apr_psprintf(p, "test_live_channel_list%d", channel_count), content); content = apr_psprintf(p, "%.*s", live_chan->description.len, live_chan->description.data); CuAssertStrEquals(tc, "live channel description", content); content = apr_psprintf(p, "%.*s", live_chan->status.len, live_chan->status.data); CuAssertStrEquals(tc, LIVE_CHANNEL_STATUS_ENABLED, content); content = apr_psprintf(p, "%.*s", live_chan->last_modified.len, live_chan->last_modified.data); CuAssertStrnEquals(tc, "202", strlen("202"), content); aos_list_for_each_entry(oss_live_channel_publish_url_t, publish_url, &live_chan->publish_url_list, node) { content = apr_psprintf(p, "%.*s", publish_url->publish_url.len, publish_url->publish_url.data); CuAssertStrnEquals(tc, AOS_RTMP_PREFIX, strlen(AOS_RTMP_PREFIX), content); } aos_list_for_each_entry(oss_live_channel_play_url_t, play_url, &live_chan->play_url_list, node) { content = apr_psprintf(p, "%.*s", play_url->play_url.len, play_url->play_url.data); CuAssertStrnEquals(tc, AOS_HTTP_PREFIX, strlen(AOS_HTTP_PREFIX), content); } } CuAssertIntEquals(tc, 5, channel_count); // list by prefix params = oss_create_list_live_channel_params(options->pool); aos_str_set(¶ms->prefix, "test_live_channel_list2"); s = oss_list_live_channel(options, &bucket, params, NULL); CuAssertIntEquals(tc, 200, s->code); channel_count = 0; aos_list_for_each_entry(oss_live_channel_content_t, live_chan, ¶ms->live_channel_list, node) { channel_count++; content = apr_psprintf(p, "%.*s", live_chan->name.len, live_chan->name.data); CuAssertStrEquals(tc, "test_live_channel_list2", content); content = apr_psprintf(p, "%.*s", live_chan->description.len, live_chan->description.data); CuAssertStrEquals(tc, "live channel description", content); content = apr_psprintf(p, "%.*s", live_chan->status.len, live_chan->status.data); CuAssertStrEquals(tc, LIVE_CHANNEL_STATUS_ENABLED, content); content = apr_psprintf(p, "%.*s", live_chan->last_modified.len, live_chan->last_modified.data); CuAssertStrnEquals(tc, "202", strlen("202"), content); aos_list_for_each_entry(oss_live_channel_publish_url_t, publish_url, &live_chan->publish_url_list, node) { content = apr_psprintf(p, "%.*s", publish_url->publish_url.len, publish_url->publish_url.data); CuAssertStrnEquals(tc, AOS_RTMP_PREFIX, strlen(AOS_RTMP_PREFIX), content); } aos_list_for_each_entry(oss_live_channel_play_url_t, play_url, &live_chan->play_url_list, node) { content = apr_psprintf(p, "%.*s", play_url->play_url.len, play_url->play_url.data); CuAssertStrnEquals(tc, AOS_HTTP_PREFIX, strlen(AOS_HTTP_PREFIX), content); } } CuAssertIntEquals(tc, 1, channel_count); // list by mark params = oss_create_list_live_channel_params(options->pool); aos_str_set(¶ms->prefix, "test_live_channel_list"); aos_str_set(¶ms->marker, "test_live_channel_list2"); s = oss_list_live_channel(options, &bucket, params, NULL); CuAssertIntEquals(tc, 200, s->code); channel_count = 0; aos_list_for_each_entry(oss_live_channel_content_t, live_chan, ¶ms->live_channel_list, node) { channel_count++; content = apr_psprintf(p, "%.*s", live_chan->name.len, live_chan->name.data); CuAssertStrEquals(tc, apr_psprintf(p, "test_live_channel_list%d", channel_count + 2), content); content = apr_psprintf(p, "%.*s", live_chan->description.len, live_chan->description.data); CuAssertStrEquals(tc, "live channel description", content); content = apr_psprintf(p, "%.*s", live_chan->status.len, live_chan->status.data); CuAssertStrEquals(tc, LIVE_CHANNEL_STATUS_ENABLED, content); content = apr_psprintf(p, "%.*s", live_chan->last_modified.len, live_chan->last_modified.data); CuAssertStrnEquals(tc, "202", strlen("202"), content); aos_list_for_each_entry(oss_live_channel_publish_url_t, publish_url, &live_chan->publish_url_list, node) { content = apr_psprintf(p, "%.*s", publish_url->publish_url.len, publish_url->publish_url.data); CuAssertStrnEquals(tc, AOS_RTMP_PREFIX, strlen(AOS_RTMP_PREFIX), content); } aos_list_for_each_entry(oss_live_channel_play_url_t, play_url, &live_chan->play_url_list, node) { content = apr_psprintf(p, "%.*s", play_url->play_url.len, play_url->play_url.data); CuAssertStrnEquals(tc, AOS_HTTP_PREFIX, strlen(AOS_HTTP_PREFIX), content); } } CuAssertIntEquals(tc, 3, channel_count); // list by max keys params = oss_create_list_live_channel_params(options->pool); aos_str_set(¶ms->prefix, "test_live_channel_list"); params->max_keys = 3; s = oss_list_live_channel(options, &bucket, params, NULL); CuAssertIntEquals(tc, 200, s->code); channel_count = 0; aos_list_for_each_entry(oss_live_channel_content_t, live_chan, ¶ms->live_channel_list, node) { channel_count++; content = apr_psprintf(p, "%.*s", live_chan->name.len, live_chan->name.data); CuAssertStrEquals(tc, apr_psprintf(p, "test_live_channel_list%d", channel_count), content); content = apr_psprintf(p, "%.*s", live_chan->description.len, live_chan->description.data); CuAssertStrEquals(tc, "live channel description", content); content = apr_psprintf(p, "%.*s", live_chan->status.len, live_chan->status.data); CuAssertStrEquals(tc, LIVE_CHANNEL_STATUS_ENABLED, content); content = apr_psprintf(p, "%.*s", live_chan->last_modified.len, live_chan->last_modified.data); CuAssertStrnEquals(tc, "202", strlen("202"), content); aos_list_for_each_entry(oss_live_channel_publish_url_t, publish_url, &live_chan->publish_url_list, node) { content = apr_psprintf(p, "%.*s", publish_url->publish_url.len, publish_url->publish_url.data); CuAssertStrnEquals(tc, AOS_RTMP_PREFIX, strlen(AOS_RTMP_PREFIX), content); } aos_list_for_each_entry(oss_live_channel_play_url_t, play_url, &live_chan->play_url_list, node) { content = apr_psprintf(p, "%.*s", play_url->play_url.len, play_url->play_url.data); CuAssertStrnEquals(tc, AOS_HTTP_PREFIX, strlen(AOS_HTTP_PREFIX), content); } } CuAssertIntEquals(tc, 3, channel_count); s = delete_test_live_channel(options, TEST_BUCKET_NAME, "test_live_channel_list1"); CuAssertIntEquals(tc, 204, s->code); s = delete_test_live_channel(options, TEST_BUCKET_NAME, "test_live_channel_list2"); CuAssertIntEquals(tc, 204, s->code); s = delete_test_live_channel(options, TEST_BUCKET_NAME, "test_live_channel_list3"); CuAssertIntEquals(tc, 204, s->code); s = delete_test_live_channel(options, TEST_BUCKET_NAME, "test_live_channel_list4"); CuAssertIntEquals(tc, 204, s->code); s = delete_test_live_channel(options, TEST_BUCKET_NAME, "test_live_channel_list5"); CuAssertIntEquals(tc, 204, s->code); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_list_live_channel(options, &bucket, params, NULL); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("test_list_live_channel ok\n"); } void test_get_live_channel_history(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t live_record_list; oss_live_record_content_t *live_record; char *live_channel_name = "test_live_channel_hist"; aos_string_t bucket; aos_string_t channel_name; aos_string_t content; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&channel_name, live_channel_name); // create s = create_test_live_channel(options, TEST_BUCKET_NAME, live_channel_name); CuAssertIntEquals(tc, 200, s->code); // get history aos_list_init(&live_record_list); s = oss_get_live_channel_history(options, &bucket, &channel_name, &live_record_list, NULL); CuAssertIntEquals(tc, 200, s->code); aos_list_for_each_entry(oss_live_record_content_t, live_record, &live_record_list, node) { aos_str_set(&content, ".000Z"); CuAssertIntEquals(tc, 1, aos_ends_with(&live_record->start_time, &content)); CuAssertIntEquals(tc, 1, aos_ends_with(&live_record->end_time, &content)); CuAssertTrue(tc, live_record->remote_addr.len >= (int)strlen("0.0.0.0:0")); } //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_get_live_channel_history(options, &bucket, &channel_name, &live_record_list, NULL); CuAssertIntEquals(tc, 404, s->code); // delete aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_delete_live_channel(options, &bucket, &channel_name, NULL); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("test_get_live_channel_history ok\n"); } /** * Note: the case need put rtmp stream, use command: * ffmpeg \-re \-i allstar.flv \-c copy \-f flv "rtmp://oss-live-channel.demo-oss-cn-shenzhen.aliyuncs.com/live/test_live_channel_vod?playlistName=play.m3u8" */ void test_gen_vod_play_list(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; aos_status_t *s = NULL; char *live_channel_name = "test_live_channel_vod"; aos_string_t bucket; aos_string_t channel_name; aos_string_t play_list_name; int64_t start_time = 0; int64_t end_time = 0; oss_acl_e oss_acl; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&channel_name, live_channel_name); oss_acl = OSS_ACL_PUBLIC_READ_WRITE; s = oss_put_bucket_acl(options, &bucket, oss_acl, &resp_headers); // create s = create_test_live_channel(options, TEST_BUCKET_NAME, live_channel_name); CuAssertIntEquals(tc, 200, s->code); // post vod aos_str_set(&play_list_name, "play.m3u8"); start_time = apr_time_now() / 1000000 - 3600; end_time = apr_time_now() / 1000000 + 3600; s = oss_gen_vod_play_list(options, &bucket, &channel_name, &play_list_name, start_time, end_time, NULL); CuAssertIntEquals(tc, 400, s->code); // delete s = oss_delete_live_channel(options, &bucket, &channel_name, NULL); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("test_post_vod_play_list ok\n"); } void test_gen_rtmp_signed_url(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; aos_status_t *s = NULL; char *live_channel_name = "test_live_channel_url"; aos_string_t bucket; aos_string_t channel_name; aos_string_t play_list_name; oss_acl_e oss_acl; aos_table_t *resp_headers = NULL; char *rtmp_url = NULL; int64_t expires = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&channel_name, live_channel_name); oss_acl = OSS_ACL_PRIVATE; s = oss_put_bucket_acl(options, &bucket, oss_acl, &resp_headers); // create s = create_test_live_channel(options, TEST_BUCKET_NAME, live_channel_name); CuAssertIntEquals(tc, 200, s->code); // gen url aos_str_set(&play_list_name, "play.m3u8"); expires = apr_time_now() / 1000000 + 60 * 30; rtmp_url = oss_gen_rtmp_signed_url(options, &bucket, &channel_name, &play_list_name, expires); // manual check passed CuAssertStrnEquals(tc, AOS_RTMP_PREFIX, strlen(AOS_RTMP_PREFIX), rtmp_url); // delete s = oss_delete_live_channel(options, &bucket, &channel_name, NULL); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("test_gen_rtmp_signed_url ok\n"); } void test_live_channel_misc_functions(CuTest *tc) { aos_pool_t *p = NULL; oss_live_record_content_t *content = NULL; aos_pool_create(&p, NULL); content = oss_create_live_record_content(p); CuAssertTrue(tc, content != NULL); aos_pool_destroy(p); printf("test_live_channel_misc_functions ok\n"); } void test_live_invalid_parameter(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; int i; char *invalid_name_list[] = { "a", "1", "!", "aa", "12", "a1", "a!", "1!", "aAa", "1A1", "a!a", "FengChao@123", "-a123", "a_123", "a123-", "1234567890123456789012345678901234567890123456789012345678901234", "" }; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); for (i = 0; i < sizeof(invalid_name_list) / sizeof(invalid_name_list[0]); i++) { aos_string_t bucket; aos_status_t *s = NULL; aos_table_t *resp_headers = NULL; aos_str_set(&bucket, invalid_name_list[i]); s = oss_create_live_channel(options, &bucket, NULL, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_live_channel_status(options, &bucket, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_live_channel_info(options, &bucket, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_live_channel_stat(options, &bucket, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_delete_live_channel(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_list_live_channel(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_live_channel_history(options, &bucket, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_gen_vod_play_list(options, &bucket, NULL, NULL, 0, 10, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); } aos_pool_destroy(p); printf("test_live_invalid_parameter ok\n"); } CuSuite *test_oss_live() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_live_setup); SUITE_ADD_TEST(suite, test_create_live_channel_default); SUITE_ADD_TEST(suite, test_create_live_channel); SUITE_ADD_TEST(suite, test_put_live_channel_status); SUITE_ADD_TEST(suite, test_get_live_channel_stat); SUITE_ADD_TEST(suite, test_delete_live_channel); SUITE_ADD_TEST(suite, test_list_live_channel); SUITE_ADD_TEST(suite, test_get_live_channel_history); SUITE_ADD_TEST(suite, test_gen_vod_play_list); SUITE_ADD_TEST(suite, test_gen_rtmp_signed_url); SUITE_ADD_TEST(suite, test_live_channel_misc_functions); SUITE_ADD_TEST(suite, test_live_invalid_parameter); SUITE_ADD_TEST(suite, test_live_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_multipart.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "aos_transport.h" #include "aos_http_io.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" #include "oss_multipart.c" void test_multipart_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "multipart"); //create test bucket aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); } void test_multipart_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; char *object_name = "oss_test_multipart_upload"; char *object_name1 = "oss_test_multipart_upload_from_file"; char *object_name2 = "oss_test_upload_part_copy_dest_object"; char *object_name3 = "oss_test_upload_part_copy_source_object"; char *object_name4 = "oss_test_list_upload_part_with_empty"; char *object_name5 = "test_oss_get_sorted_uploaded_part"; char *object_name6 = "test_oss_get_sorted_uploaded_part_with_empty"; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); //delete test object delete_test_object(options, TEST_BUCKET_NAME, object_name); delete_test_object(options, TEST_BUCKET_NAME, object_name1); delete_test_object(options, TEST_BUCKET_NAME, object_name2); delete_test_object(options, TEST_BUCKET_NAME, object_name3); delete_test_object(options, TEST_BUCKET_NAME, object_name4); delete_test_object(options, TEST_BUCKET_NAME, object_name5); delete_test_object(options, TEST_BUCKET_NAME, object_name6); //delete test bucket aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } void test_init_abort_multipart_upload(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_abort_multipart_upload"; oss_request_options_t *options = NULL; int is_cname = 0; aos_string_t upload_id; aos_status_t *s = NULL; //test init multipart aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); CuAssertTrue(tc, upload_id.len > 0); CuAssertPtrNotNull(tc, upload_id.data); //abort multipart s = abort_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("test_init_abort_multipart_upload ok\n"); } void test_list_multipart_upload(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name1 = "oss_test_abort_multipart_upload1"; char *object_name2 = "oss_test_abort_multipart_upload2"; int is_cname = 0; oss_request_options_t *options = NULL; aos_string_t upload_id1; aos_string_t upload_id2; aos_status_t *s = NULL; aos_table_t *resp_headers; oss_list_multipart_upload_params_t *params = NULL; char *expect_next_key_marker = "oss_test_abort_multipart_upload1"; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name1, &upload_id1); CuAssertIntEquals(tc, 200, s->code); s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name2, &upload_id2); CuAssertIntEquals(tc, 200, s->code); params = oss_create_list_multipart_upload_params(p); params->max_ret = 1; aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_list_multipart_upload(options, &bucket, params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 1, params->truncated); CuAssertStrEquals(tc, expect_next_key_marker, params->next_key_marker.data); CuAssertPtrNotNull(tc, resp_headers); aos_list_init(¶ms->upload_list); aos_str_set(¶ms->key_marker, params->next_key_marker.data); aos_str_set(¶ms->upload_id_marker, params->next_upload_id_marker.data); s = oss_list_multipart_upload(options, &bucket, params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); //CuAssertIntEquals(tc, 0, params->truncated); s = abort_test_multipart_upload(options, TEST_BUCKET_NAME, object_name1, &upload_id1); CuAssertIntEquals(tc, 204, s->code); s = abort_test_multipart_upload(options, TEST_BUCKET_NAME, object_name2, &upload_id2); CuAssertIntEquals(tc, 204, s->code); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_list_multipart_upload(options, &bucket, params, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("test_list_multipart_upload ok\n"); } void test_multipart_upload(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_multipart_upload"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_table_t *headers = NULL; aos_table_t *upload_part_resp_headers = NULL; oss_list_upload_part_params_t *params = NULL; aos_table_t *list_part_resp_headers = NULL; aos_string_t upload_id; aos_list_t complete_part_list; oss_list_part_content_t *part_content1 = NULL; oss_list_part_content_t *part_content2 = NULL; oss_complete_part_content_t *complete_content1 = NULL; oss_complete_part_content_t *complete_content2 = NULL; aos_table_t *complete_resp_headers = NULL; aos_table_t *head_resp_headers = NULL; int part_num = 1; int part_num1 = 2; char *expect_part_num_marker = "1"; char *content_type_for_complete = "application/octet-stream"; char *actual_content_type = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); headers = aos_table_make(options->pool, 2); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); //upload part aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num, &buffer, &upload_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, upload_part_resp_headers); aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num1, &buffer, &upload_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, upload_part_resp_headers); //list part params = oss_create_list_upload_part_params(p); params->max_ret = 1; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, &list_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 1, params->truncated); CuAssertStrEquals(tc, expect_part_num_marker, params->next_part_number_marker.data); CuAssertPtrNotNull(tc, list_part_resp_headers); aos_list_for_each_entry(oss_list_part_content_t, part_content1, ¶ms->part_list, node) { complete_content1 = oss_create_complete_part_content(p); aos_str_set(&complete_content1->part_number, part_content1->part_number.data); aos_str_set(&complete_content1->etag, part_content1->etag.data); aos_list_add_tail(&complete_content1->node, &complete_part_list); } aos_list_init(¶ms->part_list); aos_str_set(¶ms->part_number_marker, params->next_part_number_marker.data); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, &list_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 0, params->truncated); CuAssertPtrNotNull(tc, list_part_resp_headers); aos_list_for_each_entry(oss_list_part_content_t, part_content2, ¶ms->part_list, node) { complete_content2 = oss_create_complete_part_content(p); aos_str_set(&complete_content2->part_number, part_content2->part_number.data); aos_str_set(&complete_content2->etag, part_content2->etag.data); aos_list_add_tail(&complete_content2->node, &complete_part_list); } //complete multipart apr_table_add(headers, OSS_CONTENT_TYPE, content_type_for_complete); s = oss_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, headers, &complete_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, complete_resp_headers); //check content type apr_table_clear(headers); s = oss_head_object(options, &bucket, &object, headers, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); actual_content_type = (char*)(apr_table_get(head_resp_headers, OSS_CONTENT_TYPE)); CuAssertStrEquals(tc, content_type_for_complete, actual_content_type); aos_pool_destroy(p); printf("test_multipart_upload ok\n"); } void test_multipart_upload_from_file(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_multipart_upload_from_file"; char *file_path = "test_upload_part_copy.file"; FILE* fd = NULL; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; oss_upload_file_t *upload_file = NULL; aos_table_t *upload_part_resp_headers = NULL; oss_list_upload_part_params_t *params = NULL; aos_table_t *list_part_resp_headers = NULL; aos_string_t upload_id; aos_list_t complete_part_list; oss_list_part_content_t *part_content1 = NULL; oss_complete_part_content_t *complete_content1 = NULL; aos_table_t *complete_resp_headers = NULL; aos_string_t data; int part_num = 1; int part_num1 = 2; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); // create multipart upload local file make_rand_string(p, 10 * 1024 * 1024, &data); fd = fopen(file_path, "w"); CuAssertTrue(tc, fd != NULL); fwrite(data.data, sizeof(data.data[0]), data.len, fd); fclose(fd); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); //upload part from file upload_file = oss_create_upload_file(p); aos_str_set(&upload_file->filename, file_path); upload_file->file_pos = 0; upload_file->file_last = 200 * 1024; //200k s = oss_upload_part_from_file(options, &bucket, &object, &upload_id, part_num, upload_file, &upload_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, upload_part_resp_headers); upload_file->file_pos = 200 *1024;//remain content start pos upload_file->file_last = get_file_size(file_path); s = oss_upload_part_from_file(options, &bucket, &object, &upload_id, part_num1, upload_file, &upload_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, upload_part_resp_headers); //list part params = oss_create_list_upload_part_params(p); aos_str_set(¶ms->part_number_marker, ""); params->max_ret = 10; params->truncated = 0; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, &list_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 0, params->truncated); CuAssertPtrNotNull(tc, list_part_resp_headers); aos_list_for_each_entry(oss_list_part_content_t, part_content1, ¶ms->part_list, node) { complete_content1 = oss_create_complete_part_content(p); aos_str_set(&complete_content1->part_number, part_content1->part_number.data); aos_str_set(&complete_content1->etag, part_content1->etag.data); aos_list_add_tail(&complete_content1->node, &complete_part_list); } //complete multipart s = oss_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, NULL, &complete_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, complete_resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_upload_part_from_file(options, &bucket, &object, &upload_id, part_num1, upload_file, &upload_part_resp_headers); CuAssertIntEquals(tc, 404, s->code); remove(file_path); aos_pool_destroy(p); printf("test_multipart_upload_from_file ok\n"); } void test_upload_part_copy(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_string_t upload_id; oss_list_upload_part_params_t *list_upload_part_params = NULL; oss_upload_part_copy_params_t *upload_part_copy_params1 = NULL; oss_upload_part_copy_params_t *upload_part_copy_params2 = NULL; aos_table_t *headers = NULL; aos_table_t *query_params = NULL; aos_table_t *resp_headers = NULL; aos_table_t *list_part_resp_headers = NULL; aos_list_t complete_part_list; oss_list_part_content_t *part_content = NULL; oss_complete_part_content_t *complete_content = NULL; aos_table_t *complete_resp_headers = NULL; aos_status_t *s = NULL; int part1 = 1; int part2 = 2; char *local_filename = "test_upload_part_copy.file"; char *download_filename = "test_upload_part_copy.file.download"; char *source_object_name = "oss_test_upload_part_copy_source_object"; char *dest_object_name = "oss_test_upload_part_copy_dest_object"; FILE *fd = NULL; aos_string_t download_file; aos_string_t dest_bucket; aos_string_t dest_object; int64_t range_start1 = 0; int64_t range_end1 = 6000000; int64_t range_start2 = 6000001; int64_t range_end2; aos_string_t data; aos_pool_create(&p, NULL); options = oss_request_options_create(p); // create multipart upload local file make_rand_string(p, 10 * 1024 * 1024, &data); fd = fopen(local_filename, "w"); CuAssertTrue(tc, fd != NULL); fwrite(data.data, sizeof(data.data[0]), data.len, fd); fclose(fd); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); s = create_test_object_from_file(options, TEST_BUCKET_NAME, source_object_name, local_filename, headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, dest_object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); //upload part copy 1 upload_part_copy_params1 = oss_create_upload_part_copy_params(p); aos_str_set(&upload_part_copy_params1->source_bucket, TEST_BUCKET_NAME); aos_str_set(&upload_part_copy_params1->source_object, source_object_name); aos_str_set(&upload_part_copy_params1->dest_bucket, TEST_BUCKET_NAME); aos_str_set(&upload_part_copy_params1->dest_object, dest_object_name); aos_str_set(&upload_part_copy_params1->upload_id, upload_id.data); upload_part_copy_params1->part_num = part1; upload_part_copy_params1->range_start = range_start1; upload_part_copy_params1->range_end = range_end1; headers = aos_table_make(p, 0); s = oss_upload_part_copy(options, upload_part_copy_params1, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); //upload part copy 2 resp_headers = NULL; range_end2 = get_file_size(local_filename) - 1; upload_part_copy_params2 = oss_create_upload_part_copy_params(p); aos_str_set(&upload_part_copy_params2->source_bucket, TEST_BUCKET_NAME); aos_str_set(&upload_part_copy_params2->source_object, source_object_name); aos_str_set(&upload_part_copy_params2->dest_bucket, TEST_BUCKET_NAME); aos_str_set(&upload_part_copy_params2->dest_object, dest_object_name); aos_str_set(&upload_part_copy_params2->upload_id, upload_id.data); upload_part_copy_params2->part_num = part2; upload_part_copy_params2->range_start = range_start2; upload_part_copy_params2->range_end = range_end2; headers = aos_table_make(p, 0); s = oss_upload_part_copy(options, upload_part_copy_params2, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); //list part list_upload_part_params = oss_create_list_upload_part_params(p); list_upload_part_params->max_ret = 10; aos_list_init(&complete_part_list); aos_str_set(&dest_bucket, TEST_BUCKET_NAME); aos_str_set(&dest_object, dest_object_name); s = oss_list_upload_part(options, &dest_bucket, &dest_object, &upload_id, list_upload_part_params, &list_part_resp_headers); aos_list_for_each_entry(oss_list_part_content_t, part_content, &list_upload_part_params->part_list, node) { complete_content = oss_create_complete_part_content(p); aos_str_set(&complete_content->part_number, part_content->part_number.data); aos_str_set(&complete_content->etag, part_content->etag.data); aos_list_add_tail(&complete_content->node, &complete_part_list); } //complete multipart headers = aos_table_make(p, 0); s = oss_complete_multipart_upload(options, &dest_bucket, &dest_object, &upload_id, &complete_part_list, headers, &complete_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, complete_resp_headers); //check upload copy part content equal to local file headers = aos_table_make(p, 0); aos_str_set(&download_file, download_filename); s = oss_get_object_to_file(options, &dest_bucket, &dest_object, headers, query_params, &download_file, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, get_file_size(local_filename), get_file_size(download_filename)); CuAssertPtrNotNull(tc, resp_headers); //negative case resp_headers = NULL; range_end2 = get_file_size(local_filename) - 1; upload_part_copy_params2 = oss_create_upload_part_copy_params(p); aos_str_set(&upload_part_copy_params2->source_bucket, "c-sdk-no-exist"); aos_str_set(&upload_part_copy_params2->source_object, source_object_name); aos_str_set(&upload_part_copy_params2->dest_bucket, "c-sdk-no-exist"); aos_str_set(&upload_part_copy_params2->dest_object, dest_object_name); aos_str_set(&upload_part_copy_params2->upload_id, upload_id.data); upload_part_copy_params2->part_num = part2; upload_part_copy_params2->range_start = range_start2; upload_part_copy_params2->range_end = range_end2; headers = aos_table_make(p, 0); s = oss_upload_part_copy(options, upload_part_copy_params2, headers, &resp_headers); CuAssertIntEquals(tc, 404, s->code); remove(download_filename); remove(local_filename); aos_pool_destroy(p); printf("test_upload_part_copy ok\n"); } void test_upload_part_copy_with_special_char(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_string_t upload_id; oss_list_upload_part_params_t *list_upload_part_params = NULL; oss_upload_part_copy_params_t *upload_part_copy_params1 = NULL; oss_upload_part_copy_params_t *upload_part_copy_params2 = NULL; aos_table_t *headers = NULL; aos_table_t *query_params = NULL; aos_table_t *resp_headers = NULL; aos_table_t *list_part_resp_headers = NULL; aos_list_t complete_part_list; oss_list_part_content_t *part_content = NULL; oss_complete_part_content_t *complete_content = NULL; aos_table_t *complete_resp_headers = NULL; aos_status_t *s = NULL; int part1 = 1; int part2 = 2; char *local_filename = "test_upload_part_copy.file"; char *download_filename = "test_upload_part_copy.file.download"; char *source_object_name = "oss_test_upload_part_copy_source_object_special_char+1"; char *dest_object_name = "oss_test_upload_part_copy_dest_object_special_char"; FILE *fd = NULL; aos_string_t download_file; aos_string_t dest_bucket; aos_string_t dest_object; int64_t range_start1 = 0; int64_t range_end1 = 6000000; int64_t range_start2 = 6000001; int64_t range_end2; aos_string_t data; aos_pool_create(&p, NULL); options = oss_request_options_create(p); // create multipart upload local file make_rand_string(p, 10 * 1024 * 1024, &data); fd = fopen(local_filename, "w"); CuAssertTrue(tc, fd != NULL); fwrite(data.data, sizeof(data.data[0]), data.len, fd); fclose(fd); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); s = create_test_object_from_file(options, TEST_BUCKET_NAME, source_object_name, local_filename, headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, dest_object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); //upload part copy 1 upload_part_copy_params1 = oss_create_upload_part_copy_params(p); aos_str_set(&upload_part_copy_params1->source_bucket, TEST_BUCKET_NAME); aos_str_set(&upload_part_copy_params1->source_object, source_object_name); aos_str_set(&upload_part_copy_params1->dest_bucket, TEST_BUCKET_NAME); aos_str_set(&upload_part_copy_params1->dest_object, dest_object_name); aos_str_set(&upload_part_copy_params1->upload_id, upload_id.data); upload_part_copy_params1->part_num = part1; upload_part_copy_params1->range_start = range_start1; upload_part_copy_params1->range_end = range_end1; headers = aos_table_make(p, 0); s = oss_upload_part_copy(options, upload_part_copy_params1, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); //upload part copy 2 resp_headers = NULL; range_end2 = get_file_size(local_filename) - 1; upload_part_copy_params2 = oss_create_upload_part_copy_params(p); aos_str_set(&upload_part_copy_params2->source_bucket, TEST_BUCKET_NAME); aos_str_set(&upload_part_copy_params2->source_object, source_object_name); aos_str_set(&upload_part_copy_params2->dest_bucket, TEST_BUCKET_NAME); aos_str_set(&upload_part_copy_params2->dest_object, dest_object_name); aos_str_set(&upload_part_copy_params2->upload_id, upload_id.data); upload_part_copy_params2->part_num = part2; upload_part_copy_params2->range_start = range_start2; upload_part_copy_params2->range_end = range_end2; headers = aos_table_make(p, 0); s = oss_upload_part_copy(options, upload_part_copy_params2, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); //list part list_upload_part_params = oss_create_list_upload_part_params(p); list_upload_part_params->max_ret = 10; aos_list_init(&complete_part_list); aos_str_set(&dest_bucket, TEST_BUCKET_NAME); aos_str_set(&dest_object, dest_object_name); s = oss_list_upload_part(options, &dest_bucket, &dest_object, &upload_id, list_upload_part_params, &list_part_resp_headers); aos_list_for_each_entry(oss_list_part_content_t, part_content, &list_upload_part_params->part_list, node) { complete_content = oss_create_complete_part_content(p); aos_str_set(&complete_content->part_number, part_content->part_number.data); aos_str_set(&complete_content->etag, part_content->etag.data); aos_list_add_tail(&complete_content->node, &complete_part_list); } //complete multipart headers = aos_table_make(p, 0); s = oss_complete_multipart_upload(options, &dest_bucket, &dest_object, &upload_id, &complete_part_list, headers, &complete_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, complete_resp_headers); //check upload copy part content equal to local file headers = aos_table_make(p, 0); aos_str_set(&download_file, download_filename); s = oss_get_object_to_file(options, &dest_bucket, &dest_object, headers, query_params, &download_file, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, get_file_size(local_filename), get_file_size(download_filename)); CuAssertPtrNotNull(tc, resp_headers); remove(download_filename); remove(local_filename); aos_pool_destroy(p); printf("test_upload_part_copy ok\n"); } void test_upload_file_failed_without_uploadid(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_multipart_upload_from_file"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; int part_size = 100*1024; aos_string_t upload_id; aos_string_t filepath; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, "c-sdk-no-exist"); aos_str_set(&object, object_name); aos_str_null(&upload_id); aos_str_set(&filepath, __FILE__); s = oss_upload_file(options, &bucket, &object, &upload_id, &filepath, part_size, NULL); CuAssertIntEquals(tc, 404, s->code); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&filepath, ""); s = oss_upload_file(options, &bucket, &object, &upload_id, &filepath, part_size, NULL); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s->code); aos_pool_destroy(p); printf("test_upload_file_failed_without_uploadid ok\n"); } void test_upload_file(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_multipart_upload_from_file"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; int part_size = 100 * 1024; aos_string_t upload_id; aos_string_t filepath; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_null(&upload_id); aos_str_set(&filepath, __FILE__); s = oss_upload_file(options, &bucket, &object, &upload_id, &filepath, part_size, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); printf("test_upload_file ok\n"); } void test_upload_file_from_recover(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_multipart_upload_from_file"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; int part_size = 100*1024; aos_string_t upload_id; aos_string_t filepath; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); aos_str_set(&filepath, __FILE__); s = oss_upload_file(options, &bucket, &object, &upload_id, &filepath, part_size, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); printf("test_upload_file_from_recover ok\n"); } void test_upload_file_from_recover_failed(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_multipart_upload_from_file"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; int part_size = 100*1024; aos_string_t upload_id; aos_string_t filepath; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); aos_str_set(&filepath, __FILE__); aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_upload_file(options, &bucket, &object, &upload_id, &filepath, part_size, NULL); CuAssertIntEquals(tc, 404, s->code); //abort multipart s = abort_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("test_upload_file_from_recover_failed ok\n"); } void test_list_upload_part_with_empty(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_list_upload_part_with_empty"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_table_t *headers = NULL; oss_list_upload_part_params_t *params = NULL; aos_table_t *list_part_resp_headers = NULL; aos_string_t upload_id; aos_list_t complete_part_list; aos_table_t *complete_resp_headers = NULL; char *content_type_for_complete = "video/MP2T"; oss_list_part_content_t *part_content1 = NULL; oss_complete_part_content_t *complete_content1 = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); headers = aos_table_make(options->pool, 2); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); //list part params = oss_create_list_upload_part_params(p); params->max_ret = 1; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, &list_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 0, params->truncated); CuAssertStrEquals(tc, NULL, params->next_part_number_marker.data); CuAssertPtrNotNull(tc, list_part_resp_headers); // test for #OSS-1161 aos_list_for_each_entry(oss_list_part_content_t, part_content1, ¶ms->part_list, node) { complete_content1 = oss_create_complete_part_content(p); aos_str_set(&complete_content1->part_number, part_content1->part_number.data); aos_str_set(&complete_content1->etag, part_content1->etag.data); aos_list_add_tail(&complete_content1->node, &complete_part_list); } //complete multipart apr_table_add(headers, OSS_CONTENT_TYPE, content_type_for_complete); s = oss_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, headers, &complete_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, complete_resp_headers); delete_test_object(options, TEST_BUCKET_NAME, object_name); aos_pool_destroy(p); printf("test_list_upload_part_with_empty ok\n"); } void test_oss_get_sorted_uploaded_part(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "test_oss_get_sorted_uploaded_part"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_table_t *headers = NULL; aos_table_t *upload_part_resp_headers = NULL; aos_string_t upload_id; aos_list_t complete_part_list; aos_table_t *complete_resp_headers = NULL; int part_num = 1; int part_num1 = 2; int part_count = 0; char *content_type_for_complete = "video/MP2T"; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); //upload part aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num, &buffer, &upload_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, upload_part_resp_headers); aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num1, &buffer, &upload_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, upload_part_resp_headers); //get sorted uploaded part aos_list_init(&complete_part_list); s = oss_get_sorted_uploaded_part(options, &bucket, &object, &upload_id, &complete_part_list, &part_count); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 2, part_count); //complete multipart headers = aos_table_make(options->pool, 1); apr_table_add(headers, OSS_CONTENT_TYPE, content_type_for_complete); s = oss_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, headers, &complete_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, complete_resp_headers); delete_test_object(options, TEST_BUCKET_NAME, object_name); aos_pool_destroy(p); printf("test_oss_get_sorted_uploaded_part ok\n"); } void test_oss_get_sorted_uploaded_part_with_empty(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "test_oss_get_sorted_uploaded_part_with_empty"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_string_t upload_id; aos_list_t complete_part_list; int part_count = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); //get sorted uploaded part aos_list_init(&complete_part_list); s = oss_get_sorted_uploaded_part(options, &bucket, &object, &upload_id, &complete_part_list, &part_count); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 0, part_count); //abort multipart s = abort_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 204, s->code); delete_test_object(options, TEST_BUCKET_NAME, object_name); aos_pool_destroy(p); printf("test_oss_get_sorted_uploaded_part_with_empty ok\n"); } void test_multipart_invalid_parameter(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; int i; char *invalid_name_list[] = { "a", "1", "!", "aa", "12", "a1", "a!", "1!", "aAa", "1A1", "a!a", "FengChao@123", "-a123", "a_123", "a123-", "1234567890123456789012345678901234567890123456789012345678901234", "" }; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); for (i = 0; i < sizeof(invalid_name_list) / sizeof(invalid_name_list[0]); i++) { aos_string_t bucket; aos_status_t *s = NULL; aos_table_t *resp_headers = NULL; aos_table_t *headers = NULL; aos_list_t part_list; oss_upload_part_copy_params_t *copy_params = NULL; aos_str_set(&bucket, invalid_name_list[i]); headers = aos_table_make(p, 1); aos_list_init(&part_list); s = oss_init_multipart_upload(options, &bucket, NULL, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_abort_multipart_upload(options, &bucket, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_list_upload_part(options, &bucket, NULL, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_list_multipart_upload(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_complete_multipart_upload(options, &bucket, NULL, NULL, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_upload_part_from_buffer(options, &bucket, NULL, NULL, 1, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_upload_part_from_file(options, &bucket, NULL, NULL, 1, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); copy_params = oss_create_upload_part_copy_params(p); aos_str_set(©_params->dest_bucket, invalid_name_list[i]); s = oss_upload_part_copy(options, copy_params, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_sorted_uploaded_part(options, &bucket, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_upload_file(options, &bucket, NULL, NULL, NULL, 1000LL, headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); } aos_pool_destroy(p); printf("test_multipart_invalid_parameter ok\n"); } CuSuite *test_oss_multipart() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_multipart_setup); SUITE_ADD_TEST(suite, test_init_abort_multipart_upload); SUITE_ADD_TEST(suite, test_list_multipart_upload); SUITE_ADD_TEST(suite, test_multipart_upload); SUITE_ADD_TEST(suite, test_multipart_upload_from_file); SUITE_ADD_TEST(suite, test_upload_file); SUITE_ADD_TEST(suite, test_upload_file_failed_without_uploadid); SUITE_ADD_TEST(suite, test_upload_file_from_recover); SUITE_ADD_TEST(suite, test_upload_file_from_recover_failed); SUITE_ADD_TEST(suite, test_upload_part_copy); SUITE_ADD_TEST(suite, test_upload_part_copy_with_special_char); SUITE_ADD_TEST(suite, test_list_upload_part_with_empty); SUITE_ADD_TEST(suite, test_oss_get_sorted_uploaded_part); SUITE_ADD_TEST(suite, test_oss_get_sorted_uploaded_part_with_empty); SUITE_ADD_TEST(suite, test_multipart_invalid_parameter); SUITE_ADD_TEST(suite, test_multipart_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_object.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" static char *TEST_BUCKET_NAME_2; void test_object_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "object"); TEST_BUCKET_NAME_2 = get_test_bucket_name(aos_global_pool, "object2"); /* create test bucket */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); s = create_test_bucket(options, TEST_BUCKET_NAME_2, oss_acl); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); } void test_object_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; char *object_name1 = "oss_test_put_object.ts"; char *object_name2 = "oss_test_put_object_from_file.jpg"; char *object_name3 = "oss_test_object_by_url"; char *object_name4 = "oss_test_append_object"; char *object_name5 = "oss_test_append_object_from_file"; char *object_name6 = "oss_test_copy_object"; char *object_name7 = "video_1.ts"; char *object_name8 = "video_2.ts"; char *object_name9 = "oss_test_put_object_from_file2.txt"; char *object_name10 = "put_object_from_buffer_with_default_content_type"; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); /* delete test object */ delete_test_object(options, TEST_BUCKET_NAME, object_name1); delete_test_object(options, TEST_BUCKET_NAME, object_name2); delete_test_object(options, TEST_BUCKET_NAME, object_name3); delete_test_object(options, TEST_BUCKET_NAME, object_name4); delete_test_object(options, TEST_BUCKET_NAME, object_name5); delete_test_object(options, TEST_BUCKET_NAME, object_name6); delete_test_object(options, TEST_BUCKET_NAME, object_name7); delete_test_object(options, TEST_BUCKET_NAME, object_name8); delete_test_object(options, TEST_BUCKET_NAME, object_name9); delete_test_object(options, TEST_BUCKET_NAME, object_name10); /* delete test bucket */ aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(3)); aos_str_set(&bucket, TEST_BUCKET_NAME_2); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } void test_put_object_from_buffer(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_put_object.ts"; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; aos_table_t *head_headers = NULL; aos_table_t *head_resp_headers = NULL; char *content_type = NULL; oss_request_options_t *options = NULL; /* test put object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); s = create_test_object(options, TEST_BUCKET_NAME, object_name, str, headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /* head object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, head_headers, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); content_type = (char*)(apr_table_get(head_resp_headers, OSS_CONTENT_TYPE)); CuAssertStrEquals(tc, "video/MP2T", content_type); printf("test_put_object_from_buffer ok\n"); } void test_put_object_from_buffer_with_default_content_type(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "put_object_from_buffer_with_default_content_type"; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; aos_table_t *head_headers = NULL; aos_table_t *head_resp_headers = NULL; char *content_type = NULL; oss_request_options_t *options = NULL; /* test put object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); s = create_test_object(options, TEST_BUCKET_NAME, object_name, str, headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /* head object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, head_headers, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); content_type = (char*)(apr_table_get(head_resp_headers, OSS_CONTENT_TYPE)); CuAssertStrEquals(tc, "application/octet-stream", content_type); printf("test_put_object_from_buffer_with_default_content_type ok\n"); } void test_put_object_from_buffer_with_specified(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "./xxx/./ddd/"; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; aos_table_t *head_headers = NULL; aos_table_t *head_resp_headers = NULL; oss_request_options_t *options = NULL; /* test put object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); s = create_test_object(options, TEST_BUCKET_NAME, object_name, str, headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /* head object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, head_headers, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); delete_test_object(options, TEST_BUCKET_NAME, object_name); printf("test_put_object_from_buffer_with_specified ok\n"); } void test_put_object_from_file(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "video_1.ts"; char *filename = __FILE__; aos_string_t bucket; aos_string_t object; aos_status_t *s = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *head_headers = NULL; aos_table_t *head_resp_headers = NULL; char *content_type = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 5); s = create_test_object_from_file(options, TEST_BUCKET_NAME, object_name, filename, headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /* head object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, head_headers, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); content_type = (char*)(apr_table_get(head_resp_headers, OSS_CONTENT_TYPE)); CuAssertStrEquals(tc, "application/octet-stream", content_type); aos_pool_destroy(p); //NG Test aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 5); s = create_test_object_from_file(options, "c-sdk-no-exist", object_name, filename, headers); CuAssertIntEquals(tc, 404, s->code); s = create_test_object_from_file(options, TEST_BUCKET_NAME, object_name, "", headers); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s->code); aos_pool_destroy(p); printf("test_put_object_from_file ok\n"); } void test_put_object_with_large_length_header(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "video_2.ts"; char *filename = __FILE__; aos_status_t *s = NULL; oss_request_options_t *options = NULL; int is_cname = 0; int i = 0; int header_length = 0; aos_table_t *headers = NULL; char *user_meta = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); header_length = 1024 * 5; user_meta = (char*)calloc(header_length, 1); for (; i < header_length - 1; i++) { user_meta[i] = 'a'; } user_meta[header_length - 1] = '\0'; headers = aos_table_make(p, 2); apr_table_set(headers, "x-oss-meta-user-meta", user_meta); s = create_test_object_from_file(options, TEST_BUCKET_NAME, object_name, filename, headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); free(user_meta); aos_pool_destroy(p); printf("test_put_object_with_large_length_header_back_bound ok\n"); } void test_put_object_from_file_with_content_type(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_put_object_from_file2.txt"; char *filename = __FILE__; aos_string_t bucket; aos_string_t object; aos_status_t *s = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *head_headers = NULL; aos_table_t *head_resp_headers = NULL; char *content_type = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(options->pool, 1); apr_table_set(headers, OSS_CONTENT_TYPE, "image/jpeg"); s = create_test_object_from_file(options, TEST_BUCKET_NAME, object_name, filename, headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /* head object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, head_headers, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); content_type = (char*)(apr_table_get(head_resp_headers, OSS_CONTENT_TYPE)); CuAssertStrEquals(tc, "image/jpeg", content_type); aos_pool_destroy(p); printf("test_put_object_from_file ok\n"); } void test_put_symlink_for_obj(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss.jpg"; char *link_object_name = "link-to-oss.jpg"; char *filename = __FILE__; aos_string_t bucket; aos_string_t sym_object; aos_string_t target_object; aos_status_t *s = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *head_resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(options->pool, 1); apr_table_set(headers, OSS_CONTENT_TYPE, "image/jpeg"); s = create_test_object_from_file(options, TEST_BUCKET_NAME, object_name, filename, headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /* link object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&sym_object, link_object_name); aos_str_set(&target_object, object_name); init_test_request_options(options, is_cname); s = oss_put_symlink(options, &bucket, &sym_object, &target_object, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); aos_pool_destroy(p); printf("test_put_object_link ok\n"); } void test_get_symlink_for_obj(CuTest *tc) { aos_pool_t *p = NULL; char *link_object_name = "link-to-oss.jpg"; char *target_link_name = NULL; aos_string_t bucket; aos_string_t link_object; aos_string_t object; aos_status_t *s = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *head_resp_headers = NULL; /*get target link object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&link_object, link_object_name); init_test_request_options(options, is_cname); s = oss_get_symlink(options, &bucket, &link_object, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); target_link_name = (char*)(apr_table_get(head_resp_headers, OSS_CANNONICALIZED_HEADER_SYMLINK)); CuAssertStrEquals(tc, "oss.jpg", target_link_name); TEST_CASE_LOG("link_obj_name %s\n", target_link_name); aos_pool_destroy(p); aos_pool_create(&p, NULL); target_link_name = NULL; options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&link_object, "testasfadf"); init_test_request_options(options, is_cname); s = oss_get_symlink(options, &bucket, &link_object, &head_resp_headers); CuAssertIntEquals(tc, 404, s->code); CuAssertPtrNotNull(tc, head_resp_headers); /* delete object */ aos_str_set(&object, "oss.jpg"); s = oss_delete_object(options, &bucket, &object, &head_resp_headers); CuAssertIntEquals(tc, 204, s->code); CuAssertPtrNotNull(tc, head_resp_headers); /* delete link object */ aos_str_set(&object, "link-to-oss.jpg"); s = oss_delete_object(options, &bucket, &object, &head_resp_headers); CuAssertIntEquals(tc, 204, s->code); CuAssertPtrNotNull(tc, head_resp_headers); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_restore_obj(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; char *object_name1 = "oss_test_object1"; char *str = "test c oss sdk"; aos_table_t *headers1 = NULL; aos_list_t buffer; aos_string_t bucket; aos_string_t object; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; oss_bucket_info_t bucket_info; char IA_BUCKET_NAME[128] = {0}; apr_snprintf(IA_BUCKET_NAME, 127, "%s-ia", TEST_BUCKET_NAME); //setup: create archive bucket aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, IA_BUCKET_NAME); s = create_test_bucket_with_storage_class(options, bucket.data, oss_acl, OSS_STORAGE_CLASS_ARCHIVE); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); //get bucket info s = oss_get_bucket_info(options, &bucket, &bucket_info, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, bucket_info.storage_class.data, "Archive"); //create test object headers1 = aos_table_make(p, 0); s = create_test_object(options, bucket.data, object_name1, str, headers1); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); aos_str_set(&object, object_name1); aos_list_init(&buffer); headers1 = NULL; /* test get object to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers1, params, &buffer, &resp_headers); /* expect fail because it's archive bucket */ TEST_CASE_LOG("errcode[%d] %s %s\n", s->code, s->error_msg, s->error_code); CuAssertIntEquals(tc, -978, s->code); TEST_CASE_LOG("restore object begin.\n"); headers1 = aos_table_make(p, 0); s = oss_restore_object(options, &bucket, &object, headers1, &resp_headers); CuAssertIntEquals(tc, 202, s->code); CuAssertStrEquals(tc, NULL, s->error_code); do { headers1 = aos_table_make(p, 0); s = oss_restore_object(options, &bucket, &object, headers1, &resp_headers); if (s->code != 409) { break; } else { apr_sleep(5000); } } while (1); TEST_CASE_LOG("\nrestore object done.\n"); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); // restore the object aos_list_init(&buffer); headers1 = NULL; /* test get object to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers1, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); // restore the object again to verify the data no need thaw aos_list_init(&buffer); headers1 = NULL; /* test get object to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers1, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); //cleanup: delete archive bucket delete_test_object(options, bucket.data, object_name1); s = oss_delete_bucket(options, &bucket, &resp_headers); TEST_CASE_LOG("errcode[%d] %s %s\n", s->code, s->error_msg, s->error_code); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_restore_object_with_tier(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; char *object_name1 = "oss_test_object1"; char *str = "test c oss sdk"; aos_table_t *headers1 = NULL; aos_list_t buffer; aos_string_t bucket; aos_string_t object; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; oss_bucket_info_t bucket_info; oss_list_object_params_t *lo_params = NULL; oss_list_object_content_t *content = NULL; char IA_BUCKET_NAME[128] = { 0 }; apr_snprintf(IA_BUCKET_NAME, 127, "%s-code-archive", TEST_BUCKET_NAME); //setup: create archive bucket aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, IA_BUCKET_NAME); //aos_str_set(&options->config->endpoint, "http://oss-ap-southeast-2.aliyuncs.com"); s = create_test_bucket_with_storage_class(options, bucket.data, oss_acl, OSS_STORAGE_CLASS_COLD_ARCHIVE); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); //get bucket info s = oss_get_bucket_info(options, &bucket, &bucket_info, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, bucket_info.storage_class.data, "ColdArchive"); //create test object headers1 = aos_table_make(p, 0); s = create_test_object(options, bucket.data, object_name1, str, headers1); CuAssertIntEquals(tc, 200, s->code); CuAssertStrEquals(tc, NULL, s->error_code); //list object lo_params = oss_create_list_object_params(p); s = oss_list_object(options, &bucket, lo_params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 0, lo_params->truncated); aos_list_for_each_entry(oss_list_object_content_t, content, &lo_params->object_list, node) { CuAssertStrEquals(tc, "ColdArchive", content->storage_class.data); CuAssertStrEquals(tc, "Normal", content->type.data); } aos_str_set(&object, object_name1); aos_list_init(&buffer); headers1 = NULL; /* test get object to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers1, params, &buffer, &resp_headers); /* expect fail because it's archive bucket */ TEST_CASE_LOG("errcode[%d] %s %s\n", s->code, s->error_msg, s->error_code); CuAssertIntEquals(tc, -978, s->code); TEST_CASE_LOG("restore object begin.\n"); headers1 = aos_table_make(p, 0); s = oss_restore_object_with_tier(options, &bucket, &object, OSS_TIER_STANDARD, 2, headers1, &resp_headers); CuAssertIntEquals(tc, 202, s->code); CuAssertStrEquals(tc, NULL, s->error_code); headers1 = aos_table_make(p, 0); s = oss_restore_object_with_tier(options, &bucket, &object, OSS_TIER_STANDARD, 2, headers1, &resp_headers); CuAssertIntEquals(tc, 409, s->code); CuAssertStrEquals(tc, "RestoreAlreadyInProgress", s->error_code); //cleanup: delete code-archive bucket delete_test_object(options, bucket.data, object_name1); s = oss_delete_bucket(options, &bucket, &resp_headers); TEST_CASE_LOG("errcode[%d] %s %s\n", s->code, s->error_msg, s->error_code); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_get_object_to_buffer(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_put_object.ts"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_buf_t *content = NULL; char *expect_content = "test oss c sdk"; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; char *content_type = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&buffer); /* test get object to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); /* get buffer len */ len = aos_buf_list_len(&buffer); buf = aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; /* copy buffer content to memory */ aos_list_for_each_entry(aos_buf_t, content, &buffer, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } CuAssertStrEquals(tc, expect_content, buf); content_type = (char*)(apr_table_get(resp_headers, OSS_CONTENT_TYPE)); CuAssertStrEquals(tc, "video/MP2T", content_type); aos_pool_destroy(p); printf("test_get_object_to_buffer ok\n"); } void test_get_object_to_buffer_with_range(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_put_object.ts"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_buf_t *content = NULL; char *expect_content = "oss c sdk"; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); headers = aos_table_make(p, 1); apr_table_set(headers, "Range", " bytes=5-13"); aos_list_init(&buffer); /* test get object to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 206, s->code); CuAssertPtrNotNull(tc, resp_headers); /* get buffer len */ len = aos_buf_list_len(&buffer); buf = aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; /* copy buffer content to memory */ aos_list_for_each_entry(aos_buf_t, content, &buffer, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } CuAssertStrEquals(tc, expect_content, buf); aos_pool_destroy(p); printf("test_get_object_to_buffer_with_range ok\n"); } void test_get_object_to_file(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_put_object_from_file2.txt"; aos_string_t object; char *filename = "oss_test_get_object_to_file"; char *source_filename = __FILE__; aos_string_t file; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; char *content_type = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&file, filename); /* test get object to file */ s = oss_get_object_to_file(options, &bucket, &object, headers, params, &file, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, get_file_size(source_filename), get_file_size(filename)); content_type = (char*)(apr_table_get(resp_headers, OSS_CONTENT_TYPE)); CuAssertStrEquals(tc, "image/jpeg", content_type); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_get_object_to_file(options, &bucket, &object, headers, params, &file, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&file, "g:/invalid-path"); s = oss_get_object_to_file(options, &bucket, &object, headers, params, &file, &resp_headers); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s->code); remove(filename); aos_pool_destroy(p); printf("test_get_object_to_file ok\n"); } void test_head_object_with_not_exist(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "not_exist.object"; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); headers = aos_table_make(p, 0); /* test head object */ s = oss_head_object(options, &bucket, &object, headers, &resp_headers); CuAssertIntEquals(tc, 404, s->code); CuAssertStrEquals(tc, "UnknownError", s->error_code); CuAssertTrue(tc, NULL == s->error_msg); CuAssertTrue(tc, 0 != strlen(s->req_id)); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_head_object ok\n"); } void test_head_object(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_put_object.ts"; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; char *user_meta = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); headers = aos_table_make(p, 0); /* test head object */ s = oss_head_object(options, &bucket, &object, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); user_meta = (char*)(apr_table_get(resp_headers, "x-oss-meta-author")); CuAssertStrEquals(tc, "oss", user_meta); aos_pool_destroy(p); printf("test_head_object ok\n"); } void test_get_object_meta_not_exist(CuTest *tc){ aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "not_exist.object"; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); s = oss_get_object_meta(options, &bucket, &object, &resp_headers); CuAssertIntEquals(tc, 404, s->code); CuAssertStrEquals(tc, "UnknownError", s->error_code); CuAssertTrue(tc, NULL == s->error_msg); CuAssertTrue(tc, 0 != strlen(s->req_id)); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_head_object ok\n"); } void test_get_object_meta(CuTest *tc){ aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_put_object.ts"; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); s = oss_get_object_meta(options, &bucket, &object, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_get_object_meta ok\n"); } void test_get_object_acl_not_exist(CuTest *tc){ aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "not_exist.object"; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t oss_acl_str; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); s = oss_get_object_acl(options, &bucket, &object, &oss_acl_str, &resp_headers); CuAssertIntEquals(tc, 404, s->code); CuAssertStrEquals(tc, "NoSuchKey", s->error_code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_get_object_acl_not_exist ok\n"); } void test_get_object_acl_object_empty(CuTest *tc){ aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *object_name = ""; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t oss_acl_str; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); s = oss_get_object_acl(options, &bucket, &object, &oss_acl_str, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); aos_pool_destroy(p); printf("test_get_object_acl_object_empty ok\n"); } void test_get_object_acl_object_null(CuTest *tc){ aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t oss_acl_str; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_get_object_acl(options, &bucket, NULL, &oss_acl_str, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); aos_pool_destroy(p); printf("test_get_object_acl_object_null ok\n"); } void test_get_object_acl(CuTest *tc){ aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_put_object.ts"; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t oss_acl_str; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); s = oss_get_object_acl(options, &bucket, &object, &oss_acl_str, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_get_object_acl ok\n"); } void test_put_object_acl_invalid_acl(CuTest *tc){ aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_put_object.ts"; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_acl_e oss_acl_invalid = (oss_acl_e)(OSS_ACL_DEFAULT + 1); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); s = oss_put_object_acl(options, &bucket, &object, oss_acl_invalid, &resp_headers); CuAssertIntEquals(tc, 400, s->code); CuAssertStrEquals(tc, "MissingArgument", s->error_code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_put_object_acl_invalid_acl ok\n"); } void test_put_object_acl_object_empty(CuTest *tc){ aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *object_name = ""; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_acl_e oss_acl = OSS_ACL_DEFAULT; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); s = oss_put_object_acl(options, &bucket, &object, oss_acl, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); aos_pool_destroy(p); printf("test_put_object_acl_object_empty ok\n"); } void test_put_object_acl_object_null(CuTest *tc){ aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_acl_e oss_acl = OSS_ACL_DEFAULT; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_put_object_acl(options, &bucket, NULL, oss_acl, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); aos_pool_destroy(p); printf("test_put_object_acl_object_null ok\n"); } void test_put_object_acl(CuTest *tc){ aos_pool_t *p = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_put_object.ts"; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); s = oss_put_object_acl(options, &bucket, &object, oss_acl, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_put_object_acl ok\n"); } void test_delete_object(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_put_object"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); /* test delete object */ s = oss_delete_object(options, &bucket, &object, &resp_headers); CuAssertIntEquals(tc, 204, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_delete_object ok\n"); } void test_copy_object(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t source_bucket; char *source_object_name = "oss_test_put_object.ts"; aos_string_t source_object; aos_string_t dest_bucket; char *dest_object_name = "oss_test_copy_object"; aos_string_t dest_object; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_table_t *head_headers = NULL; aos_table_t *head_resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&source_bucket, TEST_BUCKET_NAME); aos_str_set(&source_object, source_object_name); aos_str_set(&dest_bucket, TEST_BUCKET_NAME); aos_str_set(&dest_object, dest_object_name); headers = aos_table_make(p, 5); /* test copy object */ s = oss_copy_object(options, &source_bucket, &source_object, &dest_bucket, &dest_object, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); apr_sleep(apr_time_from_sec(1)); /* head object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &dest_bucket, &dest_object, head_headers, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); aos_pool_destroy(p); printf("test_copy_object ok\n"); } void test_copy_object_with_source_url_encode(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t source_bucket; char *source_object_name = "y9n/g/%E9%98%B4%E9%98%B3%E5%B8%88-%E9%A3%9F%E6%A2%A6%E8%B2%98.ts"; char *filename = __FILE__; aos_string_t source_object; aos_string_t dest_bucket; char *dest_object_name = "oss_test_copy_object"; aos_string_t dest_object; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_table_t *head_headers = NULL; aos_table_t *head_resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&source_bucket, TEST_BUCKET_NAME); aos_str_set(&source_object, source_object_name); aos_str_set(&dest_bucket, TEST_BUCKET_NAME); aos_str_set(&dest_object, dest_object_name); /* put object */ s = create_test_object_from_file(options, TEST_BUCKET_NAME, source_object_name, filename, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); /* test copy object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_copy_object(options, &source_bucket, &source_object, &dest_bucket, &dest_object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); apr_sleep(apr_time_from_sec(1)); /* head object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &dest_bucket, &dest_object, head_headers, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); /* delete object */ s = oss_delete_object(options, &source_bucket, &source_object, &resp_headers); CuAssertIntEquals(tc, 204, s->code); s = oss_delete_object(options, &dest_bucket, &dest_object, &resp_headers); CuAssertIntEquals(tc, 204, s->code); aos_pool_destroy(p); printf("test_copy_object_with_source_url_encode ok\n"); } void test_copy_object_negative(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t source_bucket; char *source_object_name = NULL; aos_string_t source_object; aos_string_t dest_bucket; char *dest_object_name = "oss_test_copy_object"; aos_string_t dest_object; oss_request_options_t *options = NULL; int is_cname = 0; aos_status_t *s = NULL; char buffer[AOS_MAX_QUERY_ARG_LEN+1]; memset(buffer, 'A', AOS_MAX_QUERY_ARG_LEN); buffer[AOS_MAX_QUERY_ARG_LEN] = '\0'; source_object_name = buffer; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&source_bucket, TEST_BUCKET_NAME); aos_str_set(&source_object, source_object_name); aos_str_set(&dest_bucket, TEST_BUCKET_NAME); aos_str_set(&dest_object, dest_object_name); /* test copy object */ s = oss_copy_object(options, &source_bucket, &source_object, &dest_bucket, &dest_object, NULL, NULL); CuAssertIntEquals(tc, 400, s->code); CuAssertStrEquals(tc, "InvalidObjectName", s->error_code); aos_pool_destroy(p); printf("test_copy_object_negative ok\n"); } void test_object_by_url(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_http_request_t *req = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t url; apr_time_t now; int two_minute = 120; int is_cname = 0; char *object_name = "oss_test_object_by_url/123"; aos_string_t bucket; aos_string_t object; char *str = "test oss c sdk for object url api"; char *filename = __FILE__; char *filename_download = "oss_test_object_by_url"; aos_string_t file; int64_t effective_time; char *url_str = NULL; aos_buf_t *content = NULL; char special_query[AOS_MAX_QUERY_ARG_LEN + 1]; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); req = aos_http_request_create(p); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&file, filename); aos_list_init(&buffer); now = apr_time_now(); effective_time = now / 1000000 + two_minute; /* test effective url for put_object_from_buffer */ req = aos_http_request_create(p); headers = aos_table_make(p, 0); req->method = HTTP_PUT; url_str = gen_test_signed_url(options, TEST_BUCKET_NAME, object_name, effective_time, req); aos_str_set(&url, url_str); aos_list_init(&buffer); content = aos_buf_pack(p, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); s = oss_put_object_from_buffer_by_url(options, &url, &buffer, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); CuAssertPtrNotNull(tc, strstr(url_str, "oss_test_object_by_url%2F123")); CuAssertPtrEquals(tc, strstr(url_str, "oss_test_object_by_url/123"), NULL); CuAssertIntEquals(tc, req->normalize_url, 0); /* test effective url for put_object_from_file */ resp_headers = NULL; s = oss_put_object_from_file_by_url(options, &url, &file, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); /* test effective url for get_object_to_buffer */ req = aos_http_request_create(p); headers = aos_table_make(p, 0); req->method = HTTP_GET; req->normalize_url = 1; url_str = gen_test_signed_url(options, TEST_BUCKET_NAME, object_name, effective_time, req); aos_str_set(&url, url_str); s = oss_get_object_to_buffer_by_url(options, &url, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, strstr(url_str, "oss_test_object_by_url/123")); CuAssertPtrEquals(tc, strstr(url_str, "oss_test_object_by_url%2F123"), NULL); /* test effective url for get_object_to_file */ resp_headers = NULL; aos_str_set(&file, filename_download); s = oss_get_object_to_file_by_url(options, &url, headers, headers, &file, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, get_file_size(filename), get_file_size(filename_download)); CuAssertPtrNotNull(tc, resp_headers); /* test effective url for head_object */ req = aos_http_request_create(p); headers = aos_table_make(p, 0); resp_headers = NULL; req->method = HTTP_HEAD; url_str = gen_test_signed_url(options, TEST_BUCKET_NAME, object_name, effective_time, req); aos_str_set(&url, url_str); s = oss_head_object_by_url(options, &url, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); /* test invalid-bucketname url for put_object_from_file */ req = aos_http_request_create(p); headers = aos_table_make(p, 0); req->method = HTTP_PUT; url_str = gen_test_signed_url(options, "InvalidBucketName", object_name, effective_time, req); resp_headers = NULL; s = oss_put_object_from_file_by_url(options, &url, &file, headers, &resp_headers); CuAssertIntEquals(tc, 403, s->code); /* test invalid filepath url for put_object_from_file */ req = aos_http_request_create(p); headers = aos_table_make(p, 0); req->method = HTTP_PUT; url_str = gen_test_signed_url(options, TEST_BUCKET_NAME, object_name, effective_time, req); resp_headers = NULL; aos_str_set(&file, "g:/invalid-path"); s = oss_put_object_from_file_by_url(options, &url, &file, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s->code); /* test invalid-bucketname url for get_object_from_file */ req = aos_http_request_create(p); headers = aos_table_make(p, 0); req->method = HTTP_GET; url_str = gen_test_signed_url(options, "InvalidBucketName", object_name, effective_time, req); resp_headers = NULL; aos_str_set(&file, filename_download); s = oss_get_object_to_file_by_url(options, &url, headers, headers, &file, &resp_headers); CuAssertIntEquals(tc, 403, s->code); /* test invalid filepath url for get_object_from_file */ req = aos_http_request_create(p); headers = aos_table_make(p, 0); req->method = HTTP_GET; url_str = gen_test_signed_url(options, TEST_BUCKET_NAME, object_name, effective_time, req); resp_headers = NULL; aos_str_set(&file, "g:/invalid-path"); s = oss_get_object_to_file_by_url(options, &url, headers, headers, &file, &resp_headers); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s->code); /* test long query url fail*/ req = aos_http_request_create(p); headers = aos_table_make(p, 0); memset(special_query, 0x30, AOS_MAX_QUERY_ARG_LEN); special_query[AOS_MAX_QUERY_ARG_LEN] = '\0'; req->method = HTTP_GET; apr_table_set(req->query_params, "x-oss-process", special_query); url_str = gen_test_signed_url(options, TEST_BUCKET_NAME, object_name, effective_time, req); CuAssertTrue(tc, url_str == NULL); remove(filename_download); aos_pool_destroy(p); printf("test_object_by_url ok\n"); } void test_append_object_from_buffer(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_append_object"; aos_string_t bucket; aos_string_t object; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; int64_t position = 0; aos_table_t *headers = NULL; aos_table_t *headers1 = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; aos_list_t buffer; aos_buf_t *content = NULL; char *next_append_position = NULL; /* test append object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); s = oss_head_object(options, &bucket, &object, headers, &resp_headers); if (s->code == 200) { next_append_position = (char*)(apr_table_get(resp_headers, "x-oss-next-append-position")); position = atoi(next_append_position); } CuAssertPtrNotNull(tc, resp_headers); /* append object */ resp_headers = NULL; headers1 = aos_table_make(p, 0); aos_list_init(&buffer); content = aos_buf_pack(p, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); s = oss_append_object_from_buffer(options, &bucket, &object, position, &buffer, headers1, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_append_object_from_buffer ok\n"); } void test_append_object_from_file(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_append_object_from_file"; aos_string_t bucket; aos_string_t object; char *filename = __FILE__; aos_string_t append_file; aos_status_t *s = NULL; int is_cname = 0; int64_t position = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; /* test append object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&append_file, filename); s = oss_append_object_from_file(options, &bucket, &object, position, &append_file, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_append_object_from_file(options, &bucket, &object, position, &append_file, headers, &resp_headers); CuAssertIntEquals(tc, 400, s->code); printf("msg:%s\n", s->error_msg); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&append_file, ""); s = oss_append_object_from_file(options, &bucket, &object, position, &append_file, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s->code); aos_pool_destroy(p); printf("test_append_object_from_file ok\n"); } void test_do_append_object_from_file(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_do_append_object_from_file"; aos_string_t bucket; aos_string_t object; char *filename = __FILE__; aos_string_t append_file; aos_status_t *s = NULL; int is_cname = 0; int64_t position = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; aos_list_t resp_body; /* test append object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&append_file, filename); s = oss_do_append_object_from_file(options, &bucket, &object, position, 0, &append_file, headers, NULL, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); //negative case aos_str_set(&bucket, "c-sdk-no-exist"); s = oss_do_append_object_from_file(options, &bucket, &object, position, 0, &append_file, headers, NULL, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 400, s->code); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&append_file, ""); s = oss_do_append_object_from_file(options, &bucket, &object, position, 0, &append_file, headers, NULL, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s->code); aos_pool_destroy(p); printf("test_do_append_object_from_file ok\n"); } void test_get_not_exist_object_to_file(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_put_object_from_file_not_exist_.txt"; aos_string_t object; char *filename = "oss_test_get_object_to_file_not_exist"; aos_string_t file; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&file, filename); /* test get object to file */ s = oss_get_object_to_file(options, &bucket, &object, headers, params, &file, &resp_headers); CuAssertIntEquals(tc, 404, s->code); CuAssertIntEquals(tc, -1, get_file_size(filename)); aos_pool_destroy(p); printf("test_get_not_exist_object_to_file ok\n"); } void test_put_object_from_buffer_with_invalid_endpoint(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_put_object_invalid_endpoint.ts"; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; oss_request_options_t *options = NULL; /* test put object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&options->config->endpoint, "192.168.1.1"); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); s = create_test_object(options, TEST_BUCKET_NAME, object_name, str, headers); CuAssertIntEquals(tc, AOSE_CONNECTION_FAILED, s->code); aos_pool_destroy(p); printf("test_put_object_from_buffer_with_invalid_endpoint ok\n"); } void test_object_invalid_parameter(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; int i; char *invalid_name_list[] = { "a", "1", "!", "aa", "12", "a1", "a!", "1!", "aAa", "1A1", "a!a", "FengChao@123", "-a123", "a_123", "a123-", "1234567890123456789012345678901234567890123456789012345678901234", "", NULL, }; char* invalid_object_name_list[] = { "", NULL, }; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); for (i = 0; i < sizeof(invalid_name_list) / sizeof(invalid_name_list[0]); i++) { aos_string_t bucket; aos_status_t *s = NULL; aos_table_t *resp_headers = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; char* url = NULL; if (invalid_name_list[i] == NULL) { aos_str_null(&bucket); } else { aos_str_set(&bucket, invalid_name_list[i]); } headers = aos_table_make(p, 1); s = oss_put_object_from_buffer(options, &bucket, NULL, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_object_from_file(options, &bucket, NULL, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_object_to_buffer(options, &bucket, NULL, headers, params, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_restore_object(options, &bucket, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_object_to_file(options, &bucket, NULL, headers, params, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_head_object(options, &bucket, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_object_meta(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_object_acl(options, &bucket, NULL, OSS_ACL_DEFAULT, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_object_acl(options, &bucket, NULL, OSS_ACL_DEFAULT, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_symlink(options, &bucket, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_symlink(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_delete_object(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_copy_object(options, NULL, NULL, &bucket, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_append_object_from_buffer(options, &bucket, NULL, 1024LL, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_do_append_object_from_buffer(options, &bucket, NULL, 1024LL, 0, NULL, NULL, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_append_object_from_file(options, &bucket, NULL, 1024LL, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_do_append_object_from_file(options, &bucket, NULL, 1024LL, 0, NULL, NULL, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_do_select_object_to_buffer(options, &bucket, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_do_select_object_to_file(options, &bucket, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_create_select_object_meta(options, &bucket, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_put_object_tagging(options, &bucket, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_object_tagging(options, &bucket, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_delete_object_tagging(options, &bucket, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); url = oss_gen_signed_url(options, &bucket, NULL, 3600, NULL); CuAssertPtrEquals(tc, NULL, url); } for (i = 0; i < sizeof(invalid_object_name_list) / sizeof(invalid_object_name_list[0]); i++) { aos_string_t bucket; aos_string_t object; aos_status_t* s = NULL; aos_table_t* resp_headers = NULL; aos_table_t* headers = NULL; aos_table_t* params = NULL; char* url = NULL; aos_str_set(&bucket, "bucket"); if (invalid_object_name_list[i] != NULL) { aos_str_set(&object, invalid_object_name_list[i]); } else { aos_str_null(&object); } headers = aos_table_make(p, 1); s = oss_put_object_from_buffer(options, &bucket, &object, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_put_object_from_file(options, &bucket, &object, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_restore_object(options, &bucket, &object, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_get_object_to_file(options, &bucket, &object, headers, params, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_head_object(options, &bucket, &object, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_get_object_meta(options, &bucket, &object, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_put_object_acl(options, &bucket, &object, OSS_ACL_DEFAULT, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_put_object_acl(options, &bucket, &object, OSS_ACL_DEFAULT, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_put_symlink(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_get_symlink(options, &bucket, &object, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_delete_object(options, &bucket, &object, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_copy_object(options, NULL, NULL, &bucket, &object, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_append_object_from_buffer(options, &bucket, &object, 1024LL, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_do_append_object_from_buffer(options, &bucket, &object, 1024LL, 0, NULL, NULL, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_append_object_from_file(options, &bucket, &object, 1024LL, NULL, headers, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_do_append_object_from_file(options, &bucket, &object, 1024LL, 0, NULL, NULL, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_do_select_object_to_buffer(options, &bucket, &object, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_do_select_object_to_file(options, &bucket, &object, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_create_select_object_meta(options, &bucket, &object, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_put_object_tagging(options, &bucket, &object, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_get_object_tagging(options, &bucket, &object, NULL, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); s = oss_delete_object_tagging(options, &bucket, &object, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_OBJECT_NAME_INVALID_ERROR, s->error_code); url = oss_gen_signed_url(options, &bucket, &object, 3600, NULL); CuAssertPtrEquals(tc, NULL, url); } aos_pool_destroy(p); printf("test_object_invalid_parameter ok\n"); } void test_get_object_to_buffer_with_maxbuffersize(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "video_1.ts"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); options->ctl->options = aos_http_request_options_create(options->pool); options->ctl->options->max_memory_size = 4; options->ctl->options->enable_crc = AOS_FALSE; aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&buffer); /* test get object to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, AOSE_OVER_MEMORY, s->code); options->ctl->options->enable_crc = AOS_TRUE; /* test get object to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, AOSE_CRC_INCONSISTENT_ERROR, s->code); aos_pool_destroy(p); printf("test_get_object_to_buffer_with_maxbuffersize ok\n"); } void test_get_object_to_buffer_use_invalid_sts(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "video_1.ts"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&options->config->sts_token, "invalid-sts"); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&buffer); /* test get object to buffer */ s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 403, s->code); aos_pool_destroy(p); printf("test_get_object_to_buffer_use_invalid_sts ok\n"); } void test_object_with_invalid_endpoint(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "video_1.ts"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; char endpoint_buf[256]; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&buffer); aos_str_set(&options->config->endpoint, "www.test.com\\www.aliyuncs.com"); s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_CLIENT_ERROR_CODE, s->error_code); CuAssertStrEquals(tc, "The endpoint is invalid.", s->error_msg); aos_str_set(&options->config->endpoint, "test:pw@www.test.com*www.aliyuncs.com:80"); s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_CLIENT_ERROR_CODE, s->error_code); CuAssertStrEquals(tc, "The endpoint is invalid.", s->error_msg); aos_str_set(&options->config->endpoint, "www.test.com*www.aliyuncs.com"); s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_CLIENT_ERROR_CODE, s->error_code); CuAssertStrEquals(tc, "The endpoint is invalid.", s->error_msg); sprintf(endpoint_buf, "%s:80/test?x=1#segment", TEST_OSS_ENDPOINT); aos_str_set(&options->config->endpoint, endpoint_buf); s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); aos_str_set(&options->config->endpoint, "#www.test.com*www.aliyuncs.com"); s = oss_get_object_to_buffer(options, &bucket, &object, headers, params, &buffer, &resp_headers); CuAssertIntEquals(tc, AOSE_NAME_LOOKUP_ERROR, s->code); CuAssertStrEquals(tc, AOS_HTTP_IO_ERROR_CODE, s->error_code); CuAssertStrEquals(tc, "Couldn't resolve host name", s->error_msg); aos_pool_destroy(p); printf("test_object_with_invalid_endpoint ok\n"); } void test_object_verify_strict(CuTest* tc) { aos_pool_t* p = NULL; oss_request_options_t* options = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, 0); aos_string_t bucket; aos_string_t object; char* url; aos_http_request_t* request; // create request request = aos_http_request_create(p); request->method = HTTP_PUT; aos_str_set(&bucket, "bucket"); aos_str_set(&object, "?123"); url = oss_gen_signed_url(options, &bucket, &object, 3600, request); if (options->config->signature_version == 4) { CuAssertPtrNotNull(tc, strstr(url, "%3F123")); CuAssertPtrNotNull(tc, strstr(url, "x-oss-signature-version=OSS4-HMAC-SHA256")); } else { CuAssertTrue(tc, options->config->signature_version <= 1); CuAssertPtrEquals(tc, NULL, url); } aos_str_set(&object, "?"); url = oss_gen_signed_url(options, &bucket, &object, 3600, request); if (options->config->signature_version == 4) { CuAssertPtrNotNull(tc, strstr(url, "%3F")); CuAssertPtrNotNull(tc, strstr(url, "x-oss-signature-version=OSS4-HMAC-SHA256")); } else { CuAssertTrue(tc, options->config->signature_version <= 1); CuAssertPtrEquals(tc, NULL, url); } aos_str_set(&object, "123?123"); url = oss_gen_signed_url(options, &bucket, &object, 3600, request); CuAssertPtrNotNull(tc, url); options = oss_request_options_create(p); init_test_request_options(options, 0); options->ctl->options->verify_object_strict = AOS_FALSE; aos_str_set(&object, "?123"); url = oss_gen_signed_url(options, &bucket, &object, 3600, request); CuAssertPtrNotNull(tc, url); aos_str_set(&object, "?"); url = oss_gen_signed_url(options, &bucket, &object, 3600, request); CuAssertPtrNotNull(tc, url); aos_pool_destroy(p); printf("test_object_verify_strict ok\n"); } CuSuite *test_oss_object() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_object_setup); SUITE_ADD_TEST(suite, test_put_object_from_buffer); SUITE_ADD_TEST(suite, test_put_object_from_file); SUITE_ADD_TEST(suite, test_put_object_from_buffer_with_specified); SUITE_ADD_TEST(suite, test_get_object_to_buffer); SUITE_ADD_TEST(suite, test_get_object_to_buffer_with_range); SUITE_ADD_TEST(suite, test_put_object_from_file_with_content_type); SUITE_ADD_TEST(suite, test_put_symlink_for_obj); SUITE_ADD_TEST(suite, test_get_symlink_for_obj); SUITE_ADD_TEST(suite, test_restore_obj); SUITE_ADD_TEST(suite, test_restore_object_with_tier); SUITE_ADD_TEST(suite, test_put_object_from_buffer_with_default_content_type); SUITE_ADD_TEST(suite, test_put_object_with_large_length_header); SUITE_ADD_TEST(suite, test_get_object_to_file); SUITE_ADD_TEST(suite, test_head_object); SUITE_ADD_TEST(suite, test_head_object_with_not_exist); SUITE_ADD_TEST(suite, test_get_object_meta_not_exist); SUITE_ADD_TEST(suite, test_get_object_meta); SUITE_ADD_TEST(suite, test_get_object_acl_not_exist); SUITE_ADD_TEST(suite, test_get_object_acl_object_empty); SUITE_ADD_TEST(suite, test_get_object_acl_object_null); SUITE_ADD_TEST(suite, test_get_object_acl); SUITE_ADD_TEST(suite, test_put_object_acl_invalid_acl); SUITE_ADD_TEST(suite, test_put_object_acl_object_empty); SUITE_ADD_TEST(suite, test_put_object_acl_object_null); SUITE_ADD_TEST(suite, test_put_object_acl); SUITE_ADD_TEST(suite, test_copy_object); SUITE_ADD_TEST(suite, test_copy_object_with_source_url_encode); SUITE_ADD_TEST(suite, test_copy_object_negative); SUITE_ADD_TEST(suite, test_object_by_url); SUITE_ADD_TEST(suite, test_delete_object); SUITE_ADD_TEST(suite, test_append_object_from_buffer); SUITE_ADD_TEST(suite, test_append_object_from_file); SUITE_ADD_TEST(suite, test_do_append_object_from_file); SUITE_ADD_TEST(suite, test_get_not_exist_object_to_file); SUITE_ADD_TEST(suite, test_put_object_from_buffer_with_invalid_endpoint); SUITE_ADD_TEST(suite, test_object_invalid_parameter); SUITE_ADD_TEST(suite, test_get_object_to_buffer_with_maxbuffersize); SUITE_ADD_TEST(suite, test_get_object_to_buffer_use_invalid_sts); SUITE_ADD_TEST(suite, test_object_with_invalid_endpoint); SUITE_ADD_TEST(suite, test_object_verify_strict); SUITE_ADD_TEST(suite, test_object_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_object_tagging.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" static char test_file[1024]; void test_object_tagging_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "tagging"); /* create test bucket */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); sprintf(test_file, "%sBingWallpaper-2017-01-19.jpg", get_test_file_path()); } void test_object_tagging_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; char *object_name1 = "test_object_tagging_basic"; char *object_name2 = "test_object_tagging_tag_argument"; char *object_name3 = "test_object_tagging_put_object"; char *object_name4 = "test_object_tagging_append_object"; char *object_name5 = "test_object_tagging_copy_object_source"; char *object_name6 = "test_object_tagging_copy_object_dest"; char *object_name7 = "test_object_tagging_oss_object"; char *object_name8 = "test_object_tagging_link_to_oss_object"; char *object_name9 = "test_object_tagging_multipart_upload"; char *object_name10 = "test_object_tagging_resumable_upload"; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); /* delete test object */ delete_test_object(options, TEST_BUCKET_NAME, object_name1); delete_test_object(options, TEST_BUCKET_NAME, object_name2); delete_test_object(options, TEST_BUCKET_NAME, object_name3); delete_test_object(options, TEST_BUCKET_NAME, object_name4); delete_test_object(options, TEST_BUCKET_NAME, object_name5); delete_test_object(options, TEST_BUCKET_NAME, object_name6); delete_test_object(options, TEST_BUCKET_NAME, object_name7); delete_test_object(options, TEST_BUCKET_NAME, object_name8); delete_test_object(options, TEST_BUCKET_NAME, object_name9); delete_test_object(options, TEST_BUCKET_NAME, object_name10); /* delete test bucket */ aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } void test_object_tagging_basic(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_object_tagging_basic"; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; aos_table_t *head_resp_headers = NULL; oss_request_options_t *options = NULL; aos_list_t tag_list; oss_tag_content_t *tag_content; int index; /* test put object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); s = create_test_object(options, TEST_BUCKET_NAME, object_name, str, headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /* get object tagging*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); s = oss_get_object_tagging(options, &bucket, &object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); index = 0; aos_list_for_each_entry(oss_tag_content_t, tag_content, &tag_list, node) { index++; } CuAssertIntEquals(tc, 0, index); aos_pool_destroy(p); /*set object tagging*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); tag_content = oss_create_tag_content(p); aos_str_set(&tag_content->key, "key1"); aos_str_set(&tag_content->value, "value1"); aos_list_add_tail(&tag_content->node, &tag_list); tag_content = oss_create_tag_content(p); aos_str_set(&tag_content->key, "key2"); aos_str_set(&tag_content->value, "value2"); aos_list_add_tail(&tag_content->node, &tag_list); s = oss_put_object_tagging(options, &bucket, &object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); aos_pool_destroy(p); /*get object tagging again*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); s = oss_get_object_tagging(options, &bucket, &object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); index = 0; aos_list_for_each_entry(oss_tag_content_t, tag_content, &tag_list, node) { char *value = NULL; if (index == 0) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key1", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value1", value); } else if (index == 1) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key2", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value2", value); } index++; } CuAssertIntEquals(tc, 2, index); aos_pool_destroy(p); /*delete object tagging*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); s = oss_delete_object_tagging(options, &bucket, &object, &head_resp_headers); CuAssertIntEquals(tc, 204, s->code); CuAssertPtrNotNull(tc, head_resp_headers); aos_pool_destroy(p); /*get object tagging again*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); s = oss_get_object_tagging(options, &bucket, &object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); index = 0; aos_list_for_each_entry(oss_tag_content_t, tag_content, &tag_list, node) { index++; } CuAssertIntEquals(tc, 0, index); aos_pool_destroy(p); //negative case aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, "c-sdk-no-exist"); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); s = oss_get_object_tagging(options, &bucket, &object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("test_object_tagging_basic ok\n"); } void test_object_tagging_tag_list(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_object_tagging_tag_argument"; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; aos_table_t *head_resp_headers = NULL; oss_request_options_t *options = NULL; aos_list_t tag_list; oss_tag_content_t *tag_content; /* test put object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); s = create_test_object(options, TEST_BUCKET_NAME, object_name, str, headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /*set object tagging with empty tag list*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); s = oss_put_object_tagging(options, &bucket, &object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); aos_pool_destroy(p); /*set object tagging with empty tag.key */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); tag_content = oss_create_tag_content(p); aos_str_set(&tag_content->key, "key1"); aos_list_add_tail(&tag_content->node, &tag_list); s = oss_put_object_tagging(options, &bucket, &object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); aos_pool_destroy(p); /*set object tagging with empty tag.value */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); tag_content = oss_create_tag_content(p); aos_str_set(&tag_content->value, "value1"); aos_list_add_tail(&tag_content->node, &tag_list); s = oss_put_object_tagging(options, &bucket, &object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 400, s->code); CuAssertIntEquals(tc, 400, s->code); CuAssertPtrNotNull(tc, head_resp_headers); aos_pool_destroy(p); printf("test_object_tagging_tag_list ok\n"); } void test_object_tagging_put_object(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_object_tagging_put_object"; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; aos_table_t *head_resp_headers = NULL; oss_request_options_t *options = NULL; aos_list_t tag_list; oss_tag_content_t *tag_content; int index; aos_list_t buffer; aos_buf_t *content; /* test put object with tagging */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-tagging", "key1=value1&key2=value2"); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); s = oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /*get object tagging again*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); s = oss_get_object_tagging(options, &bucket, &object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); index = 0; aos_list_for_each_entry(oss_tag_content_t, tag_content, &tag_list, node) { char *value = NULL; if (index == 0) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key1", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value1", value); } else if (index == 1) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key2", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value2", value); } index++; } CuAssertIntEquals(tc, 2, index); aos_pool_destroy(p); printf("test_object_tagging_put_object ok\n"); } void test_object_tagging_append_object(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_object_tagging_append_object"; char *str = "test oss c sdk"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; aos_table_t *head_resp_headers = NULL; oss_request_options_t *options = NULL; aos_list_t tag_list; oss_tag_content_t *tag_content; int index; aos_list_t buffer; aos_buf_t *content; /* test put object with tagging */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-tagging", "key1=value1&key2=value2"); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); s = oss_append_object_from_buffer(options, &bucket, &object, 0, &buffer, headers, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /*get object tagging*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); s = oss_get_object_tagging(options, &bucket, &object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); index = 0; aos_list_for_each_entry(oss_tag_content_t, tag_content, &tag_list, node) { char *value = NULL; if (index == 0) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key1", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value1", value); } else if (index == 1) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key2", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value2", value); } index++; } CuAssertIntEquals(tc, 2, index); aos_pool_destroy(p); printf("test_object_tagging_append_object ok\n"); } void test_object_tagging_put_symlink(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_object_tagging_oss_object"; char *link_object_name = "test_object_tagging_link_to_oss_object"; aos_string_t bucket; aos_string_t sym_object; aos_string_t target_object; aos_status_t *s = NULL; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *head_resp_headers = NULL; aos_list_t tag_list; oss_tag_content_t *tag_content; int index; /*put object*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-tagging", "key3=value3"); s = create_test_object(options, TEST_BUCKET_NAME, object_name, "hello world", headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /* link object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-tagging", "key1=value1"); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&sym_object, link_object_name); aos_str_set(&target_object, object_name); init_test_request_options(options, is_cname); s = oss_do_put_symlink(options, &bucket, &sym_object, &target_object, headers, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); aos_pool_destroy(p); /*get object tagging*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_list_init(&tag_list); s = oss_get_object_tagging(options, &bucket, &sym_object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); index = 0; aos_list_for_each_entry(oss_tag_content_t, tag_content, &tag_list, node) { char *value = NULL; if (index == 0) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key1", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value1", value); } index++; } CuAssertIntEquals(tc, 1, index); aos_pool_destroy(p); printf("test_object_tagging_put_symlink ok\n"); } void test_object_tagging_copy_object(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t source_bucket; char *source_object_name = "test_object_tagging_copy_object_source"; aos_string_t source_object; aos_string_t dest_bucket; char *dest_object_name = "test_object_tagging_copy_object_dest"; aos_string_t dest_object; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t tag_list; oss_tag_content_t *tag_content; int index; /*put object*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-tagging", "key3=value3"); s = create_test_object(options, TEST_BUCKET_NAME, source_object_name, "hello world", headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /* test copy object with directive copy*/ aos_pool_create(&p, NULL); headers = aos_table_make(p, 1); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&source_bucket, TEST_BUCKET_NAME); aos_str_set(&source_object, source_object_name); aos_str_set(&dest_bucket, TEST_BUCKET_NAME); aos_str_set(&dest_object, dest_object_name); apr_table_set(headers, "x-oss-tagging-directive", "Copy"); s = oss_copy_object(options, &source_bucket, &source_object, &dest_bucket, &dest_object, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); apr_sleep(apr_time_from_sec(1)); /*get object tagging*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_list_init(&tag_list); s = oss_get_object_tagging(options, &dest_bucket, &dest_object, &tag_list, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); index = 0; aos_list_for_each_entry(oss_tag_content_t, tag_content, &tag_list, node) { char *value = NULL; if (index == 0) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key3", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value3", value); } index++; } CuAssertIntEquals(tc, 1, index); aos_pool_destroy(p); /* test copy object with directive replace*/ aos_pool_create(&p, NULL); headers = aos_table_make(p, 1); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&source_bucket, TEST_BUCKET_NAME); aos_str_set(&source_object, source_object_name); aos_str_set(&dest_bucket, TEST_BUCKET_NAME); aos_str_set(&dest_object, dest_object_name); apr_table_set(headers, "x-oss-tagging-directive", "Replace"); apr_table_set(headers, "x-oss-tagging", "key1=value1&key2=value2"); s = oss_copy_object(options, &source_bucket, &source_object, &dest_bucket, &dest_object, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); apr_sleep(apr_time_from_sec(1)); /*get object tagging*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_list_init(&tag_list); s = oss_get_object_tagging(options, &dest_bucket, &dest_object, &tag_list, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); index = 0; aos_list_for_each_entry(oss_tag_content_t, tag_content, &tag_list, node) { char *value = NULL; if (index == 0) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key1", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value1", value); } index++; } CuAssertIntEquals(tc, 2, index); aos_pool_destroy(p); printf("test_object_tagging_copy_object ok\n"); } void test_object_tagging_multipart_upload(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "test_object_tagging_multipart_upload"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t buffer; aos_table_t *headers = NULL; aos_table_t *upload_part_resp_headers = NULL; oss_list_upload_part_params_t *params = NULL; aos_table_t *list_part_resp_headers = NULL; aos_string_t upload_id; aos_list_t complete_part_list; oss_list_part_content_t *part_content1 = NULL; oss_list_part_content_t *part_content2 = NULL; oss_complete_part_content_t *complete_content1 = NULL; oss_complete_part_content_t *complete_content2 = NULL; aos_table_t *complete_resp_headers = NULL; aos_table_t *head_resp_headers = NULL; int part_num = 1; int part_num1 = 2; char *expect_part_num_marker = "1"; char *content_type_for_complete = "application/octet-stream"; aos_list_t tag_list; oss_tag_content_t *tag_content; int index; aos_table_t *resp_headers; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); headers = aos_table_make(options->pool, 2); //init mulitipart apr_table_add(headers, "x-oss-tagging", "key1=value1&key2=value2"); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); s = oss_init_multipart_upload(options, &bucket, &object, &upload_id, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); //upload part aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num, &buffer, &upload_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, upload_part_resp_headers); aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num1, &buffer, &upload_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, upload_part_resp_headers); //list part params = oss_create_list_upload_part_params(p); params->max_ret = 1; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, &list_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 1, params->truncated); CuAssertStrEquals(tc, expect_part_num_marker, params->next_part_number_marker.data); CuAssertPtrNotNull(tc, list_part_resp_headers); aos_list_for_each_entry(oss_list_part_content_t, part_content1, ¶ms->part_list, node) { complete_content1 = oss_create_complete_part_content(p); aos_str_set(&complete_content1->part_number, part_content1->part_number.data); aos_str_set(&complete_content1->etag, part_content1->etag.data); aos_list_add_tail(&complete_content1->node, &complete_part_list); } aos_list_init(¶ms->part_list); aos_str_set(¶ms->part_number_marker, params->next_part_number_marker.data); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, &list_part_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertIntEquals(tc, 0, params->truncated); CuAssertPtrNotNull(tc, list_part_resp_headers); aos_list_for_each_entry(oss_list_part_content_t, part_content2, ¶ms->part_list, node) { complete_content2 = oss_create_complete_part_content(p); aos_str_set(&complete_content2->part_number, part_content2->part_number.data); aos_str_set(&complete_content2->etag, part_content2->etag.data); aos_list_add_tail(&complete_content2->node, &complete_part_list); } //complete multipart apr_table_clear(headers); apr_table_add(headers, OSS_CONTENT_TYPE, content_type_for_complete); s = oss_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, headers, &complete_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, complete_resp_headers); aos_pool_destroy(p); /*get object tagging*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); s = oss_get_object_tagging(options, &bucket, &object, &tag_list, &head_resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, head_resp_headers); index = 0; aos_list_for_each_entry(oss_tag_content_t, tag_content, &tag_list, node) { char *value = NULL; if (index == 0) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key1", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value1", value); } else if (index == 1) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key2", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value2", value); } index++; } CuAssertIntEquals(tc, 2, index); aos_pool_destroy(p); printf("test_object_tagging_multipart ok\n"); } void test_object_tagging_resumale_upload(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_object_tagging_resumable_upload"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; aos_list_t tag_list; oss_tag_content_t *tag_content; int index; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); apr_table_add(headers, "x-oss-tagging", "key1=value1&key2=value2"); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // upload object clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); /*get object tagging*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); init_test_request_options(options, is_cname); aos_list_init(&tag_list); apr_table_clear(resp_headers); s = oss_get_object_tagging(options, &bucket, &object, &tag_list, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); index = 0; aos_list_for_each_entry(oss_tag_content_t, tag_content, &tag_list, node) { char *value = NULL; if (index == 0) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key1", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value1", value); } else if (index == 1) { value = apr_psprintf(p, "%.*s", tag_content->key.len, tag_content->key.data); CuAssertStrEquals(tc, "key2", value); value = apr_psprintf(p, "%.*s", tag_content->value.len, tag_content->value.data); CuAssertStrEquals(tc, "value2", value); } index++; } CuAssertIntEquals(tc, 2, index); aos_pool_destroy(p); printf("test_object_tagging_resumale_upload ok\n"); } void test_lifecycle_tag(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t lifecycle_rule_list; oss_lifecycle_rule_content_t *rule_content = NULL; oss_lifecycle_rule_content_t *rule_content1 = NULL; oss_lifecycle_rule_content_t *rule_content2 = NULL; oss_lifecycle_rule_content_t *rule_content3 = NULL; oss_lifecycle_rule_content_t *rule_content4 = NULL; int size = 0; char *rule_id = NULL; char *prefix = NULL; char *status = NULL; int days = INT_MAX; char* date = NULL; char* created_before_date = NULL; oss_tag_content_t *tag_content = NULL; int tag_index = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); //put lifecycle resp_headers = NULL; aos_list_init(&lifecycle_rule_list); rule_content1 = oss_create_lifecycle_rule_content(p); aos_str_set(&rule_content1->id, "1"); aos_str_set(&rule_content1->prefix, "pre1"); aos_str_set(&rule_content1->status, "Enabled"); rule_content1->days = 1; tag_content = oss_create_tag_content(p); aos_str_set(&tag_content->key, "pre1key1"); aos_str_set(&tag_content->value, "pre1value1"); aos_list_add_tail(&tag_content->node, &rule_content1->tag_list); tag_content = oss_create_tag_content(p); aos_str_set(&tag_content->key, "pre1key2"); aos_str_set(&tag_content->value, "pre1value2"); aos_list_add_tail(&tag_content->node, &rule_content1->tag_list); rule_content2 = oss_create_lifecycle_rule_content(p); aos_str_set(&rule_content2->id, "2"); aos_str_set(&rule_content2->prefix, "pre2"); aos_str_set(&rule_content2->status, "Enabled"); aos_str_set(&rule_content2->date, "2022-10-11T00:00:00.000Z"); rule_content3 = oss_create_lifecycle_rule_content(p); aos_str_set(&rule_content3->id, "3"); aos_str_set(&rule_content3->prefix, "pre3"); aos_str_set(&rule_content3->status, "Enabled"); aos_str_set(&rule_content3->created_before_date, "2017-10-11T00:00:00.000Z"); rule_content3->abort_multipart_upload_dt.days = 1; rule_content4 = oss_create_lifecycle_rule_content(p); aos_str_set(&rule_content4->id, "4"); aos_str_set(&rule_content4->prefix, "pre4"); aos_str_set(&rule_content4->status, "Enabled"); aos_str_set(&rule_content4->created_before_date, "2017-10-11T00:00:00.000Z"); aos_str_set(&rule_content4->abort_multipart_upload_dt.created_before_date, "2012-10-11T00:00:00.000Z"); aos_list_add_tail(&rule_content1->node, &lifecycle_rule_list); aos_list_add_tail(&rule_content2->node, &lifecycle_rule_list); aos_list_add_tail(&rule_content3->node, &lifecycle_rule_list); aos_list_add_tail(&rule_content4->node, &lifecycle_rule_list); s = oss_put_bucket_lifecycle(options, &bucket, &lifecycle_rule_list, &resp_headers); if (s->error_msg) { TEST_CASE_LOG("%s %s\n", s->error_msg, s->error_code); } CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); //get lifecycle resp_headers = NULL; aos_list_init(&lifecycle_rule_list); s = oss_get_bucket_lifecycle(options, &bucket, &lifecycle_rule_list, &resp_headers); if (s->error_msg) { printf("%s %s", s->error_msg, s->error_code); } CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_list_for_each_entry(oss_lifecycle_rule_content_t, rule_content, &lifecycle_rule_list, node) { if (size == 0) { rule_id = apr_psprintf(p, "%.*s", rule_content->id.len, rule_content->id.data); CuAssertStrEquals(tc, "1", rule_id); prefix = apr_psprintf(p, "%.*s", rule_content->prefix.len, rule_content->prefix.data); CuAssertStrEquals(tc, "pre1", prefix); date = apr_psprintf(p, "%.*s", rule_content->date.len, rule_content->date.data); CuAssertStrEquals(tc, "", date); status = apr_psprintf(p, "%.*s", rule_content->status.len, rule_content->status.data); CuAssertStrEquals(tc, "Enabled", status); days = rule_content->days; CuAssertIntEquals(tc, 1, days); tag_index = 0; aos_list_for_each_entry(oss_tag_content_t, tag_content, &rule_content->tag_list, node) { if (tag_index == 0) { CuAssertStrEquals(tc, "pre1key1", tag_content->key.data); CuAssertStrEquals(tc, "pre1value1", tag_content->value.data); } else if (tag_index == 1) { CuAssertStrEquals(tc, "pre1key2", tag_content->key.data); CuAssertStrEquals(tc, "pre1value2", tag_content->value.data); } tag_index++; } CuAssertIntEquals(tc, 2, tag_index); } else if (size == 1) { rule_id = apr_psprintf(p, "%.*s", rule_content->id.len, rule_content->id.data); CuAssertStrEquals(tc, "2", rule_id); prefix = apr_psprintf(p, "%.*s", rule_content->prefix.len, rule_content->prefix.data); CuAssertStrEquals(tc, "pre2", prefix); date = apr_psprintf(p, "%.*s", rule_content->date.len, rule_content->date.data); CuAssertStrEquals(tc, "2022-10-11T00:00:00.000Z", date); status = apr_psprintf(p, "%.*s", rule_content->status.len, rule_content->status.data); CuAssertStrEquals(tc, "Enabled", status); days = rule_content->days; CuAssertIntEquals(tc, INT_MAX, days); CuAssertIntEquals(tc, 1, aos_list_empty(&rule_content->tag_list)); } else if (size == 2) { rule_id = apr_psprintf(p, "%.*s", rule_content->id.len, rule_content->id.data); CuAssertStrEquals(tc, "3", rule_id); prefix = apr_psprintf(p, "%.*s", rule_content->prefix.len, rule_content->prefix.data); CuAssertStrEquals(tc, "pre3", prefix); date = apr_psprintf(p, "%.*s", rule_content->date.len, rule_content->date.data); CuAssertStrEquals(tc, "", date); created_before_date = apr_psprintf(p, "%.*s", rule_content->created_before_date.len, rule_content->created_before_date.data); CuAssertStrEquals(tc, "2017-10-11T00:00:00.000Z", created_before_date); days = rule_content->abort_multipart_upload_dt.days; CuAssertIntEquals(tc, 1, days); status = apr_psprintf(p, "%.*s", rule_content->status.len, rule_content->status.data); CuAssertStrEquals(tc, "Enabled", status); days = rule_content->days; CuAssertIntEquals(tc, INT_MAX, days); CuAssertIntEquals(tc, 1, aos_list_empty(&rule_content->tag_list)); } else if (size == 3) { rule_id = apr_psprintf(p, "%.*s", rule_content->id.len, rule_content->id.data); CuAssertStrEquals(tc, "4", rule_id); prefix = apr_psprintf(p, "%.*s", rule_content->prefix.len, rule_content->prefix.data); CuAssertStrEquals(tc, "pre4", prefix); created_before_date = apr_psprintf(p, "%.*s", rule_content->created_before_date.len, rule_content->created_before_date.data); CuAssertStrEquals(tc, "2017-10-11T00:00:00.000Z", created_before_date); created_before_date = apr_psprintf(p, "%.*s", rule_content->abort_multipart_upload_dt.created_before_date.len, rule_content->abort_multipart_upload_dt.created_before_date.data); CuAssertStrEquals(tc, "2012-10-11T00:00:00.000Z", created_before_date); days = rule_content->abort_multipart_upload_dt.days; CuAssertIntEquals(tc, INT_MAX, days); status = apr_psprintf(p, "%.*s", rule_content->status.len, rule_content->status.data); CuAssertStrEquals(tc, "Enabled", status); days = rule_content->days; CuAssertIntEquals(tc, INT_MAX, days); CuAssertIntEquals(tc, 1, aos_list_empty(&rule_content->tag_list)); } ++size; } CuAssertIntEquals(tc, 4, size); //delete lifecycle resp_headers = NULL; s = oss_delete_bucket_lifecycle(options, &bucket, &resp_headers); CuAssertIntEquals(tc, 204, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("test_lifecycle ok\n"); } void test_object_tagging_invalid_parameter(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; int i; char *invalid_name_list[] = { "a", "1", "!", "aa", "12", "a1", "a!", "1!", "aAa", "1A1", "a!a", "FengChao@123", "-a123", "a_123", "a123-", "1234567890123456789012345678901234567890123456789012345678901234", "" }; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); for (i = 0; i < sizeof(invalid_name_list) / sizeof(invalid_name_list[0]); i++) { aos_string_t bucket; aos_status_t *s = NULL; aos_table_t *resp_headers = NULL; aos_str_set(&bucket, invalid_name_list[i]); s = oss_put_object_tagging(options, &bucket, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_get_object_tagging(options, &bucket, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_delete_object_tagging(options, &bucket, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); } aos_pool_destroy(p); printf("test_object_tagging_invalid_parameter ok\n"); } CuSuite *test_oss_object_tagging() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_object_tagging_setup); SUITE_ADD_TEST(suite, test_object_tagging_basic); SUITE_ADD_TEST(suite, test_object_tagging_tag_list); SUITE_ADD_TEST(suite, test_object_tagging_put_object); SUITE_ADD_TEST(suite, test_object_tagging_append_object); SUITE_ADD_TEST(suite, test_object_tagging_put_symlink); SUITE_ADD_TEST(suite, test_object_tagging_copy_object); SUITE_ADD_TEST(suite, test_object_tagging_multipart_upload); SUITE_ADD_TEST(suite, test_object_tagging_resumale_upload); SUITE_ADD_TEST(suite, test_lifecycle_tag); SUITE_ADD_TEST(suite, test_object_tagging_invalid_parameter); SUITE_ADD_TEST(suite, test_object_tagging_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_progress.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" void test_progress_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "progress"); /* create test bucket */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); } void test_progress_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; char *object_name1 = "oss_test_progress_put_object.ts"; char *object_name2 = "oss_test_progress_append_object.ts"; char *object_name3 = "oss_test_progress_multipart_object.ts"; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); /* delete test object */ delete_test_object(options, TEST_BUCKET_NAME, object_name1); delete_test_object(options, TEST_BUCKET_NAME, object_name2); delete_test_object(options, TEST_BUCKET_NAME, object_name3); /* delete test bucket */ aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, NULL); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } void test_progress_put_and_get_from_buffer(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_progress_put_object.ts"; char *str = NULL; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; aos_table_t *params = NULL; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; size_t length = 1024 * 16 * 10; aos_list_t resp_body; aos_list_t buffer; aos_buf_t *content; /* init test*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); str = (char *)aos_palloc(p, length); memset(str, 'A', length - 1); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, length); aos_list_add_tail(&content->node, &buffer); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); /* test put object */ s = oss_do_put_object_from_buffer(options, &bucket, &object, &buffer, headers, params, percentage, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /* test get object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_do_get_object_to_buffer(options, &bucket, &object, NULL, NULL, &buffer, percentage, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); printf("test_progress_put_object_from_buffer ok\n"); } void test_progress_put_and_get_from_file(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_progress_put_object.ts"; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_string_t filename; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; size_t length = 1024 * 16 * 10; aos_list_t resp_body; /* init test*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); make_random_file(p, object_name, length); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); aos_list_init(&resp_body); /* test put object */ s = oss_do_put_object_from_file(options, &bucket, &object, &filename, NULL, NULL, percentage, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); /* test get object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_do_get_object_to_file(options, &bucket, &object, NULL, NULL, &filename, percentage, NULL); CuAssertIntEquals(tc, 200, s->code); apr_file_remove(object_name, p); aos_pool_destroy(p); printf("test_progress_put_and_get_from_file ok\n"); } void test_progress_put_and_get_empty_body(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_progress_put_object.ts"; char *str = ""; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_table_t *headers = NULL; aos_table_t *params = NULL; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; size_t length = 0; aos_list_t resp_body; aos_list_t buffer; aos_buf_t *content; /* init test*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, length); aos_list_add_tail(&content->node, &buffer); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); /* test put object */ s = oss_do_put_object_from_buffer(options, &bucket, &object, &buffer, headers, params, percentage, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, headers); aos_pool_destroy(p); /* test get object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_do_get_object_to_buffer(options, &bucket, &object, NULL, NULL, &buffer, percentage, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); printf("test_progress_put_and_get_empty_body ok\n"); } void test_progress_append_object(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_progress_append_object.ts"; char *str = NULL; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_table_t *headers = NULL; aos_table_t *params = NULL; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; size_t length = 1024 * 16 * 20; uint64_t initcrc = 0; aos_list_t resp_body; aos_list_t buffer; aos_buf_t *content; /* init test*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); str = (char *)aos_palloc(p, length); memset(str, 'A', length - 1); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, length); aos_list_add_tail(&content->node, &buffer); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-meta-author", "oss"); /* test append object from buffer */ s = oss_do_append_object_from_buffer(options, &bucket, &object, 0, initcrc, &buffer, headers, params, percentage, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); /* test append object from file*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&filename, object_name); make_random_file(p, object_name, length); initcrc = aos_atoui64((char*)(apr_table_get(resp_headers, OSS_HASH_CRC64_ECMA))); s = oss_do_append_object_from_file(options, &bucket, &object, length, initcrc, &filename, NULL, NULL, percentage, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); apr_file_remove(object_name, p); aos_pool_destroy(p); printf("test_progress_append_object ok\n"); } void test_progress_multipart_from_buffer(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_progress_multipart_object.ts"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; aos_list_t buffer; oss_list_upload_part_params_t *params = NULL; aos_string_t upload_id; aos_list_t complete_part_list; oss_list_part_content_t *part_content1 = NULL; oss_complete_part_content_t *complete_content1 = NULL; int part_num = 1; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); //upload part aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_do_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num++, &buffer, percentage, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, 200, s->code); aos_list_init(&buffer); make_random_body(p, 200, &buffer); s = oss_do_upload_part_from_buffer(options, &bucket, &object, &upload_id, part_num++, &buffer, percentage, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, 200, s->code); //list part params = oss_create_list_upload_part_params(p); params->max_ret = 1; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, NULL); CuAssertIntEquals(tc, 200, s->code); aos_list_for_each_entry(oss_list_part_content_t, part_content1, ¶ms->part_list, node) { complete_content1 = oss_create_complete_part_content(p); aos_str_set(&complete_content1->part_number, part_content1->part_number.data); aos_str_set(&complete_content1->etag, part_content1->etag.data); aos_list_add_tail(&complete_content1->node, &complete_part_list); } //complete multipart s = oss_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, NULL, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); printf("test_progress_multipart_from_buffer ok\n"); } void test_progress_multipart_from_file(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_progress_multipart_object.ts"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_status_t *s = NULL; oss_list_upload_part_params_t *params = NULL; aos_string_t upload_id; aos_list_t complete_part_list; oss_upload_file_t *upload_file = NULL; oss_list_part_content_t *part_content1 = NULL; oss_complete_part_content_t *complete_content1 = NULL; size_t length = 1024 * 16 * 10; int part_num = 1; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); make_random_file(p, object_name, length); upload_file = oss_create_upload_file(p); aos_str_set(&upload_file->filename, object_name); //init mulitipart s = init_test_multipart_upload(options, TEST_BUCKET_NAME, object_name, &upload_id); CuAssertIntEquals(tc, 200, s->code); //upload part upload_file->file_pos = 0; upload_file->file_last = length/2; s = oss_do_upload_part_from_file(options, &bucket, &object, &upload_id, part_num++, upload_file, percentage, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, 200, s->code); upload_file->file_pos = length/2; upload_file->file_last = length; s = oss_do_upload_part_from_file(options, &bucket, &object, &upload_id, part_num++, upload_file, percentage, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, 200, s->code); //list part params = oss_create_list_upload_part_params(p); params->max_ret = 1; aos_list_init(&complete_part_list); s = oss_list_upload_part(options, &bucket, &object, &upload_id, params, NULL); CuAssertIntEquals(tc, 200, s->code); aos_list_for_each_entry(oss_list_part_content_t, part_content1, ¶ms->part_list, node) { complete_content1 = oss_create_complete_part_content(p); aos_str_set(&complete_content1->part_number, part_content1->part_number.data); aos_str_set(&complete_content1->etag, part_content1->etag.data); aos_list_add_tail(&complete_content1->node, &complete_part_list); } //complete multipart s = oss_complete_multipart_upload(options, &bucket, &object, &upload_id, &complete_part_list, NULL, NULL); CuAssertIntEquals(tc, 200, s->code); apr_file_remove(object_name, p); aos_pool_destroy(p); printf("void test_progress_multipart_from_file ok\n"); } CuSuite *test_oss_progress() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_progress_setup); SUITE_ADD_TEST(suite, test_progress_put_and_get_from_buffer); SUITE_ADD_TEST(suite, test_progress_put_and_get_from_file); SUITE_ADD_TEST(suite, test_progress_put_and_get_empty_body); SUITE_ADD_TEST(suite, test_progress_append_object); SUITE_ADD_TEST(suite, test_progress_multipart_from_buffer); SUITE_ADD_TEST(suite, test_progress_multipart_from_file); SUITE_ADD_TEST(suite, test_progress_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_proxy.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" #include "aos_crc64.h" static char test_file[1024]; void test_proxy_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "proxy"); /* create test bucket */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); sprintf(test_file, "%sBingWallpaper-2017-01-19.jpg", get_test_file_path()); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); } void test_proxy_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; char *object_name1 = "oss_test_proxy_put_object.txt"; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); /* delete test object */ delete_test_object(options, TEST_BUCKET_NAME, object_name1); /* delete test bucket */ aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } void init_test_proxy_request_options(oss_request_options_t *options, int is_cname) { options->config = oss_config_create(options->pool); init_test_config(options->config, is_cname); aos_str_set(&options->config->proxy_host, decrypt("^]DRRDR^D^Z", options->pool)); aos_str_set(&options->config->proxy_user, decrypt("\x1e\xf\x19\x1e\xf\x18", options->pool)); aos_str_set(&options->config->proxy_passwd, decrypt("\"\xf\x6\x6\x5[XY^_", options->pool)); options->config->proxy_port = 3128; options->ctl = aos_http_controller_create(options->pool, 0); options->ctl->options = aos_http_request_options_create(options->pool); oss_config_resolve(options->pool, options->config, options->ctl); options->ctl->options->verify_ssl = AOS_FALSE; } void test_proxy_put_object_from_buffer(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "oss_test_proxy_put_object.txt"; char *str = "Sow nothing, reap nothing."; aos_status_t *s = NULL; int is_cname = 0; aos_string_t bucket; aos_string_t object; oss_request_options_t *options = NULL; aos_table_t *headers = NULL; aos_list_t buffer; aos_buf_t *content; /* init test*/ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_proxy_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); headers = aos_table_make(p, 2); apr_table_set(headers, "Expect", ""); apr_table_set(headers, "Transfer-Encoding", ""); /* test put object */ s = oss_put_object_from_buffer(options, &bucket, &object, &buffer, headers, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); /* test get object */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_proxy_request_options(options, is_cname); s = oss_get_object_to_buffer(options, &bucket, &object, NULL, NULL, &buffer, NULL); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); printf("test_proxy_put_object_from_buffer ok\n"); } void test_proxy_list_object(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; oss_request_options_t *options = NULL; int is_cname = 0; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_list_object_params_t *params = NULL; oss_list_object_content_t *content = NULL; int size = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_proxy_request_options(options, is_cname); params = oss_create_list_object_params(p); params->max_ret = 1; params->truncated = 0; aos_str_set(¶ms->prefix, "oss_test_proxy_"); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_list_object(options, &bucket, params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); aos_list_for_each_entry(oss_list_object_content_t, content, ¶ms->object_list, node) { ++size; } CuAssertIntEquals(tc, 1 ,size); printf("test_proxy_list_object ok\n"); } void test_proxy_resumable_upload(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_proxy_resumable_upload.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_proxy_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // upload object clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); printf("test_proxy_resumable_upload ok\n"); } CuSuite *test_oss_proxy() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_proxy_setup); SUITE_ADD_TEST(suite, test_proxy_put_object_from_buffer); SUITE_ADD_TEST(suite, test_proxy_list_object); SUITE_ADD_TEST(suite, test_proxy_resumable_upload); SUITE_ADD_TEST(suite, test_proxy_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_resumable.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" #include "aos_crc64.h" static char test_file[1024]; void test_resumable_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "resumable"); /* create test bucket */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); sprintf(test_file, "%sBingWallpaper-2017-01-19.jpg", get_test_file_path()); } void test_resumable_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; oss_list_multipart_upload_params_t *params; oss_list_multipart_upload_content_t *content; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); /* delete test object */ delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_without_checkpoint.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_partsize.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_threads.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_with_checkpoint.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_with_checkpoint_format_invalid.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_with_file_size_unavailable.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_with_uploadid_unavailable.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_with_uploadid_available.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_callback_without_checkpoint.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_progress_without_checkpoint.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_callback_with_checkpoint.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_progress_with_checkpoint.jpg"); delete_test_object(options, TEST_BUCKET_NAME, "test_resumable_upload_content_type.ts"); /* abort multipart uploads */ params = oss_create_list_multipart_upload_params(p); aos_str_set(&bucket, TEST_BUCKET_NAME); s = oss_list_multipart_upload(options, &bucket, params, &resp_headers); if (aos_status_is_ok(s)) { aos_list_for_each_entry(oss_list_multipart_upload_content_t, content, ¶ms->upload_list, node) { oss_abort_multipart_upload(options, &bucket, &content->key, &content->upload_id, &resp_headers); } } /* delete test bucket */ aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } static int aos_curl_http_transport_perform_random_failure(aos_http_transport_t *t_) { aos_curl_http_transport_t *t = (aos_curl_http_transport_t *)(t_); int ret = aos_curl_http_transport_perform(t_); if (rand() % 4 == 0) { t->controller->error_code = AOSE_INTERNAL_ERROR; t->controller->reason = "Internal error for test"; ret = t->controller->error_code; } return ret; } static int aos_curl_http_transport_perform_bad_crc64(aos_http_transport_t *t_) { aos_curl_http_transport_t *t = (aos_curl_http_transport_t *)(t_); int ret = aos_curl_http_transport_perform(t_); t->resp->crc64 = rand(); return ret; } // ---------------------------- UT ---------------------------- void test_resumable_oss_get_thread_num(CuTest *tc) { aos_pool_t *p = NULL; oss_resumable_clt_params_t *clt_params; int32_t thread_num = 0; aos_pool_create(&p, NULL); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1024, AOS_FALSE, NULL); thread_num = oss_get_thread_num(clt_params); CuAssertIntEquals(tc, 1024, thread_num); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 0, AOS_FALSE, NULL); thread_num = oss_get_thread_num(clt_params); CuAssertIntEquals(tc, 1, thread_num); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, -1, AOS_FALSE, NULL); thread_num = oss_get_thread_num(clt_params); CuAssertIntEquals(tc, 1, thread_num); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1025, AOS_FALSE, NULL); thread_num = oss_get_thread_num(clt_params); CuAssertIntEquals(tc, 1, thread_num); aos_pool_destroy(p); printf("test_resumable_oss_get_thread_num ok\n"); } void test_resumable_oss_get_checkpoint_path(CuTest *tc) { aos_pool_t *p = NULL; oss_resumable_clt_params_t *clt_params; aos_string_t file_path = aos_null_string; aos_string_t checkpoint_path = aos_null_string; aos_pool_create(&p, NULL); aos_str_set(&file_path, test_file); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1024, AOS_FALSE, NULL); oss_get_upload_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertTrue(tc, checkpoint_path.data == NULL); CuAssertTrue(tc, checkpoint_path.len == 0); oss_get_download_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertTrue(tc, checkpoint_path.data == NULL); CuAssertTrue(tc, checkpoint_path.len == 0); aos_str_set(&checkpoint_path, "BingWallpaper-2017-01-19.jpg.checkpoint"); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1024, AOS_TRUE, checkpoint_path.data); oss_get_upload_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertStrEquals(tc, "BingWallpaper-2017-01-19.jpg.checkpoint", checkpoint_path.data); oss_get_download_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertStrEquals(tc, "BingWallpaper-2017-01-19.jpg.checkpoint", checkpoint_path.data); // win path aos_str_set(&file_path, "D:\\work\\oss\\BingWallpaper-2017-01-19.jpg"); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1024, AOS_TRUE, NULL); oss_get_upload_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertStrEquals(tc, "D:\\work\\oss\\BingWallpaper-2017-01-19.jpg.ucp", checkpoint_path.data); oss_get_download_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertStrEquals(tc, "D:\\work\\oss\\BingWallpaper-2017-01-19.jpg.dcp", checkpoint_path.data); aos_str_set(&checkpoint_path, ""); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1024, AOS_TRUE, NULL); oss_get_upload_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertStrEquals(tc, "D:\\work\\oss\\BingWallpaper-2017-01-19.jpg.ucp", checkpoint_path.data); aos_str_set(&checkpoint_path, ""); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1024, AOS_TRUE, NULL); oss_get_download_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertStrEquals(tc, "D:\\work\\oss\\BingWallpaper-2017-01-19.jpg.dcp", checkpoint_path.data); // linux path aos_str_set(&file_path, "/home/tim/work/oss/BingWallpaper-2017-01-19.jpg"); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1024, AOS_TRUE, NULL); oss_get_upload_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertStrEquals(tc, "/home/tim/work/oss/BingWallpaper-2017-01-19.jpg.ucp", checkpoint_path.data); oss_get_download_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertStrEquals(tc, "/home/tim/work/oss/BingWallpaper-2017-01-19.jpg.dcp", checkpoint_path.data); aos_str_set(&checkpoint_path, ""); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1024, AOS_TRUE, NULL); oss_get_upload_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertStrEquals(tc, "/home/tim/work/oss/BingWallpaper-2017-01-19.jpg.ucp", checkpoint_path.data); aos_str_set(&checkpoint_path, ""); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1024, AOS_TRUE, NULL); oss_get_download_checkpoint_path(clt_params, &file_path, p, &checkpoint_path); CuAssertStrEquals(tc, "/home/tim/work/oss/BingWallpaper-2017-01-19.jpg.dcp", checkpoint_path.data); aos_pool_destroy(p); printf("test_resumable_oss_get_checkpoint_path ok\n"); } void test_resumable_oss_get_file_info(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t file_path = aos_null_string; char *local_file = "test_resumable_oss_get_file_info.txt"; apr_finfo_t finfo; int rv; aos_pool_create(&p, NULL); // invalid path aos_str_set(&file_path, ""); rv = oss_get_file_info(&file_path, p, &finfo); CuAssertTrue(tc, APR_STATUS_IS_ENOENT(rv)); // file not exist aos_str_set(&file_path, "/uvwxyz/abchij/test.udp"); rv = oss_get_file_info(&file_path, p, &finfo); CuAssertTrue(tc, APR_STATUS_IS_ENOENT(rv)); // empty file rv = fill_test_file(p, local_file, ""); CuAssertIntEquals(tc, APR_SUCCESS, rv); aos_str_set(&file_path, local_file); rv = oss_get_file_info(&file_path, p, &finfo); CuAssertIntEquals(tc, AOSE_OK, rv); CuAssertTrue(tc, 0 == finfo.size); // normal rv = make_random_file(p, local_file, 1024); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = oss_get_file_info(&file_path, p, &finfo); CuAssertIntEquals(tc, AOSE_OK, rv); CuAssertTrue(tc, 1024 == finfo.size); apr_file_remove(local_file, p); aos_pool_destroy(p); printf("test_resumable_oss_get_file_info ok\n"); } void test_resumable_oss_does_file_exist(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t file_path = aos_null_string; char *local_file = "test_resumable_oss_does_file_exist.txt"; int rv; aos_pool_create(&p, NULL); // invalid path aos_str_set(&file_path, ""); rv = oss_does_file_exist(&file_path, p); CuAssertTrue(tc, !rv); // file not exist aos_str_set(&file_path, "/uvwxyz/abchij/test.udp"); rv = oss_does_file_exist(&file_path, p); CuAssertTrue(tc, !rv); // normal rv = make_random_file(p, local_file, 1024); CuAssertIntEquals(tc, APR_SUCCESS, rv); aos_str_set(&file_path, local_file); rv = oss_does_file_exist(&file_path, p); CuAssertTrue(tc, rv); apr_file_remove(local_file, p); aos_pool_destroy(p); printf("test_resumable_oss_does_file_exist ok\n"); } void test_resumable_oss_dump_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t file_path = aos_null_string; char *cp_file = "test_resumable_oss_dump_checkpoint.ucp"; oss_checkpoint_t *cp; apr_finfo_t finfo; aos_string_t upload_id; int64_t part_size; int rv; aos_pool_create(&p, NULL); // build checkpoint finfo.size = 510598; finfo.mtime = 1459922563; aos_str_set(&file_path, "D:\\work\\oss\\BingWallpaper-2017-01-19.jpg"); aos_str_set(&upload_id, "0004B9894A22E5B1888A1E29F8236E2D"); part_size = 1024 * 100; cp = oss_create_checkpoint_content(p); oss_build_upload_checkpoint(p, cp, &file_path, &finfo, &upload_id, part_size); aos_str_set(&file_path, cp_file); rv = oss_open_checkpoint_file(p, &file_path, cp); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = oss_dump_checkpoint(p, cp); CuAssertIntEquals(tc, AOSE_OK, rv); apr_file_close(cp->thefile); // write failed rv = apr_file_open(&cp->thefile, file_path.data, APR_READ, APR_UREAD | APR_GREAD, p); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = oss_dump_checkpoint(p, cp); CuAssertIntEquals(tc, AOSE_FILE_TRUNC_ERROR, rv); apr_file_close(cp->thefile); apr_file_remove(cp_file, p); aos_pool_destroy(p); printf("test_resumable_oss_dump_checkpoint ok\n"); } void test_resumable_oss_load_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t file_path = aos_null_string; char *cp_file = "test_resumable_oss_load_checkpoint.ucp"; oss_checkpoint_t *cp; oss_checkpoint_t *cp_l; apr_finfo_t finfo; aos_string_t upload_id; int64_t part_size; int rv; aos_pool_create(&p, NULL); // build checkpoint finfo.size = 510598; finfo.mtime = 1459922563; aos_str_set(&file_path, "D:\\work\\oss\\BingWallpaper-2017-01-19.jpg"); aos_str_set(&upload_id, "0004B9894A22E5B1888A1E29F8236E2D"); part_size = 1024 * 100; cp = oss_create_checkpoint_content(p); oss_build_upload_checkpoint(p, cp, &file_path, &finfo, &upload_id, part_size); aos_str_set(&file_path, cp_file); rv = oss_open_checkpoint_file(p, &file_path, cp); CuAssertIntEquals(tc, APR_SUCCESS, rv); // dump rv = oss_dump_checkpoint(p, cp); CuAssertIntEquals(tc, AOSE_OK, rv); apr_file_close(cp->thefile); // load cp_l = oss_create_checkpoint_content(p); rv = oss_load_checkpoint(p, &file_path, cp_l); CuAssertIntEquals(tc, AOSE_OK, rv); CuAssertStrEquals(tc, cp->md5.data, cp_l->md5.data); CuAssertIntEquals(tc, cp->cp_type, cp_l->cp_type); CuAssertStrEquals(tc, cp->upload_id.data, cp_l->upload_id.data); CuAssertIntEquals(tc, cp->part_num, cp_l->part_num); CuAssertTrue(tc, cp->part_size == cp_l->part_size); // load failed aos_str_set(&file_path, "/uvwxyz/abchij/test.udp"); rv = oss_load_checkpoint(p, &file_path, cp_l); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, rv); // content invalid rv = make_random_file(p, cp_file, 1024); CuAssertIntEquals(tc, APR_SUCCESS, rv); aos_str_set(&file_path, cp_file); rv = oss_load_checkpoint(p, &file_path, cp_l); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, rv); apr_file_remove(cp_file, p); aos_pool_destroy(p); printf("test_resumable_oss_load_checkpoint ok\n"); } void test_resumable_oss_is_upload_checkpoint_valid(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t file_path = aos_null_string; oss_checkpoint_t *cp; apr_finfo_t finfo; aos_string_t upload_id; int64_t part_size; int rv; aos_pool_create(&p, NULL); // build checkpoint finfo.size = 510598; finfo.mtime = 1459922563; aos_str_set(&file_path, "D:\\work\\oss\\BingWallpaper-2017-01-19.jpg"); aos_str_set(&upload_id, "0004B9894A22E5B1888A1E29F8236E2D"); part_size = 1024 * 100; cp = oss_create_checkpoint_content(p); oss_build_upload_checkpoint(p, cp, &file_path, &finfo, &upload_id, part_size); rv = oss_is_upload_checkpoint_valid(p, cp, &finfo); CuAssertTrue(tc, rv); finfo.size = 510599; rv = oss_is_upload_checkpoint_valid(p, cp, &finfo); CuAssertTrue(tc, !rv); finfo.mtime = 1459922562; rv = oss_is_upload_checkpoint_valid(p, cp, &finfo); CuAssertTrue(tc, !rv); aos_pool_destroy(p); printf("test_resumable_oss_is_upload_checkpoint_valid ok\n"); } void test_resumable_checkpoint_xml(CuTest *tc) { aos_pool_t *p = NULL; char *xml_doc = NULL; oss_checkpoint_t *cp; int64_t part_size = 0; int i = 0; oss_checkpoint_t *cp_actual; const char *xml_doc_expected = "" "1" "" "D:\\work\\oss\\BingWallpaper-2017-01-19.jpg510598" "1459922563fba9dede5f27731c9771645a39863328" "" "" "~/oss/BingWallpaper-2017-01-19.jpg510598" "Fri, 24 Feb 2012 06:07:48 GMT0F7230CAA4BE94CCBDC99C5500000000" "" "0004B9894A22E5B1888A1E29F8236E2D" "" "5102400" "" "0010240010" "110240010240010" "220480010240010" "330720010240010" "440960010099810" "" "" "\n"; aos_pool_create(&p, NULL); cp = oss_create_checkpoint_content(p); cp->cp_type = OSS_CP_UPLOAD; aos_str_set(&cp->file_path, "D:\\work\\oss\\BingWallpaper-2017-01-19.jpg"); cp->file_size = 510598; cp->file_last_modified = 1459922563; aos_str_set(&cp->file_md5,"fba9dede5f27731c9771645a39863328"); aos_str_set(&cp->object_name, "~/oss/BingWallpaper-2017-01-19.jpg"); cp->object_size = 510598; aos_str_set(&cp->object_last_modified, "Fri, 24 Feb 2012 06:07:48 GMT"); aos_str_set(&cp->object_etag, "0F7230CAA4BE94CCBDC99C5500000000"); aos_str_set(&cp->upload_id, "0004B9894A22E5B1888A1E29F8236E2D"); part_size = 1024 * 100; oss_get_part_size(cp->file_size, &part_size); cp->part_size = part_size; for (i = 0; i * part_size < cp->file_size; i++) { cp->parts[i].index = i; cp->parts[i].offset = i * part_size; cp->parts[i].size = aos_min(part_size, (cp->file_size - i * part_size)); cp->parts[i].completed = AOS_TRUE; aos_str_set(& cp->parts[i].etag, ""); } cp->part_num = i; xml_doc = oss_build_checkpoint_xml(p ,cp); CuAssertStrEquals(tc, xml_doc_expected, xml_doc); cp_actual = oss_create_checkpoint_content(p); oss_checkpoint_parse_from_body(p, xml_doc, cp_actual); CuAssertIntEquals(tc, OSS_CP_UPLOAD, cp_actual->cp_type); CuAssertStrEquals(tc, "", cp_actual->md5.data); CuAssertStrEquals(tc, "D:\\work\\oss\\BingWallpaper-2017-01-19.jpg", cp_actual->file_path.data); CuAssertTrue(tc, 510598 == cp_actual->file_size); CuAssertTrue(tc, 1459922563 == cp_actual->file_last_modified); CuAssertStrEquals(tc, "fba9dede5f27731c9771645a39863328", cp_actual->file_md5.data); CuAssertStrEquals(tc, "~/oss/BingWallpaper-2017-01-19.jpg", cp_actual->object_name.data); CuAssertTrue(tc, 510598 == cp_actual->file_size); CuAssertStrEquals(tc, "Fri, 24 Feb 2012 06:07:48 GMT", cp_actual->object_last_modified.data); CuAssertStrEquals(tc, "0F7230CAA4BE94CCBDC99C5500000000", cp_actual->object_etag.data); CuAssertStrEquals(tc, "0004B9894A22E5B1888A1E29F8236E2D", cp_actual->upload_id.data); CuAssertIntEquals(tc, 5, cp_actual->part_num); CuAssertTrue(tc, 102400 == cp_actual->part_size); CuAssertIntEquals(tc, 4, cp_actual->parts[4].index); CuAssertTrue(tc, 409600 == cp_actual->parts[4].offset); CuAssertTrue(tc, 100998 == cp_actual->parts[4].size); CuAssertIntEquals(tc, 1, cp_actual->parts[4].completed); aos_pool_destroy(p); printf("test_resumable_checkpoint_xml ok\n"); } // ---------------------------- FT ---------------------------- void test_resumable_upload_without_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_without_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // upload object clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); printf("test_resumable_upload_without_checkpoint ok\n"); } void test_resumable_upload_partsize(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_partsize.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // upload object with part size 10MB clt_params = oss_create_resumable_clt_params_content(p, 1024 * 1024 * 10, 3, AOS_FALSE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); // upload object with part size 200K aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 200, 3, AOS_FALSE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); printf("test_resumable_upload_partsize ok\n"); } void test_resumable_upload_threads(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_threads.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // upload object with thread 1 clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1, AOS_FALSE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); // upload object with thread 5 aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 200, 5, AOS_FALSE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); // upload object with thread 10 aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 10, AOS_FALSE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); printf("test_resumable_upload_threads ok\n"); } void test_resumable_upload_with_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // upload object clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); printf("test_resumable_upload_with_checkpoint ok\n"); } void test_resumable_upload_with_checkpoint_format_invalid(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint_format_invalid.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_string_t checkpoint_path; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // generate checkpoint clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); oss_get_upload_checkpoint_path(clt_params, &filename, p, &checkpoint_path); fill_test_file(p, checkpoint_path.data, "HiOSS"); // upload object s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); printf("test_resumable_upload_with_checkpoint_format_invalid ok\n"); } void test_resumable_upload_with_checkpoint_path_invalid(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; char *cp_path = "/uvwxyz/abchij/test.udp"; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // upload clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, cp_path); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertStrEquals(tc, "OpenFileFail", s->error_code); aos_pool_destroy(p); printf("test_resumable_upload_with_checkpoint_path_invalid ok\n"); } void test_resumable_upload_with_file_size_unavailable(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_file_size_unavailable.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_string_t checkpoint_path; char *xml_doc = "" "" "1" "" "/home/baiyb/work/tmp/aliyun-oss-c-sdk-doing/BingWallpaper-2017-01-19.jpg" "01484790044000000" "" "" "0" "" "750FBF7EB9104D4F8DDB74F0432A821F" "" "8102400" "" "001024001"06336E9660D3D9610C79835D27F4D2EF"" "11024001024001"D1C009C43EAA5E64B6B794E47BA37917"" "22048001024001"073D2D906CEB0FADA1F2BA8A0BA54C1D"" "33072001024001"7BA3B455E7B30D734F2CA29548E8BC56"" "44096001024001"296F06C36E3746CD2A28824D3B4F0648"" "55120001024001"06A0A19EC60DD4F51344D900BE543C53"" "66144001024001"B7CE941E6AC00B6B3423572A87EA0B67"" "7716800528861"AE5EEAEBB54232A6F71743AA45A32DA9"" "" "" ""; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // generate checkpoint clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); oss_get_upload_checkpoint_path(clt_params, &filename, p, &checkpoint_path); fill_test_file(p, checkpoint_path.data, xml_doc); // upload object s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); printf("test_resumable_upload_with_file_size_unavailable ok\n"); } void test_resumable_upload_with_uploadid_unavailable(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_uploadid_unavailable.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; apr_finfo_t finfo; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; char *cp_path = "test.ucp"; char *xml_doc = "" "1" "oss_c_sdk_test/BingWallpaper-2017-01-19.jpg" "769686%" APR_INT64_T_FMT "" "0" "F5F901B64DF34BEDA60C9B2B0984B" "11048576" "007696860" ""; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // generate checkpoint oss_get_file_info(&filename, p, &finfo); xml_doc = apr_psprintf(p, xml_doc, finfo.mtime); fill_test_file(p, cp_path, xml_doc); // upload object clt_params = oss_create_resumable_clt_params_content(p, 1024 * 1024, 1, AOS_TRUE, cp_path); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 404, s->code); //CuAssertStrEquals(tc, "NoSuchUpload", s->error_code); apr_file_remove(cp_path, p); aos_pool_destroy(p); printf("test_resumable_upload_with_uploadid_unavailable ok\n"); } void test_resumable_upload_with_uploadid_available(CuTest *tc) { aos_pool_t *p = NULL; aos_pool_t *pool = NULL; char *object_name = "test_resumable_upload_with_uploadid_available.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_string_t checkpoint_path; aos_string_t upload_id; char *xml_doc = "" "" "1" "" "/home/baiyb/work/tmp/aliyun-oss-c-sdk-doing/BingWallpaper-2017-01-19.jpg" "7696861484790044000000" "" "" "0" "" "%.*s" "" "8102400" "" "001024000" "11024001024000" "22048001024000" "33072001024000" "44096001024000" "55120001024000" "66144001024000" "7716800528860" "" "" ""; aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // generate upload id aos_pool_create(&p, NULL); aos_pool_create(&pool, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_init_multipart_upload(options, &bucket, &object, &upload_id, headers, &resp_headers); CuAssertIntEquals(tc, 200, s->code); xml_doc = apr_psprintf(pool, xml_doc, upload_id.len, upload_id.data); aos_pool_destroy(p); // generate checkpoint aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); oss_get_upload_checkpoint_path(clt_params, &filename, p, &checkpoint_path); fill_test_file(p, checkpoint_path.data, xml_doc); // upload object s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); aos_pool_destroy(pool); printf("test_resumable_upload_with_uploadid_available ok\n"); } void test_resumable_upload_with_file_path_invalid(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_file_path_invalid.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, "/uvwxyz/abchij/test.jpg"); // upload clt_params = oss_create_resumable_clt_params_content(p, 1024 * 1024, 1, AOS_TRUE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertStrEquals(tc, "OpenFileFail", s->error_code); aos_pool_destroy(p); printf("test_resumable_upload_with_file_path_invalid ok\n"); } void test_resumable_upload_callback_without_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_callback_without_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_buf_t *content; char b64_buf[1024]; int b64_len = 64; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; char callback[1024]; char *callback_fmt = "{" "\"callbackUrl\":\"%s\"," "\"callbackHost\":\"oss-cn-hangzhou.aliyuncs.com\"," "\"callbackBody\":\"bucket=${bucket}&object=${object}&size=${size}&mimeType=${mimeType}\"," "\"callbackBodyType\":\"application/x-www-form-urlencoded\"" "}"; char *callback_var = "{" "\"x:var1\":\"value1\"," "\"x:var2\":\"value2\"" "}"; sprintf(callback, callback_fmt, TEST_CALLBACK_URL); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); headers = aos_table_make(p, 2); b64_len = aos_base64_encode((unsigned char*)callback, strlen(callback), b64_buf); b64_buf[b64_len] = '\0'; apr_table_set(headers, OSS_CALLBACK, apr_pstrdup(p, b64_buf)); b64_len = aos_base64_encode((unsigned char*)callback_var, strlen(callback_var), b64_buf); b64_buf[b64_len] = '\0'; apr_table_set(headers, OSS_CALLBACK_VAR, apr_pstrdup(p, b64_buf)); // upload object clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); /* get buffer len */ len = aos_buf_list_len(&resp_body); buf = (char *)aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; /* copy buffer content to memory */ aos_list_for_each_entry(aos_buf_t, content, &resp_body, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } CuAssertStrEquals(tc, buf, "{\"Status\":\"OK\"}"); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); printf("test_resumable_upload_callback_without_checkpoint ok\n"); } void test_resumable_upload_progress_without_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_progress_without_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // upload object clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, percentage, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); printf("test_resumable_upload_progress_without_checkpoint ok\n"); } void test_resumable_upload_callback_with_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_callback_with_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_buf_t *content; char b64_buf[1024]; int b64_len = 64; char *buf = NULL; int64_t len = 0; int64_t size = 0; int64_t pos = 0; char callback[1024]; char *callback_fmt = "{" "\"callbackUrl\":\"%s\"," "\"callbackHost\":\"oss-cn-hangzhou.aliyuncs.com\"," "\"callbackBody\":\"bucket=${bucket}&object=${object}&size=${size}&mimeType=${mimeType}\"," "\"callbackBodyType\":\"application/x-www-form-urlencoded\"" "}"; char *callback_var = "{" "\"x:var1\":\"value1\"," "\"x:var2\":\"value2\"" "}"; sprintf(callback, callback_fmt, TEST_CALLBACK_URL); aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); headers = aos_table_make(p, 2); b64_len = aos_base64_encode((unsigned char*)callback, strlen(callback), b64_buf); b64_buf[b64_len] = '\0'; apr_table_set(headers, OSS_CALLBACK, apr_pstrdup(p, b64_buf)); b64_len = aos_base64_encode((unsigned char*)callback_var, strlen(callback_var), b64_buf); b64_buf[b64_len] = '\0'; apr_table_set(headers, OSS_CALLBACK_VAR, apr_pstrdup(p, b64_buf)); // upload object clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); /* get buffer len */ len = aos_buf_list_len(&resp_body); buf = (char *)aos_pcalloc(p, (apr_size_t)(len + 1)); buf[len] = '\0'; /* copy buffer content to memory */ aos_list_for_each_entry(aos_buf_t, content, &resp_body, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, (size_t)size); pos += size; } CuAssertStrEquals(tc, buf, "{\"Status\":\"OK\"}"); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); printf("test_resumable_upload_callback_with_checkpoint ok\n"); } void test_resumable_upload_progress_with_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_progress_with_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // upload object clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, percentage, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); aos_pool_destroy(p); printf("test_resumable_upload_progress_with_checkpoint ok\n"); } void test_resumable_upload_content_type(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_content_type.ts"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int64_t content_length = 0; char *content_type = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); // upload object clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_upload_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 200, s->code); aos_pool_destroy(p); // head object aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); content_type = (char*)(apr_table_get(resp_headers, OSS_CONTENT_TYPE)); CuAssertStrEquals(tc, "video/MP2T", content_type); aos_pool_destroy(p); printf("test_resumable_upload_content_type ok\n"); } void test_resumable_download_without_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_without_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); // download clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_without_checkpoint ok\n"); } void test_resumable_download_with_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); // download clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_with_checkpoint ok\n"); } void test_resumable_download_without_checkpoint_target_invalid(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_without_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, "a/b/c/d/e/f/g/h/i/j/k/l/m/n/~!@#$%^&*()"); // download clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s->code); aos_pool_destroy(p); printf("test_resumable_download_without_checkpoint_target_invalid ok\n"); } void test_resumable_download_with_checkpoint_target_invalid(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, "a/b/c/d/e/f/g/h/i/j/k/l/m/n/~!@#$%^&*()"); // download clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertStrEquals(tc, AOS_OPEN_FILE_ERROR_CODE, s->error_code); aos_pool_destroy(p); printf("test_resumable_download_with_checkpoint_target_invalid ok\n"); } void test_resumable_download_partsize(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_partsize.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); // download clt_params = oss_create_resumable_clt_params_content(p, 1024 * 1024 * 10, 3, AOS_FALSE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_partsize ok\n"); } void test_resumable_download_small_partsize(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_partsize.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); // download clt_params = oss_create_resumable_clt_params_content(p, 64, 16, AOS_FALSE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_small_partsize ok\n"); } void test_resumable_download_threads(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_threads.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); // download with thread 1 clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 1, AOS_FALSE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_threads ok\n"); } void test_resumable_download_with_checkpoint_format_invalid(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint_format_invalid.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_string_t tmp_filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; aos_string_t checkpoint_path; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); // generate checkpoint clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); oss_get_download_checkpoint_path(clt_params, &filename, p, &checkpoint_path); fill_test_file(p, checkpoint_path.data, "HiOSS"); oss_get_temporary_file_name(p, &filename, &tmp_filename); make_random_file(p, tmp_filename.data, content_length); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(tmp_filename.data); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_with_checkpoint_format_invalid ok\n"); } void test_resumable_download_with_checkpoint_info_invalid(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint_format_invalid.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_string_t tmp_filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; aos_string_t checkpoint_path; const char *object_last_modified = NULL; const char *object_etag = NULL; oss_checkpoint_t *checkpoint = NULL; int rv; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); object_last_modified = apr_table_get(resp_headers, "Last-Modified"); object_etag = apr_table_get(resp_headers, "ETag"); // generate checkpoint clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); oss_get_download_checkpoint_path(clt_params, &filename, p, &checkpoint_path); checkpoint = oss_create_checkpoint_content(p); oss_build_download_checkpoint(p, checkpoint, &filename, object.data, content_length, object_last_modified, object_etag, 1024 * 99); rv = oss_open_checkpoint_file(p, &checkpoint_path, checkpoint); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = oss_dump_checkpoint(p, checkpoint); CuAssertIntEquals(tc, AOSE_OK, rv); apr_file_close(checkpoint->thefile); oss_get_temporary_file_name(p, &filename, &tmp_filename); make_random_file(p, tmp_filename.data, content_length); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(tmp_filename.data); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_with_checkpoint_info_invalid ok\n"); } void test_resumable_download_with_checkpoint_info_valid(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint_format_invalid.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_string_t tmp_filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; const char *object_last_modified = NULL; const char *object_etag = NULL; aos_string_t checkpoint_path; oss_checkpoint_t *checkpoint = NULL; int rv; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); object_last_modified = apr_table_get(resp_headers, "Last-Modified"); object_etag = apr_table_get(resp_headers, "ETag"); // generate checkpoint clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); oss_get_download_checkpoint_path(clt_params, &filename, p, &checkpoint_path); checkpoint = oss_create_checkpoint_content(p); oss_build_download_checkpoint(p, checkpoint, &filename, object.data, content_length, object_last_modified, object_etag, 1024 * 100); rv = oss_open_checkpoint_file(p, &checkpoint_path, checkpoint); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = oss_dump_checkpoint(p, checkpoint); CuAssertIntEquals(tc, AOSE_OK, rv); apr_file_close(checkpoint->thefile); oss_get_temporary_file_name(p, &filename, &tmp_filename); make_random_file(p, tmp_filename.data, content_length); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(tmp_filename.data); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_with_checkpoint_info_valid ok\n"); } void test_resumable_download_with_checkpoint_path_invalid(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint_format_invalid.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; char *cp_path = "/uvwxyz/abchij/test.udp"; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); // generate checkpoint clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, cp_path); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertStrEquals(tc, "OpenFileFail", s->error_code); aos_pool_destroy(p); printf("test_resumable_download_with_checkpoint_path_invalid ok\n"); } void test_resumable_download_with_tmpfile_not_found(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; aos_string_t checkpoint_path; const char *object_last_modified; const char *object_etag; oss_checkpoint_t *checkpoint = NULL; int rv; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); object_last_modified = apr_table_get(resp_headers, "Last-Modified"); object_etag = apr_table_get(resp_headers, "ETag"); // generate checkpoint clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); oss_get_download_checkpoint_path(clt_params, &filename, p, &checkpoint_path); checkpoint = oss_create_checkpoint_content(p); oss_build_download_checkpoint(p, checkpoint, &filename, object.data, content_length, object_last_modified, object_etag, 1024 * 100); rv = oss_open_checkpoint_file(p, &checkpoint_path, checkpoint); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = oss_dump_checkpoint(p, checkpoint); CuAssertIntEquals(tc, AOSE_OK, rv); apr_file_close(checkpoint->thefile); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_with_tmpfile_not_found ok\n"); } void test_resumable_download_with_tmpfile_invalid(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_string_t tmp_filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; aos_string_t checkpoint_path; const char *object_last_modified; const char *object_etag; oss_checkpoint_t *checkpoint = NULL; int rv; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); object_last_modified = apr_table_get(resp_headers, "Last-Modified"); object_etag = apr_table_get(resp_headers, "ETag"); // generate checkpoint clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); oss_get_download_checkpoint_path(clt_params, &filename, p, &checkpoint_path); checkpoint = oss_create_checkpoint_content(p); oss_build_download_checkpoint(p, checkpoint, &filename, object.data, content_length, object_last_modified, object_etag, 1024 * 100); rv = oss_open_checkpoint_file(p, &checkpoint_path, checkpoint); CuAssertIntEquals(tc, APR_SUCCESS, rv); rv = oss_dump_checkpoint(p, checkpoint); CuAssertIntEquals(tc, AOSE_OK, rv); apr_file_close(checkpoint->thefile); //length mismatch oss_get_temporary_file_name(p, &filename, &tmp_filename); make_random_file(p, tmp_filename.data, content_length + 1); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(tmp_filename.data); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_with_tmpfile_invalid ok\n"); } void test_resumable_download_without_checkpoint_object_not_found(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "/a/b/c/d/e/f/g/h/i/j/k/j/m/n.fake"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); // download clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("test_resumable_download_without_checkpoint_object_not_found ok\n"); } void test_resumable_download_with_checkpoint_object_not_found(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "/a/b/c/d/e/f/g/h/i/j/k/j/m/n.fake"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); // download clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("test_resumable_download_with_checkpoint_object_not_found ok\n"); } void test_resumable_download_progress_without_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_progress_without_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); // download clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, percentage, &resp_headers); CuAssertIntEquals(tc, 200, s->code); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_progress_without_checkpoint ok\n"); } void test_resumable_download_progress_with_checkpoint(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_progress_with_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; unsigned long content_length; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); // download clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, percentage, &resp_headers); CuAssertIntEquals(tc, 200, s->code); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(filename.data)); remove(filename.data); aos_pool_destroy(p); printf("test_resumable_download_progress_with_checkpoint ok\n"); } void test_resumable_download_without_checkpoint_random_failure(CuTest *tc) { int i; aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_without_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int failed_count = 0; // mock aos_http_transport_perform_pt old = aos_http_transport_perform; aos_http_transport_perform = aos_curl_http_transport_perform_random_failure; // download for (i = 0; i < 20; i++) { aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); if (!aos_status_is_ok(s)) { CuAssertStrEquals(tc, "Internal error for test", s->error_msg); failed_count++; } aos_pool_destroy(p); } CuAssertTrue(tc, failed_count > 0); // restore mock aos_http_transport_perform = old; // continue finish downloading aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); options->ctl->options->enable_crc = 1; headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_FALSE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); aos_pool_destroy(p); CuAssertIntEquals(tc, 200, s->code); remove(filename.data); printf("test_resumable_download_without_checkpoint_random_failure ok\n"); } void test_resumable_download_with_checkpoint_random_failure(CuTest *tc) { int i; aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; int failed_count = 0; // mock aos_http_transport_perform_pt old = aos_http_transport_perform; aos_http_transport_perform = aos_curl_http_transport_perform_random_failure; // download for (i = 0; i < 20; i++) { aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); if (!aos_status_is_ok(s)) { CuAssertStrEquals(tc, "Internal error for test", s->error_msg); failed_count++; } aos_pool_destroy(p); } CuAssertTrue(tc, failed_count > 0); // restore mock aos_http_transport_perform = old; // continue finish downloading aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); options->ctl->options->enable_crc = 1; headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); aos_pool_destroy(p); CuAssertIntEquals(tc, 200, s->code); remove(filename.data); printf("test_resumable_download_with_checkpoint_random_failure ok\n"); } void test_resumable_download_with_checkpoint_crc64_mismatch(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_resumable_upload_with_checkpoint.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; oss_request_options_t *options = NULL; oss_resumable_clt_params_t *clt_params; // mock aos_http_transport_perform_pt old = aos_http_transport_perform; aos_http_transport_perform = aos_curl_http_transport_perform_bad_crc64; // download aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); options->ctl->options->enable_crc = 1; headers = aos_table_make(p, 0); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_str_set(&filename, object_name); clt_params = oss_create_resumable_clt_params_content(p, 1024 * 100, 3, AOS_TRUE, NULL); s = oss_resumable_download_file(options, &bucket, &object, &filename, headers, NULL, clt_params, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_CRC_INCONSISTENT_ERROR, s->code); aos_pool_destroy(p); // restore mock aos_http_transport_perform = old; remove(filename.data); printf("test_resumable_download_with_checkpoint_crc64_mismatch ok\n"); } static void test_oss_get_thread_num_negative(CuTest *tc) { int ret; ret = oss_get_thread_num(NULL); CuAssertIntEquals(tc, 1, ret); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_upload_checkpoint_path_negative(CuTest *tc) { aos_string_t checkpoint_path; oss_get_upload_checkpoint_path(NULL, NULL, NULL, NULL); oss_get_upload_checkpoint_path(NULL, NULL, NULL, &checkpoint_path); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_download_checkpoint_path_negative(CuTest *tc) { aos_string_t checkpoint_path; oss_get_download_checkpoint_path(NULL, NULL, NULL, NULL); oss_get_download_checkpoint_path(NULL, NULL, NULL, &checkpoint_path); printf("%s ok\n", __FUNCTION__); } static void test_oss_is_upload_checkpoint_valid_negative(CuTest *tc) { oss_checkpoint_t checkpoint; apr_finfo_t finfo; int ret; finfo.mtime = 1000; finfo.size = 100; checkpoint.cp_type = OSS_CP_UPLOAD; checkpoint.file_size = 100; checkpoint.file_last_modified = 1000; ret = oss_is_upload_checkpoint_valid(NULL, &checkpoint, &finfo); CuAssertIntEquals(tc, 1, ret); checkpoint.cp_type = OSS_CP_DOWNLOAD; ret = oss_is_upload_checkpoint_valid(NULL, &checkpoint, &finfo); CuAssertIntEquals(tc, 0, ret); checkpoint.cp_type = OSS_CP_UPLOAD; checkpoint.file_size = 101; ret = oss_is_upload_checkpoint_valid(NULL, &checkpoint, &finfo); CuAssertIntEquals(tc, 0, ret); checkpoint.cp_type = OSS_CP_UPLOAD; checkpoint.file_size = 100; checkpoint.file_last_modified = 1001; ret = oss_is_upload_checkpoint_valid(NULL, &checkpoint, &finfo); CuAssertIntEquals(tc, 0, ret); printf("%s ok\n", __FUNCTION__); } static void test_oss_is_download_checkpoint_valid_negative(CuTest *tc) { oss_checkpoint_t checkpoint; int64_t object_size = 100; const char *object_last_modified = "last modified"; const char *object_etag = "etag"; int ret; checkpoint.cp_type = OSS_CP_DOWNLOAD; checkpoint.object_size = object_size; aos_str_set(&checkpoint.object_last_modified, object_last_modified); aos_str_set(&checkpoint.object_etag, object_etag); ret = oss_is_download_checkpoint_valid(NULL, &checkpoint, NULL, object_size, object_last_modified, object_etag); CuAssertIntEquals(tc, 1, ret); checkpoint.cp_type = OSS_CP_UPLOAD; checkpoint.object_size = object_size; aos_str_set(&checkpoint.object_last_modified, object_last_modified); aos_str_set(&checkpoint.object_etag, object_etag); ret = oss_is_download_checkpoint_valid(NULL, &checkpoint, NULL, object_size, object_last_modified, object_etag); CuAssertIntEquals(tc, 0, ret); checkpoint.cp_type = OSS_CP_DOWNLOAD; checkpoint.object_size = object_size + 1; aos_str_set(&checkpoint.object_last_modified, object_last_modified); aos_str_set(&checkpoint.object_etag, object_etag); ret = oss_is_download_checkpoint_valid(NULL, &checkpoint, NULL, object_size, object_last_modified, object_etag); CuAssertIntEquals(tc, 0, ret); checkpoint.cp_type = OSS_CP_DOWNLOAD; checkpoint.object_size = object_size; aos_str_set(&checkpoint.object_last_modified, ""); aos_str_set(&checkpoint.object_etag, object_etag); ret = oss_is_download_checkpoint_valid(NULL, &checkpoint, NULL, object_size, object_last_modified, object_etag); CuAssertIntEquals(tc, 0, ret); checkpoint.cp_type = OSS_CP_DOWNLOAD; checkpoint.object_size = object_size; aos_str_set(&checkpoint.object_last_modified, object_last_modified); aos_str_set(&checkpoint.object_etag, ""); ret = oss_is_download_checkpoint_valid(NULL, &checkpoint, NULL, object_size, object_last_modified, object_etag); CuAssertIntEquals(tc, 0, ret); printf("%s ok\n", __FUNCTION__); } static void test_oss_dump_checkpoint_negative(CuTest *tc) { int ret; ret = oss_dump_checkpoint(NULL, NULL); CuAssertIntEquals(tc, AOSE_OUT_MEMORY, ret); printf("%s ok\n", __FUNCTION__); } static void test_oss_resumable_upload_file_without_cp_negative(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_oss_resumable_upload_file_without_cp_negative.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; int64_t part_size = 100 * 1024; apr_finfo_t finfo; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, "c-sdk-no-exist"); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); finfo.size = 1000 * 1024; // upload object s = oss_resumable_upload_file_without_cp(options, &bucket, &object, &filename, headers, NULL, 1, part_size, &finfo, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_resumable_upload_file_with_cp_negative(CuTest *tc) { aos_pool_t *p = NULL; char *object_name = "test_oss_resumable_upload_file_without_cp_negative.jpg"; aos_string_t bucket; aos_string_t object; aos_string_t filename; aos_status_t *s = NULL; int is_cname = 0; aos_table_t *headers = NULL; aos_table_t *resp_headers = NULL; aos_list_t resp_body; oss_request_options_t *options = NULL; int64_t part_size = 100 * 1024; apr_finfo_t finfo; aos_string_t checkpoint_path; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); headers = aos_table_make(p, 0); aos_str_set(&bucket, "c-sdk-no-exist"); aos_str_set(&object, object_name); aos_list_init(&resp_body); aos_str_set(&filename, test_file); finfo.size = 1000 * 1024; aos_str_set(&checkpoint_path, ""); // upload object s = oss_resumable_upload_file_with_cp(options, &bucket, &object, &filename, headers, NULL, 1, part_size, &checkpoint_path, &finfo, NULL, &resp_headers, &resp_body); CuAssertIntEquals(tc, 404, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_resumable_invalid_parameter(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; int i; char *invalid_name_list[] = { "a", "1", "!", "aa", "12", "a1", "a!", "1!", "aAa", "1A1", "a!a", "FengChao@123", "-a123", "a_123", "a123-", "1234567890123456789012345678901234567890123456789012345678901234", "" }; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); for (i = 0; i < sizeof(invalid_name_list) / sizeof(invalid_name_list[0]); i++) { aos_string_t bucket; aos_status_t *s = NULL; aos_table_t *resp_headers = NULL; aos_table_t *headers = NULL; aos_table_t *params = NULL; aos_str_set(&bucket, invalid_name_list[i]); headers = aos_table_make(p, 1); s = oss_resumable_upload_file(options, &bucket, NULL, NULL, headers, params, NULL, NULL, &resp_headers, NULL); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_resumable_download_file(options, &bucket, NULL, NULL, headers, params, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); } aos_pool_destroy(p); printf("test_multipart_invalid_parameter ok\n"); } CuSuite *test_oss_resumable() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_resumable_setup); SUITE_ADD_TEST(suite, test_resumable_oss_get_thread_num); SUITE_ADD_TEST(suite, test_resumable_oss_get_checkpoint_path); SUITE_ADD_TEST(suite, test_resumable_oss_get_file_info); SUITE_ADD_TEST(suite, test_resumable_oss_does_file_exist); SUITE_ADD_TEST(suite, test_resumable_oss_dump_checkpoint); SUITE_ADD_TEST(suite, test_resumable_oss_load_checkpoint); SUITE_ADD_TEST(suite, test_resumable_oss_is_upload_checkpoint_valid); SUITE_ADD_TEST(suite, test_resumable_checkpoint_xml); SUITE_ADD_TEST(suite, test_resumable_upload_without_checkpoint); SUITE_ADD_TEST(suite, test_resumable_upload_with_checkpoint); SUITE_ADD_TEST(suite, test_resumable_upload_partsize); SUITE_ADD_TEST(suite, test_resumable_upload_threads); SUITE_ADD_TEST(suite, test_resumable_upload_with_checkpoint_format_invalid); SUITE_ADD_TEST(suite, test_resumable_upload_with_checkpoint_path_invalid); SUITE_ADD_TEST(suite, test_resumable_upload_with_file_size_unavailable); SUITE_ADD_TEST(suite, test_resumable_upload_with_uploadid_unavailable); SUITE_ADD_TEST(suite, test_resumable_upload_with_uploadid_available); SUITE_ADD_TEST(suite, test_resumable_upload_with_file_path_invalid); SUITE_ADD_TEST(suite, test_resumable_upload_callback_without_checkpoint); SUITE_ADD_TEST(suite, test_resumable_upload_progress_without_checkpoint); SUITE_ADD_TEST(suite, test_resumable_upload_callback_with_checkpoint); SUITE_ADD_TEST(suite, test_resumable_upload_progress_with_checkpoint); SUITE_ADD_TEST(suite, test_resumable_upload_content_type); SUITE_ADD_TEST(suite, test_resumable_download_without_checkpoint); SUITE_ADD_TEST(suite, test_resumable_download_with_checkpoint); SUITE_ADD_TEST(suite, test_resumable_download_without_checkpoint_target_invalid); SUITE_ADD_TEST(suite, test_resumable_download_with_checkpoint_target_invalid); SUITE_ADD_TEST(suite, test_resumable_download_partsize); SUITE_ADD_TEST(suite, test_resumable_download_small_partsize); SUITE_ADD_TEST(suite, test_resumable_download_threads); SUITE_ADD_TEST(suite, test_resumable_download_with_checkpoint_format_invalid); SUITE_ADD_TEST(suite, test_resumable_download_with_checkpoint_info_invalid); SUITE_ADD_TEST(suite, test_resumable_download_with_checkpoint_info_valid); SUITE_ADD_TEST(suite, test_resumable_download_with_checkpoint_path_invalid); SUITE_ADD_TEST(suite, test_resumable_download_with_tmpfile_invalid); SUITE_ADD_TEST(suite, test_resumable_download_with_tmpfile_not_found); SUITE_ADD_TEST(suite, test_resumable_download_without_checkpoint_object_not_found); SUITE_ADD_TEST(suite, test_resumable_download_with_checkpoint_object_not_found); SUITE_ADD_TEST(suite, test_resumable_download_progress_without_checkpoint); SUITE_ADD_TEST(suite, test_resumable_download_progress_with_checkpoint); SUITE_ADD_TEST(suite, test_resumable_download_without_checkpoint_random_failure); SUITE_ADD_TEST(suite, test_resumable_download_with_checkpoint_random_failure); SUITE_ADD_TEST(suite, test_resumable_download_with_checkpoint_crc64_mismatch); SUITE_ADD_TEST(suite, test_oss_get_thread_num_negative); SUITE_ADD_TEST(suite, test_oss_get_upload_checkpoint_path_negative); SUITE_ADD_TEST(suite, test_oss_get_download_checkpoint_path_negative); SUITE_ADD_TEST(suite, test_oss_is_upload_checkpoint_valid_negative); SUITE_ADD_TEST(suite, test_oss_is_download_checkpoint_valid_negative); SUITE_ADD_TEST(suite, test_oss_dump_checkpoint_negative); SUITE_ADD_TEST(suite, test_oss_resumable_upload_file_without_cp_negative); SUITE_ADD_TEST(suite, test_oss_resumable_upload_file_with_cp_negative); SUITE_ADD_TEST(suite, test_resumable_invalid_parameter); SUITE_ADD_TEST(suite, test_resumable_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_select_object.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" #include "aos_crc64.h" static char test_file[1024]; static char test_file_gz[1024]; static void test_select_object_setup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_status_t *s = NULL; oss_request_options_t *options = NULL; oss_acl_e oss_acl = OSS_ACL_PRIVATE; TEST_BUCKET_NAME = get_test_bucket_name(aos_global_pool, "selectobject"); /* create test bucket */ aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); s = create_test_bucket(options, TEST_BUCKET_NAME, oss_acl); CuAssertIntEquals(tc, 200, s->code); sprintf(test_file, "%ssample_data.csv", get_test_file_path()); sprintf(test_file_gz, "%ssample_data.csv.gz", get_test_file_path()); create_test_object_from_file(options, TEST_BUCKET_NAME, "sampleusers.csv", test_file, NULL); aos_pool_destroy(p); } static void test_select_object_cleanup(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; aos_string_t bucket; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); delete_test_object_by_prefix(options, TEST_BUCKET_NAME, ""); /* delete test bucket */ aos_str_set(&bucket, TEST_BUCKET_NAME); oss_delete_bucket(options, &bucket, &resp_headers); apr_sleep(apr_time_from_sec(3)); aos_pool_destroy(p); } void test_select_object_csv_data(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "oss_test_select_objec_sample_data.csv"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; char *select_data = NULL; oss_select_object_meta_params_t *meta_params; long content_length = 0; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; char Year[128]; char StateAbbr[128]; char CityName[128]; char PopulationCount[128]; char line_buff[1024]; char *ptr = NULL; int32_t col = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&buffer); create_test_object_from_file(options, TEST_BUCKET_NAME, object_name, test_file, NULL); resp_headers = NULL; meta_params = oss_create_select_object_meta_params(options->pool); s = oss_create_select_object_meta(options, &bucket, &object, meta_params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file)); sql = "select Year, StateAbbr, CityName, PopulationCount from ossobject where CityName != '' limit 20"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.file_header_info, "USE"); select_params->output_param.enable_payload_crc = AOS_TRUE; s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); ptr = select_data; while ((ptr[0] != '\0') && sscanf(ptr, "%s\n", line_buff)) { memset(Year, 0, sizeof(Year)); memset(StateAbbr, 0, sizeof(Year)); memset(CityName, 0, sizeof(Year)); memset(PopulationCount, 0, sizeof(Year)); sscanf(line_buff, "%[^,],%[^,],%[^,],%[^,]", Year, StateAbbr, CityName, PopulationCount); ptr += strlen(line_buff) + 1; CuAssertTrue(tc, strlen(CityName) > 0); col++; } CuAssertTrue(tc, col == 20); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_output_header(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_with_output_header.csv"; char *object_data = "name,job\nabc,def\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select name from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.file_header_info, "USE"); select_params->output_param.output_header = AOS_TRUE; aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "name\nabc\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_without_output_header(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_without_output_header.csv"; char *object_data = "name,job\nabc,def\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select name from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.file_header_info, "USE"); aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "abc\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_keep_columns(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_with_keep_columns.csv"; char *object_data = "abc,def,ghi,jkl\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _1, _4 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); select_params->output_param.keep_all_columns = AOS_TRUE; aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "abc,,,jkl\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_without_keep_columns(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_without_keep_columns.csv"; char *object_data = "abc,def,ghi,jkl\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _1, _4 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); select_params->output_param.keep_all_columns = AOS_FALSE; aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "abc,jkl\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_output_raw(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_with_output_raw.csv"; char *object_data = "abc,def\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _1 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); select_params->output_param.output_rawdata = AOS_TRUE; aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 206, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "abc\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_without_output_raw(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_without_output_raw.csv"; char *object_data = "abc,def\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _1 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); select_params->output_param.output_rawdata = AOS_FALSE; aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "abc\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_skip_partial_data_true(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_with_skip_partial_data.csv"; char *object_data = "abc,def\nefg\nhij,klm\n"; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _1, _2 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); select_params->option_param.skip_partial_data_record = AOS_TRUE; aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 400, s->code); CuAssertPtrNotNull(tc, resp_headers); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_skip_partial_data_false(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_without_skip_partial_data.csv"; char *object_data = "abc,def\nefg\nhij,klm\n123,456\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _1, _2 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); select_params->option_param.skip_partial_data_record = AOS_FALSE; aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "abc,def\nefg,\nhij,klm\n123,456\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_crc(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_with_crc.csv"; char *object_data = "abc,def\n"; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _1, _2 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); select_params->output_param.enable_payload_crc = AOS_TRUE; aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); printf("%s ok\n", __FUNCTION__); } void test_select_object_without_crc(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_without_crc.csv"; char *object_data = "abc,def\n"; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _1, _2 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); select_params->output_param.enable_payload_crc = AOS_FALSE; aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_output_delimiters(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_with_output_delimiters.csv"; char *object_data = "abc,def\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _1,_2 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->output_param.record_delimiter, "\r\n"); aos_str_set(&select_params->output_param.field_delimiter, "|"); aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "abc|def\r\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_line_range(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_with_line_range.csv"; char *object_data = "abc,def\n123,456\n789,efg\nhij,klm\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; oss_select_object_meta_params_t *meta_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); meta_params = oss_create_select_object_meta_params(options->pool); s = oss_create_select_object_meta(options, &bucket, &object, meta_params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); sql = "select _1,_2 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.range, "line-range=1-2"); aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "123,456\n789,efg\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_input_comment_character(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_with_input_comment_character.csv"; char *object_data = "abc,def\n`123,456\n#ghi,jkl\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _1 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.comment_character, "`"); aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "abc\n#ghi\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_input_quote_character(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_with_input_quote_character.csv"; char *object_data = "'abc','def\n123','456'\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _2 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "'def\n'456'\n", select_data); //use ' select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.quote_character, "'"); aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "'def\n123'\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_input_delimiters(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_with_input_delimiters.csv"; char *object_data = "abc,def|123,456|7891334\n\n777,888|999,222|012345\n\n"; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _2,_3 from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.record_delimiter, "\n\n"); aos_str_set(&select_params->input_param.field_delimiter, "|"); aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); CuAssertStrEquals(tc, "123,456|7891334\n\n999,222|012345\n\n", select_data); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_gzip_data(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "test_select_object_with_gzip_data.csv.gz"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; char *select_data = NULL; int32_t select_data_len = 0; //char *cmp_data = NULL; //int32_t cmp_data_len = 0; long content_length = 0; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; int64_t select_data_crc = 0; //int64_t cmp_data_crc = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&buffer); create_test_object_from_file(options, TEST_BUCKET_NAME, object_name, test_file_gz, NULL); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file_gz)); sql = "select * from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.file_header_info, "None"); aos_str_set(&select_params->input_param.record_delimiter, "\n"); aos_str_set(&select_params->input_param.field_delimiter, ","); aos_str_set(&select_params->input_param.quote_character, "\""); aos_str_set(&select_params->input_param.compression_type, "GZIP"); select_params->output_param.output_rawdata = AOS_FALSE; s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); select_data_len = strlen(select_data); select_data_crc = aos_crc64(0, select_data, (size_t)select_data_len); //cmp_data = get_text_file_data(options->pool, test_file); //cmp_data_len = strlen(select_data); //cmp_data_crc = aos_crc64(0, cmp_data, (size_t)cmp_data_len); CuAssertTrue(tc, select_data_crc == 0x42DF5EE66341E3C3); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_select_object_with_gzip_data_to_file(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "test_select_object_with_gzip_data.csv.gz"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; char *select_data = NULL; int32_t select_data_len = 0; //char *cmp_data = NULL; //int32_t cmp_data_len = 0; char *tmpfile = "test_select_object_with_gzip_data.csv.tmp"; long content_length = 0; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_string_t filename; int64_t select_data_crc = 0; //int64_t cmp_data_crc = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&buffer); create_test_object_from_file(options, TEST_BUCKET_NAME, object_name, test_file_gz, NULL); s = oss_head_object(options, &bucket, &object, NULL, &resp_headers); CuAssertIntEquals(tc, 200, s->code); content_length = atol((char*)apr_table_get(resp_headers, OSS_CONTENT_LENGTH)); CuAssertTrue(tc, content_length == get_file_size(test_file_gz)); sql = "select * from ossobject"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.file_header_info, "None"); aos_str_set(&select_params->input_param.record_delimiter, "\n"); aos_str_set(&select_params->input_param.field_delimiter, ","); aos_str_set(&select_params->input_param.quote_character, "\""); aos_str_set(&select_params->input_param.compression_type, "GZIP"); aos_str_set(&filename, tmpfile); s = oss_select_object_to_file(options, &bucket, &object, &expression, select_params, &filename, &resp_headers); CuAssertIntEquals(tc, 206, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = get_text_file_data(options->pool, tmpfile); select_data_len = strlen(select_data); select_data_crc = aos_crc64(0, select_data, (size_t)select_data_len); //cmp_data = get_text_file_data(options->pool, test_file); //cmp_data_len = strlen(select_data); //cmp_data_crc = aos_crc64(0, cmp_data, (size_t)cmp_data_len); CuAssertTrue(tc, select_data_crc == 0x42DF5EE66341E3C3); //to invalid filepath aos_str_set(&filename, "g:/invalid-path"); s = oss_select_object_to_file(options, &bucket, &object, &expression, select_params, &filename, &resp_headers); CuAssertIntEquals(tc, AOSE_OPEN_FILE_ERROR, s->code); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_select_object_big_csv_data(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "sampleusers.csv"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_list_t buffer; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; char name[128]; char company[128]; char age[128]; char line_buff[1024]; char *ptr = NULL; int32_t col = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); aos_list_init(&buffer); sql = "select Year, StateAbbr,StateDesc from ossobject limit 200"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.file_header_info, "USE"); select_params->output_param.enable_payload_crc = AOS_TRUE; s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = aos_buf_list_content(options->pool, &buffer); ptr = select_data; memset(line_buff, 0, sizeof(line_buff)); while ((ptr[0] != '\0') && sscanf(ptr, "%[^\n]\n", line_buff)) { memset(name, 0, sizeof(name)); memset(company, 0, sizeof(company)); memset(age, 0, sizeof(age)); sscanf(line_buff, "%[^,],%[^,],%[^,]", name, company, age); ptr += strlen(line_buff) + 1; CuAssertTrue(tc, strlen(name) > 0); memset(line_buff, 0, sizeof(line_buff)); col++; } CuAssertIntEquals(tc, 200, col); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_select_object_big_csv_data_to_file(CuTest *tc) { aos_pool_t *p = NULL; aos_string_t bucket; char *object_name = "sampleusers.csv"; aos_string_t object; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t filename; char *select_data = NULL; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; char name[128]; char company[128]; char age[128]; char line_buff[1024]; char *ptr = NULL; int32_t col = 0; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); sql = "select Year, StateAbbr,StateDesc from ossobject limit 200"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.file_header_info, "USE"); select_params->output_param.enable_payload_crc = AOS_TRUE; aos_str_set(&filename, "result_sampleusers.csv"); s = oss_select_object_to_file(options, &bucket, &object, &expression, select_params, &filename, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); select_data = get_text_file_data(options->pool, filename.data); ptr = select_data; memset(line_buff, 0, sizeof(line_buff)); while ((ptr[0] != '\0') && sscanf(ptr, "%[^\n]\n", line_buff)) { memset(name, 0, sizeof(name)); memset(company, 0, sizeof(company)); memset(age, 0, sizeof(age)); sscanf(line_buff, "%[^,],%[^,],%[^,]", name, company, age); ptr += strlen(line_buff) + 1; CuAssertTrue(tc, strlen(name) > 0); memset(line_buff, 0, sizeof(line_buff)); col++; } CuAssertIntEquals(tc, 200, col); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_select_object_create_meta_delimiters(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_create_meta_delimiters.csv"; char *object_data = "abc,def123,456|7891334\n777,888|999,222012345\n\n"; oss_select_object_meta_params_t *meta_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); meta_params = oss_create_select_object_meta_params(options->pool); aos_str_set(&meta_params->field_delimiter, ","); aos_str_set(&meta_params->record_delimiter, "\n"); resp_headers = NULL; s = oss_create_select_object_meta(options, &bucket, &object, meta_params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); CuAssertIntEquals(tc, 1, meta_params->splits_count); CuAssertIntEquals(tc, 3, (int32_t)meta_params->rows_count); CuAssertIntEquals(tc, 3, meta_params->columns_count); //create meta without overwrite meta_params = oss_create_select_object_meta_params(options->pool); aos_str_set(&meta_params->field_delimiter, "|"); aos_str_set(&meta_params->record_delimiter, "\n\n"); resp_headers = NULL; s = oss_create_select_object_meta(options, &bucket, &object, meta_params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); CuAssertIntEquals(tc, 1, meta_params->splits_count); CuAssertIntEquals(tc, 3, (int32_t)meta_params->rows_count); CuAssertIntEquals(tc, 3, meta_params->columns_count); //create meta with overwrite meta_params = oss_create_select_object_meta_params(options->pool); aos_str_set(&meta_params->field_delimiter, "|"); aos_str_set(&meta_params->record_delimiter, "\n\n"); meta_params->over_write_if_existing = AOS_TRUE; resp_headers = NULL; s = oss_create_select_object_meta(options, &bucket, &object, meta_params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); CuAssertIntEquals(tc, 1, meta_params->splits_count); CuAssertIntEquals(tc, 1, (int32_t)meta_params->rows_count); CuAssertIntEquals(tc, 3, meta_params->columns_count); //create new oject create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); meta_params = oss_create_select_object_meta_params(options->pool); aos_str_set(&meta_params->field_delimiter, "|"); aos_str_set(&meta_params->record_delimiter, "\n\n"); meta_params->over_write_if_existing = AOS_TRUE; resp_headers = NULL; s = oss_create_select_object_meta(options, &bucket, &object, meta_params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); CuAssertIntEquals(tc, 1, meta_params->splits_count); CuAssertIntEquals(tc, 1, (int32_t)meta_params->rows_count); CuAssertIntEquals(tc, 3, meta_params->columns_count); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_select_object_create_meta_quote_character(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_create_meta_quote_character.csv"; char *object_data = "'abc','def\n123','456'\n"; oss_select_object_meta_params_t *meta_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); meta_params = oss_create_select_object_meta_params(options->pool); aos_str_set(&meta_params->quote_character, "'"); resp_headers = NULL; s = oss_create_select_object_meta(options, &bucket, &object, meta_params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); CuAssertIntEquals(tc, 1, meta_params->splits_count); CuAssertIntEquals(tc, 1, (int32_t)meta_params->rows_count); CuAssertIntEquals(tc, 3, meta_params->columns_count); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); meta_params = oss_create_select_object_meta_params(options->pool); aos_str_set(&meta_params->quote_character, "\""); resp_headers = NULL; s = oss_create_select_object_meta(options, &bucket, &object, meta_params, &resp_headers); CuAssertIntEquals(tc, 200, s->code); CuAssertPtrNotNull(tc, resp_headers); CuAssertIntEquals(tc, 1, meta_params->splits_count); CuAssertIntEquals(tc, 2, (int32_t)meta_params->rows_count); CuAssertIntEquals(tc, 2, meta_params->columns_count); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_select_object_invalid(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_invalid.csv"; char *object_data = "abc,def|123,456|7891334\n\n777,888|999,222|012345\n\n"; char *sql = NULL; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sql = "select _2,_3 from ossobject where"; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 400, s->code); CuAssertPtrNotNull(tc, resp_headers); printf("%s ok\n", __FUNCTION__); } void test_select_object_create_meta_invalid(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "oss_test_select_object_create_meta_invalid.csv"; char *object_data = "'abc','def\n123','456'\n"; oss_select_object_meta_params_t *meta_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); meta_params = oss_create_select_object_meta_params(options->pool); aos_str_set(&meta_params->quote_character, "adbc"); resp_headers = NULL; s = oss_create_select_object_meta(options, &bucket, &object, meta_params, &resp_headers); CuAssertIntEquals(tc, 400, s->code); CuAssertPtrNotNull(tc, resp_headers); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } void test_select_object_invalid_parameter(CuTest *tc) { aos_pool_t *p = NULL; oss_request_options_t *options = NULL; int is_cname = 0; int i; char *invalid_name_list[] = { "a", "1", "!", "aa", "12", "a1", "a!", "1!", "aAa", "1A1", "a!a", "FengChao@123", "-a123", "a_123", "a123-", "1234567890123456789012345678901234567890123456789012345678901234", "" }; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); for (i = 0; i < sizeof(invalid_name_list) / sizeof(invalid_name_list[0]); i++) { aos_string_t bucket; aos_status_t *s = NULL; aos_table_t *resp_headers = NULL; aos_str_set(&bucket, invalid_name_list[i]); s = oss_select_object_to_buffer(options, &bucket, NULL, NULL, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_select_object_to_file(options, &bucket, NULL, NULL, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); s = oss_create_select_object_meta(options, &bucket, NULL, NULL, &resp_headers); CuAssertIntEquals(tc, AOSE_INVALID_ARGUMENT, s->code); CuAssertStrEquals(tc, AOS_BUCKET_NAME_INVALID_ERROR, s->error_code); } aos_pool_destroy(p); printf("test_select_object_invalid_parameter ok\n"); } void test_select_object_with_long_sql_expression(CuTest *tc) { aos_pool_t *p = NULL; int is_cname = 0; oss_request_options_t *options = NULL; aos_table_t *resp_headers = NULL; aos_list_t buffer; aos_status_t *s = NULL; aos_string_t bucket; aos_string_t object; char *object_name = "test_select_object_with_long_sql_expression.csv"; char *object_data = "name,job\nabc,def\n"; char *sql = NULL; char sql_buff[2500]; aos_string_t expression; oss_select_object_params_t *select_params; aos_pool_create(&p, NULL); options = oss_request_options_create(p); init_test_request_options(options, is_cname); aos_str_set(&bucket, TEST_BUCKET_NAME); aos_str_set(&object, object_name); create_test_object(options, TEST_BUCKET_NAME, object_name, object_data, NULL); sprintf(sql_buff, "%s", "select name from ossobject"); memset(sql_buff + 26, 0x20, sizeof(sql_buff) - 26); sql_buff[2500 - 1] = '\0'; sql = sql_buff; aos_str_set(&expression, sql); select_params = oss_create_select_object_params(options->pool); aos_str_set(&select_params->input_param.file_header_info, "USE"); select_params->output_param.output_header = AOS_TRUE; aos_list_init(&buffer); s = oss_select_object_to_buffer(options, &bucket, &object, &expression, select_params, &buffer, &resp_headers); CuAssertIntEquals(tc, 400, s->code); CuAssertPtrNotNull(tc, resp_headers); printf("%s ok\n", __FUNCTION__); } CuSuite *test_oss_select_object() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_select_object_setup); SUITE_ADD_TEST(suite, test_select_object_csv_data); SUITE_ADD_TEST(suite, test_select_object_with_output_header); SUITE_ADD_TEST(suite, test_select_object_without_output_header); SUITE_ADD_TEST(suite, test_select_object_with_keep_columns); SUITE_ADD_TEST(suite, test_select_object_without_keep_columns); SUITE_ADD_TEST(suite, test_select_object_with_output_raw); SUITE_ADD_TEST(suite, test_select_object_without_output_raw); SUITE_ADD_TEST(suite, test_select_object_with_skip_partial_data_true); SUITE_ADD_TEST(suite, test_select_object_with_skip_partial_data_false); SUITE_ADD_TEST(suite, test_select_object_with_crc); SUITE_ADD_TEST(suite, test_select_object_without_crc); SUITE_ADD_TEST(suite, test_select_object_with_output_delimiters); SUITE_ADD_TEST(suite, test_select_object_with_line_range); SUITE_ADD_TEST(suite, test_select_object_with_input_comment_character); SUITE_ADD_TEST(suite, test_select_object_with_input_quote_character); SUITE_ADD_TEST(suite, test_select_object_with_input_delimiters); SUITE_ADD_TEST(suite, test_select_object_with_gzip_data); SUITE_ADD_TEST(suite, test_select_object_with_gzip_data_to_file); SUITE_ADD_TEST(suite, test_select_object_big_csv_data); SUITE_ADD_TEST(suite, test_select_object_big_csv_data_to_file); SUITE_ADD_TEST(suite, test_select_object_create_meta_delimiters); SUITE_ADD_TEST(suite, test_select_object_create_meta_quote_character); SUITE_ADD_TEST(suite, test_select_object_invalid); SUITE_ADD_TEST(suite, test_select_object_create_meta_invalid); SUITE_ADD_TEST(suite, test_select_object_invalid_parameter); SUITE_ADD_TEST(suite, test_select_object_with_long_sql_expression); SUITE_ADD_TEST(suite, test_select_object_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_sign.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" void test_sign_setup(CuTest *tc) { } void test_sign_cleanup(CuTest *tc) { } static void test_sign_v4_object_full(CuTest* tc) { aos_pool_t* p = NULL; aos_string_t bucket; aos_string_t object; oss_request_options_t* options = NULL; aos_table_t* headers = NULL; aos_table_t* querys = NULL; aos_table_t* resp_headers = NULL; aos_status_t* s = NULL; aos_list_t buffer; aos_buf_t* content = NULL; const char* str = ""; aos_pool_create(&p, NULL); options = oss_request_options_create(p); options->config = oss_config_create(options->pool); aos_str_set(&options->config->endpoint, "oss-cn-hangzhou.aliyuncs.com"); aos_str_set(&options->config->access_key_id, "ak"); aos_str_set(&options->config->access_key_secret, "sk"); aos_str_set(&options->config->region, "cn-hangzhou"); options->config->signature_version = 4; options->ctl = aos_http_controller_create(options->pool, 0); aos_str_set(&bucket, "oss-bucket-test"); aos_str_set(&object, "test-sign-V4/-!@#$%^&*()/abcdefjhijklmnoqprstuvwxyz/123456789"); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-head1", "value"); apr_table_set(headers, "abc", "value"); apr_table_set(headers, "ZAbc", "value"); apr_table_set(headers, "XYZ", "value"); //force x-oss-date to the speical value for test apr_table_set(headers, "x-oss-date", "20221016T040719Z"); querys = aos_table_make(p, 1); apr_table_set(querys, "param1", "value1"); apr_table_set(querys, "|param1", "value2"); apr_table_set(querys, "+param1", "value3"); apr_table_set(querys, "|param1", "value4"); apr_table_set(querys, "+param2", ""); apr_table_set(querys, "|param2", ""); apr_table_set(querys, "param2", ""); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); s = oss_do_put_object_from_buffer(options, &bucket, &object, &buffer, headers, querys, NULL, &resp_headers, NULL); CuAssertIntEquals(tc, 403, s->code); str = apr_table_get(headers, OSS_AUTHORIZATION); CuAssertStrEquals(tc, "OSS4-HMAC-SHA256 Credential=ak/20221016/cn-hangzhou/oss/aliyun_v4_request,Signature=16e58322c5aafb55edd82813b02d6521caab8194882c786bf0e77b7987a63979", str); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_sign_v4_object_without_query(CuTest* tc) { aos_pool_t* p = NULL; aos_string_t bucket; aos_string_t object; oss_request_options_t* options = NULL; aos_table_t* headers = NULL; aos_table_t* resp_headers = NULL; aos_status_t* s = NULL; aos_list_t buffer; aos_buf_t* content = NULL; const char* str = ""; aos_pool_create(&p, NULL); options = oss_request_options_create(p); options->config = oss_config_create(options->pool); aos_str_set(&options->config->endpoint, "oss-cn-hangzhou.aliyuncs.com"); aos_str_set(&options->config->access_key_id, "ak"); aos_str_set(&options->config->access_key_secret, "sk"); aos_str_set(&options->config->region, "cn-hangzhou"); options->config->signature_version = 4; options->ctl = aos_http_controller_create(options->pool, 0); aos_str_set(&bucket, "oss-bucket-test"); aos_str_set(&object, "test-sign-V4/-!@#$%^&*()/abcdefjhijklmnoqprstuvwxyz/123456789"); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-head1", "value"); //force x-oss-date to the speical value for test apr_table_set(headers, "x-oss-date", "20221016T091431Z"); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); s = oss_do_put_object_from_buffer(options, &bucket, &object, &buffer, headers, NULL, NULL, &resp_headers, NULL); CuAssertIntEquals(tc, 403, s->code); str = apr_table_get(headers, OSS_AUTHORIZATION); CuAssertStrEquals(tc, "OSS4-HMAC-SHA256 Credential=ak/20221016/cn-hangzhou/oss/aliyun_v4_request,Signature=5028172a0a3806285979896982bee6e36e915cbf428ee7100a809e1f0ff43b64", str); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_sign_v4_object_cloudbox_id_full(CuTest* tc) { aos_pool_t* p = NULL; aos_string_t bucket; aos_string_t object; oss_request_options_t* options = NULL; aos_table_t* headers = NULL; aos_table_t* querys = NULL; aos_table_t* resp_headers = NULL; aos_status_t* s = NULL; aos_list_t buffer; aos_buf_t* content = NULL; const char* str = ""; aos_pool_create(&p, NULL); options = oss_request_options_create(p); options->config = oss_config_create(options->pool); aos_str_set(&options->config->endpoint, "oss-cn-hangzhou.aliyuncs.com"); aos_str_set(&options->config->access_key_id, "ak"); aos_str_set(&options->config->access_key_secret, "sk"); aos_str_set(&options->config->region, "cn-hangzhou"); aos_str_set(&options->config->cloudbox_id, "cloudbox-id"); options->config->signature_version = 4; options->ctl = aos_http_controller_create(options->pool, 0); aos_str_set(&bucket, "oss-bucket-test"); aos_str_set(&object, "test-sign-V4/-!@#$%^&*()/abcdefjhijklmnoqprstuvwxyz/123456789"); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-head1", "value"); apr_table_set(headers, "abc", "value"); apr_table_set(headers, "ZAbc", "value"); apr_table_set(headers, "XYZ", "value"); //force x-oss-date to the speical value for test apr_table_set(headers, "x-oss-date", "20221016T091831Z"); querys = aos_table_make(p, 1); apr_table_set(querys, "param1", "value1"); apr_table_set(querys, "|param1", "value2"); apr_table_set(querys, "+param1", "value3"); apr_table_set(querys, "|param1", "value4"); apr_table_set(querys, "+param2", ""); apr_table_set(querys, "|param2", ""); apr_table_set(querys, "param2", ""); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); s = oss_do_put_object_from_buffer(options, &bucket, &object, &buffer, headers, querys, NULL, &resp_headers, NULL); CuAssertIntEquals(tc, 403, s->code); str = apr_table_get(headers, OSS_AUTHORIZATION); CuAssertStrEquals(tc, "OSS4-HMAC-SHA256 Credential=ak/20221016/cloudbox-id/oss-cloudbox/aliyun_v4_request,Signature=939eae7d5012d444c8d1dd8c68811275928f780a859e41ddbe52cf10a100adb4", str); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_sign_v4_with_gmt_datefomat(CuTest* tc) { aos_pool_t* p = NULL; aos_string_t bucket; aos_string_t object; oss_request_options_t* options = NULL; aos_table_t* headers = NULL; aos_table_t* querys = NULL; aos_table_t* resp_headers = NULL; aos_status_t* s = NULL; aos_list_t buffer; aos_buf_t* content = NULL; const char* str = ""; aos_pool_create(&p, NULL); options = oss_request_options_create(p); options->config = oss_config_create(options->pool); aos_str_set(&options->config->endpoint, "oss-cn-hangzhou.aliyuncs.com"); aos_str_set(&options->config->access_key_id, "ak"); aos_str_set(&options->config->access_key_secret, "sk"); aos_str_set(&options->config->region, "cn-hangzhou"); aos_str_set(&options->config->cloudbox_id, "cloudbox-id"); options->config->signature_version = 4; options->ctl = aos_http_controller_create(options->pool, 0); aos_str_set(&bucket, "oss-bucket-test"); aos_str_set(&object, "test-sign-V4/-!@#$%^&*()/abcdefjhijklmnoqprstuvwxyz/123456789"); headers = aos_table_make(p, 1); apr_table_set(headers, "x-oss-head1", "value"); apr_table_set(headers, "abc", "value"); apr_table_set(headers, "ZAbc", "value"); apr_table_set(headers, "XYZ", "value"); //force x-oss-date to the speical value for test apr_table_set(headers, "x-oss-date", "Thu, 19 Mar 2015 18:00:00 GMT"); querys = aos_table_make(p, 1); apr_table_set(querys, "param1", "value1"); apr_table_set(querys, "|param1", "value2"); apr_table_set(querys, "+param1", "value3"); apr_table_set(querys, "|param1", "value4"); apr_table_set(querys, "+param2", ""); apr_table_set(querys, "|param2", ""); apr_table_set(querys, "param2", ""); aos_list_init(&buffer); content = aos_buf_pack(options->pool, str, strlen(str)); aos_list_add_tail(&content->node, &buffer); s = oss_do_put_object_from_buffer(options, &bucket, &object, &buffer, headers, querys, NULL, &resp_headers, NULL); CuAssertIntEquals(tc, 403, s->code); str = apr_table_get(headers, OSS_AUTHORIZATION); CuAssertPtrNotNull(tc, strstr(str, "OSS4-HMAC-SHA256 Credential=ak/20150319/cloudbox-id/oss-cloudbox/aliyun_v4_request")); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_sign_v4_presign(CuTest* tc) { printf("%s ok\n", __FUNCTION__); } CuSuite *test_oss_sign() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_sign_setup); SUITE_ADD_TEST(suite, test_sign_v4_object_full); SUITE_ADD_TEST(suite, test_sign_v4_object_without_query); SUITE_ADD_TEST(suite, test_sign_v4_object_cloudbox_id_full); SUITE_ADD_TEST(suite, test_sign_v4_with_gmt_datefomat); SUITE_ADD_TEST(suite, test_sign_v4_presign); SUITE_ADD_TEST(suite, test_sign_cleanup); return suite; } ================================================ FILE: oss_c_sdk_test/test_oss_xml.c ================================================ #include "CuTest.h" #include "aos_log.h" #include "aos_util.h" #include "aos_string.h" #include "aos_status.h" #include "oss_auth.h" #include "oss_util.h" #include "oss_xml.h" #include "oss_api.h" #include "oss_config.h" #include "oss_test_util.h" static void test_oss_xml_setup(CuTest *tc) { } static void test_oss_xml_cleanup(CuTest *tc) { } static void test_get_xmldoc_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "invalid"; mxml_node_t *root; int ret; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_acl_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "invalid"; char *no_node_xml_grant = "\n" ""; int ret; aos_string_t ret_str; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_acl_parse_from_body(p, &buffer, &ret_str); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_str_null(&ret_str); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml_grant, strlen(no_node_xml_grant)); aos_list_add_tail(&content->node, &buffer); ret = oss_acl_parse_from_body(p, &buffer, &ret_str); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, ret_str.data == NULL); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_location_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "invalid"; char *no_node_xml_grant = "\n" ""; int ret; aos_string_t ret_str; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_location_parse_from_body(p, &buffer, &ret_str); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_str_null(&ret_str); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml_grant, strlen(no_node_xml_grant)); aos_list_add_tail(&content->node, &buffer); ret = oss_location_parse_from_body(p, &buffer, &ret_str); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, ret_str.data == NULL); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_storage_capacity_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "invalid"; char *no_node_xml_grant = "\n" ""; int ret; long ret_long = 2; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_storage_capacity_parse_from_body(p, &buffer, &ret_long); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml_grant, strlen(no_node_xml_grant)); aos_list_add_tail(&content->node, &buffer); ret = oss_storage_capacity_parse_from_body(p, &buffer, &ret_long); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertIntEquals(tc, 2, ret_long); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_logging_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "invalid"; char *no_node_xml_grant = "\n" ""; char *no_node_xml_enable = "\n" ""; int ret; oss_logging_config_content_t logging_content; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_logging_parse_from_body(p, &buffer, &logging_content); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); logging_content.logging_enabled = 2; aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml_grant, strlen(no_node_xml_grant)); aos_list_add_tail(&content->node, &buffer); ret = oss_logging_parse_from_body(p, &buffer, &logging_content); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertIntEquals(tc, 2, logging_content.logging_enabled); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml_enable, strlen(no_node_xml_enable)); aos_list_add_tail(&content->node, &buffer); ret = oss_logging_parse_from_body(p, &buffer, &logging_content); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertIntEquals(tc, 2, logging_content.logging_enabled); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_list_objects_owner_parse_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; int ret; mxml_node_t *root; oss_list_object_content_t object_content; aos_pool_create(&p, NULL); aos_str_null(&object_content.owner_id); aos_str_null(&object_content.owner_display_name); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_list_objects_owner_parse(p, root, &object_content); CuAssertTrue(tc, object_content.owner_id.data == NULL); CuAssertTrue(tc, object_content.owner_display_name.data == NULL); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_list_objects_content_parse_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; int ret; mxml_node_t *root; oss_list_object_content_t object_content; aos_pool_create(&p, NULL); aos_str_null(&object_content.owner_id); aos_str_null(&object_content.owner_display_name); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_list_objects_content_parse(p, root, &object_content); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_list_objects_prefix_parse_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; int ret; mxml_node_t *root; oss_list_object_common_prefix_t common_prefix; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_list_objects_prefix_parse(p, root, &common_prefix); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_list_objects_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *full_node_xml = "\n" "" "oss-example" "Prefix" "Marker" "100" "/" "false" "nextMarker" "" " fun/movie/001.avi" " 2012-02-24T08:43:07.000Z" " "5B3C1A2E053D763E1B002CC607C"" " Normal" " 344606" " Standard" " " " 0022012****" " user-example" " " "" "" " fun/movie/007.avi" " 2012-02-24T08:43:27.000Z" " "5B3C1A2E053D763E1B002CC607C"" " Normal" " 344606" " Standard" " " " 0022012****" " user-example" " " "" ""; int ret; aos_list_t object_list; aos_list_t common_prefix_list; aos_string_t marker; int truncated; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_objects_parse_from_body(p, &buffer, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&object_list); aos_list_init(&common_prefix_list); aos_list_init(&buffer); content = aos_buf_pack(p, full_node_xml, strlen(full_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_objects_parse_from_body(p, &buffer, &object_list, &common_prefix_list, &marker, &truncated); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_list_buckets_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; char *full_node_xml = "\n" "" " " " 512**" " 51264" " " " " " " " 2015-12-17T18:12:43.000Z" " " " " " oss-cn-shanghai" " app-base-oss" " Standard" " " " " ""; int ret; mxml_node_t *root; oss_list_buckets_params_t *params = NULL; aos_list_t node_list; aos_pool_create(&p, NULL); params = oss_create_list_buckets_params(p); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_buckets_parse_from_body(p, &buffer, params); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_buckets_parse_from_body(p, &buffer, params); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&buffer); aos_list_init(&node_list); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_list_buckets_content_parse(p, root, &node_list); oss_list_buckets_content_parse(NULL, root, &node_list); aos_list_init(&buffer); content = aos_buf_pack(p, full_node_xml, strlen(full_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_buckets_parse_from_body(p, &buffer, params); CuAssertIntEquals(tc, AOSE_OK, ret); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_bucket_info_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; int ret; oss_bucket_info_t bucket_info; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_info_parse_from_body(p, &buffer, &bucket_info); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_info_parse_from_body(p, &buffer, &bucket_info); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_bucket_info_parse_from_body_pasitive(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *xml = "\n" "\n" " \n" " 2013-07-31T10:56:21.000Z\n" " oss-cn-hangzhou.aliyuncs.com\n" " oss-cn-hangzhou-internal.aliyuncs.com\n" " oss-cn-hangzhou\n" " oss-example\n" " \n" " username\n" " 27183473914****\n" " \n" " \n" " private\n" " \n" " test\n" " \n" "\n" ; int ret; oss_bucket_info_t bucket_info; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, xml, strlen(xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_info_parse_from_body(p, &buffer, &bucket_info); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertStrEquals(tc, bucket_info.location.data, "oss-cn-hangzhou"); CuAssertStrEquals(tc, bucket_info.created_date.data, "2013-07-31T10:56:21.000Z"); CuAssertStrEquals(tc, bucket_info.acl.data, "private"); CuAssertStrEquals(tc, bucket_info.storage_class.data, NULL); CuAssertIntEquals(tc, bucket_info.storage_class.len, 0); xml = "\n" "\n" " \n" " 2013-07-31T10:56:21.000Z\n" " oss-cn-hangzhou.aliyuncs.com\n" " oss-cn-hangzhou-internal.aliyuncs.com\n" " oss-cn-hangzhou\n" " oss-example\n" " \n" " username\n" " 27183473914****\n" " \n" " \n" " public-read\n" " \n" " test\n" " Archive\n" " \n" "\n" ; aos_list_init(&buffer); content = aos_buf_pack(p, xml, strlen(xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_info_parse_from_body(p, &buffer, &bucket_info); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertStrEquals(tc, bucket_info.location.data, "oss-cn-hangzhou"); CuAssertStrEquals(tc, bucket_info.created_date.data, "2013-07-31T10:56:21.000Z"); CuAssertStrEquals(tc, bucket_info.acl.data, "public-read"); CuAssertStrEquals(tc, bucket_info.storage_class.data, "Archive"); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_bucket_stat_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; int ret; oss_bucket_stat_t bucket_stat; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_stat_parse_from_body(p, &buffer, &bucket_stat); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_stat_parse_from_body(p, &buffer, &bucket_stat); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_bucket_website_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; int ret; oss_website_config_t website_config; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_website_parse_from_body(p, &buffer, &website_config); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_website_parse_from_body(p, &buffer, &website_config); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_bucket_referer_config_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; char *full_node_xml = "\n" "" " false" " " " http://abc.com" " http://www.*.com" " " ""; int ret; oss_referer_config_t referer_config; aos_pool_create(&p, NULL); aos_list_init(&buffer); aos_list_init(&referer_config.referer_list); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_referer_config_parse_from_body(p, &buffer, &referer_config); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&buffer); aos_list_init(&referer_config.referer_list); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_referer_config_parse_from_body(p, &buffer, &referer_config); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&buffer); aos_list_init(&referer_config.referer_list); content = aos_buf_pack(p, full_node_xml, strlen(full_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_referer_config_parse_from_body(p, &buffer, &referer_config); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_cors_rule_content_parse_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; int ret; mxml_node_t *root; aos_list_t node_list; aos_pool_create(&p, NULL); aos_list_init(&node_list); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_cors_rule_content_parse(p, root, &node_list); oss_cors_rule_content_parse(NULL, root, &node_list); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_bucket_cors_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; char *full_node_xml = "\n" "" " " " abc" " GET" " *" " x-oss-test" " 100" " " ""; int ret; aos_list_t rule_list; aos_pool_create(&p, NULL); aos_list_init(&rule_list); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_cors_parse_from_body(p, &buffer, &rule_list); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&rule_list); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_cors_parse_from_body(p, &buffer, &rule_list); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&rule_list); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_cors_parse_from_body(NULL, &buffer, &rule_list); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&rule_list); aos_list_init(&buffer); content = aos_buf_pack(p, full_node_xml, strlen(full_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_bucket_cors_parse_from_body(p, &buffer, &rule_list); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_list_parts_content_parse_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; int ret; mxml_node_t *root; oss_list_part_content_t part_content; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_list_parts_content_parse(p, root, &part_content); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_list_parts_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; int ret; aos_list_t rule_list; aos_pool_create(&p, NULL); aos_list_init(&rule_list); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_parts_parse_from_body(p, &buffer, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_list_multipart_uploads_content_parse_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; int ret; mxml_node_t *root; oss_list_multipart_upload_content_t upload_content; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_list_multipart_uploads_content_parse(p, root, &upload_content); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_list_multipart_uploads_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; int ret; aos_list_t upload_list; aos_string_t key_marker; aos_string_t upload_id_marker; int truncated; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_multipart_uploads_parse_from_body(p, &buffer, NULL, NULL, NULL, NULL); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&upload_list); aos_str_set(&key_marker, ""); aos_str_set(&upload_id_marker, ""); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_multipart_uploads_parse_from_body(p, &buffer, &upload_list, &key_marker, &upload_id_marker, &truncated); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_upload_id_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; int ret; aos_string_t upload_id; aos_pool_create(&p, NULL); aos_str_set(&upload_id, ""); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_upload_id_parse_from_body(p, &buffer, &upload_id); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_str_set(&upload_id, ""); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_upload_id_parse_from_body(p, &buffer, &upload_id); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_lifecycle_rule_content_parse_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; int ret; mxml_node_t *root; oss_lifecycle_rule_content_t rule_content; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_lifecycle_rule_content_parse(p, root, &rule_content); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_live_channel_info_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; char *root_node_xml = "\n" ""; char *sub_node_xml = "\n" ""; int ret; oss_live_channel_configuration_t info; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_live_channel_info_parse_from_body(p, &buffer, &info); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_live_channel_info_parse_from_body(p, &buffer, &info); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&buffer); content = aos_buf_pack(p, root_node_xml, strlen(root_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_live_channel_info_parse_from_body(p, &buffer, &info); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&buffer); content = aos_buf_pack(p, sub_node_xml, strlen(sub_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_live_channel_info_parse_from_body(p, &buffer, &info); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } //oss_list_live_channel_content_parse // static void test_oss_live_channel_stat_video_content_parse(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; char *full_node_xml = "\n" ""; int ret; mxml_node_t *root; oss_video_stat_t video_stat; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_live_channel_stat_video_content_parse(p, root, &video_stat); mxmlDelete(root); aos_list_init(&buffer); content = aos_buf_pack(p, full_node_xml, strlen(full_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_live_channel_stat_video_content_parse(p, root, &video_stat); CuAssertIntEquals(tc, 0, video_stat.band_width); CuAssertIntEquals(tc, 1280, video_stat.width); CuAssertIntEquals(tc, 536, video_stat.height); CuAssertIntEquals(tc, 24, video_stat.frame_rate); CuAssertStrEquals(tc, "H264", video_stat.codec.data); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_live_channel_stat_audio_content_parse(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; char *full_node_xml = "\n" ""; int ret; mxml_node_t *root; oss_audio_stat_t audio_stat; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_live_channel_stat_audio_content_parse(p, root, &audio_stat); mxmlDelete(root); aos_list_init(&buffer); content = aos_buf_pack(p, full_node_xml, strlen(full_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_live_channel_stat_audio_content_parse(p, root, &audio_stat); CuAssertIntEquals(tc, 0, audio_stat.band_width); CuAssertIntEquals(tc, 44100, audio_stat.sample_rate); CuAssertStrEquals(tc, "ADPCM", audio_stat.codec.data); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_live_channel_stat_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; char *root_node_xml = "\n" ""; char *full_node_xml = "\n" "" " Live" " 2016-08-25T06:25:15.000Z" " 10.1.2.3:47745" " " " " ""; int ret; oss_live_channel_stat_t stat; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_live_channel_stat_parse_from_body(p, &buffer, &stat); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_live_channel_stat_parse_from_body(p, &buffer, &stat); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&buffer); content = aos_buf_pack(p, root_node_xml, strlen(root_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_live_channel_stat_parse_from_body(p, &buffer, &stat); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&buffer); content = aos_buf_pack(p, full_node_xml, strlen(full_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_live_channel_stat_parse_from_body(p, &buffer, &stat); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertStrEquals(tc, "2016-08-25T06:25:15.000Z", stat.connected_time.data); CuAssertStrEquals(tc, "10.1.2.3:47745", stat.remote_addr.data); CuAssertIntEquals(tc, 0, stat.video_stat.band_width); CuAssertIntEquals(tc, 1280, stat.video_stat.width); CuAssertIntEquals(tc, 536, stat.video_stat.height); CuAssertIntEquals(tc, 24, stat.video_stat.frame_rate); CuAssertStrEquals(tc, "H264", stat.video_stat.codec.data); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_list_live_channel_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; char *root_node_xml = "\n" ""; char *full_node_xml = "\n" "" " " " " " 1" " true" " channel-0" " " " channel-0" " " " disabled" " 2016-07-30T01:54:21.000Z" " " " rtmp://test-bucket.oss-cn-hangzhou.aliyuncs.com/live/channel-0" " " " " " http://test-bucket.oss-cn-hangzhou.aliyuncs.com/channel-0/playlist.m3u8" " " " " ""; int ret; aos_list_t live_channel_list; aos_string_t next_marker; int truncated; aos_pool_create(&p, NULL); aos_list_init(&live_channel_list); aos_str_set(&next_marker, ""); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_live_channel_parse_from_body(p, &buffer, &live_channel_list, &next_marker, &truncated); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&live_channel_list); aos_str_set(&next_marker, ""); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_live_channel_parse_from_body(p, &buffer, &live_channel_list, &next_marker, &truncated); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&live_channel_list); aos_str_set(&next_marker, ""); aos_list_init(&buffer); content = aos_buf_pack(p, root_node_xml, strlen(root_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_live_channel_parse_from_body(p, &buffer, &live_channel_list, &next_marker, &truncated); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&live_channel_list); aos_str_set(&next_marker, ""); aos_list_init(&buffer); content = aos_buf_pack(p, full_node_xml, strlen(full_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_list_live_channel_parse_from_body(p, &buffer, &live_channel_list, &next_marker, &truncated); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_live_channel_history_content_parse(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; char *full_node_xml = "\n" "2016-07-30T01:53:21.000Z" "2016-07-30T01:53:31.000Z" "10.101.194.148:56861"; int ret; mxml_node_t *root; oss_live_record_content_t record_content; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_live_channel_history_content_parse(p, root, &record_content); mxmlDelete(root); aos_list_init(&buffer); content = aos_buf_pack(p, full_node_xml, strlen(full_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_live_channel_history_content_parse(p, root, &record_content); CuAssertStrEquals(tc, "2016-07-30T01:53:21.000Z", record_content.start_time.data); CuAssertStrEquals(tc, "2016-07-30T01:53:31.000Z", record_content.end_time.data); CuAssertStrEquals(tc, "10.101.194.148:56861", record_content.remote_addr.data); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_live_channel_history_parse_from_body(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; char *full_node_xml = "\n" "" "" "2016-07-30T01:53:21.000Z" "2016-07-30T01:53:31.000Z" "10.101.194.148:56861" "" "" "2016-07-30T01:53:35.000Z" "2016-07-30T01:53:45.000Z" "10.101.194.148:57126" "" "" "2016-07-30T01:53:49.000Z" "2016-07-30T01:53:59.000Z" "10.101.194.148:57577" "" "" "2016-07-30T01:54:04.000Z" "2016-07-30T01:54:14.000Z" "10.101.194.148:57632" "" ""; aos_list_t live_record_list; int ret; aos_pool_create(&p, NULL); aos_list_init(&live_record_list); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_live_channel_history_parse_from_body(p, &buffer, &live_record_list); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&live_record_list); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_live_channel_history_parse_from_body(p, &buffer, &live_record_list); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&live_record_list); aos_list_init(&buffer); content = aos_buf_pack(p, full_node_xml, strlen(full_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_live_channel_history_parse_from_body(p, &buffer, &live_record_list); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_create_live_channel_parse_from_body(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; int ret; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_create_live_channel_parse_from_body(p, &buffer, NULL, NULL); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_create_live_channel_parse_from_body(p, &buffer, NULL, NULL); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_get_tagging_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; char *root_node_xml = "\n" ""; int ret; aos_list_t tag_list; aos_pool_create(&p, NULL); aos_list_init(&tag_list); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_tagging_parse_from_body(p, &buffer, &tag_list); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&tag_list); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_tagging_parse_from_body(p, &buffer, &tag_list); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&tag_list); aos_list_init(&buffer); content = aos_buf_pack(p, root_node_xml, strlen(root_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_get_tagging_parse_from_body(p, &buffer, &tag_list); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_get_xmlnode_value(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; mxml_node_t *root; int ret; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); get_xmlnode_value_int(p, root, "Node", NULL); get_xmlnode_value_int64(p, root, "Node", NULL); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_lifecycle_rules_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; int ret; aos_list_t lifecycle_rule_list; aos_pool_create(&p, NULL); aos_list_init(&lifecycle_rule_list); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_lifecycle_rules_parse_from_body(p, &buffer, &lifecycle_rule_list); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&lifecycle_rule_list); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_lifecycle_rules_parse_from_body(p, &buffer, &lifecycle_rule_list); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_lifecycle_rule_tag_parse_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *no_node_xml = "\n" ""; int ret; mxml_node_t *root; oss_tag_content_t tag; aos_pool_create(&p, NULL); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = get_xmldoc(&buffer, &root); CuAssertIntEquals(tc, AOSE_OK, ret); CuAssertTrue(tc, root != NULL); oss_lifecycle_rule_tag_parse(p, root, &tag); mxmlDelete(root); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_delete_objects_parse_from_body_negative(CuTest *tc) { aos_pool_t *p; aos_list_t buffer; aos_buf_t *content; char *invalid_xml = "Invalid"; char *no_node_xml = "\n" ""; char *root_node_xml = "\n" ""; char *full_node_xml = "\n" "" " " " " " " " test.jpg" " " ""; int ret; aos_list_t object_list; aos_pool_create(&p, NULL); aos_list_init(&object_list); aos_list_init(&buffer); content = aos_buf_pack(p, invalid_xml, strlen(invalid_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_delete_objects_parse_from_body(p, &buffer, &object_list); CuAssertIntEquals(tc, AOSE_XML_PARSE_ERROR, ret); aos_list_init(&object_list); aos_list_init(&buffer); content = aos_buf_pack(p, no_node_xml, strlen(no_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_delete_objects_parse_from_body(p, &buffer, &object_list); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&object_list); aos_list_init(&buffer); content = aos_buf_pack(p, root_node_xml, strlen(root_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_delete_objects_parse_from_body(p, &buffer, &object_list); CuAssertIntEquals(tc, AOSE_OK, ret); aos_list_init(&object_list); aos_list_init(&buffer); content = aos_buf_pack(p, full_node_xml, strlen(full_node_xml)); aos_list_add_tail(&content->node, &buffer); ret = oss_delete_objects_parse_from_body(p, &buffer, &object_list); CuAssertIntEquals(tc, AOSE_OK, ret); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_build_bucket_logging_body_negative(CuTest *tc) { aos_pool_t *p; oss_logging_config_content_t content; aos_list_t body; aos_pool_create(&p, NULL); aos_list_init(&body); aos_str_set(&content.target_bucket, ""); aos_str_set(&content.prefix, ""); build_bucket_logging_body(p, &content, &body); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_build_bucket_storage_class_negative(CuTest *tc) { aos_pool_t *p; aos_list_t body; aos_pool_create(&p, NULL); aos_list_init(&body); build_bucket_storage_class(p, OSS_STORAGE_CLASS_BUTT, &body); CuAssertTrue(tc, aos_list_empty(&body) == 1); aos_list_init(&body); build_bucket_storage_class(p, OSS_STORAGE_CLASS_STANDARD, &body); CuAssertTrue(tc, aos_list_empty(&body) == 0); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_publish_url_parse(CuTest *tc) { aos_pool_t *p; aos_pool_create(&p, NULL); oss_publish_url_parse(p, NULL, NULL); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_play_url_parse(CuTest *tc) { aos_pool_t *p; aos_pool_create(&p, NULL); oss_play_url_parse(p, NULL, NULL); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_build_select_object_body(CuTest *tc) { aos_pool_t *p; aos_list_t body; aos_string_t expression; aos_pool_create(&p, NULL); oss_build_select_object_body(p, NULL, NULL, &body); oss_build_select_object_body(p, &expression, NULL, &body); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_build_create_select_object_meta_body(CuTest *tc) { aos_pool_t *p; aos_list_t body; aos_pool_create(&p, NULL); oss_build_create_select_object_meta_body(p, NULL, &body); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } static void test_oss_build_restore_object_body(CuTest *tc) { aos_pool_t *p; aos_list_t body; int64_t len = 0; int64_t size = 0; int64_t pos = 0; char *buf = NULL; aos_buf_t *content = NULL; aos_pool_create(&p, NULL); oss_build_restore_object_body(p, OSS_TIER_BULK, 3, &body); len = aos_buf_list_len(&body); buf = aos_pcalloc(p, len + 1); buf[len] = '\0'; aos_list_for_each_entry(aos_buf_t, content, &body, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, size); pos += size; } CuAssertTrue(tc, strstr(buf, "3") != NULL); CuAssertTrue(tc, strstr(buf, "Bulk") != NULL); aos_list_init(&body); pos = len = size = 0; oss_build_restore_object_body(p, OSS_TIER_EXPEDITED, 10, &body); len = aos_buf_list_len(&body); buf = aos_pcalloc(p, len + 1); buf[len] = '\0'; aos_list_for_each_entry(aos_buf_t, content, &body, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, size); pos += size; } CuAssertTrue(tc, strstr(buf, "10") != NULL); CuAssertTrue(tc, strstr(buf, "Expedited") != NULL); aos_list_init(&body); pos = len = size = 0; oss_build_restore_object_body(p, OSS_TIER_STANDARD, 1, &body); len = aos_buf_list_len(&body); buf = aos_pcalloc(p, len + 1); buf[len] = '\0'; aos_list_for_each_entry(aos_buf_t, content, &body, node) { size = aos_buf_size(content); memcpy(buf + pos, content->pos, size); pos += size; } CuAssertTrue(tc, strstr(buf, "1") != NULL); CuAssertTrue(tc, strstr(buf, "Standard") != NULL); aos_pool_destroy(p); printf("%s ok\n", __FUNCTION__); } // //build_bucket_storage_capacity_body //oss_build_create_select_object_meta_xml // CuSuite *test_oss_xml() { CuSuite* suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_oss_xml_setup); SUITE_ADD_TEST(suite, test_get_xmldoc_negative); SUITE_ADD_TEST(suite, test_oss_acl_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_location_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_storage_capacity_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_logging_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_list_objects_owner_parse_negative); SUITE_ADD_TEST(suite, test_oss_list_objects_content_parse_negative); SUITE_ADD_TEST(suite, test_oss_list_objects_prefix_parse_negative); SUITE_ADD_TEST(suite, test_oss_list_objects_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_list_buckets_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_get_bucket_info_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_get_bucket_info_parse_from_body_pasitive); SUITE_ADD_TEST(suite, test_oss_get_bucket_stat_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_get_bucket_website_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_get_bucket_referer_config_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_cors_rule_content_parse_negative); SUITE_ADD_TEST(suite, test_oss_get_bucket_cors_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_list_parts_content_parse_negative); SUITE_ADD_TEST(suite, test_oss_list_parts_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_list_multipart_uploads_content_parse_negative); SUITE_ADD_TEST(suite, test_oss_list_multipart_uploads_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_upload_id_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_lifecycle_rule_content_parse_negative); SUITE_ADD_TEST(suite, test_oss_live_channel_info_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_live_channel_stat_video_content_parse); SUITE_ADD_TEST(suite, test_oss_live_channel_stat_audio_content_parse); SUITE_ADD_TEST(suite, test_oss_live_channel_stat_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_list_live_channel_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_live_channel_history_content_parse); SUITE_ADD_TEST(suite, test_oss_live_channel_history_parse_from_body); SUITE_ADD_TEST(suite, test_oss_create_live_channel_parse_from_body); SUITE_ADD_TEST(suite, test_oss_get_tagging_parse_from_body_negative); SUITE_ADD_TEST(suite, test_get_xmlnode_value); SUITE_ADD_TEST(suite, test_oss_lifecycle_rules_parse_from_body_negative); SUITE_ADD_TEST(suite, test_oss_lifecycle_rule_tag_parse_negative); SUITE_ADD_TEST(suite, test_oss_delete_objects_parse_from_body_negative); SUITE_ADD_TEST(suite, test_build_bucket_logging_body_negative); SUITE_ADD_TEST(suite, test_build_bucket_storage_class_negative); SUITE_ADD_TEST(suite, test_oss_publish_url_parse); SUITE_ADD_TEST(suite, test_oss_play_url_parse); SUITE_ADD_TEST(suite, test_oss_build_select_object_body); SUITE_ADD_TEST(suite, test_oss_build_create_select_object_meta_body); SUITE_ADD_TEST(suite, test_oss_build_restore_object_body); SUITE_ADD_TEST(suite, test_oss_xml_cleanup); return suite; } ================================================ FILE: third_party/include/apr/apr.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_H #define APR_H /* GENERATED FILE WARNING! DO NOT EDIT apr.h * * You must modify apr.hw instead. * * And please, make an effort to stub apr.hnw and apr.h.in in the process. * * This is the Win32 specific version of apr.h. It is copied from * apr.hw by the apr.dsp and libapr.dsp projects. */ /** * @file apr.h * @brief APR Platform Definitions * @remark This is a generated header generated from include/apr.h.in by * ./configure, or copied from include/apr.hw or include/apr.hnw * for Win32 or Netware by those build environments, respectively. */ /* Make sure we have our platform identifier macro defined we ask for later. */ #if defined(_WIN32) && !defined(WIN32) #define WIN32 1 #endif #if defined(WIN32) || defined(DOXYGEN) /* Ignore most warnings (back down to /W3) for poorly constructed headers */ #if defined(_MSC_VER) && _MSC_VER >= 1200 #pragma warning(push, 3) #endif /* disable or reduce the frequency of... * C4057: indirection to slightly different base types * C4075: slight indirection changes (unsigned short* vs short[]) * C4100: unreferenced formal parameter * C4127: conditional expression is constant * C4163: '_rotl64' : not available as an intrinsic function * C4201: nonstandard extension nameless struct/unions * C4244: int to char/short - precision loss * C4514: unreferenced inline function removed */ #pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244) /* Ignore Microsoft's interpretation of secure development * and the POSIX string handling API */ #if defined(_MSC_VER) && _MSC_VER >= 1400 #ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE #endif #pragma warning(disable: 4996) #endif /* Has windows.h already been included? If so, our preferences don't matter, * but we will still need the winsock things no matter what was included. * If not, include a restricted set of windows headers to our tastes. */ #ifndef _WINDOWS_ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifndef _WIN32_WINNT /* Restrict the server to a subset of Windows XP header files by default */ #define _WIN32_WINNT 0x0501 #endif #ifndef NOUSER #define NOUSER #endif #ifndef NOMCX #define NOMCX #endif #ifndef NOIME #define NOIME #endif #include /* * Add a _very_few_ declarations missing from the restricted set of headers * (If this list becomes extensive, re-enable the required headers above!) * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now */ #define SW_HIDE 0 #ifndef _WIN32_WCE #include #include #include #else #include #endif #endif /* !_WINDOWS_ */ /** * @defgroup APR Apache Portability Runtime library * @{ */ /** * @defgroup apr_platform Platform Definitions * @{ * @warning * The actual values of macros and typedefs on this page
* are platform specific and should NOT be relied upon!
*/ #define APR_INLINE __inline #define APR_HAS_INLINE 1 #if !defined(__GNUC__) && !defined(__attribute__) #define __attribute__(__x) #endif #ifndef _WIN32_WCE #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CONIO_H 1 #define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 1 #define APR_HAVE_DIRENT_H 0 #define APR_HAVE_ERRNO_H 1 #define APR_HAVE_FCNTL_H 1 #define APR_HAVE_IO_H 1 #define APR_HAVE_LIMITS_H 1 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_NETINET_SCTP_H 0 #define APR_HAVE_NETINET_SCTP_UIO_H 0 #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SEMAPHORE_H 0 #define APR_HAVE_SIGNAL_H 1 #define APR_HAVE_STDARG_H 1 #define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 #define APR_HAVE_SYS_IOCTL_H 0 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_SYS_UN_H 0 #define APR_HAVE_SYS_WAIT_H 0 #define APR_HAVE_TIME_H 1 #define APR_HAVE_UNISTD_H 0 #define APR_HAVE_STDDEF_H 1 #define APR_HAVE_PROCESS_H 1 #else #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CONIO_H 0 #define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 0 #define APR_HAVE_DIRENT_H 0 #define APR_HAVE_ERRNO_H 0 #define APR_HAVE_FCNTL_H 0 #define APR_HAVE_IO_H 0 #define APR_HAVE_LIMITS_H 0 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_NETINET_SCTP_H 0 #define APR_HAVE_NETINET_SCTP_UIO_H 0 #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SEMAPHORE_H 0 #define APR_HAVE_SIGNAL_H 0 #define APR_HAVE_STDARG_H 0 #define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 #define APR_HAVE_SYS_IOCTL_H 0 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 0 #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_SYS_UN_H 0 #define APR_HAVE_SYS_WAIT_H 0 #define APR_HAVE_TIME_H 0 #define APR_HAVE_UNISTD_H 0 #define APR_HAVE_STDDEF_H 0 #define APR_HAVE_PROCESS_H 0 #endif /** @} */ /** @} */ /* We don't include our conditional headers within the doxyblocks * or the extern "C" namespace */ #if APR_HAVE_STDLIB_H #include #endif #if APR_HAVE_STDIO_H #include #endif #if APR_HAVE_SYS_TYPES_H #include #endif #if APR_HAVE_STDDEF_H #include #endif #if APR_HAVE_TIME_H #include #endif #if APR_HAVE_PROCESS_H #include #endif #ifdef __cplusplus extern "C" { #endif /** * @addtogroup apr_platform * @ingroup APR * @{ */ #define APR_HAVE_SHMEM_MMAP_TMP 0 #define APR_HAVE_SHMEM_MMAP_SHM 0 #define APR_HAVE_SHMEM_MMAP_ZERO 0 #define APR_HAVE_SHMEM_SHMGET_ANON 0 #define APR_HAVE_SHMEM_SHMGET 0 #define APR_HAVE_SHMEM_MMAP_ANON 0 #define APR_HAVE_SHMEM_BEOS 0 #define APR_USE_SHMEM_MMAP_TMP 0 #define APR_USE_SHMEM_MMAP_SHM 0 #define APR_USE_SHMEM_MMAP_ZERO 0 #define APR_USE_SHMEM_SHMGET_ANON 0 #define APR_USE_SHMEM_SHMGET 0 #define APR_USE_SHMEM_MMAP_ANON 0 #define APR_USE_SHMEM_BEOS 0 #define APR_USE_FLOCK_SERIALIZE 0 #define APR_USE_POSIXSEM_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 #define APR_USE_FCNTL_SERIALIZE 0 #define APR_USE_PROC_PTHREAD_SERIALIZE 0 #define APR_USE_PTHREAD_SERIALIZE 0 #define APR_HAS_FLOCK_SERIALIZE 0 #define APR_HAS_SYSVSEM_SERIALIZE 0 #define APR_HAS_POSIXSEM_SERIALIZE 0 #define APR_HAS_FCNTL_SERIALIZE 0 #define APR_HAS_PROC_PTHREAD_SERIALIZE 0 #define APR_PROCESS_LOCK_IS_GLOBAL 0 #define APR_HAVE_CORKABLE_TCP 0 #define APR_HAVE_GETRLIMIT 0 #define APR_HAVE_ICONV 0 #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 #define APR_HAVE_IPV6 0 #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 #define APR_HAVE_SIGSUSPEND 0 #define APR_HAVE_SIGWAIT 0 #define APR_HAVE_SA_STORAGE 0 #define APR_HAVE_STRCASECMP 0 #define APR_HAVE_STRDUP 1 #define APR_HAVE_STRNCASECMP 0 #define APR_HAVE_STRSTR 1 #define APR_HAVE_MEMCHR 1 #define APR_HAVE_STRUCT_RLIMIT 0 #define APR_HAVE_UNION_SEMUN 0 #define APR_HAVE_SCTP 0 #define APR_HAVE_IOVEC 0 #ifndef _WIN32_WCE #define APR_HAVE_STRICMP 1 #define APR_HAVE_STRNICMP 1 #else #define APR_HAVE_STRICMP 0 #define APR_HAVE_STRNICMP 0 #endif /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 1 #define APR_HAS_THREADS 1 #define APR_HAS_MMAP 1 #define APR_HAS_FORK 0 #define APR_HAS_RANDOM 1 #define APR_HAS_OTHER_CHILD 1 #define APR_HAS_DSO 1 #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 1 #define APR_HAS_PROC_INVOKED 1 #define APR_HAS_OS_UUID 1 #ifndef _WIN32_WCE #define APR_HAS_SENDFILE 1 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 1 #define APR_HAS_XTHREAD_FILES 1 #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 1 #else #define APR_HAS_SENDFILE 0 #define APR_HAS_USER 0 #define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 #endif /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible * to poll on files/pipes. */ #define APR_FILES_AS_SOCKETS 0 /* This macro indicates whether or not EBCDIC is the native character set. */ #define APR_CHARSET_EBCDIC 0 /* If we have a TCP implementation that can be "corked", what flag * do we use? */ #define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ /* Is the TCP_NODELAY socket option inherited from listening sockets? */ #define APR_TCP_NODELAY_INHERITED 1 /* Is the O_NONBLOCK flag inherited from listening sockets? */ #define APR_O_NONBLOCK_INHERITED 1 /* Typedefs that APR needs. */ typedef unsigned char apr_byte_t; typedef short apr_int16_t; typedef unsigned short apr_uint16_t; typedef int apr_int32_t; typedef unsigned int apr_uint32_t; typedef __int64 apr_int64_t; typedef unsigned __int64 apr_uint64_t; typedef size_t apr_size_t; #if APR_HAVE_STDDEF_H typedef ptrdiff_t apr_ssize_t; #else typedef int apr_ssize_t; #endif #if APR_HAS_LARGE_FILES typedef __int64 apr_off_t; #else typedef int apr_off_t; #endif typedef int apr_socklen_t; typedef apr_uint64_t apr_ino_t; #ifdef _WIN64 #define APR_SIZEOF_VOIDP 8 #else #define APR_SIZEOF_VOIDP 4 #endif #if APR_SIZEOF_VOIDP == 8 typedef apr_uint64_t apr_uintptr_t; #else typedef apr_uint32_t apr_uintptr_t; #endif /* Are we big endian? */ /* XXX: Fatal assumption on Alpha platforms */ #define APR_IS_BIGENDIAN 0 /* Mechanisms to properly type numeric literals */ #ifndef __GNUC__ #define APR_INT64_C(val) (val##i64) #define APR_UINT64_C(val) (val##Ui64) #else #define APR_INT64_C(val) (val##LL) #define APR_UINT64_C(val) (val##ULL) #endif #ifdef INT16_MIN #define APR_INT16_MIN INT16_MIN #else #define APR_INT16_MIN (-0x7fff - 1) #endif #ifdef INT16_MAX #define APR_INT16_MAX INT16_MAX #else #define APR_INT16_MAX (0x7fff) #endif #ifdef UINT16_MAX #define APR_UINT16_MAX UINT16_MAX #else #define APR_UINT16_MAX (0xffff) #endif #ifdef INT32_MIN #define APR_INT32_MIN INT32_MIN #else #define APR_INT32_MIN (-0x7fffffff - 1) #endif #ifdef INT32_MAX #define APR_INT32_MAX INT32_MAX #else #define APR_INT32_MAX 0x7fffffff #endif #ifdef UINT32_MAX #define APR_UINT32_MAX UINT32_MAX #else #define APR_UINT32_MAX (0xffffffffU) #endif #ifdef INT64_MIN #define APR_INT64_MIN INT64_MIN #else #define APR_INT64_MIN (APR_INT64_C(-0x7fffffffffffffff) - 1) #endif #ifdef INT64_MAX #define APR_INT64_MAX INT64_MAX #else #define APR_INT64_MAX APR_INT64_C(0x7fffffffffffffff) #endif #ifdef UINT64_MAX #define APR_UINT64_MAX UINT64_MAX #else #define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff) #endif #define APR_SIZE_MAX (~((apr_size_t)0)) /* Definitions that APR programs need to work properly. */ /** * APR public API wrap for C++ compilers. */ #ifdef __cplusplus #define APR_BEGIN_DECLS extern "C" { #define APR_END_DECLS } #else #define APR_BEGIN_DECLS #define APR_END_DECLS #endif /** * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, * so that they follow the platform's calling convention. *
 *
 * void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
 *
 * 
*/ #define APR_THREAD_FUNC __stdcall #if defined(DOXYGEN) || !defined(WIN32) /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APR_DECLARE_NONSTD(). * * @remark Both the declaration and implementations must use the same macro. * *
 * APR_DECLARE(rettype) apr_func(args)
 * 
* @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA * @remark Note that when APR compiles the library itself, it passes the * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) * to export public symbols from the dynamic library build.\n * The user must define the APR_DECLARE_STATIC when compiling to target * the static APR library on some platforms (e.g. Win32.) The public symbols * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n * By default, compiling an application and including the APR public * headers, without defining APR_DECLARE_STATIC, will prepare the code to be * linked to the dynamic library. */ #define APR_DECLARE(type) type /** * The public APR functions using variable arguments are declared with * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. * @see APR_DECLARE @see APR_DECLARE_DATA * @remark Both the declaration and implementations must use the same macro. *
 *
 * APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
 *
 * 
*/ #define APR_DECLARE_NONSTD(type) type /** * The public APR variables are declared with AP_MODULE_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * @see APR_DECLARE @see APR_DECLARE_NONSTD * @remark Note that the declaration and implementations use different forms, * but both must include the macro. * *
 *
 * extern APR_DECLARE_DATA type apr_variable;\n
 * APR_DECLARE_DATA type apr_variable = value;
 *
 * 
*/ #define APR_DECLARE_DATA #elif defined(APR_DECLARE_STATIC) #define APR_DECLARE(type) type __stdcall #define APR_DECLARE_NONSTD(type) type __cdecl #define APR_DECLARE_DATA #elif defined(APR_DECLARE_EXPORT) #define APR_DECLARE(type) __declspec(dllexport) type __stdcall #define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl #define APR_DECLARE_DATA __declspec(dllexport) #else #define APR_DECLARE(type) __declspec(dllimport) type __stdcall #define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl #define APR_DECLARE_DATA __declspec(dllimport) #endif #ifdef _WIN64 #define APR_SSIZE_T_FMT "I64d" #define APR_SIZE_T_FMT "I64u" #else #define APR_SSIZE_T_FMT "d" #define APR_SIZE_T_FMT "u" #endif #if APR_HAS_LARGE_FILES #define APR_OFF_T_FMT "I64d" #else #define APR_OFF_T_FMT "d" #endif #define APR_PID_T_FMT "d" #define APR_INT64_T_FMT "I64d" #define APR_UINT64_T_FMT "I64u" #define APR_UINT64_T_HEX_FMT "I64x" /* No difference between PROC and GLOBAL mutex */ #define APR_PROC_MUTEX_IS_GLOBAL 1 /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" typedef int apr_wait_t; #if APR_HAS_UNICODE_FS /* An arbitrary size that is digestable. True max is a bit less than 32000 */ #define APR_PATH_MAX 8192 #else /* !APR_HAS_UNICODE_FS */ #define APR_PATH_MAX MAX_PATH #endif #define APR_DSOPATH "PATH" /** @} */ /* Definitions that only Win32 programs need to compile properly. */ /* XXX These simply don't belong here, perhaps in apr_portable.h * based on some APR_HAVE_PID/GID/UID? */ #ifndef __GNUC__ typedef int pid_t; #endif typedef int uid_t; typedef int gid_t; /* Win32 .h ommissions we really need */ #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 #if APR_HAVE_IPV6 /* Appears in later flavors, not the originals. */ #ifndef in_addr6 #define in6_addr in_addr6 #endif #ifndef WS2TCPIP_INLINE #define IN6_IS_ADDR_V4MAPPED(a) \ ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif #endif /* APR_HAS_IPV6 */ #ifdef __cplusplus } #endif /* Done with badly written headers */ #if defined(_MSC_VER) && _MSC_VER >= 1200 #pragma warning(pop) #pragma warning(disable: 4996) #endif #endif /* WIN32 */ #endif /* APR_H */ ================================================ FILE: third_party/include/apr/apr.h.in ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_H #define APR_H /* GENERATED FILE WARNING! DO NOT EDIT apr.h * * You must modify apr.h.in instead. * * And please, make an effort to stub apr.hw and apr.hnw in the process. */ /** * @file apr.h * @brief APR Platform Definitions * @remark This is a generated header generated from include/apr.h.in by * ./configure, or copied from include/apr.hw or include/apr.hnw * for Win32 or Netware by those build environments, respectively. */ /** * @defgroup APR Apache Portability Runtime library * @{ */ /** * @defgroup apr_platform Platform Definitions * @{ * @warning * The actual values of macros and typedefs on this page
* are platform specific and should NOT be relied upon!
*/ /* So that we can use inline on some critical functions, and use * GNUC attributes (such as to get -Wall warnings for printf-like * functions). Only do this in gcc 2.7 or later ... it may work * on earlier stuff, but why chance it. * * We've since discovered that the gcc shipped with NeXT systems * as "cc" is completely broken. It claims to be __GNUC__ and so * on, but it doesn't implement half of the things that __GNUC__ * means. In particular it's missing inline and the __attribute__ * stuff. So we hack around it. PR#1613. -djg */ #if !defined(__GNUC__) || __GNUC__ < 2 || \ (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\ defined(NEXT) #ifndef __attribute__ #define __attribute__(__x) #endif #define APR_INLINE #define APR_HAS_INLINE 0 #else #define APR_INLINE __inline__ #define APR_HAS_INLINE 1 #endif #define APR_HAVE_ARPA_INET_H @arpa_ineth@ #define APR_HAVE_CONIO_H @conioh@ #define APR_HAVE_CRYPT_H @crypth@ #define APR_HAVE_CTYPE_H @ctypeh@ #define APR_HAVE_DIRENT_H @direnth@ #define APR_HAVE_ERRNO_H @errnoh@ #define APR_HAVE_FCNTL_H @fcntlh@ #define APR_HAVE_IO_H @ioh@ #define APR_HAVE_LIMITS_H @limitsh@ #define APR_HAVE_NETDB_H @netdbh@ #define APR_HAVE_NETINET_IN_H @netinet_inh@ #define APR_HAVE_NETINET_SCTP_H @netinet_sctph@ #define APR_HAVE_NETINET_SCTP_UIO_H @netinet_sctp_uioh@ #define APR_HAVE_NETINET_TCP_H @netinet_tcph@ #define APR_HAVE_PROCESS_H @processh@ #define APR_HAVE_PTHREAD_H @pthreadh@ #define APR_HAVE_SEMAPHORE_H @semaphoreh@ #define APR_HAVE_SIGNAL_H @signalh@ #define APR_HAVE_STDARG_H @stdargh@ #define APR_HAVE_STDINT_H @stdint@ #define APR_HAVE_STDIO_H @stdioh@ #define APR_HAVE_STDLIB_H @stdlibh@ #define APR_HAVE_STRING_H @stringh@ #define APR_HAVE_STRINGS_H @stringsh@ #define APR_HAVE_SYS_IOCTL_H @sys_ioctlh@ #define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@ #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@ #define APR_HAVE_SYS_SOCKET_H @sys_socketh@ #define APR_HAVE_SYS_SOCKIO_H @sys_sockioh@ #define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@ #define APR_HAVE_SYS_TIME_H @sys_timeh@ #define APR_HAVE_SYS_TYPES_H @sys_typesh@ #define APR_HAVE_SYS_UIO_H @sys_uioh@ #define APR_HAVE_SYS_UN_H @sys_unh@ #define APR_HAVE_SYS_WAIT_H @sys_waith@ #define APR_HAVE_TIME_H @timeh@ #define APR_HAVE_UNISTD_H @unistdh@ #define APR_HAVE_WINDOWS_H @windowsh@ #define APR_HAVE_WINSOCK2_H @winsock2h@ /** @} */ /** @} */ /* We don't include our conditional headers within the doxyblocks * or the extern "C" namespace */ #if APR_HAVE_WINDOWS_H && defined(WIN32) /* If windows.h was already included, our preferences don't matter. * If not, include a restricted set of windows headers to our tastes. */ #ifndef _WINDOWS_ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifndef _WIN32_WINNT /* Restrict the server to a subset of Windows XP header files by default */ #define _WIN32_WINNT 0x0501 #endif #ifndef NOUSER #define NOUSER #endif #ifndef NOMCX #define NOMCX #endif #ifndef NOIME #define NOIME #endif #include /* * Add a _very_few_ declarations missing from the restricted set of headers * (If this list becomes extensive, re-enable the required headers above!) * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now */ #define SW_HIDE 0 #ifndef _WIN32_WCE #include #include #include #else #include #endif #endif /* ndef _WINDOWS_ */ #endif /* APR_HAVE_WINDOWS_H */ #if APR_HAVE_SYS_TYPES_H #include #endif #if APR_HAVE_SYS_SOCKET_H #include #endif #if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS) /* C99 7.18.4 requires that stdint.h only exposes INT64_C * and UINT64_C for C++ implementations if this is defined: */ #define __STDC_CONSTANT_MACROS #endif #if APR_HAVE_STDINT_H #include #endif #if APR_HAVE_SYS_WAIT_H #include #endif #ifdef OS2 #define INCL_DOS #define INCL_DOSERRORS #include #endif /* header files for PATH_MAX, _POSIX_PATH_MAX */ #if APR_HAVE_LIMITS_H #include #else #if APR_HAVE_SYS_SYSLIMITS_H #include #endif #endif #ifdef __cplusplus extern "C" { #endif /** * @addtogroup apr_platform * @ingroup APR * @{ */ #define APR_HAVE_SHMEM_MMAP_TMP @havemmaptmp@ #define APR_HAVE_SHMEM_MMAP_SHM @havemmapshm@ #define APR_HAVE_SHMEM_MMAP_ZERO @havemmapzero@ #define APR_HAVE_SHMEM_SHMGET_ANON @haveshmgetanon@ #define APR_HAVE_SHMEM_SHMGET @haveshmget@ #define APR_HAVE_SHMEM_MMAP_ANON @havemmapanon@ #define APR_HAVE_SHMEM_BEOS @havebeosarea@ #define APR_USE_SHMEM_MMAP_TMP @usemmaptmp@ #define APR_USE_SHMEM_MMAP_SHM @usemmapshm@ #define APR_USE_SHMEM_MMAP_ZERO @usemmapzero@ #define APR_USE_SHMEM_SHMGET_ANON @useshmgetanon@ #define APR_USE_SHMEM_SHMGET @useshmget@ #define APR_USE_SHMEM_MMAP_ANON @usemmapanon@ #define APR_USE_SHMEM_BEOS @usebeosarea@ #define APR_USE_FLOCK_SERIALIZE @flockser@ #define APR_USE_SYSVSEM_SERIALIZE @sysvser@ #define APR_USE_POSIXSEM_SERIALIZE @posixser@ #define APR_USE_FCNTL_SERIALIZE @fcntlser@ #define APR_USE_PROC_PTHREAD_SERIALIZE @procpthreadser@ #define APR_USE_PTHREAD_SERIALIZE @pthreadser@ #define APR_HAS_FLOCK_SERIALIZE @hasflockser@ #define APR_HAS_SYSVSEM_SERIALIZE @hassysvser@ #define APR_HAS_POSIXSEM_SERIALIZE @hasposixser@ #define APR_HAS_FCNTL_SERIALIZE @hasfcntlser@ #define APR_HAS_PROC_PTHREAD_SERIALIZE @hasprocpthreadser@ #define APR_PROCESS_LOCK_IS_GLOBAL @proclockglobal@ #define APR_HAVE_CORKABLE_TCP @have_corkable_tcp@ #define APR_HAVE_GETRLIMIT @have_getrlimit@ #define APR_HAVE_IN_ADDR @have_in_addr@ #define APR_HAVE_INET_ADDR @have_inet_addr@ #define APR_HAVE_INET_NETWORK @have_inet_network@ #define APR_HAVE_IPV6 @have_ipv6@ #define APR_HAVE_MEMMOVE @have_memmove@ #define APR_HAVE_SETRLIMIT @have_setrlimit@ #define APR_HAVE_SIGACTION @have_sigaction@ #define APR_HAVE_SIGSUSPEND @have_sigsuspend@ #define APR_HAVE_SIGWAIT @have_sigwait@ #define APR_HAVE_SA_STORAGE @have_sa_storage@ #define APR_HAVE_STRCASECMP @have_strcasecmp@ #define APR_HAVE_STRDUP @have_strdup@ #define APR_HAVE_STRICMP @have_stricmp@ #define APR_HAVE_STRNCASECMP @have_strncasecmp@ #define APR_HAVE_STRNICMP @have_strnicmp@ #define APR_HAVE_STRSTR @have_strstr@ #define APR_HAVE_MEMCHR @have_memchr@ #define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@ #define APR_HAVE_UNION_SEMUN @have_union_semun@ #define APR_HAVE_SCTP @have_sctp@ #define APR_HAVE_IOVEC @have_iovec@ /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY @sharedmem@ #define APR_HAS_THREADS @threads@ #define APR_HAS_SENDFILE @sendfile@ #define APR_HAS_MMAP @mmap@ #define APR_HAS_FORK @fork@ #define APR_HAS_RANDOM @rand@ #define APR_HAS_OTHER_CHILD @oc@ #define APR_HAS_DSO @aprdso@ #define APR_HAS_SO_ACCEPTFILTER @acceptfilter@ #define APR_HAS_UNICODE_FS @have_unicode_fs@ #define APR_HAS_PROC_INVOKED @have_proc_invoked@ #define APR_HAS_USER @apr_has_user@ #define APR_HAS_LARGE_FILES @aprlfs@ #define APR_HAS_XTHREAD_FILES @apr_has_xthread_files@ #define APR_HAS_OS_UUID @osuuid@ #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD @apr_procattr_user_set_requires_password@ /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible * to poll on files/pipes. */ #define APR_FILES_AS_SOCKETS @file_as_socket@ /* This macro indicates whether or not EBCDIC is the native character set. */ #define APR_CHARSET_EBCDIC @apr_charset_ebcdic@ /* If we have a TCP implementation that can be "corked", what flag * do we use? */ #define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ /* Is the TCP_NODELAY socket option inherited from listening sockets? */ #define APR_TCP_NODELAY_INHERITED @tcp_nodelay_inherited@ /* Is the O_NONBLOCK flag inherited from listening sockets? */ #define APR_O_NONBLOCK_INHERITED @o_nonblock_inherited@ /* Typedefs that APR needs. */ typedef unsigned char apr_byte_t; typedef @short_value@ apr_int16_t; typedef unsigned @short_value@ apr_uint16_t; typedef @int_value@ apr_int32_t; typedef unsigned @int_value@ apr_uint32_t; #define APR_SIZEOF_VOIDP @voidp_size@ /* * Darwin 10's default compiler (gcc42) builds for both 64 and * 32 bit architectures unless specifically told not to. * In those cases, we need to override types depending on how * we're being built at compile time. * NOTE: This is an ugly work-around for Darwin's * concept of universal binaries, a single package * (executable, lib, etc...) which contains both 32 * and 64 bit versions. The issue is that if APR is * built universally, if something else is compiled * against it, some bit sizes will depend on whether * it is 32 or 64 bit. This is determined by the __LP64__ * flag. Since we need to support both, we have to * handle OS X unqiuely. */ #ifdef DARWIN_10 #undef APR_SIZEOF_VOIDP #undef INT64_C #undef UINT64_C #ifdef __LP64__ typedef long apr_int64_t; typedef unsigned long apr_uint64_t; #define APR_SIZEOF_VOIDP 8 #define INT64_C(v) (v ## L) #define UINT64_C(v) (v ## UL) #else typedef long long apr_int64_t; typedef unsigned long long apr_uint64_t; #define APR_SIZEOF_VOIDP 4 #define INT64_C(v) (v ## LL) #define UINT64_C(v) (v ## ULL) #endif #else typedef @long_value@ apr_int64_t; typedef unsigned @long_value@ apr_uint64_t; #endif typedef @size_t_value@ apr_size_t; typedef @ssize_t_value@ apr_ssize_t; typedef @off_t_value@ apr_off_t; typedef @socklen_t_value@ apr_socklen_t; typedef @ino_t_value@ apr_ino_t; #if APR_SIZEOF_VOIDP == 8 typedef apr_uint64_t apr_uintptr_t; #else typedef apr_uint32_t apr_uintptr_t; #endif /* Are we big endian? */ #define APR_IS_BIGENDIAN @bigendian@ /* Mechanisms to properly type numeric literals */ @int64_literal@ @uint64_literal@ #ifdef INT16_MIN #define APR_INT16_MIN INT16_MIN #else #define APR_INT16_MIN (-0x7fff - 1) #endif #ifdef INT16_MAX #define APR_INT16_MAX INT16_MAX #else #define APR_INT16_MAX (0x7fff) #endif #ifdef UINT16_MAX #define APR_UINT16_MAX UINT16_MAX #else #define APR_UINT16_MAX (0xffff) #endif #ifdef INT32_MIN #define APR_INT32_MIN INT32_MIN #else #define APR_INT32_MIN (-0x7fffffff - 1) #endif #ifdef INT32_MAX #define APR_INT32_MAX INT32_MAX #else #define APR_INT32_MAX 0x7fffffff #endif #ifdef UINT32_MAX #define APR_UINT32_MAX UINT32_MAX #else #define APR_UINT32_MAX (0xffffffffU) #endif #ifdef INT64_MIN #define APR_INT64_MIN INT64_MIN #else #define APR_INT64_MIN (APR_INT64_C(-0x7fffffffffffffff) - 1) #endif #ifdef INT64_MAX #define APR_INT64_MAX INT64_MAX #else #define APR_INT64_MAX APR_INT64_C(0x7fffffffffffffff) #endif #ifdef UINT64_MAX #define APR_UINT64_MAX UINT64_MAX #else #define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff) #endif #define APR_SIZE_MAX (~((apr_size_t)0)) /* Definitions that APR programs need to work properly. */ /** * APR public API wrap for C++ compilers. */ #ifdef __cplusplus #define APR_BEGIN_DECLS extern "C" { #define APR_END_DECLS } #else #define APR_BEGIN_DECLS #define APR_END_DECLS #endif /** * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, * so that they follow the platform's calling convention. *
 *
 * void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
 *
 * 
*/ #define APR_THREAD_FUNC @apr_thread_func@ #if defined(DOXYGEN) || !defined(WIN32) /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APR_DECLARE_NONSTD(). * * @remark Both the declaration and implementations must use the same macro. * *
 * APR_DECLARE(rettype) apr_func(args)
 * 
* @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA * @remark Note that when APR compiles the library itself, it passes the * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) * to export public symbols from the dynamic library build.\n * The user must define the APR_DECLARE_STATIC when compiling to target * the static APR library on some platforms (e.g. Win32.) The public symbols * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n * By default, compiling an application and including the APR public * headers, without defining APR_DECLARE_STATIC, will prepare the code to be * linked to the dynamic library. */ #define APR_DECLARE(type) type /** * The public APR functions using variable arguments are declared with * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. * @see APR_DECLARE @see APR_DECLARE_DATA * @remark Both the declaration and implementations must use the same macro. *
 *
 * APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
 *
 * 
*/ #define APR_DECLARE_NONSTD(type) type /** * The public APR variables are declared with AP_MODULE_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * @see APR_DECLARE @see APR_DECLARE_NONSTD * @remark Note that the declaration and implementations use different forms, * but both must include the macro. * *
 *
 * extern APR_DECLARE_DATA type apr_variable;\n
 * APR_DECLARE_DATA type apr_variable = value;
 *
 * 
*/ #define APR_DECLARE_DATA #elif defined(APR_DECLARE_STATIC) #define APR_DECLARE(type) type __stdcall #define APR_DECLARE_NONSTD(type) type __cdecl #define APR_DECLARE_DATA #elif defined(APR_DECLARE_EXPORT) #define APR_DECLARE(type) __declspec(dllexport) type __stdcall #define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl #define APR_DECLARE_DATA __declspec(dllexport) #else #define APR_DECLARE(type) __declspec(dllimport) type __stdcall #define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl #define APR_DECLARE_DATA __declspec(dllimport) #endif /* Define APR_SSIZE_T_FMT. * If ssize_t is an integer we define it to be "d", * if ssize_t is a long int we define it to be "ld", * if ssize_t is neither we declare an error here. * I looked for a better way to define this here, but couldn't find one, so * to find the logic for this definition search for "ssize_t_fmt" in * configure.in. */ @ssize_t_fmt@ /* And APR_SIZE_T_FMT */ @size_t_fmt@ /* And APR_OFF_T_FMT */ @off_t_fmt@ /* And APR_PID_T_FMT */ @pid_t_fmt@ /* And APR_INT64_T_FMT */ @int64_t_fmt@ /* And APR_UINT64_T_FMT */ @uint64_t_fmt@ /* And APR_UINT64_T_HEX_FMT */ @uint64_t_hex_fmt@ /* * Ensure we work with universal binaries on Darwin */ #ifdef DARWIN_10 #undef APR_HAS_LARGE_FILES #undef APR_SIZEOF_VOIDP #undef APR_INT64_T_FMT #undef APR_UINT64_T_FMT #undef APR_UINT64_T_HEX_FMT #ifdef __LP64__ #define APR_HAS_LARGE_FILES 0 #define APR_SIZEOF_VOIDP 8 #define APR_INT64_T_FMT "ld" #define APR_UINT64_T_FMT "lu" #define APR_UINT64_T_HEX_FMT "lx" #else #define APR_HAS_LARGE_FILES 1 #define APR_SIZEOF_VOIDP 4 #define APR_INT64_T_FMT "lld" #define APR_UINT64_T_FMT "llu" #define APR_UINT64_T_HEX_FMT "llx" #endif #undef APR_IS_BIGENDIAN #ifdef __BIG_ENDIAN__ #define APR_IS_BIGENDIAN 1 #else #define APR_IS_BIGENDIAN 0 #endif #undef APR_OFF_T_FMT #define APR_OFF_T_FMT "lld" #endif /* DARWIN_10 */ /* Does the proc mutex lock threads too */ #define APR_PROC_MUTEX_IS_GLOBAL @proc_mutex_is_global@ /* Local machine definition for console and log output. */ #define APR_EOL_STR "@eolstr@" #if APR_HAVE_SYS_WAIT_H #ifdef WEXITSTATUS #define apr_wait_t int #else #define apr_wait_t union wait #define WEXITSTATUS(status) (int)((status).w_retcode) #define WTERMSIG(status) (int)((status).w_termsig) #endif /* !WEXITSTATUS */ #elif defined(__MINGW32__) typedef int apr_wait_t; #endif /* HAVE_SYS_WAIT_H */ #if defined(PATH_MAX) #define APR_PATH_MAX PATH_MAX #elif defined(_POSIX_PATH_MAX) #define APR_PATH_MAX _POSIX_PATH_MAX #else #error no decision has been made on APR_PATH_MAX for your platform #endif #define APR_DSOPATH "@shlibpath_var@" /** @} */ /* Definitions that only Win32 programs need to compile properly. */ /* XXX These simply don't belong here, perhaps in apr_portable.h * based on some APR_HAVE_PID/GID/UID? */ #ifdef __MINGW32__ #ifndef __GNUC__ typedef int pid_t; #endif typedef int uid_t; typedef int gid_t; #endif #ifdef __cplusplus } #endif #endif /* APR_H */ ================================================ FILE: third_party/include/apr/apr.hnw ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_H #define APR_H /* GENERATED FILE WARNING! DO NOT EDIT apr.h * * You must modify apr.hnw instead. * * And please, make an effort to stub apr.hw and apr.h.in in the process. * * This is the NetWare specific version of apr.h. It is copied from * apr.hnw at the start of a NetWare build by the ./build/NWGNmakefile. */ /** * @file apr.h * @brief APR Platform Definitions * @remark This is a generated header generated from include/apr.h.in by * ./configure, or copied from include/apr.hw or include/apr.hnw * for Win32 or Netware by those build environments, respectively. */ #if defined(NETWARE) || defined(DOXYGEN) #undef FD_SETSIZE #define FD_SETSIZE 1024 #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_WINSOCK #include #ifdef NW_BUILD_IPV6 #include #endif #else #include #include #endif #include #define _POSIX_THREAD_SAFE_FUNCTIONS 1 #define READDIR_IS_THREAD_SAFE 1 /* Keep #include'd headers from within the __cplusplus or doxyblocks */ #ifdef __cplusplus extern "C" { #endif /** * @defgroup apr_platform Platform Definitions * @ingroup APR * @{ */ #define APR_INLINE #define APR_HAS_INLINE 0 #ifndef __attribute__ #define __attribute__(__x) #endif #define ENUM_BITFIELD(e,n,w) signed int n : w #define APR_HAVE_CONIO_H 0 #define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 1 #define APR_HAVE_DIRENT_H 1 #define APR_HAVE_ERRNO_H 1 #define APR_HAVE_FCNTL_H 1 #define APR_HAVE_IO_H 0 #define APR_HAVE_LIMITS_H 1 #ifdef USE_WINSOCK #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #else #define APR_HAVE_ARPA_INET_H 1 #define APR_HAVE_NETDB_H 1 #define APR_HAVE_NETINET_IN_H 1 #endif #define APR_HAVE_NETINET_SCTP_H 0 #define APR_HAVE_NETINET_SCTP_UIO_H 0 #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SIGNAL_H 1 #define APR_HAVE_STDARG_H 1 #define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 #define APR_HAVE_STRTOLL 1 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #ifdef USE_WINSOCK #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_UN_H 0 #else #define APR_HAVE_SYS_SOCKET_H 1 #define APR_HAVE_SYS_SOCKIO_H 1 #define APR_HAVE_SYS_UN_H 1 #endif #define APR_HAVE_SYS_SIGNAL_H 1 #define APR_HAVE_SYS_TIME_H 1 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 1 #define APR_HAVE_SYS_WAIT_H 1 #define APR_HAVE_TIME_H 1 #define APR_HAVE_UNISTD_H 1 #define APR_HAVE_SHMEM_MMAP_TMP 0 #define APR_HAVE_SHMEM_MMAP_SHM 0 #define APR_HAVE_SHMEM_MMAP_ZERO 0 #define APR_HAVE_SHMEM_SHMGET_ANON 0 #define APR_HAVE_SHMEM_SHMGET 0 #define APR_HAVE_SHMEM_MMAP_ANON 0 #define APR_HAVE_SHMEM_BEOS 0 #define APR_USE_SHMEM_MMAP_TMP 0 #define APR_USE_SHMEM_MMAP_SHM 0 #define APR_USE_SHMEM_MMAP_ZERO 0 #define APR_USE_SHMEM_SHMGET_ANON 0 #define APR_USE_SHMEM_SHMGET 0 #define APR_USE_SHMEM_MMAP_ANON 0 #define APR_USE_SHMEM_BEOS 0 #define APR_USE_FLOCK_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 #define APR_USE_FCNTL_SERIALIZE 0 #define APR_USE_PROC_PTHREAD_SERIALIZE 0 #define APR_USE_PTHREAD_SERIALIZE 0 #define APR_HAS_FLOCK_SERIALIZE 0 #define APR_HAS_SYSVSEM_SERIALIZE 0 #define APR_HAS_FCNTL_SERIALIZE 0 #define APR_HAS_PROC_PTHREAD_SERIALIZE 0 #define APR_HAS_RWLOCK_SERIALIZE 0 #define APR_HAS_LOCK_CREATE_NP 0 #define APR_PROCESS_LOCK_IS_GLOBAL 1 #define APR_FILE_BASED_SHM 0 #define APR_HAVE_CORKABLE_TCP 0 #define APR_HAVE_GETRLIMIT 0 #define APR_HAVE_ICONV 0 #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 #ifdef NW_BUILD_IPV6 #define APR_HAVE_IPV6 1 #else #define APR_HAVE_IPV6 0 #endif #define APR_HAVE_MEMCHR 1 #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 #define APR_HAVE_SIGSUSPEND 0 #define APR_HAVE_SIGWAIT 0 #define APR_HAVE_STRCASECMP 1 #define APR_HAVE_STRDUP 1 #define APR_HAVE_STRICMP 1 #define APR_HAVE_STRNCASECMP 1 #define APR_HAVE_STRNICMP 1 #define APR_HAVE_STRSTR 1 #define APR_HAVE_STRUCT_RLIMIT 0 #define APR_HAVE_UNION_SEMUN 0 #define APR_HAVE_SCTP 0 #define APR_HAVE_IOVEC 1 /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 0 #define APR_HAS_THREADS 1 #define APR_HAS_SENDFILE 0 #define APR_HAS_MMAP 0 #define APR_HAS_FORK 0 #define APR_HAS_RANDOM 1 #define APR_HAS_OTHER_CHILD 0 #define APR_HAS_DSO 1 #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 0 #define APR_HAS_PROC_INVOKED 0 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 1 #define APR_HAS_XTHREAD_FILES 0 #define APR_HAS_OS_UUID 0 #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 /* Netware can poll on files/pipes. */ #define APR_FILES_AS_SOCKETS 1 /* This macro indicates whether or not EBCDIC is the native character set. */ #define APR_CHARSET_EBCDIC 0 /* Is the TCP_NODELAY socket option inherited from listening sockets? */ #define APR_TCP_NODELAY_INHERITED 1 /* Is the O_NONBLOCK flag inherited from listening sockets? */ #define APR_O_NONBLOCK_INHERITED 1 /* Typedefs that APR needs. */ typedef unsigned char apr_byte_t; typedef short apr_int16_t; typedef unsigned short apr_uint16_t; typedef int apr_int32_t; typedef unsigned int apr_uint32_t; typedef long long apr_int64_t; typedef unsigned long long apr_uint64_t; typedef size_t apr_size_t; typedef ssize_t apr_ssize_t; #if APR_HAS_LARGE_FILES typedef off64_t apr_off_t; #else typedef off_t apr_off_t; #endif #ifdef USE_WINSOCK typedef int apr_socklen_t; #else typedef size_t apr_socklen_t; #endif typedef apr_uint64_t apr_ino_t; /* Are we big endian? */ /* XXX: Fatal assumption on Alpha platforms */ #define APR_IS_BIGENDIAN 0 #ifdef UNKNOWN_NETWARE_64BIT_FLAG_NEEDED #define APR_SIZEOF_VOIDP 8 #else #define APR_SIZEOF_VOIDP 4 #endif #if APR_SIZEOF_VOIDP == 8 typedef apr_uint64_t apr_uintptr_t; #else typedef apr_uint32_t apr_uintptr_t; #endif /* Mechanisms to properly type numeric literals */ #define APR_INT64_C(val) (val##LL) #define APR_UINT64_C(val) (val##ULL) #ifdef INT16_MIN #define APR_INT16_MIN INT16_MIN #else #define APR_INT16_MIN (-0x7fff - 1) #endif #ifdef INT16_MAX #define APR_INT16_MAX INT16_MAX #else #define APR_INT16_MAX (0x7fff) #endif #ifdef UINT16_MAX #define APR_UINT16_MAX UINT16_MAX #else #define APR_UINT16_MAX (0xffff) #endif #ifdef INT32_MIN #define APR_INT32_MIN INT32_MIN #else #define APR_INT32_MIN (-0x7fffffff - 1) #endif #ifdef INT32_MAX #define APR_INT32_MAX INT32_MAX #else #define APR_INT32_MAX 0x7fffffff #endif #ifdef UINT32_MAX #define APR_UINT32_MAX UINT32_MAX #else #define APR_UINT32_MAX (0xffffffffU) #endif #ifdef INT64_MIN #define APR_INT64_MIN INT64_MIN #else #define APR_INT64_MIN (APR_INT64_C(-0x7fffffffffffffff) - 1) #endif #ifdef INT64_MAX #define APR_INT64_MAX INT64_MAX #else #define APR_INT64_MAX APR_INT64_C(0x7fffffffffffffff) #endif #ifdef UINT64_MAX #define APR_UINT64_MAX UINT64_MAX #else #define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff) #endif #define APR_SIZE_MAX (~((apr_size_t)0)) /* PROC mutex is a GLOBAL mutex on Netware */ #define APR_PROC_MUTEX_IS_GLOBAL 1 /* Definitions that APR programs need to work properly. */ /** * APR public API wrap for C++ compilers. */ #ifdef __cplusplus #define APR_BEGIN_DECLS extern "C" { #define APR_END_DECLS } #else #define APR_BEGIN_DECLS #define APR_END_DECLS #endif /** * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, * so that they follow the platform's calling convention. * @example */ /** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data); */ #define APR_THREAD_FUNC /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APR_DECLARE_NONSTD(). * * @remark Both the declaration and implementations must use the same macro. * @example */ /** APR_DECLARE(rettype) apr_func(args) * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA * @remark Note that when APR compiles the library itself, it passes the * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) * to export public symbols from the dynamic library build.\n * The user must define the APR_DECLARE_STATIC when compiling to target * the static APR library on some platforms (e.g. Win32.) The public symbols * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n * By default, compiling an application and including the APR public * headers, without defining APR_DECLARE_STATIC, will prepare the code to be * linked to the dynamic library. */ #define APR_DECLARE(type) type /** * The public APR functions using variable arguments are declared with * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. * @see APR_DECLARE @see APR_DECLARE_DATA * @remark Both the declaration and implementations must use the same macro. * @example */ /** APR_DECLARE_NONSTD(rettype) apr_func(args, ...); */ #define APR_DECLARE_NONSTD(type) type /** * The public APR variables are declared with APR_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * @see APR_DECLARE @see APR_DECLARE_NONSTD * @remark Note that the declaration and implementations use different forms, * but both must include the macro. * @example */ /** extern APR_DECLARE_DATA type apr_variable;\n * APR_DECLARE_DATA type apr_variable = value; */ #define APR_DECLARE_DATA #define APR_SSIZE_T_FMT "d" #define APR_SIZE_T_FMT "d" #if APR_HAS_LARGE_FILES #define APR_OFF_T_FMT "lld" #else #define APR_OFF_T_FMT "ld" #endif #define APR_PID_T_FMT "d" /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" typedef int apr_wait_t; #define APR_PATH_MAX PATH_MAX #define APR_DSOPATH "PATH" #define APR_INT64_T_FMT "lld" #define APR_UINT64_T_FMT "llu" #define APR_UINT64_T_HEX_FMT "llx" #define APR_TIME_T_FMT APR_INT64_T_FMT /** @} */ #ifdef __cplusplus } #endif #endif /* NETWARE */ #endif /* APR_H */ ================================================ FILE: third_party/include/apr/apr.hw ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_H #define APR_H /* GENERATED FILE WARNING! DO NOT EDIT apr.h * * You must modify apr.hw instead. * * And please, make an effort to stub apr.hnw and apr.h.in in the process. * * This is the Win32 specific version of apr.h. It is copied from * apr.hw by the apr.dsp and libapr.dsp projects. */ /** * @file apr.h * @brief APR Platform Definitions * @remark This is a generated header generated from include/apr.h.in by * ./configure, or copied from include/apr.hw or include/apr.hnw * for Win32 or Netware by those build environments, respectively. */ /* Make sure we have our platform identifier macro defined we ask for later. */ #if defined(_WIN32) && !defined(WIN32) #define WIN32 1 #endif #if defined(WIN32) || defined(DOXYGEN) /* Ignore most warnings (back down to /W3) for poorly constructed headers */ #if defined(_MSC_VER) && _MSC_VER >= 1200 #pragma warning(push, 3) #endif /* disable or reduce the frequency of... * C4057: indirection to slightly different base types * C4075: slight indirection changes (unsigned short* vs short[]) * C4100: unreferenced formal parameter * C4127: conditional expression is constant * C4163: '_rotl64' : not available as an intrinsic function * C4201: nonstandard extension nameless struct/unions * C4244: int to char/short - precision loss * C4514: unreferenced inline function removed */ #pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244) /* Ignore Microsoft's interpretation of secure development * and the POSIX string handling API */ #if defined(_MSC_VER) && _MSC_VER >= 1400 #ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE #endif #pragma warning(disable: 4996) #endif /* Has windows.h already been included? If so, our preferences don't matter, * but we will still need the winsock things no matter what was included. * If not, include a restricted set of windows headers to our tastes. */ #ifndef _WINDOWS_ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifndef _WIN32_WINNT /* Restrict the server to a subset of Windows XP header files by default */ #define _WIN32_WINNT 0x0501 #endif #ifndef NOUSER #define NOUSER #endif #ifndef NOMCX #define NOMCX #endif #ifndef NOIME #define NOIME #endif #include /* * Add a _very_few_ declarations missing from the restricted set of headers * (If this list becomes extensive, re-enable the required headers above!) * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now */ #define SW_HIDE 0 #ifndef _WIN32_WCE #include #include #include #else #include #endif #endif /* !_WINDOWS_ */ /** * @defgroup APR Apache Portability Runtime library * @{ */ /** * @defgroup apr_platform Platform Definitions * @{ * @warning * The actual values of macros and typedefs on this page
* are platform specific and should NOT be relied upon!
*/ #define APR_INLINE __inline #define APR_HAS_INLINE 1 #if !defined(__GNUC__) && !defined(__attribute__) #define __attribute__(__x) #endif #ifndef _WIN32_WCE #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CONIO_H 1 #define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 1 #define APR_HAVE_DIRENT_H 0 #define APR_HAVE_ERRNO_H 1 #define APR_HAVE_FCNTL_H 1 #define APR_HAVE_IO_H 1 #define APR_HAVE_LIMITS_H 1 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_NETINET_SCTP_H 0 #define APR_HAVE_NETINET_SCTP_UIO_H 0 #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SEMAPHORE_H 0 #define APR_HAVE_SIGNAL_H 1 #define APR_HAVE_STDARG_H 1 #define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 #define APR_HAVE_SYS_IOCTL_H 0 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_SYS_UN_H 0 #define APR_HAVE_SYS_WAIT_H 0 #define APR_HAVE_TIME_H 1 #define APR_HAVE_UNISTD_H 0 #define APR_HAVE_STDDEF_H 1 #define APR_HAVE_PROCESS_H 1 #else #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CONIO_H 0 #define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 0 #define APR_HAVE_DIRENT_H 0 #define APR_HAVE_ERRNO_H 0 #define APR_HAVE_FCNTL_H 0 #define APR_HAVE_IO_H 0 #define APR_HAVE_LIMITS_H 0 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_NETINET_SCTP_H 0 #define APR_HAVE_NETINET_SCTP_UIO_H 0 #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SEMAPHORE_H 0 #define APR_HAVE_SIGNAL_H 0 #define APR_HAVE_STDARG_H 0 #define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 #define APR_HAVE_SYS_IOCTL_H 0 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 0 #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_SYS_UN_H 0 #define APR_HAVE_SYS_WAIT_H 0 #define APR_HAVE_TIME_H 0 #define APR_HAVE_UNISTD_H 0 #define APR_HAVE_STDDEF_H 0 #define APR_HAVE_PROCESS_H 0 #endif /** @} */ /** @} */ /* We don't include our conditional headers within the doxyblocks * or the extern "C" namespace */ #if APR_HAVE_STDLIB_H #include #endif #if APR_HAVE_STDIO_H #include #endif #if APR_HAVE_SYS_TYPES_H #include #endif #if APR_HAVE_STDDEF_H #include #endif #if APR_HAVE_TIME_H #include #endif #if APR_HAVE_PROCESS_H #include #endif #ifdef __cplusplus extern "C" { #endif /** * @addtogroup apr_platform * @ingroup APR * @{ */ #define APR_HAVE_SHMEM_MMAP_TMP 0 #define APR_HAVE_SHMEM_MMAP_SHM 0 #define APR_HAVE_SHMEM_MMAP_ZERO 0 #define APR_HAVE_SHMEM_SHMGET_ANON 0 #define APR_HAVE_SHMEM_SHMGET 0 #define APR_HAVE_SHMEM_MMAP_ANON 0 #define APR_HAVE_SHMEM_BEOS 0 #define APR_USE_SHMEM_MMAP_TMP 0 #define APR_USE_SHMEM_MMAP_SHM 0 #define APR_USE_SHMEM_MMAP_ZERO 0 #define APR_USE_SHMEM_SHMGET_ANON 0 #define APR_USE_SHMEM_SHMGET 0 #define APR_USE_SHMEM_MMAP_ANON 0 #define APR_USE_SHMEM_BEOS 0 #define APR_USE_FLOCK_SERIALIZE 0 #define APR_USE_POSIXSEM_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 #define APR_USE_FCNTL_SERIALIZE 0 #define APR_USE_PROC_PTHREAD_SERIALIZE 0 #define APR_USE_PTHREAD_SERIALIZE 0 #define APR_HAS_FLOCK_SERIALIZE 0 #define APR_HAS_SYSVSEM_SERIALIZE 0 #define APR_HAS_POSIXSEM_SERIALIZE 0 #define APR_HAS_FCNTL_SERIALIZE 0 #define APR_HAS_PROC_PTHREAD_SERIALIZE 0 #define APR_PROCESS_LOCK_IS_GLOBAL 0 #define APR_HAVE_CORKABLE_TCP 0 #define APR_HAVE_GETRLIMIT 0 #define APR_HAVE_ICONV 0 #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 #define APR_HAVE_IPV6 0 #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 #define APR_HAVE_SIGSUSPEND 0 #define APR_HAVE_SIGWAIT 0 #define APR_HAVE_SA_STORAGE 0 #define APR_HAVE_STRCASECMP 0 #define APR_HAVE_STRDUP 1 #define APR_HAVE_STRNCASECMP 0 #define APR_HAVE_STRSTR 1 #define APR_HAVE_MEMCHR 1 #define APR_HAVE_STRUCT_RLIMIT 0 #define APR_HAVE_UNION_SEMUN 0 #define APR_HAVE_SCTP 0 #define APR_HAVE_IOVEC 0 #ifndef _WIN32_WCE #define APR_HAVE_STRICMP 1 #define APR_HAVE_STRNICMP 1 #else #define APR_HAVE_STRICMP 0 #define APR_HAVE_STRNICMP 0 #endif /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 1 #define APR_HAS_THREADS 1 #define APR_HAS_MMAP 1 #define APR_HAS_FORK 0 #define APR_HAS_RANDOM 1 #define APR_HAS_OTHER_CHILD 1 #define APR_HAS_DSO 1 #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 1 #define APR_HAS_PROC_INVOKED 1 #define APR_HAS_OS_UUID 1 #ifndef _WIN32_WCE #define APR_HAS_SENDFILE 1 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 1 #define APR_HAS_XTHREAD_FILES 1 #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 1 #else #define APR_HAS_SENDFILE 0 #define APR_HAS_USER 0 #define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 #endif /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible * to poll on files/pipes. */ #define APR_FILES_AS_SOCKETS 0 /* This macro indicates whether or not EBCDIC is the native character set. */ #define APR_CHARSET_EBCDIC 0 /* If we have a TCP implementation that can be "corked", what flag * do we use? */ #define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ /* Is the TCP_NODELAY socket option inherited from listening sockets? */ #define APR_TCP_NODELAY_INHERITED 1 /* Is the O_NONBLOCK flag inherited from listening sockets? */ #define APR_O_NONBLOCK_INHERITED 1 /* Typedefs that APR needs. */ typedef unsigned char apr_byte_t; typedef short apr_int16_t; typedef unsigned short apr_uint16_t; typedef int apr_int32_t; typedef unsigned int apr_uint32_t; typedef __int64 apr_int64_t; typedef unsigned __int64 apr_uint64_t; typedef size_t apr_size_t; #if APR_HAVE_STDDEF_H typedef ptrdiff_t apr_ssize_t; #else typedef int apr_ssize_t; #endif #if APR_HAS_LARGE_FILES typedef __int64 apr_off_t; #else typedef int apr_off_t; #endif typedef int apr_socklen_t; typedef apr_uint64_t apr_ino_t; #ifdef _WIN64 #define APR_SIZEOF_VOIDP 8 #else #define APR_SIZEOF_VOIDP 4 #endif #if APR_SIZEOF_VOIDP == 8 typedef apr_uint64_t apr_uintptr_t; #else typedef apr_uint32_t apr_uintptr_t; #endif /* Are we big endian? */ /* XXX: Fatal assumption on Alpha platforms */ #define APR_IS_BIGENDIAN 0 /* Mechanisms to properly type numeric literals */ #ifndef __GNUC__ #define APR_INT64_C(val) (val##i64) #define APR_UINT64_C(val) (val##Ui64) #else #define APR_INT64_C(val) (val##LL) #define APR_UINT64_C(val) (val##ULL) #endif #ifdef INT16_MIN #define APR_INT16_MIN INT16_MIN #else #define APR_INT16_MIN (-0x7fff - 1) #endif #ifdef INT16_MAX #define APR_INT16_MAX INT16_MAX #else #define APR_INT16_MAX (0x7fff) #endif #ifdef UINT16_MAX #define APR_UINT16_MAX UINT16_MAX #else #define APR_UINT16_MAX (0xffff) #endif #ifdef INT32_MIN #define APR_INT32_MIN INT32_MIN #else #define APR_INT32_MIN (-0x7fffffff - 1) #endif #ifdef INT32_MAX #define APR_INT32_MAX INT32_MAX #else #define APR_INT32_MAX 0x7fffffff #endif #ifdef UINT32_MAX #define APR_UINT32_MAX UINT32_MAX #else #define APR_UINT32_MAX (0xffffffffU) #endif #ifdef INT64_MIN #define APR_INT64_MIN INT64_MIN #else #define APR_INT64_MIN (APR_INT64_C(-0x7fffffffffffffff) - 1) #endif #ifdef INT64_MAX #define APR_INT64_MAX INT64_MAX #else #define APR_INT64_MAX APR_INT64_C(0x7fffffffffffffff) #endif #ifdef UINT64_MAX #define APR_UINT64_MAX UINT64_MAX #else #define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff) #endif #define APR_SIZE_MAX (~((apr_size_t)0)) /* Definitions that APR programs need to work properly. */ /** * APR public API wrap for C++ compilers. */ #ifdef __cplusplus #define APR_BEGIN_DECLS extern "C" { #define APR_END_DECLS } #else #define APR_BEGIN_DECLS #define APR_END_DECLS #endif /** * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, * so that they follow the platform's calling convention. *
 *
 * void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
 *
 * 
*/ #define APR_THREAD_FUNC __stdcall #if defined(DOXYGEN) || !defined(WIN32) /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APR_DECLARE_NONSTD(). * * @remark Both the declaration and implementations must use the same macro. * *
 * APR_DECLARE(rettype) apr_func(args)
 * 
* @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA * @remark Note that when APR compiles the library itself, it passes the * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) * to export public symbols from the dynamic library build.\n * The user must define the APR_DECLARE_STATIC when compiling to target * the static APR library on some platforms (e.g. Win32.) The public symbols * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n * By default, compiling an application and including the APR public * headers, without defining APR_DECLARE_STATIC, will prepare the code to be * linked to the dynamic library. */ #define APR_DECLARE(type) type /** * The public APR functions using variable arguments are declared with * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. * @see APR_DECLARE @see APR_DECLARE_DATA * @remark Both the declaration and implementations must use the same macro. *
 *
 * APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
 *
 * 
*/ #define APR_DECLARE_NONSTD(type) type /** * The public APR variables are declared with AP_MODULE_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * @see APR_DECLARE @see APR_DECLARE_NONSTD * @remark Note that the declaration and implementations use different forms, * but both must include the macro. * *
 *
 * extern APR_DECLARE_DATA type apr_variable;\n
 * APR_DECLARE_DATA type apr_variable = value;
 *
 * 
*/ #define APR_DECLARE_DATA #elif defined(APR_DECLARE_STATIC) #define APR_DECLARE(type) type __stdcall #define APR_DECLARE_NONSTD(type) type __cdecl #define APR_DECLARE_DATA #elif defined(APR_DECLARE_EXPORT) #define APR_DECLARE(type) __declspec(dllexport) type __stdcall #define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl #define APR_DECLARE_DATA __declspec(dllexport) #else #define APR_DECLARE(type) __declspec(dllimport) type __stdcall #define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl #define APR_DECLARE_DATA __declspec(dllimport) #endif #ifdef _WIN64 #define APR_SSIZE_T_FMT "I64d" #define APR_SIZE_T_FMT "I64u" #else #define APR_SSIZE_T_FMT "d" #define APR_SIZE_T_FMT "u" #endif #if APR_HAS_LARGE_FILES #define APR_OFF_T_FMT "I64d" #else #define APR_OFF_T_FMT "d" #endif #define APR_PID_T_FMT "d" #define APR_INT64_T_FMT "I64d" #define APR_UINT64_T_FMT "I64u" #define APR_UINT64_T_HEX_FMT "I64x" /* No difference between PROC and GLOBAL mutex */ #define APR_PROC_MUTEX_IS_GLOBAL 1 /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" typedef int apr_wait_t; #if APR_HAS_UNICODE_FS /* An arbitrary size that is digestable. True max is a bit less than 32000 */ #define APR_PATH_MAX 8192 #else /* !APR_HAS_UNICODE_FS */ #define APR_PATH_MAX MAX_PATH #endif #define APR_DSOPATH "PATH" /** @} */ /* Definitions that only Win32 programs need to compile properly. */ /* XXX These simply don't belong here, perhaps in apr_portable.h * based on some APR_HAVE_PID/GID/UID? */ #ifndef __GNUC__ typedef int pid_t; #endif typedef int uid_t; typedef int gid_t; /* Win32 .h ommissions we really need */ #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 #if APR_HAVE_IPV6 /* Appears in later flavors, not the originals. */ #ifndef in_addr6 #define in6_addr in_addr6 #endif #ifndef WS2TCPIP_INLINE #define IN6_IS_ADDR_V4MAPPED(a) \ ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif #endif /* APR_HAS_IPV6 */ #ifdef __cplusplus } #endif /* Done with badly written headers */ #if defined(_MSC_VER) && _MSC_VER >= 1200 #pragma warning(pop) #pragma warning(disable: 4996) #endif #endif /* WIN32 */ #endif /* APR_H */ ================================================ FILE: third_party/include/apr/apr.hwc ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_H #define APR_H /* GENERATED FILE WARNING! DO NOT EDIT apr.h * * You must modify apr.hwc instead. * * And please, make an effort to stub apr.hnw and apr.h.in in the process. * * This is the Win32 specific version of apr.h. It is copied from * apr.hw by the apr.dsp and libapr.dsp projects. */ /** * @file apr.h * @brief APR Platform Definitions * @remark This is a generated header generated from include/apr.h.in by * ./configure, or copied from include/apr.hw or include/apr.hnw * for Win32 or Netware by those build environments, respectively. */ /* Make sure we have our platform identifier macro defined we ask for later. */ #if defined(_WIN32) && !defined(WIN32) #define WIN32 1 #endif #if defined(WIN32) || defined(DOXYGEN) /* Ignore most warnings (back down to /W3) for poorly constructed headers */ #if defined(_MSC_VER) && _MSC_VER >= 1200 #pragma warning(push, 3) #endif /* disable or reduce the frequency of... * C4057: indirection to slightly different base types * C4075: slight indirection changes (unsigned short* vs short[]) * C4100: unreferenced formal parameter * C4127: conditional expression is constant * C4163: '_rotl64' : not available as an intrinsic function * C4201: nonstandard extension nameless struct/unions * C4244: int to char/short - precision loss * C4514: unreferenced inline function removed */ #pragma warning(disable: 4100 4127 4163 4201 4514; once: 4057 4075 4244) /* Ignore Microsoft's interpretation of secure development * and the POSIX string handling API */ #if defined(_MSC_VER) && _MSC_VER >= 1400 #ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE #endif #pragma warning(disable: 4996) #endif /* Has windows.h already been included? If so, our preferences don't matter, * but we will still need the winsock things no matter what was included. * If not, include a restricted set of windows headers to our tastes. */ #ifndef _WINDOWS_ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifndef _WIN32_WINNT #define _WIN32_WINNT @win32_winnt_str@ #endif #ifndef NOUSER #define NOUSER #endif #ifndef NOMCX #define NOMCX #endif #ifndef NOIME #define NOIME #endif #include /* * Add a _very_few_ declarations missing from the restricted set of headers * (If this list becomes extensive, re-enable the required headers above!) * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now */ #define SW_HIDE 0 #ifndef _WIN32_WCE #include #include #include #else #include #endif #endif /* !_WINDOWS_ */ /** * @defgroup APR Apache Portability Runtime library * @{ */ /** * @defgroup apr_platform Platform Definitions * @{ * @warning * The actual values of macros and typedefs on this page
* are platform specific and should NOT be relied upon!
*/ #define APR_INLINE __inline #define APR_HAS_INLINE 1 #if !defined(__GNUC__) && !defined(__attribute__) #define __attribute__(__x) #endif #ifndef _WIN32_WCE #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CONIO_H 1 #define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 1 #define APR_HAVE_DIRENT_H 0 #define APR_HAVE_ERRNO_H 1 #define APR_HAVE_FCNTL_H 1 #define APR_HAVE_IO_H 1 #define APR_HAVE_LIMITS_H 1 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_NETINET_SCTP_H 0 #define APR_HAVE_NETINET_SCTP_UIO_H 0 #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SEMAPHORE_H 0 #define APR_HAVE_SIGNAL_H 1 #define APR_HAVE_STDARG_H 1 #define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 #define APR_HAVE_SYS_IOCTL_H 0 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 1 #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_SYS_UN_H 0 #define APR_HAVE_SYS_WAIT_H 0 #define APR_HAVE_TIME_H 1 #define APR_HAVE_UNISTD_H 0 #define APR_HAVE_STDDEF_H 1 #define APR_HAVE_PROCESS_H 1 #else #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_CONIO_H 0 #define APR_HAVE_CRYPT_H 0 #define APR_HAVE_CTYPE_H 0 #define APR_HAVE_DIRENT_H 0 #define APR_HAVE_ERRNO_H 0 #define APR_HAVE_FCNTL_H 0 #define APR_HAVE_IO_H 0 #define APR_HAVE_LIMITS_H 0 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 #define APR_HAVE_NETINET_SCTP_H 0 #define APR_HAVE_NETINET_SCTP_UIO_H 0 #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SEMAPHORE_H 0 #define APR_HAVE_SIGNAL_H 0 #define APR_HAVE_STDARG_H 0 #define APR_HAVE_STDINT_H 0 #define APR_HAVE_STDIO_H 1 #define APR_HAVE_STDLIB_H 1 #define APR_HAVE_STRING_H 1 #define APR_HAVE_STRINGS_H 0 #define APR_HAVE_SYS_IOCTL_H 0 #define APR_HAVE_SYS_SENDFILE_H 0 #define APR_HAVE_SYS_SIGNAL_H 0 #define APR_HAVE_SYS_SOCKET_H 0 #define APR_HAVE_SYS_SOCKIO_H 0 #define APR_HAVE_SYS_SYSLIMITS_H 0 #define APR_HAVE_SYS_TIME_H 0 #define APR_HAVE_SYS_TYPES_H 0 #define APR_HAVE_SYS_UIO_H 0 #define APR_HAVE_SYS_UN_H 0 #define APR_HAVE_SYS_WAIT_H 0 #define APR_HAVE_TIME_H 0 #define APR_HAVE_UNISTD_H 0 #define APR_HAVE_STDDEF_H 0 #define APR_HAVE_PROCESS_H 0 #endif /** @} */ /** @} */ /* We don't include our conditional headers within the doxyblocks * or the extern "C" namespace */ #if APR_HAVE_STDLIB_H #include #endif #if APR_HAVE_STDIO_H #include #endif #if APR_HAVE_SYS_TYPES_H #include #endif #if APR_HAVE_STDDEF_H #include #endif #if APR_HAVE_TIME_H #include #endif #if APR_HAVE_PROCESS_H #include #endif #ifdef __cplusplus extern "C" { #endif /** * @addtogroup apr_platform * @ingroup APR * @{ */ #define APR_HAVE_SHMEM_MMAP_TMP 0 #define APR_HAVE_SHMEM_MMAP_SHM 0 #define APR_HAVE_SHMEM_MMAP_ZERO 0 #define APR_HAVE_SHMEM_SHMGET_ANON 0 #define APR_HAVE_SHMEM_SHMGET 0 #define APR_HAVE_SHMEM_MMAP_ANON 0 #define APR_HAVE_SHMEM_BEOS 0 #define APR_USE_SHMEM_MMAP_TMP 0 #define APR_USE_SHMEM_MMAP_SHM 0 #define APR_USE_SHMEM_MMAP_ZERO 0 #define APR_USE_SHMEM_SHMGET_ANON 0 #define APR_USE_SHMEM_SHMGET 0 #define APR_USE_SHMEM_MMAP_ANON 0 #define APR_USE_SHMEM_BEOS 0 #define APR_USE_FLOCK_SERIALIZE 0 #define APR_USE_POSIXSEM_SERIALIZE 0 #define APR_USE_SYSVSEM_SERIALIZE 0 #define APR_USE_FCNTL_SERIALIZE 0 #define APR_USE_PROC_PTHREAD_SERIALIZE 0 #define APR_USE_PTHREAD_SERIALIZE 0 #define APR_HAS_FLOCK_SERIALIZE 0 #define APR_HAS_SYSVSEM_SERIALIZE 0 #define APR_HAS_POSIXSEM_SERIALIZE 0 #define APR_HAS_FCNTL_SERIALIZE 0 #define APR_HAS_PROC_PTHREAD_SERIALIZE 0 #define APR_PROCESS_LOCK_IS_GLOBAL 0 #define APR_HAVE_CORKABLE_TCP 0 #define APR_HAVE_GETRLIMIT 0 #define APR_HAVE_ICONV 0 #define APR_HAVE_IN_ADDR 1 #define APR_HAVE_INET_ADDR 1 #define APR_HAVE_INET_NETWORK 0 #define APR_HAVE_IPV6 @apr_have_ipv6_10@ #define APR_HAVE_MEMMOVE 1 #define APR_HAVE_SETRLIMIT 0 #define APR_HAVE_SIGACTION 0 #define APR_HAVE_SIGSUSPEND 0 #define APR_HAVE_SIGWAIT 0 #define APR_HAVE_SA_STORAGE 0 #define APR_HAVE_STRCASECMP 0 #define APR_HAVE_STRDUP 1 #define APR_HAVE_STRNCASECMP 0 #define APR_HAVE_STRSTR 1 #define APR_HAVE_MEMCHR 1 #define APR_HAVE_STRUCT_RLIMIT 0 #define APR_HAVE_UNION_SEMUN 0 #define APR_HAVE_SCTP 0 #define APR_HAVE_IOVEC 0 #ifndef _WIN32_WCE #define APR_HAVE_STRICMP 1 #define APR_HAVE_STRNICMP 1 #else #define APR_HAVE_STRICMP 0 #define APR_HAVE_STRNICMP 0 #endif /* APR Feature Macros */ #define APR_HAS_SHARED_MEMORY 1 #define APR_HAS_THREADS 1 #define APR_HAS_MMAP 1 #define APR_HAS_FORK 0 #define APR_HAS_RANDOM 1 #define APR_HAS_OTHER_CHILD 1 #define APR_HAS_DSO 1 #define APR_HAS_SO_ACCEPTFILTER 0 #define APR_HAS_UNICODE_FS 1 #define APR_HAS_PROC_INVOKED 1 #define APR_HAS_OS_UUID 1 #ifndef _WIN32_WCE #define APR_HAS_SENDFILE 1 #define APR_HAS_USER 1 #define APR_HAS_LARGE_FILES 1 #define APR_HAS_XTHREAD_FILES 1 #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 1 #else #define APR_HAS_SENDFILE 0 #define APR_HAS_USER 0 #define APR_HAS_LARGE_FILES 0 #define APR_HAS_XTHREAD_FILES 0 #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0 #endif /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible * to poll on files/pipes. */ #define APR_FILES_AS_SOCKETS 0 /* This macro indicates whether or not EBCDIC is the native character set. */ #define APR_CHARSET_EBCDIC 0 /* If we have a TCP implementation that can be "corked", what flag * do we use? */ #define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@ /* Is the TCP_NODELAY socket option inherited from listening sockets? */ #define APR_TCP_NODELAY_INHERITED 1 /* Is the O_NONBLOCK flag inherited from listening sockets? */ #define APR_O_NONBLOCK_INHERITED 1 /* Typedefs that APR needs. */ typedef unsigned char apr_byte_t; typedef short apr_int16_t; typedef unsigned short apr_uint16_t; typedef int apr_int32_t; typedef unsigned int apr_uint32_t; typedef __int64 apr_int64_t; typedef unsigned __int64 apr_uint64_t; typedef size_t apr_size_t; #if APR_HAVE_STDDEF_H typedef ptrdiff_t apr_ssize_t; #else typedef int apr_ssize_t; #endif #if APR_HAS_LARGE_FILES typedef __int64 apr_off_t; #else typedef int apr_off_t; #endif typedef int apr_socklen_t; typedef apr_uint64_t apr_ino_t; #ifdef _WIN64 #define APR_SIZEOF_VOIDP 8 #else #define APR_SIZEOF_VOIDP 4 #endif #if APR_SIZEOF_VOIDP == 8 typedef apr_uint64_t apr_uintptr_t; #else typedef apr_uint32_t apr_uintptr_t; #endif /* Are we big endian? */ /* XXX: Fatal assumption on Alpha platforms */ #define APR_IS_BIGENDIAN 0 /* Mechanisms to properly type numeric literals */ #ifndef __GNUC__ #define APR_INT64_C(val) (val##i64) #define APR_UINT64_C(val) (val##Ui64) #else #define APR_INT64_C(val) (val##LL) #define APR_UINT64_C(val) (val##ULL) #endif #ifdef INT16_MIN #define APR_INT16_MIN INT16_MIN #else #define APR_INT16_MIN (-0x7fff - 1) #endif #ifdef INT16_MAX #define APR_INT16_MAX INT16_MAX #else #define APR_INT16_MAX (0x7fff) #endif #ifdef UINT16_MAX #define APR_UINT16_MAX UINT16_MAX #else #define APR_UINT16_MAX (0xffff) #endif #ifdef INT32_MIN #define APR_INT32_MIN INT32_MIN #else #define APR_INT32_MIN (-0x7fffffff - 1) #endif #ifdef INT32_MAX #define APR_INT32_MAX INT32_MAX #else #define APR_INT32_MAX 0x7fffffff #endif #ifdef UINT32_MAX #define APR_UINT32_MAX UINT32_MAX #else #define APR_UINT32_MAX (0xffffffffU) #endif #ifdef INT64_MIN #define APR_INT64_MIN INT64_MIN #else #define APR_INT64_MIN (APR_INT64_C(-0x7fffffffffffffff) - 1) #endif #ifdef INT64_MAX #define APR_INT64_MAX INT64_MAX #else #define APR_INT64_MAX APR_INT64_C(0x7fffffffffffffff) #endif #ifdef UINT64_MAX #define APR_UINT64_MAX UINT64_MAX #else #define APR_UINT64_MAX APR_UINT64_C(0xffffffffffffffff) #endif #define APR_SIZE_MAX (~((apr_size_t)0)) /* Definitions that APR programs need to work properly. */ /** * APR public API wrap for C++ compilers. */ #ifdef __cplusplus #define APR_BEGIN_DECLS extern "C" { #define APR_END_DECLS } #else #define APR_BEGIN_DECLS #define APR_END_DECLS #endif /** * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, * so that they follow the platform's calling convention. *
 *
 * void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
 *
 * 
*/ #define APR_THREAD_FUNC __stdcall #if defined(DOXYGEN) || !defined(WIN32) /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APR_DECLARE_NONSTD(). * * @remark Both the declaration and implementations must use the same macro. * *
 * APR_DECLARE(rettype) apr_func(args)
 * 
* @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA * @remark Note that when APR compiles the library itself, it passes the * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) * to export public symbols from the dynamic library build.\n * The user must define the APR_DECLARE_STATIC when compiling to target * the static APR library on some platforms (e.g. Win32.) The public symbols * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n * By default, compiling an application and including the APR public * headers, without defining APR_DECLARE_STATIC, will prepare the code to be * linked to the dynamic library. */ #define APR_DECLARE(type) type /** * The public APR functions using variable arguments are declared with * APR_DECLARE_NONSTD(), as they must follow the C language calling convention. * @see APR_DECLARE @see APR_DECLARE_DATA * @remark Both the declaration and implementations must use the same macro. *
 *
 * APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
 *
 * 
*/ #define APR_DECLARE_NONSTD(type) type /** * The public APR variables are declared with AP_MODULE_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * @see APR_DECLARE @see APR_DECLARE_NONSTD * @remark Note that the declaration and implementations use different forms, * but both must include the macro. * *
 *
 * extern APR_DECLARE_DATA type apr_variable;\n
 * APR_DECLARE_DATA type apr_variable = value;
 *
 * 
*/ #define APR_DECLARE_DATA #elif defined(APR_DECLARE_STATIC) #define APR_DECLARE(type) type __stdcall #define APR_DECLARE_NONSTD(type) type __cdecl #define APR_DECLARE_DATA #elif defined(APR_DECLARE_EXPORT) #define APR_DECLARE(type) __declspec(dllexport) type __stdcall #define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl #define APR_DECLARE_DATA __declspec(dllexport) #else #define APR_DECLARE(type) __declspec(dllimport) type __stdcall #define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl #define APR_DECLARE_DATA __declspec(dllimport) #endif #ifdef _WIN64 #define APR_SSIZE_T_FMT "I64d" #define APR_SIZE_T_FMT "I64u" #else #define APR_SSIZE_T_FMT "d" #define APR_SIZE_T_FMT "u" #endif #if APR_HAS_LARGE_FILES #define APR_OFF_T_FMT "I64d" #else #define APR_OFF_T_FMT "d" #endif #define APR_PID_T_FMT "d" #define APR_INT64_T_FMT "I64d" #define APR_UINT64_T_FMT "I64u" #define APR_UINT64_T_HEX_FMT "I64x" /* No difference between PROC and GLOBAL mutex */ #define APR_PROC_MUTEX_IS_GLOBAL 1 /* Local machine definition for console and log output. */ #define APR_EOL_STR "\r\n" typedef int apr_wait_t; #if APR_HAS_UNICODE_FS /* An arbitrary size that is digestable. True max is a bit less than 32000 */ #define APR_PATH_MAX 8192 #else /* !APR_HAS_UNICODE_FS */ #define APR_PATH_MAX MAX_PATH #endif #define APR_DSOPATH "PATH" /** @} */ /* Definitions that only Win32 programs need to compile properly. */ /* XXX These simply don't belong here, perhaps in apr_portable.h * based on some APR_HAVE_PID/GID/UID? */ #ifndef __GNUC__ typedef int pid_t; #endif typedef int uid_t; typedef int gid_t; /* Win32 .h ommissions we really need */ #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 #if APR_HAVE_IPV6 /* Appears in later flavors, not the originals. */ #ifndef in_addr6 #define in6_addr in_addr6 #endif #ifndef WS2TCPIP_INLINE #define IN6_IS_ADDR_V4MAPPED(a) \ ( (*(const apr_uint64_t *)(const void *)(&(a)->s6_addr[0]) == 0) \ && (*(const apr_uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif #endif /* APR_HAS_IPV6 */ #ifdef __cplusplus } #endif /* Done with badly written headers */ #if defined(_MSC_VER) && _MSC_VER >= 1200 #pragma warning(pop) #pragma warning(disable: 4996) #endif #endif /* WIN32 */ #endif /* APR_H */ ================================================ FILE: third_party/include/apr/apr_allocator.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_ALLOCATOR_H #define APR_ALLOCATOR_H /** * @file apr_allocator.h * @brief APR Internal Memory Allocation */ #include "apr.h" #include "apr_errno.h" #define APR_WANT_MEMFUNC /**< For no good reason? */ #include "apr_want.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup apr_allocator Internal Memory Allocation * @ingroup APR * @{ */ /** the allocator structure */ typedef struct apr_allocator_t apr_allocator_t; /** the structure which holds information about the allocation */ typedef struct apr_memnode_t apr_memnode_t; /** basic memory node structure * @note The next, ref and first_avail fields are available for use by the * caller of apr_allocator_alloc(), the remaining fields are read-only. * The next field has to be used with caution and sensibly set when the * memnode is passed back to apr_allocator_free(). See apr_allocator_free() * for details. * The ref and first_avail fields will be properly restored by * apr_allocator_free(). */ struct apr_memnode_t { apr_memnode_t *next; /**< next memnode */ apr_memnode_t **ref; /**< reference to self */ apr_uint32_t index; /**< size */ apr_uint32_t free_index; /**< how much free */ char *first_avail; /**< pointer to first free memory */ char *endp; /**< pointer to end of free memory */ }; /** The base size of a memory node - aligned. */ #define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t)) /** Symbolic constants */ #define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0 /** * Create a new allocator * @param allocator The allocator we have just created. * */ APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator) __attribute__((nonnull(1))); /** * Destroy an allocator * @param allocator The allocator to be destroyed * @remark Any memnodes not given back to the allocator prior to destroying * will _not_ be free()d. */ APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) __attribute__((nonnull(1))); /** * Allocate a block of mem from the allocator * @param allocator The allocator to allocate from * @param size The size of the mem to allocate (excluding the * memnode structure) */ APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator, apr_size_t size) __attribute__((nonnull(1))); /** * Free a list of blocks of mem, giving them back to the allocator. * The list is typically terminated by a memnode with its next field * set to NULL. * @param allocator The allocator to give the mem back to * @param memnode The memory node to return */ APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator, apr_memnode_t *memnode) __attribute__((nonnull(1,2))); #include "apr_pools.h" /** * Set the owner of the allocator * @param allocator The allocator to set the owner for * @param pool The pool that is to own the allocator * @remark Typically pool is the highest level pool using the allocator */ /* * XXX: see if we can come up with something a bit better. Currently * you can make a pool an owner, but if the pool doesn't use the allocator * the allocator will never be destroyed. */ APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator, apr_pool_t *pool) __attribute__((nonnull(1))); /** * Get the current owner of the allocator * @param allocator The allocator to get the owner from */ APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator) __attribute__((nonnull(1))); /** * Set the current threshold at which the allocator should start * giving blocks back to the system. * @param allocator The allocator to set the threshold on * @param size The threshold. 0 == unlimited. */ APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator, apr_size_t size) __attribute__((nonnull(1))); #include "apr_thread_mutex.h" #if APR_HAS_THREADS /** * Set a mutex for the allocator to use * @param allocator The allocator to set the mutex for * @param mutex The mutex */ APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator, apr_thread_mutex_t *mutex) __attribute__((nonnull(1))); /** * Get the mutex currently set for the allocator * @param allocator The allocator */ APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get( apr_allocator_t *allocator) __attribute__((nonnull(1))); #endif /* APR_HAS_THREADS */ /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_ALLOCATOR_H */ ================================================ FILE: third_party/include/apr/apr_atomic.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_ATOMIC_H #define APR_ATOMIC_H /** * @file apr_atomic.h * @brief APR Atomic Operations */ #include "apr.h" #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup apr_atomic Atomic Operations * @ingroup APR * @{ */ /** * this function is required on some platforms to initialize the * atomic operation's internal structures * @param p pool * @return APR_SUCCESS on successful completion * @remark Programs do NOT need to call this directly. APR will call this * automatically from apr_initialize. * @internal */ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p); /* * Atomic operations on 32-bit values * Note: Each of these functions internally implements a memory barrier * on platforms that require it */ /** * atomically read an apr_uint32_t from memory * @param mem the pointer */ APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem); /** * atomically set an apr_uint32_t in memory * @param mem pointer to the object * @param val value that the object will assume */ APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val); /** * atomically add 'val' to an apr_uint32_t * @param mem pointer to the object * @param val amount to add * @return old value pointed to by mem */ APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val); /** * atomically subtract 'val' from an apr_uint32_t * @param mem pointer to the object * @param val amount to subtract */ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val); /** * atomically increment an apr_uint32_t by 1 * @param mem pointer to the object * @return old value pointed to by mem */ APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem); /** * atomically decrement an apr_uint32_t by 1 * @param mem pointer to the atomic value * @return zero if the value becomes zero on decrement, otherwise non-zero */ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem); /** * compare an apr_uint32_t's value with 'cmp'. * If they are the same swap the value with 'with' * @param mem pointer to the value * @param with what to swap it with * @param cmp the value to compare it to * @return the old value of *mem */ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t with, apr_uint32_t cmp); /** * exchange an apr_uint32_t's value with 'val'. * @param mem pointer to the value * @param val what to swap it with * @return the old value of *mem */ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val); /** * compare the pointer's value with cmp. * If they are the same swap the value with 'with' * @param mem pointer to the pointer * @param with what to swap it with * @param cmp the value to compare it to * @return the old value of the pointer */ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); /** * exchange a pair of pointer values * @param mem pointer to the pointer * @param with what to swap it with * @return the old value of the pointer */ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_ATOMIC_H */ ================================================ FILE: third_party/include/apr/apr_dso.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_DSO_DOT_H #define APR_DSO_DOT_H /** * @file apr_dso.h * @brief APR Dynamic Object Handling Routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup apr_dso Dynamic Object Handling * @ingroup APR * @{ */ #if APR_HAS_DSO || defined(DOXYGEN) /** * Structure for referencing dynamic objects */ typedef struct apr_dso_handle_t apr_dso_handle_t; /** * Structure for referencing symbols from dynamic objects */ typedef void * apr_dso_handle_sym_t; /** * Load a DSO library. * @param res_handle Location to store new handle for the DSO. * @param path Path to the DSO library * @param ctx Pool to use. * @bug We aught to provide an alternative to RTLD_GLOBAL, which * is the only supported method of loading DSOs today. */ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx); /** * Close a DSO library. * @param handle handle to close. */ APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); /** * Load a symbol from a DSO handle. * @param ressym Location to store the loaded symbol * @param handle handle to load the symbol from. * @param symname Name of the symbol to load. */ APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname); /** * Report more information when a DSO function fails. * @param dso The dso handle that has been opened * @param buf Location to store the dso error * @param bufsize The size of the provided buffer */ APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); #endif /* APR_HAS_DSO */ /** @} */ #ifdef __cplusplus } #endif #endif ================================================ FILE: third_party/include/apr/apr_env.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_ENV_H #define APR_ENV_H /** * @file apr_env.h * @brief APR Environment functions */ #include "apr_errno.h" #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_env Functions for manipulating the environment * @ingroup APR * @{ */ /** * Get the value of an environment variable * @param value the returned value, allocated from @a pool * @param envvar the name of the environment variable * @param pool where to allocate @a value and any temporary storage from */ APR_DECLARE(apr_status_t) apr_env_get(char **value, const char *envvar, apr_pool_t *pool); /** * Set the value of an environment variable * @param envvar the name of the environment variable * @param value the value to set * @param pool where to allocate temporary storage from */ APR_DECLARE(apr_status_t) apr_env_set(const char *envvar, const char *value, apr_pool_t *pool); /** * Delete a variable from the environment * @param envvar the name of the environment variable * @param pool where to allocate temporary storage from */ APR_DECLARE(apr_status_t) apr_env_delete(const char *envvar, apr_pool_t *pool); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_ENV_H */ ================================================ FILE: third_party/include/apr/apr_errno.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_ERRNO_H #define APR_ERRNO_H /** * @file apr_errno.h * @brief APR Error Codes */ #include "apr.h" #if APR_HAVE_ERRNO_H #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_errno Error Codes * @ingroup APR * @{ */ /** * Type for specifying an error or status code. */ typedef int apr_status_t; /** * Return a human readable string describing the specified error. * @param statcode The error code to get a string for. * @param buf A buffer to hold the error string. * @param bufsize Size of the buffer to hold the string. */ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize); #if defined(DOXYGEN) /** * @def APR_FROM_OS_ERROR(os_err_type syserr) * Fold a platform specific error into an apr_status_t code. * @return apr_status_t * @param e The platform os error code. * @warning macro implementation; the syserr argument may be evaluated * multiple times. */ #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) /** * @def APR_TO_OS_ERROR(apr_status_t statcode) * @return os_err_type * Fold an apr_status_t code back to the native platform defined error. * @param e The apr_status_t folded platform os error code. * @warning macro implementation; the statcode argument may be evaluated * multiple times. If the statcode was not created by apr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. */ #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) /** @def apr_get_os_error() * @return apr_status_t the last platform error, folded into apr_status_t, on most platforms * @remark This retrieves errno, or calls a GetLastError() style function, and * folds it with APR_FROM_OS_ERROR. Some platforms (such as OS2) have no * such mechanism, so this call may be unsupported. Do NOT use this * call for socket errors from socket, send, recv etc! */ /** @def apr_set_os_error(e) * Reset the last platform error, unfolded from an apr_status_t, on some platforms * @param e The OS error folded in a prior call to APR_FROM_OS_ERROR() * @warning This is a macro implementation; the statcode argument may be evaluated * multiple times. If the statcode was not created by apr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. This macro sets * errno, or calls a SetLastError() style function, unfolding statcode * with APR_TO_OS_ERROR. Some platforms (such as OS2) have no such * mechanism, so this call may be unsupported. */ /** @def apr_get_netos_error() * Return the last socket error, folded into apr_status_t, on all platforms * @remark This retrieves errno or calls a GetLastSocketError() style function, * and folds it with APR_FROM_OS_ERROR. */ /** @def apr_set_netos_error(e) * Reset the last socket error, unfolded from an apr_status_t * @param e The socket error folded in a prior call to APR_FROM_OS_ERROR() * @warning This is a macro implementation; the statcode argument may be evaluated * multiple times. If the statcode was not created by apr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. This macro sets * errno, or calls a WSASetLastError() style function, unfolding * socketcode with APR_TO_OS_ERROR. */ #endif /* defined(DOXYGEN) */ /** * APR_OS_START_ERROR is where the APR specific error values start. */ #define APR_OS_START_ERROR 20000 /** * APR_OS_ERRSPACE_SIZE is the maximum number of errors you can fit * into one of the error/status ranges below -- except for * APR_OS_START_USERERR, which see. */ #define APR_OS_ERRSPACE_SIZE 50000 /** * APR_UTIL_ERRSPACE_SIZE is the size of the space that is reserved for * use within apr-util. This space is reserved above that used by APR * internally. * @note This number MUST be smaller than APR_OS_ERRSPACE_SIZE by a * large enough amount that APR has sufficient room for its * codes. */ #define APR_UTIL_ERRSPACE_SIZE 20000 /** * APR_OS_START_STATUS is where the APR specific status codes start. */ #define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE) /** * APR_UTIL_START_STATUS is where APR-Util starts defining its * status codes. */ #define APR_UTIL_START_STATUS (APR_OS_START_STATUS + \ (APR_OS_ERRSPACE_SIZE - APR_UTIL_ERRSPACE_SIZE)) /** * APR_OS_START_USERERR are reserved for applications that use APR that * layer their own error codes along with APR's. Note that the * error immediately following this one is set ten times farther * away than usual, so that users of apr have a lot of room in * which to declare custom error codes. * * In general applications should try and create unique error codes. To try * and assist in finding suitable ranges of numbers to use, the following * ranges are known to be used by the listed applications. If your * application defines error codes please advise the range of numbers it * uses to dev@apr.apache.org for inclusion in this list. * * Ranges shown are in relation to APR_OS_START_USERERR * * Subversion - Defined ranges, of less than 100, at intervals of 5000 * starting at an offset of 5000, e.g. * +5000 to 5100, +10000 to 10100 * * Apache HTTPD - +2000 to 2999 */ #define APR_OS_START_USERERR (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE) /** * APR_OS_START_USEERR is obsolete, defined for compatibility only. * Use APR_OS_START_USERERR instead. */ #define APR_OS_START_USEERR APR_OS_START_USERERR /** * APR_OS_START_CANONERR is where APR versions of errno values are defined * on systems which don't have the corresponding errno. */ #define APR_OS_START_CANONERR (APR_OS_START_USERERR \ + (APR_OS_ERRSPACE_SIZE * 10)) /** * APR_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into * apr_status_t values. */ #define APR_OS_START_EAIERR (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE) /** * APR_OS_START_SYSERR folds platform-specific system error values into * apr_status_t values. */ #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE) /** * @defgroup APR_ERROR_map APR Error Space *
 * The following attempts to show the relation of the various constants
 * used for mapping APR Status codes.
 *
 *       0
 *
 *  20,000     APR_OS_START_ERROR
 *
 *         + APR_OS_ERRSPACE_SIZE (50,000)
 *
 *  70,000      APR_OS_START_STATUS
 *
 *         + APR_OS_ERRSPACE_SIZE - APR_UTIL_ERRSPACE_SIZE (30,000)
 *
 * 100,000      APR_UTIL_START_STATUS
 *
 *         + APR_UTIL_ERRSPACE_SIZE (20,000)
 *
 * 120,000      APR_OS_START_USERERR
 *
 *         + 10 x APR_OS_ERRSPACE_SIZE (50,000 * 10)
 *
 * 620,000      APR_OS_START_CANONERR
 *
 *         + APR_OS_ERRSPACE_SIZE (50,000)
 *
 * 670,000      APR_OS_START_EAIERR
 *
 *         + APR_OS_ERRSPACE_SIZE (50,000)
 *
 * 720,000      APR_OS_START_SYSERR
 *
 * 
*/ /** no error. */ #define APR_SUCCESS 0 /** * @defgroup APR_Error APR Error Values *
 * APR ERROR VALUES
 * APR_ENOSTAT      APR was unable to perform a stat on the file
 * APR_ENOPOOL      APR was not provided a pool with which to allocate memory
 * APR_EBADDATE     APR was given an invalid date
 * APR_EINVALSOCK   APR was given an invalid socket
 * APR_ENOPROC      APR was not given a process structure
 * APR_ENOTIME      APR was not given a time structure
 * APR_ENODIR       APR was not given a directory structure
 * APR_ENOLOCK      APR was not given a lock structure
 * APR_ENOPOLL      APR was not given a poll structure
 * APR_ENOSOCKET    APR was not given a socket
 * APR_ENOTHREAD    APR was not given a thread structure
 * APR_ENOTHDKEY    APR was not given a thread key structure
 * APR_ENOSHMAVAIL  There is no more shared memory available
 * APR_EDSOOPEN     APR was unable to open the dso object.  For more
 *                  information call apr_dso_error().
 * APR_EGENERAL     General failure (specific information not available)
 * APR_EBADIP       The specified IP address is invalid
 * APR_EBADMASK     The specified netmask is invalid
 * APR_ESYMNOTFOUND Could not find the requested symbol
 * APR_ENOTENOUGHENTROPY Not enough entropy to continue
 * 
* *
 * APR STATUS VALUES
 * APR_INCHILD        Program is currently executing in the child
 * APR_INPARENT       Program is currently executing in the parent
 * APR_DETACH         The thread is detached
 * APR_NOTDETACH      The thread is not detached
 * APR_CHILD_DONE     The child has finished executing
 * APR_CHILD_NOTDONE  The child has not finished executing
 * APR_TIMEUP         The operation did not finish before the timeout
 * APR_INCOMPLETE     The operation was incomplete although some processing
 *                    was performed and the results are partially valid
 * APR_BADCH          Getopt found an option not in the option string
 * APR_BADARG         Getopt found an option that is missing an argument
 *                    and an argument was specified in the option string
 * APR_EOF            APR has encountered the end of the file
 * APR_NOTFOUND       APR was unable to find the socket in the poll structure
 * APR_ANONYMOUS      APR is using anonymous shared memory
 * APR_FILEBASED      APR is using a file name as the key to the shared memory
 * APR_KEYBASED       APR is using a shared key as the key to the shared memory
 * APR_EINIT          Ininitalizer value.  If no option has been found, but
 *                    the status variable requires a value, this should be used
 * APR_ENOTIMPL       The APR function has not been implemented on this
 *                    platform, either because nobody has gotten to it yet,
 *                    or the function is impossible on this platform.
 * APR_EMISMATCH      Two passwords do not match.
 * APR_EABSOLUTE      The given path was absolute.
 * APR_ERELATIVE      The given path was relative.
 * APR_EINCOMPLETE    The given path was neither relative nor absolute.
 * APR_EABOVEROOT     The given path was above the root path.
 * APR_EBUSY          The given lock was busy.
 * APR_EPROC_UNKNOWN  The given process wasn't recognized by APR
 * 
* @{ */ /** @see APR_STATUS_IS_ENOSTAT */ #define APR_ENOSTAT (APR_OS_START_ERROR + 1) /** @see APR_STATUS_IS_ENOPOOL */ #define APR_ENOPOOL (APR_OS_START_ERROR + 2) /* empty slot: +3 */ /** @see APR_STATUS_IS_EBADDATE */ #define APR_EBADDATE (APR_OS_START_ERROR + 4) /** @see APR_STATUS_IS_EINVALSOCK */ #define APR_EINVALSOCK (APR_OS_START_ERROR + 5) /** @see APR_STATUS_IS_ENOPROC */ #define APR_ENOPROC (APR_OS_START_ERROR + 6) /** @see APR_STATUS_IS_ENOTIME */ #define APR_ENOTIME (APR_OS_START_ERROR + 7) /** @see APR_STATUS_IS_ENODIR */ #define APR_ENODIR (APR_OS_START_ERROR + 8) /** @see APR_STATUS_IS_ENOLOCK */ #define APR_ENOLOCK (APR_OS_START_ERROR + 9) /** @see APR_STATUS_IS_ENOPOLL */ #define APR_ENOPOLL (APR_OS_START_ERROR + 10) /** @see APR_STATUS_IS_ENOSOCKET */ #define APR_ENOSOCKET (APR_OS_START_ERROR + 11) /** @see APR_STATUS_IS_ENOTHREAD */ #define APR_ENOTHREAD (APR_OS_START_ERROR + 12) /** @see APR_STATUS_IS_ENOTHDKEY */ #define APR_ENOTHDKEY (APR_OS_START_ERROR + 13) /** @see APR_STATUS_IS_EGENERAL */ #define APR_EGENERAL (APR_OS_START_ERROR + 14) /** @see APR_STATUS_IS_ENOSHMAVAIL */ #define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15) /** @see APR_STATUS_IS_EBADIP */ #define APR_EBADIP (APR_OS_START_ERROR + 16) /** @see APR_STATUS_IS_EBADMASK */ #define APR_EBADMASK (APR_OS_START_ERROR + 17) /* empty slot: +18 */ /** @see APR_STATUS_IS_EDSOPEN */ #define APR_EDSOOPEN (APR_OS_START_ERROR + 19) /** @see APR_STATUS_IS_EABSOLUTE */ #define APR_EABSOLUTE (APR_OS_START_ERROR + 20) /** @see APR_STATUS_IS_ERELATIVE */ #define APR_ERELATIVE (APR_OS_START_ERROR + 21) /** @see APR_STATUS_IS_EINCOMPLETE */ #define APR_EINCOMPLETE (APR_OS_START_ERROR + 22) /** @see APR_STATUS_IS_EABOVEROOT */ #define APR_EABOVEROOT (APR_OS_START_ERROR + 23) /** @see APR_STATUS_IS_EBADPATH */ #define APR_EBADPATH (APR_OS_START_ERROR + 24) /** @see APR_STATUS_IS_EPATHWILD */ #define APR_EPATHWILD (APR_OS_START_ERROR + 25) /** @see APR_STATUS_IS_ESYMNOTFOUND */ #define APR_ESYMNOTFOUND (APR_OS_START_ERROR + 26) /** @see APR_STATUS_IS_EPROC_UNKNOWN */ #define APR_EPROC_UNKNOWN (APR_OS_START_ERROR + 27) /** @see APR_STATUS_IS_ENOTENOUGHENTROPY */ #define APR_ENOTENOUGHENTROPY (APR_OS_START_ERROR + 28) /** @} */ /** * @defgroup APR_STATUS_IS Status Value Tests * @warning For any particular error condition, more than one of these tests * may match. This is because platform-specific error codes may not * always match the semantics of the POSIX codes these tests (and the * corresponding APR error codes) are named after. A notable example * are the APR_STATUS_IS_ENOENT and APR_STATUS_IS_ENOTDIR tests on * Win32 platforms. The programmer should always be aware of this and * adjust the order of the tests accordingly. * @{ */ /** * APR was unable to perform a stat on the file * @warning always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_ENOSTAT(s) ((s) == APR_ENOSTAT) /** * APR was not provided a pool with which to allocate memory * @warning always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_ENOPOOL(s) ((s) == APR_ENOPOOL) /** APR was given an invalid date */ #define APR_STATUS_IS_EBADDATE(s) ((s) == APR_EBADDATE) /** APR was given an invalid socket */ #define APR_STATUS_IS_EINVALSOCK(s) ((s) == APR_EINVALSOCK) /** APR was not given a process structure */ #define APR_STATUS_IS_ENOPROC(s) ((s) == APR_ENOPROC) /** APR was not given a time structure */ #define APR_STATUS_IS_ENOTIME(s) ((s) == APR_ENOTIME) /** APR was not given a directory structure */ #define APR_STATUS_IS_ENODIR(s) ((s) == APR_ENODIR) /** APR was not given a lock structure */ #define APR_STATUS_IS_ENOLOCK(s) ((s) == APR_ENOLOCK) /** APR was not given a poll structure */ #define APR_STATUS_IS_ENOPOLL(s) ((s) == APR_ENOPOLL) /** APR was not given a socket */ #define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET) /** APR was not given a thread structure */ #define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD) /** APR was not given a thread key structure */ #define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY) /** Generic Error which can not be put into another spot */ #define APR_STATUS_IS_EGENERAL(s) ((s) == APR_EGENERAL) /** There is no more shared memory available */ #define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL) /** The specified IP address is invalid */ #define APR_STATUS_IS_EBADIP(s) ((s) == APR_EBADIP) /** The specified netmask is invalid */ #define APR_STATUS_IS_EBADMASK(s) ((s) == APR_EBADMASK) /* empty slot: +18 */ /** * APR was unable to open the dso object. * For more information call apr_dso_error(). */ #if defined(WIN32) #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN \ || APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND) #else #define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN) #endif /** The given path was absolute. */ #define APR_STATUS_IS_EABSOLUTE(s) ((s) == APR_EABSOLUTE) /** The given path was relative. */ #define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE) /** The given path was neither relative nor absolute. */ #define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE) /** The given path was above the root path. */ #define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT) /** The given path was bad. */ #define APR_STATUS_IS_EBADPATH(s) ((s) == APR_EBADPATH) /** The given path contained wildcards. */ #define APR_STATUS_IS_EPATHWILD(s) ((s) == APR_EPATHWILD) /** Could not find the requested symbol. * For more information call apr_dso_error(). */ #if defined(WIN32) #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND \ || APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND) #else #define APR_STATUS_IS_ESYMNOTFOUND(s) ((s) == APR_ESYMNOTFOUND) #endif /** The given process was not recognized by APR. */ #define APR_STATUS_IS_EPROC_UNKNOWN(s) ((s) == APR_EPROC_UNKNOWN) /** APR could not gather enough entropy to continue. */ #define APR_STATUS_IS_ENOTENOUGHENTROPY(s) ((s) == APR_ENOTENOUGHENTROPY) /** @} */ /** * @addtogroup APR_Error * @{ */ /** @see APR_STATUS_IS_INCHILD */ #define APR_INCHILD (APR_OS_START_STATUS + 1) /** @see APR_STATUS_IS_INPARENT */ #define APR_INPARENT (APR_OS_START_STATUS + 2) /** @see APR_STATUS_IS_DETACH */ #define APR_DETACH (APR_OS_START_STATUS + 3) /** @see APR_STATUS_IS_NOTDETACH */ #define APR_NOTDETACH (APR_OS_START_STATUS + 4) /** @see APR_STATUS_IS_CHILD_DONE */ #define APR_CHILD_DONE (APR_OS_START_STATUS + 5) /** @see APR_STATUS_IS_CHILD_NOTDONE */ #define APR_CHILD_NOTDONE (APR_OS_START_STATUS + 6) /** @see APR_STATUS_IS_TIMEUP */ #define APR_TIMEUP (APR_OS_START_STATUS + 7) /** @see APR_STATUS_IS_INCOMPLETE */ #define APR_INCOMPLETE (APR_OS_START_STATUS + 8) /* empty slot: +9 */ /* empty slot: +10 */ /* empty slot: +11 */ /** @see APR_STATUS_IS_BADCH */ #define APR_BADCH (APR_OS_START_STATUS + 12) /** @see APR_STATUS_IS_BADARG */ #define APR_BADARG (APR_OS_START_STATUS + 13) /** @see APR_STATUS_IS_EOF */ #define APR_EOF (APR_OS_START_STATUS + 14) /** @see APR_STATUS_IS_NOTFOUND */ #define APR_NOTFOUND (APR_OS_START_STATUS + 15) /* empty slot: +16 */ /* empty slot: +17 */ /* empty slot: +18 */ /** @see APR_STATUS_IS_ANONYMOUS */ #define APR_ANONYMOUS (APR_OS_START_STATUS + 19) /** @see APR_STATUS_IS_FILEBASED */ #define APR_FILEBASED (APR_OS_START_STATUS + 20) /** @see APR_STATUS_IS_KEYBASED */ #define APR_KEYBASED (APR_OS_START_STATUS + 21) /** @see APR_STATUS_IS_EINIT */ #define APR_EINIT (APR_OS_START_STATUS + 22) /** @see APR_STATUS_IS_ENOTIMPL */ #define APR_ENOTIMPL (APR_OS_START_STATUS + 23) /** @see APR_STATUS_IS_EMISMATCH */ #define APR_EMISMATCH (APR_OS_START_STATUS + 24) /** @see APR_STATUS_IS_EBUSY */ #define APR_EBUSY (APR_OS_START_STATUS + 25) /** @} */ /** * @addtogroup APR_STATUS_IS * @{ */ /** * Program is currently executing in the child * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD) /** * Program is currently executing in the parent * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_INPARENT(s) ((s) == APR_INPARENT) /** * The thread is detached * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_DETACH(s) ((s) == APR_DETACH) /** * The thread is not detached * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_NOTDETACH(s) ((s) == APR_NOTDETACH) /** * The child has finished executing * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_CHILD_DONE(s) ((s) == APR_CHILD_DONE) /** * The child has not finished executing * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_CHILD_NOTDONE(s) ((s) == APR_CHILD_NOTDONE) /** * The operation did not finish before the timeout * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP) /** * The operation was incomplete although some processing was performed * and the results are partially valid. * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_INCOMPLETE(s) ((s) == APR_INCOMPLETE) /* empty slot: +9 */ /* empty slot: +10 */ /* empty slot: +11 */ /** * Getopt found an option not in the option string * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_BADCH(s) ((s) == APR_BADCH) /** * Getopt found an option not in the option string and an argument was * specified in the option string * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_BADARG(s) ((s) == APR_BADARG) /** * APR has encountered the end of the file * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_EOF(s) ((s) == APR_EOF) /** * APR was unable to find the socket in the poll structure * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_NOTFOUND(s) ((s) == APR_NOTFOUND) /* empty slot: +16 */ /* empty slot: +17 */ /* empty slot: +18 */ /** * APR is using anonymous shared memory * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_ANONYMOUS(s) ((s) == APR_ANONYMOUS) /** * APR is using a file name as the key to the shared memory * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_FILEBASED(s) ((s) == APR_FILEBASED) /** * APR is using a shared key as the key to the shared memory * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_KEYBASED(s) ((s) == APR_KEYBASED) /** * Ininitalizer value. If no option has been found, but * the status variable requires a value, this should be used * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT) /** * The APR function has not been implemented on this * platform, either because nobody has gotten to it yet, * or the function is impossible on this platform. * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL) /** * Two passwords do not match. * @warning * always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH) /** * The given lock was busy * @warning always use this test, as platform-specific variances may meet this * more than one error code */ #define APR_STATUS_IS_EBUSY(s) ((s) == APR_EBUSY) /** @} */ /** * @addtogroup APR_Error APR Error Values * @{ */ /* APR CANONICAL ERROR VALUES */ /** @see APR_STATUS_IS_EACCES */ #ifdef EACCES #define APR_EACCES EACCES #else #define APR_EACCES (APR_OS_START_CANONERR + 1) #endif /** @see APR_STATUS_IS_EEXIST */ #ifdef EEXIST #define APR_EEXIST EEXIST #else #define APR_EEXIST (APR_OS_START_CANONERR + 2) #endif /** @see APR_STATUS_IS_ENAMETOOLONG */ #ifdef ENAMETOOLONG #define APR_ENAMETOOLONG ENAMETOOLONG #else #define APR_ENAMETOOLONG (APR_OS_START_CANONERR + 3) #endif /** @see APR_STATUS_IS_ENOENT */ #ifdef ENOENT #define APR_ENOENT ENOENT #else #define APR_ENOENT (APR_OS_START_CANONERR + 4) #endif /** @see APR_STATUS_IS_ENOTDIR */ #ifdef ENOTDIR #define APR_ENOTDIR ENOTDIR #else #define APR_ENOTDIR (APR_OS_START_CANONERR + 5) #endif /** @see APR_STATUS_IS_ENOSPC */ #ifdef ENOSPC #define APR_ENOSPC ENOSPC #else #define APR_ENOSPC (APR_OS_START_CANONERR + 6) #endif /** @see APR_STATUS_IS_ENOMEM */ #ifdef ENOMEM #define APR_ENOMEM ENOMEM #else #define APR_ENOMEM (APR_OS_START_CANONERR + 7) #endif /** @see APR_STATUS_IS_EMFILE */ #ifdef EMFILE #define APR_EMFILE EMFILE #else #define APR_EMFILE (APR_OS_START_CANONERR + 8) #endif /** @see APR_STATUS_IS_ENFILE */ #ifdef ENFILE #define APR_ENFILE ENFILE #else #define APR_ENFILE (APR_OS_START_CANONERR + 9) #endif /** @see APR_STATUS_IS_EBADF */ #ifdef EBADF #define APR_EBADF EBADF #else #define APR_EBADF (APR_OS_START_CANONERR + 10) #endif /** @see APR_STATUS_IS_EINVAL */ #ifdef EINVAL #define APR_EINVAL EINVAL #else #define APR_EINVAL (APR_OS_START_CANONERR + 11) #endif /** @see APR_STATUS_IS_ESPIPE */ #ifdef ESPIPE #define APR_ESPIPE ESPIPE #else #define APR_ESPIPE (APR_OS_START_CANONERR + 12) #endif /** * @see APR_STATUS_IS_EAGAIN * @warning use APR_STATUS_IS_EAGAIN instead of just testing this value */ #ifdef EAGAIN #define APR_EAGAIN EAGAIN #elif defined(EWOULDBLOCK) #define APR_EAGAIN EWOULDBLOCK #else #define APR_EAGAIN (APR_OS_START_CANONERR + 13) #endif /** @see APR_STATUS_IS_EINTR */ #ifdef EINTR #define APR_EINTR EINTR #else #define APR_EINTR (APR_OS_START_CANONERR + 14) #endif /** @see APR_STATUS_IS_ENOTSOCK */ #ifdef ENOTSOCK #define APR_ENOTSOCK ENOTSOCK #else #define APR_ENOTSOCK (APR_OS_START_CANONERR + 15) #endif /** @see APR_STATUS_IS_ECONNREFUSED */ #ifdef ECONNREFUSED #define APR_ECONNREFUSED ECONNREFUSED #else #define APR_ECONNREFUSED (APR_OS_START_CANONERR + 16) #endif /** @see APR_STATUS_IS_EINPROGRESS */ #ifdef EINPROGRESS #define APR_EINPROGRESS EINPROGRESS #else #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17) #endif /** * @see APR_STATUS_IS_ECONNABORTED * @warning use APR_STATUS_IS_ECONNABORTED instead of just testing this value */ #ifdef ECONNABORTED #define APR_ECONNABORTED ECONNABORTED #else #define APR_ECONNABORTED (APR_OS_START_CANONERR + 18) #endif /** @see APR_STATUS_IS_ECONNRESET */ #ifdef ECONNRESET #define APR_ECONNRESET ECONNRESET #else #define APR_ECONNRESET (APR_OS_START_CANONERR + 19) #endif /** @see APR_STATUS_IS_ETIMEDOUT * @deprecated */ #ifdef ETIMEDOUT #define APR_ETIMEDOUT ETIMEDOUT #else #define APR_ETIMEDOUT (APR_OS_START_CANONERR + 20) #endif /** @see APR_STATUS_IS_EHOSTUNREACH */ #ifdef EHOSTUNREACH #define APR_EHOSTUNREACH EHOSTUNREACH #else #define APR_EHOSTUNREACH (APR_OS_START_CANONERR + 21) #endif /** @see APR_STATUS_IS_ENETUNREACH */ #ifdef ENETUNREACH #define APR_ENETUNREACH ENETUNREACH #else #define APR_ENETUNREACH (APR_OS_START_CANONERR + 22) #endif /** @see APR_STATUS_IS_EFTYPE */ #ifdef EFTYPE #define APR_EFTYPE EFTYPE #else #define APR_EFTYPE (APR_OS_START_CANONERR + 23) #endif /** @see APR_STATUS_IS_EPIPE */ #ifdef EPIPE #define APR_EPIPE EPIPE #else #define APR_EPIPE (APR_OS_START_CANONERR + 24) #endif /** @see APR_STATUS_IS_EXDEV */ #ifdef EXDEV #define APR_EXDEV EXDEV #else #define APR_EXDEV (APR_OS_START_CANONERR + 25) #endif /** @see APR_STATUS_IS_ENOTEMPTY */ #ifdef ENOTEMPTY #define APR_ENOTEMPTY ENOTEMPTY #else #define APR_ENOTEMPTY (APR_OS_START_CANONERR + 26) #endif /** @see APR_STATUS_IS_EAFNOSUPPORT */ #ifdef EAFNOSUPPORT #define APR_EAFNOSUPPORT EAFNOSUPPORT #else #define APR_EAFNOSUPPORT (APR_OS_START_CANONERR + 27) #endif /** @} */ #if defined(OS2) && !defined(DOXYGEN) #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) #define INCL_DOSERRORS #define INCL_DOS /* Leave these undefined. * OS2 doesn't rely on the errno concept. * The API calls always return a result codes which * should be filtered through APR_FROM_OS_ERROR(). * * #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) * #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) */ /* A special case, only socket calls require this; */ #define apr_get_netos_error() (APR_FROM_OS_ERROR(errno)) #define apr_set_netos_error(e) (errno = APR_TO_OS_ERROR(e)) /* And this needs to be greped away for good: */ #define APR_OS2_STATUS(e) (APR_FROM_OS_ERROR(e)) /* These can't sit in a private header, so in spite of the extra size, * they need to be made available here. */ #define SOCBASEERR 10000 #define SOCEPERM (SOCBASEERR+1) /* Not owner */ #define SOCESRCH (SOCBASEERR+3) /* No such process */ #define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ #define SOCENXIO (SOCBASEERR+6) /* No such device or address */ #define SOCEBADF (SOCBASEERR+9) /* Bad file number */ #define SOCEACCES (SOCBASEERR+13) /* Permission denied */ #define SOCEFAULT (SOCBASEERR+14) /* Bad address */ #define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ #define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ #define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ #define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ #define SOCEWOULDBLOCK (SOCBASEERR+35) /* Operation would block */ #define SOCEINPROGRESS (SOCBASEERR+36) /* Operation now in progress */ #define SOCEALREADY (SOCBASEERR+37) /* Operation already in progress */ #define SOCENOTSOCK (SOCBASEERR+38) /* Socket operation on non-socket */ #define SOCEDESTADDRREQ (SOCBASEERR+39) /* Destination address required */ #define SOCEMSGSIZE (SOCBASEERR+40) /* Message too long */ #define SOCEPROTOTYPE (SOCBASEERR+41) /* Protocol wrong type for socket */ #define SOCENOPROTOOPT (SOCBASEERR+42) /* Protocol not available */ #define SOCEPROTONOSUPPORT (SOCBASEERR+43) /* Protocol not supported */ #define SOCESOCKTNOSUPPORT (SOCBASEERR+44) /* Socket type not supported */ #define SOCEOPNOTSUPP (SOCBASEERR+45) /* Operation not supported on socket */ #define SOCEPFNOSUPPORT (SOCBASEERR+46) /* Protocol family not supported */ #define SOCEAFNOSUPPORT (SOCBASEERR+47) /* Address family not supported by protocol family */ #define SOCEADDRINUSE (SOCBASEERR+48) /* Address already in use */ #define SOCEADDRNOTAVAIL (SOCBASEERR+49) /* Can't assign requested address */ #define SOCENETDOWN (SOCBASEERR+50) /* Network is down */ #define SOCENETUNREACH (SOCBASEERR+51) /* Network is unreachable */ #define SOCENETRESET (SOCBASEERR+52) /* Network dropped connection on reset */ #define SOCECONNABORTED (SOCBASEERR+53) /* Software caused connection abort */ #define SOCECONNRESET (SOCBASEERR+54) /* Connection reset by peer */ #define SOCENOBUFS (SOCBASEERR+55) /* No buffer space available */ #define SOCEISCONN (SOCBASEERR+56) /* Socket is already connected */ #define SOCENOTCONN (SOCBASEERR+57) /* Socket is not connected */ #define SOCESHUTDOWN (SOCBASEERR+58) /* Can't send after socket shutdown */ #define SOCETOOMANYREFS (SOCBASEERR+59) /* Too many references: can't splice */ #define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ #define SOCECONNREFUSED (SOCBASEERR+61) /* Connection refused */ #define SOCELOOP (SOCBASEERR+62) /* Too many levels of symbolic links */ #define SOCENAMETOOLONG (SOCBASEERR+63) /* File name too long */ #define SOCEHOSTDOWN (SOCBASEERR+64) /* Host is down */ #define SOCEHOSTUNREACH (SOCBASEERR+65) /* No route to host */ #define SOCENOTEMPTY (SOCBASEERR+66) /* Directory not empty */ /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \ || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION) #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \ || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \ || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS \ || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED) #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \ || (s) == APR_OS_START_SYSERR + SOCENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES \ || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL) #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES) #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE) #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ || (s) == APR_OS_START_SYSERR + SOCEWOULDBLOCK \ || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ || (s) == APR_OS_START_SYSERR + SOCEINTR) #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ || (s) == APR_OS_START_SYSERR + SOCENOTSOCK) #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ || (s) == APR_OS_START_SYSERR + SOCECONNREFUSED) #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ || (s) == APR_OS_START_SYSERR + SOCEINPROGRESS) #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ || (s) == APR_OS_START_SYSERR + SOCECONNABORTED) #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + SOCECONNRESET) /* XXX deprecated */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) #undef APR_STATUS_IS_TIMEUP #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + SOCETIMEDOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ || (s) == APR_OS_START_SYSERR + SOCEHOSTUNREACH) #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ || (s) == APR_OS_START_SYSERR + SOCENETUNREACH) #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE \ || (s) == APR_OS_START_SYSERR + SOCEPIPE) #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \ || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE) #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \ || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY \ || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED) #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_AFNOSUPPORT \ || (s) == APR_OS_START_SYSERR + SOCEAFNOSUPPORT) /* Sorry, too tired to wrap this up for OS2... feel free to fit the following into their best matches. { ERROR_NO_SIGNAL_SENT, ESRCH }, { SOCEALREADY, EALREADY }, { SOCEDESTADDRREQ, EDESTADDRREQ }, { SOCEMSGSIZE, EMSGSIZE }, { SOCEPROTOTYPE, EPROTOTYPE }, { SOCENOPROTOOPT, ENOPROTOOPT }, { SOCEPROTONOSUPPORT, EPROTONOSUPPORT }, { SOCESOCKTNOSUPPORT, ESOCKTNOSUPPORT }, { SOCEOPNOTSUPP, EOPNOTSUPP }, { SOCEPFNOSUPPORT, EPFNOSUPPORT }, { SOCEADDRINUSE, EADDRINUSE }, { SOCEADDRNOTAVAIL, EADDRNOTAVAIL }, { SOCENETDOWN, ENETDOWN }, { SOCENETRESET, ENETRESET }, { SOCENOBUFS, ENOBUFS }, { SOCEISCONN, EISCONN }, { SOCENOTCONN, ENOTCONN }, { SOCESHUTDOWN, ESHUTDOWN }, { SOCETOOMANYREFS, ETOOMANYREFS }, { SOCELOOP, ELOOP }, { SOCEHOSTDOWN, EHOSTDOWN }, { SOCENOTEMPTY, ENOTEMPTY }, { SOCEPIPE, EPIPE } */ #elif defined(WIN32) && !defined(DOXYGEN) /* !defined(OS2) */ #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) /* A special case, only socket calls require this: */ #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ || (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \ || (s) == APR_OS_START_SYSERR + ERROR_CANNOT_MAKE \ || (s) == APR_OS_START_SYSERR + ERROR_CURRENT_DIRECTORY \ || (s) == APR_OS_START_SYSERR + ERROR_DRIVE_LOCKED \ || (s) == APR_OS_START_SYSERR + ERROR_FAIL_I24 \ || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \ || (s) == APR_OS_START_SYSERR + ERROR_LOCK_FAILED \ || (s) == APR_OS_START_SYSERR + ERROR_NOT_LOCKED \ || (s) == APR_OS_START_SYSERR + ERROR_NETWORK_ACCESS_DENIED \ || (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION) #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_EXISTS \ || (s) == APR_OS_START_SYSERR + ERROR_ALREADY_EXISTS) #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ || (s) == APR_OS_START_SYSERR + ERROR_FILENAME_EXCED_RANGE \ || (s) == APR_OS_START_SYSERR + WSAENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_OPEN_FAILED \ || (s) == APR_OS_START_SYSERR + ERROR_NO_MORE_FILES) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR \ || (s) == APR_OS_START_SYSERR + ERROR_PATH_NOT_FOUND \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_NETPATH \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_NET_NAME \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_PATHNAME \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DRIVE \ || (s) == APR_OS_START_SYSERR + ERROR_DIRECTORY) #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ || (s) == APR_OS_START_SYSERR + ERROR_DISK_FULL) #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM \ || (s) == APR_OS_START_SYSERR + ERROR_ARENA_TRASHED \ || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_MEMORY \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_BLOCK \ || (s) == APR_OS_START_SYSERR + ERROR_NOT_ENOUGH_QUOTA \ || (s) == APR_OS_START_SYSERR + ERROR_OUTOFMEMORY) #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ || (s) == APR_OS_START_SYSERR + ERROR_TOO_MANY_OPEN_FILES) #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_TARGET_HANDLE) #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_ACCESS \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DATA \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \ || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE \ || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \ || (s) == APR_OS_START_SYSERR + ERROR_NO_PROC_SLOTS \ || (s) == APR_OS_START_SYSERR + ERROR_NESTING_NOT_ALLOWED \ || (s) == APR_OS_START_SYSERR + ERROR_MAX_THRDS_REACHED \ || (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \ || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ || (s) == APR_OS_START_SYSERR + WSAEINTR) #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ || (s) == APR_OS_START_SYSERR + WSAENOTSOCK) #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED) #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS) #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + ERROR_NETNAME_DELETED \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) /* XXX deprecated */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #undef APR_STATUS_IS_TIMEUP #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE \ || (s) == APR_OS_START_SYSERR + ERROR_EXE_MACHINE_TYPE_MISMATCH \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DLL \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_MODULETYPE \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_EXE_FORMAT \ || (s) == APR_OS_START_SYSERR + ERROR_INVALID_EXE_SIGNATURE \ || (s) == APR_OS_START_SYSERR + ERROR_FILE_CORRUPT \ || (s) == APR_OS_START_SYSERR + ERROR_BAD_FORMAT) #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE \ || (s) == APR_OS_START_SYSERR + ERROR_BROKEN_PIPE) #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV \ || (s) == APR_OS_START_SYSERR + ERROR_NOT_SAME_DEVICE) #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY \ || (s) == APR_OS_START_SYSERR + ERROR_DIR_NOT_EMPTY) #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \ || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT) #elif defined(NETWARE) && defined(USE_WINSOCK) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */ #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR) #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR) #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) /* A special case, only socket calls require this: */ #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) #define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e))) /* APR CANONICAL ERROR TESTS */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == EWOULDBLOCK \ || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK) #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ || (s) == APR_OS_START_SYSERR + WSAEINTR) #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ || (s) == APR_OS_START_SYSERR + WSAENOTSOCK) #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ || (s) == APR_OS_START_SYSERR + WSAECONNREFUSED) #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ || (s) == APR_OS_START_SYSERR + WSAEINPROGRESS) #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET \ || (s) == APR_OS_START_SYSERR + WSAECONNRESET) /* XXX deprecated */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #undef APR_STATUS_IS_TIMEUP #define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP \ || (s) == APR_OS_START_SYSERR + WSAETIMEDOUT \ || (s) == APR_OS_START_SYSERR + WAIT_TIMEOUT) #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH \ || (s) == APR_OS_START_SYSERR + WSAEHOSTUNREACH) #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH \ || (s) == APR_OS_START_SYSERR + WSAENETUNREACH) #define APR_STATUS_IS_ENETDOWN(s) ((s) == APR_OS_START_SYSERR + WSAENETDOWN) #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV) #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY) #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT \ || (s) == APR_OS_START_SYSERR + WSAEAFNOSUPPORT) #else /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */ /* * os error codes are clib error codes */ #define APR_FROM_OS_ERROR(e) (e) #define APR_TO_OS_ERROR(e) (e) #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) /* A special case, only socket calls require this: */ #define apr_get_netos_error() (errno) #define apr_set_netos_error(e) (errno = (e)) /** * @addtogroup APR_STATUS_IS * @{ */ /** permission denied */ #define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) /** file exists */ #define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) /** path name is too long */ #define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) /** * no such file or directory * @remark * EMVSCATLG can be returned by the automounter on z/OS for * paths which do not exist. */ #ifdef EMVSCATLG #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ || (s) == EMVSCATLG) #else #define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) #endif /** not a directory */ #define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) /** no space left on device */ #ifdef EDQUOT #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ || (s) == EDQUOT) #else #define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) #endif /** not enough memory */ #define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) /** too many open files */ #define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) /** file table overflow */ #define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) /** bad file # */ #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) /** invalid argument */ #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) /** illegal seek */ #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) /** operation would block */ #if !defined(EWOULDBLOCK) || !defined(EAGAIN) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) #elif (EWOULDBLOCK == EAGAIN) #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) #else #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ || (s) == EWOULDBLOCK) #endif /** interrupted system call */ #define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR) /** socket operation on a non-socket */ #define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK) /** Connection Refused */ #define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED) /** operation now in progress */ #define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS) /** * Software caused connection abort * @remark * EPROTO on certain older kernels really means ECONNABORTED, so we need to * ignore it for them. See discussion in new-httpd archives nh.9701 & nh.9603 * * There is potentially a bug in Solaris 2.x x<6, and other boxes that * implement tcp sockets in userland (i.e. on top of STREAMS). On these * systems, EPROTO can actually result in a fatal loop. See PR#981 for * example. It's hard to handle both uses of EPROTO. */ #ifdef EPROTO #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ || (s) == EPROTO) #else #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED) #endif /** Connection Reset by peer */ #define APR_STATUS_IS_ECONNRESET(s) ((s) == APR_ECONNRESET) /** Operation timed out * @deprecated */ #define APR_STATUS_IS_ETIMEDOUT(s) ((s) == APR_ETIMEDOUT) /** no route to host */ #define APR_STATUS_IS_EHOSTUNREACH(s) ((s) == APR_EHOSTUNREACH) /** network is unreachable */ #define APR_STATUS_IS_ENETUNREACH(s) ((s) == APR_ENETUNREACH) /** inappropiate file type or format */ #define APR_STATUS_IS_EFTYPE(s) ((s) == APR_EFTYPE) /** broken pipe */ #define APR_STATUS_IS_EPIPE(s) ((s) == APR_EPIPE) /** cross device link */ #define APR_STATUS_IS_EXDEV(s) ((s) == APR_EXDEV) /** Directory Not Empty */ #define APR_STATUS_IS_ENOTEMPTY(s) ((s) == APR_ENOTEMPTY || \ (s) == APR_EEXIST) /** Address Family not supported */ #define APR_STATUS_IS_EAFNOSUPPORT(s) ((s) == APR_EAFNOSUPPORT) /** @} */ #endif /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_ERRNO_H */ ================================================ FILE: third_party/include/apr/apr_escape.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_escape.h * @brief APR-UTIL Escaping */ #ifndef APR_ESCAPE_H #define APR_ESCAPE_H #include "apr.h" #include "apr_general.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_Escaping Escape functions * @ingroup APR * @{ */ /* Simple escape/unescape functions. * */ /** * When passing a string to one of the escape functions, this value can be * passed to indicate a string-valued key, and have the length computed * automatically. */ #define APR_ESCAPE_STRING (-1) /** * Perform shell escaping on the provided string. * * Shell escaping causes characters to be prefixed with a '\' character. * @param escaped Optional buffer to write the encoded string, can be * NULL * @param str The original string * @param slen The length of the original string, or APR_ESCAPE_STRING * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were * detected or the string was NULL */ APR_DECLARE(apr_status_t) apr_escape_shell(char *escaped, const char *str, apr_ssize_t slen, apr_size_t *len); /** * Perform shell escaping on the provided string, returning the result * from the pool. * * Shell escaping causes characters to be prefixed with a '\' character. * * If no characters were escaped, the original string is returned. * @param p Pool to allocate from * @param str The original string * @return the encoded string, allocated from the pool, or the original * string if no escaping took place or the string was NULL. */ APR_DECLARE(const char *) apr_pescape_shell(apr_pool_t *p, const char *str) __attribute__((nonnull(1))); /** * Unescapes a URL, leaving reserved characters intact. * @param escaped Optional buffer to write the encoded string, can be * NULL * @param url String to be unescaped * @param slen The length of the original url, or APR_ESCAPE_STRING * @param forbid Optional list of forbidden characters, in addition to * 0x00 * @param reserved Optional list of reserved characters that will be * left unescaped * @param plus If non zero, '+' is converted to ' ' as per * application/x-www-form-urlencoded encoding * @param len If set, the length of the escaped string will be returned * @return APR_SUCCESS on success, APR_NOTFOUND if no characters are * decoded or the string is NULL, APR_EINVAL if a bad escape sequence is * found, APR_BADCH if a character on the forbid list is found. */ APR_DECLARE(apr_status_t) apr_unescape_url(char *escaped, const char *url, apr_ssize_t slen, const char *forbid, const char *reserved, int plus, apr_size_t *len); /** * Unescapes a URL, leaving reserved characters intact, returning the * result from a pool. * @param p Pool to allocate from * @param url String to be unescaped in place * @param forbid Optional list of forbidden characters, in addition to * 0x00 * @param reserved Optional list of reserved characters that will be * left unescaped * @param plus If non zero, '+' is converted to ' ' as per * application/x-www-form-urlencoded encoding * @return A string allocated from the pool on success, the original string * if no characters are decoded, or NULL if a bad escape sequence is found * or if a character on the forbid list is found, or if the original string * was NULL. */ APR_DECLARE(const char *) apr_punescape_url(apr_pool_t *p, const char *url, const char *forbid, const char *reserved, int plus) __attribute__((nonnull(1))); /** * Escape a path segment, as defined in RFC1808. * @param escaped Optional buffer to write the encoded string, can be * NULL * @param str The original string * @param slen The length of the original string, or APR_ESCAPE_STRING * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were * detected or the string was NULL */ APR_DECLARE(apr_status_t) apr_escape_path_segment(char *escaped, const char *str, apr_ssize_t slen, apr_size_t *len); /** * Escape a path segment, as defined in RFC1808, returning the result from a * pool. * @param p Pool to allocate from * @param str String to be escaped * @return A string allocated from the pool on success, the original string * if no characters are encoded or the string is NULL. */ APR_DECLARE(const char *) apr_pescape_path_segment(apr_pool_t *p, const char *str) __attribute__((nonnull(1))); /** * Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808. * In all cases if a ':' occurs before the first '/' in the URL, the URL should * be prefixed with "./" (or the ':' escaped). In the case of Unix, this means * leaving '/' alone, but otherwise doing what escape_path_segment() does. For * efficiency reasons, we don't use escape_path_segment(), which is provided for * reference. Again, RFC 1808 is where this stuff is defined. * * If partial is set, os_escape_path() assumes that the path will be appended to * something with a '/' in it (and thus does not prefix "./"). * @param escaped Optional buffer to write the encoded string, can be * NULL * @param path The original string * @param slen The length of the original string, or APR_ESCAPE_STRING * @param partial If non zero, suppresses the prepending of "./" * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were * detected or if the string was NULL */ APR_DECLARE(apr_status_t) apr_escape_path(char *escaped, const char *path, apr_ssize_t slen, int partial, apr_size_t *len); /** * Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808, * returning the result from a pool. * * In all cases if a ':' occurs before the first '/' in the URL, the URL should * be prefixed with "./" (or the ':' escaped). In the case of Unix, this means * leaving '/' alone, but otherwise doing what escape_path_segment() does. For * efficiency reasons, we don't use escape_path_segment(), which is provided for * reference. Again, RFC 1808 is where this stuff is defined. * * If partial is set, os_escape_path() assumes that the path will be appended to * something with a '/' in it (and thus does not prefix "./"). * @param p Pool to allocate from * @param str The original string * @param partial If non zero, suppresses the prepending of "./" * @return A string allocated from the pool on success, the original string * if no characters are encoded or if the string was NULL. */ APR_DECLARE(const char *) apr_pescape_path(apr_pool_t *p, const char *str, int partial) __attribute__((nonnull(1))); /** * Urlencode a string, as defined in * http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1. * @param escaped Optional buffer to write the encoded string, can be * NULL * @param str The original string * @param slen The length of the original string, or APR_ESCAPE_STRING * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were * detected or if the stirng was NULL */ APR_DECLARE(apr_status_t) apr_escape_urlencoded(char *escaped, const char *str, apr_ssize_t slen, apr_size_t *len); /** * Urlencode a string, as defined in * http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1, returning * the result from a pool. * @param p Pool to allocate from * @param str String to be escaped * @return A string allocated from the pool on success, the original string * if no characters are encoded or if the string was NULL. */ APR_DECLARE(const char *) apr_pescape_urlencoded(apr_pool_t *p, const char *str) __attribute__((nonnull(1))); /** * Apply entity encoding to a string. Characters are replaced as follows: * '<' becomes '<', '>' becomes '>', '&' becomes '&', the * double quote becomes '"" and the single quote becomes '''. * * If toasc is not zero, any non ascii character will be encoded as * '%\#ddd;', where ddd is the decimal code of the character. * @param escaped Optional buffer to write the encoded string, can be * NULL * @param str The original string * @param slen The length of the original string, or APR_ESCAPE_STRING * @param toasc If non zero, encode non ascii characters * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were * detected or the string was NULL */ APR_DECLARE(apr_status_t) apr_escape_entity(char *escaped, const char *str, apr_ssize_t slen, int toasc, apr_size_t *len); /** * Apply entity encoding to a string, returning the result from a pool. * Characters are replaced as follows: '<' becomes '<', '>' becomes * '>', '&' becomes '&', the double quote becomes '"" and the * single quote becomes '''. * @param p Pool to allocate from * @param str The original string * @param toasc If non zero, encode non ascii characters * @return A string allocated from the pool on success, the original string * if no characters are encoded or the string is NULL. */ APR_DECLARE(const char *) apr_pescape_entity(apr_pool_t *p, const char *str, int toasc) __attribute__((nonnull(1))); /** * Decodes html entities or numeric character references in a string. If * the string to be unescaped is syntactically incorrect, then the * following fixups will be made: * unknown entities will be left undecoded; * references to unused numeric characters will be deleted. * In particular, � will not be decoded, but will be deleted. * @param unescaped Optional buffer to write the encoded string, can be * NULL * @param str The original string * @param slen The length of the original string, or APR_ESCAPE_STRING * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were * detected or the string was NULL */ APR_DECLARE(apr_status_t) apr_unescape_entity(char *unescaped, const char *str, apr_ssize_t slen, apr_size_t *len); /** * Decodes html entities or numeric character references in a string. If * the string to be unescaped is syntactically incorrect, then the * following fixups will be made: * unknown entities will be left undecoded; * references to unused numeric characters will be deleted. * In particular, � will not be decoded, but will be deleted. * @param p Pool to allocate from * @param str The original string * @return A string allocated from the pool on success, the original string * if no characters are encoded or the string is NULL. */ APR_DECLARE(const char *) apr_punescape_entity(apr_pool_t *p, const char *str) __attribute__((nonnull(1))); /** * Escape control characters in a string, as performed by the shell's * 'echo' command. Characters are replaced as follows: * \\a alert (bell), \\b backspace, \\f form feed, \\n new line, \\r carriage * return, \\t horizontal tab, \\v vertical tab, \\ backslash. * * Any non ascii character will be encoded as '\\xHH', where HH is the hex * code of the character. * * If quote is not zero, the double quote character will also be escaped. * @param escaped Optional buffer to write the encoded string, can be * NULL * @param str The original string * @param slen The length of the original string, or APR_ESCAPE_STRING * @param quote If non zero, encode double quotes * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if no changes to the string were * detected or the string was NULL */ APR_DECLARE(apr_status_t) apr_escape_echo(char *escaped, const char *str, apr_ssize_t slen, int quote, apr_size_t *len); /** * Escape control characters in a string, as performed by the shell's * 'echo' command, and return the results from a pool. Characters are * replaced as follows: \\a alert (bell), \\b backspace, \\f form feed, * \\n new line, \\r carriage return, \\t horizontal tab, \\v vertical tab, * \\ backslash. * * Any non ascii character will be encoded as '\\xHH', where HH is the hex * code of the character. * * If quote is not zero, the double quote character will also be escaped. * @param p Pool to allocate from * @param str The original string * @param quote If non zero, encode double quotes * @return A string allocated from the pool on success, the original string * if no characters are encoded or the string is NULL. */ APR_DECLARE(const char *) apr_pescape_echo(apr_pool_t *p, const char *str, int quote); /** * Convert binary data to a hex encoding. * @param dest The destination buffer, can be NULL * @param src The original buffer * @param srclen The length of the original buffer * @param colon If not zero, insert colon characters between hex digits. * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL */ APR_DECLARE(apr_status_t) apr_escape_hex(char *dest, const void *src, apr_size_t srclen, int colon, apr_size_t *len); /** * Convert binary data to a hex encoding, and return the results from a * pool. * @param p Pool to allocate from * @param src The original buffer * @param slen The length of the original buffer * @param colon If not zero, insert colon characters between hex digits. * @return A zero padded buffer allocated from the pool on success, or * NULL if src was NULL. */ APR_DECLARE(const char *) apr_pescape_hex(apr_pool_t *p, const void *src, apr_size_t slen, int colon) __attribute__((nonnull(1))); /** * Convert hex encoded string to binary data. * @param dest The destination buffer, can be NULL * @param str The original buffer * @param slen The length of the original buffer * @param colon If not zero, ignore colon characters between hex digits. * @param len If present, returns the length of the string * @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH * if a non hex character is present. */ APR_DECLARE(apr_status_t) apr_unescape_hex(void *dest, const char *str, apr_ssize_t slen, int colon, apr_size_t *len); /** * Convert hex encoding to binary data, and return the results from a pool. * If the colon character appears between pairs of hex digits, it will be * ignored. * @param p Pool to allocate from * @param str The original string * @param colon If not zero, ignore colon characters between hex digits. * @param len If present, returns the length of the final buffer * @return A buffer allocated from the pool on success, or NULL if src was * NULL, or a bad character was present. */ APR_DECLARE(const void *) apr_punescape_hex(apr_pool_t *p, const char *str, int colon, apr_size_t *len); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_ESCAPE_H */ ================================================ FILE: third_party/include/apr/apr_escape_test_char.h ================================================ /* this file is automatically generated by gen_test_char, do not edit. "make include/private/apr_escape_test_char.h" to regenerate. */ #define T_ESCAPE_SHELL_CMD (1) #define T_ESCAPE_PATH_SEGMENT (2) #define T_OS_ESCAPE_PATH (4) #define T_ESCAPE_ECHO (8) #define T_ESCAPE_URLENCODED (16) #define T_ESCAPE_XML (32) static const unsigned char test_char_table[256] = { 32,30,30,30,30,30,30,30,30,30,31,30,30,31,30,30,30,30,30,30, 30,30,30,30,30,30,30,30,30,30,30,30,6,16,63,22,17,23,49,17, 17,17,1,16,16,0,0,18,0,0,0,0,0,0,0,0,0,0,16,23, 55,16,55,23,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,23,31,23,23,0,23,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,23,23,23,17,30,30,30,30,30,30,30,30,30,30,30,30,30, 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30, 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30, 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30, 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30, 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30, 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30 }; ================================================ FILE: third_party/include/apr/apr_file_info.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_FILE_INFO_H #define APR_FILE_INFO_H /** * @file apr_file_info.h * @brief APR File Information */ #include "apr.h" #include "apr_user.h" #include "apr_pools.h" #include "apr_tables.h" #include "apr_time.h" #include "apr_errno.h" #if APR_HAVE_SYS_UIO_H #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_file_info File Information * @ingroup APR * @{ */ /* Many applications use the type member to determine the * existance of a file or initialization of the file info, * so the APR_NOFILE value must be distinct from APR_UNKFILE. */ /** apr_filetype_e values for the filetype member of the * apr_file_info_t structure * @warning: Not all of the filetypes below can be determined. * For example, a given platform might not correctly report * a socket descriptor as APR_SOCK if that type isn't * well-identified on that platform. In such cases where * a filetype exists but cannot be described by the recognized * flags below, the filetype will be APR_UNKFILE. If the * filetype member is not determined, the type will be APR_NOFILE. */ typedef enum { APR_NOFILE = 0, /**< no file type determined */ APR_REG, /**< a regular file */ APR_DIR, /**< a directory */ APR_CHR, /**< a character device */ APR_BLK, /**< a block device */ APR_PIPE, /**< a FIFO / pipe */ APR_LNK, /**< a symbolic link */ APR_SOCK, /**< a [unix domain] socket */ APR_UNKFILE = 127 /**< a file of some other unknown type */ } apr_filetype_e; /** * @defgroup apr_file_permissions File Permissions flags * @{ */ #define APR_FPROT_USETID 0x8000 /**< Set user id */ #define APR_FPROT_UREAD 0x0400 /**< Read by user */ #define APR_FPROT_UWRITE 0x0200 /**< Write by user */ #define APR_FPROT_UEXECUTE 0x0100 /**< Execute by user */ #define APR_FPROT_GSETID 0x4000 /**< Set group id */ #define APR_FPROT_GREAD 0x0040 /**< Read by group */ #define APR_FPROT_GWRITE 0x0020 /**< Write by group */ #define APR_FPROT_GEXECUTE 0x0010 /**< Execute by group */ #define APR_FPROT_WSTICKY 0x2000 /**< Sticky bit */ #define APR_FPROT_WREAD 0x0004 /**< Read by others */ #define APR_FPROT_WWRITE 0x0002 /**< Write by others */ #define APR_FPROT_WEXECUTE 0x0001 /**< Execute by others */ #define APR_FPROT_OS_DEFAULT 0x0FFF /**< use OS's default permissions */ /* additional permission flags for apr_file_copy and apr_file_append */ #define APR_FPROT_FILE_SOURCE_PERMS 0x1000 /**< Copy source file's permissions */ /* backcompat */ #define APR_USETID APR_FPROT_USETID /**< @deprecated @see APR_FPROT_USETID */ #define APR_UREAD APR_FPROT_UREAD /**< @deprecated @see APR_FPROT_UREAD */ #define APR_UWRITE APR_FPROT_UWRITE /**< @deprecated @see APR_FPROT_UWRITE */ #define APR_UEXECUTE APR_FPROT_UEXECUTE /**< @deprecated @see APR_FPROT_UEXECUTE */ #define APR_GSETID APR_FPROT_GSETID /**< @deprecated @see APR_FPROT_GSETID */ #define APR_GREAD APR_FPROT_GREAD /**< @deprecated @see APR_FPROT_GREAD */ #define APR_GWRITE APR_FPROT_GWRITE /**< @deprecated @see APR_FPROT_GWRITE */ #define APR_GEXECUTE APR_FPROT_GEXECUTE /**< @deprecated @see APR_FPROT_GEXECUTE */ #define APR_WSTICKY APR_FPROT_WSTICKY /**< @deprecated @see APR_FPROT_WSTICKY */ #define APR_WREAD APR_FPROT_WREAD /**< @deprecated @see APR_FPROT_WREAD */ #define APR_WWRITE APR_FPROT_WWRITE /**< @deprecated @see APR_FPROT_WWRITE */ #define APR_WEXECUTE APR_FPROT_WEXECUTE /**< @deprecated @see APR_FPROT_WEXECUTE */ #define APR_OS_DEFAULT APR_FPROT_OS_DEFAULT /**< @deprecated @see APR_FPROT_OS_DEFAULT */ #define APR_FILE_SOURCE_PERMS APR_FPROT_FILE_SOURCE_PERMS /**< @deprecated @see APR_FPROT_FILE_SOURCE_PERMS */ /** @} */ /** * Structure for referencing directories. */ typedef struct apr_dir_t apr_dir_t; /** * Structure for determining file permissions. */ typedef apr_int32_t apr_fileperms_t; #if (defined WIN32) || (defined NETWARE) /** * Structure for determining the device the file is on. */ typedef apr_uint32_t apr_dev_t; #else /** * Structure for determining the device the file is on. */ typedef dev_t apr_dev_t; #endif /** * @defgroup apr_file_stat Stat Functions * @{ */ /** file info structure */ typedef struct apr_finfo_t apr_finfo_t; #define APR_FINFO_LINK 0x00000001 /**< Stat the link not the file itself if it is a link */ #define APR_FINFO_MTIME 0x00000010 /**< Modification Time */ #define APR_FINFO_CTIME 0x00000020 /**< Creation or inode-changed time */ #define APR_FINFO_ATIME 0x00000040 /**< Access Time */ #define APR_FINFO_SIZE 0x00000100 /**< Size of the file */ #define APR_FINFO_CSIZE 0x00000200 /**< Storage size consumed by the file */ #define APR_FINFO_DEV 0x00001000 /**< Device */ #define APR_FINFO_INODE 0x00002000 /**< Inode */ #define APR_FINFO_NLINK 0x00004000 /**< Number of links */ #define APR_FINFO_TYPE 0x00008000 /**< Type */ #define APR_FINFO_USER 0x00010000 /**< User */ #define APR_FINFO_GROUP 0x00020000 /**< Group */ #define APR_FINFO_UPROT 0x00100000 /**< User protection bits */ #define APR_FINFO_GPROT 0x00200000 /**< Group protection bits */ #define APR_FINFO_WPROT 0x00400000 /**< World protection bits */ #define APR_FINFO_ICASE 0x01000000 /**< if dev is case insensitive */ #define APR_FINFO_NAME 0x02000000 /**< ->name in proper case */ #define APR_FINFO_MIN 0x00008170 /**< type, mtime, ctime, atime, size */ #define APR_FINFO_IDENT 0x00003000 /**< dev and inode */ #define APR_FINFO_OWNER 0x00030000 /**< user and group */ #define APR_FINFO_PROT 0x00700000 /**< all protections */ #define APR_FINFO_NORM 0x0073b170 /**< an atomic unix apr_stat() */ #define APR_FINFO_DIRENT 0x02000000 /**< an atomic unix apr_dir_read() */ /** * The file information structure. This is analogous to the POSIX * stat structure. */ struct apr_finfo_t { /** Allocates memory and closes lingering handles in the specified pool */ apr_pool_t *pool; /** The bitmask describing valid fields of this apr_finfo_t structure * including all available 'wanted' fields and potentially more */ apr_int32_t valid; /** The access permissions of the file. Mimics Unix access rights. */ apr_fileperms_t protection; /** The type of file. One of APR_REG, APR_DIR, APR_CHR, APR_BLK, APR_PIPE, * APR_LNK or APR_SOCK. If the type is undetermined, the value is APR_NOFILE. * If the type cannot be determined, the value is APR_UNKFILE. */ apr_filetype_e filetype; /** The user id that owns the file */ apr_uid_t user; /** The group id that owns the file */ apr_gid_t group; /** The inode of the file. */ apr_ino_t inode; /** The id of the device the file is on. */ apr_dev_t device; /** The number of hard links to the file. */ apr_int32_t nlink; /** The size of the file */ apr_off_t size; /** The storage size consumed by the file */ apr_off_t csize; /** The time the file was last accessed */ apr_time_t atime; /** The time the file was last modified */ apr_time_t mtime; /** The time the file was created, or the inode was last changed */ apr_time_t ctime; /** The pathname of the file (possibly unrooted) */ const char *fname; /** The file's name (no path) in filesystem case */ const char *name; /** Unused */ struct apr_file_t *filehand; }; /** * get the specified file's stats. The file is specified by filename, * instead of using a pre-opened file. * @param finfo Where to store the information about the file, which is * never touched if the call fails. * @param fname The name of the file to stat. * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param pool the pool to use to allocate the new file. * * @note If @c APR_INCOMPLETE is returned all the fields in @a finfo may * not be filled in, and you need to check the @c finfo->valid bitmask * to verify that what you're looking for is there. */ APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *pool); /** @} */ /** * @defgroup apr_dir Directory Manipulation Functions * @{ */ /** * Open the specified directory. * @param new_dir The opened directory descriptor. * @param dirname The full path to the directory (use / on all systems) * @param pool The pool to use. */ APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *pool); /** * close the specified directory. * @param thedir the directory descriptor to close. */ APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir); /** * Read the next entry from the specified directory. * @param finfo the file info structure and filled in by apr_dir_read * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values * @param thedir the directory descriptor returned from apr_dir_open * @remark No ordering is guaranteed for the entries read. * * @note If @c APR_INCOMPLETE is returned all the fields in @a finfo may * not be filled in, and you need to check the @c finfo->valid bitmask * to verify that what you're looking for is there. When no more * entries are available, APR_ENOENT is returned. */ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir); /** * Rewind the directory to the first entry. * @param thedir the directory descriptor to rewind. */ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir); /** @} */ /** * @defgroup apr_filepath Filepath Manipulation Functions * @{ */ /** Cause apr_filepath_merge to fail if addpath is above rootpath * @bug in APR 0.9 and 1.x, this flag's behavior is undefined * if the rootpath is NULL or empty. In APR 2.0 this should be * changed to imply NOTABSOLUTE if the rootpath is NULL or empty. */ #define APR_FILEPATH_NOTABOVEROOT 0x01 /** internal: Only meaningful with APR_FILEPATH_NOTABOVEROOT */ #define APR_FILEPATH_SECUREROOTTEST 0x02 /** Cause apr_filepath_merge to fail if addpath is above rootpath, * even given a rootpath /foo/bar and an addpath ../bar/bash */ #define APR_FILEPATH_SECUREROOT 0x03 /** Fail apr_filepath_merge if the merged path is relative */ #define APR_FILEPATH_NOTRELATIVE 0x04 /** Fail apr_filepath_merge if the merged path is absolute */ #define APR_FILEPATH_NOTABSOLUTE 0x08 /** Return the file system's native path format (e.g. path delimiters * of ':' on MacOS9, '\' on Win32, etc.) */ #define APR_FILEPATH_NATIVE 0x10 /** Resolve the true case of existing directories and file elements * of addpath, (resolving any aliases on Win32) and append a proper * trailing slash if a directory */ #define APR_FILEPATH_TRUENAME 0x20 /** * Extract the rootpath from the given filepath * @param rootpath the root file path returned with APR_SUCCESS or APR_EINCOMPLETE * @param filepath the pathname to parse for its root component * @param flags the desired rules to apply, from *
 *      APR_FILEPATH_NATIVE    Use native path separators (e.g. '\' on Win32)
 *      APR_FILEPATH_TRUENAME  Tests that the root exists, and makes it proper
 * 
* @param p the pool to allocate the new path string from * @remark on return, filepath points to the first non-root character in the * given filepath. In the simplest example, given a filepath of "/foo", * returns the rootpath of "/" and filepath points at "foo". This is far * more complex on other platforms, which will canonicalize the root form * to a consistant format, given the APR_FILEPATH_TRUENAME flag, and also * test for the validity of that root (e.g., that a drive d:/ or network * share //machine/foovol/). * The function returns APR_ERELATIVE if filepath isn't rooted (an * error), APR_EINCOMPLETE if the root path is ambiguous (but potentially * legitimate, e.g. "/" on Windows is incomplete because it doesn't specify * the drive letter), or APR_EBADPATH if the root is simply invalid. * APR_SUCCESS is returned if filepath is an absolute path. */ APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, const char **filepath, apr_int32_t flags, apr_pool_t *p); /** * Merge additional file path onto the previously processed rootpath * @param newpath the merged paths returned * @param rootpath the root file path (NULL uses the current working path) * @param addpath the path to add to the root path * @param flags the desired APR_FILEPATH_ rules to apply when merging * @param p the pool to allocate the new path string from * @remark if the flag APR_FILEPATH_TRUENAME is given, and the addpath * contains wildcard characters ('*', '?') on platforms that don't support * such characters within filenames, the paths will be merged, but the * result code will be APR_EPATHWILD, and all further segments will not * reflect the true filenames including the wildcard and following segments. */ APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, const char *rootpath, const char *addpath, apr_int32_t flags, apr_pool_t *p); /** * Split a search path into separate components * @param pathelts the returned components of the search path * @param liststr the search path (e.g., getenv("PATH")) * @param p the pool to allocate the array and path components from * @remark empty path components do not become part of @a pathelts. * @remark the path separator in @a liststr is system specific; * e.g., ':' on Unix, ';' on Windows, etc. */ APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts, const char *liststr, apr_pool_t *p); /** * Merge a list of search path components into a single search path * @param liststr the returned search path; may be NULL if @a pathelts is empty * @param pathelts the components of the search path * @param p the pool to allocate the search path from * @remark emtpy strings in the source array are ignored. * @remark the path separator in @a liststr is system specific; * e.g., ':' on Unix, ';' on Windows, etc. */ APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr, apr_array_header_t *pathelts, apr_pool_t *p); /** * Return the default file path (for relative file names) * @param path the default path string returned * @param flags optional flag APR_FILEPATH_NATIVE to retrieve the * default file path in os-native format. * @param p the pool to allocate the default path string from */ APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_int32_t flags, apr_pool_t *p); /** * Set the default file path (for relative file names) * @param path the default path returned * @param p the pool to allocate any working storage */ APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p); /** The FilePath character encoding is unknown */ #define APR_FILEPATH_ENCODING_UNKNOWN 0 /** The FilePath character encoding is locale-dependent */ #define APR_FILEPATH_ENCODING_LOCALE 1 /** The FilePath character encoding is UTF-8 */ #define APR_FILEPATH_ENCODING_UTF8 2 /** * Determine the encoding used internally by the FilePath functions * @param style points to a variable which receives the encoding style flag * @param p the pool to allocate any working storage * @remark Use @c apr_os_locale_encoding and/or @c apr_os_default_encoding * to get the name of the path encoding if it's not UTF-8. */ APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p); /** @} */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_FILE_INFO_H */ ================================================ FILE: third_party/include/apr/apr_file_io.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_FILE_IO_H #define APR_FILE_IO_H /** * @file apr_file_io.h * @brief APR File I/O Handling */ #include "apr.h" #include "apr_pools.h" #include "apr_time.h" #include "apr_errno.h" #include "apr_file_info.h" #include "apr_inherit.h" #define APR_WANT_STDIO /**< for SEEK_* */ #define APR_WANT_IOVEC /**< for apr_file_writev */ #include "apr_want.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_file_io File I/O Handling Functions * @ingroup APR * @{ */ /** * @defgroup apr_file_open_flags File Open Flags/Routines * @{ */ /* Note to implementors: Values in the range 0x00100000--0x80000000 are reserved for platform-specific values. */ #define APR_FOPEN_READ 0x00001 /**< Open the file for reading */ #define APR_FOPEN_WRITE 0x00002 /**< Open the file for writing */ #define APR_FOPEN_CREATE 0x00004 /**< Create the file if not there */ #define APR_FOPEN_APPEND 0x00008 /**< Append to the end of the file */ #define APR_FOPEN_TRUNCATE 0x00010 /**< Open the file and truncate to 0 length */ #define APR_FOPEN_BINARY 0x00020 /**< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)*/ #define APR_FOPEN_EXCL 0x00040 /**< Open should fail if #APR_FOPEN_CREATE and file exists. */ #define APR_FOPEN_BUFFERED 0x00080 /**< Open the file for buffered I/O */ #define APR_FOPEN_DELONCLOSE 0x00100 /**< Delete the file after close */ #define APR_FOPEN_XTHREAD 0x00200 /**< Platform dependent tag to open the file for use across multiple threads */ #define APR_FOPEN_SHARELOCK 0x00400 /**< Platform dependent support for higher level locked read/write access to support writes across process/machines */ #define APR_FOPEN_NOCLEANUP 0x00800 /**< Do not register a cleanup when the file is opened. The apr_os_file_t handle in apr_file_t will not be closed when the pool is destroyed. */ #define APR_FOPEN_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this file should support apr_socket_sendfile operation */ #define APR_FOPEN_LARGEFILE 0x04000 /**< Platform dependent flag to enable * large file support, see WARNING below */ #define APR_FOPEN_SPARSE 0x08000 /**< Platform dependent flag to enable * sparse file support, see WARNING below */ #define APR_FOPEN_NONBLOCK 0x40000 /**< Platform dependent flag to enable * non blocking file io */ /* backcompat */ #define APR_READ APR_FOPEN_READ /**< @deprecated @see APR_FOPEN_READ */ #define APR_WRITE APR_FOPEN_WRITE /**< @deprecated @see APR_FOPEN_WRITE */ #define APR_CREATE APR_FOPEN_CREATE /**< @deprecated @see APR_FOPEN_CREATE */ #define APR_APPEND APR_FOPEN_APPEND /**< @deprecated @see APR_FOPEN_APPEND */ #define APR_TRUNCATE APR_FOPEN_TRUNCATE /**< @deprecated @see APR_FOPEN_TRUNCATE */ #define APR_BINARY APR_FOPEN_BINARY /**< @deprecated @see APR_FOPEN_BINARY */ #define APR_EXCL APR_FOPEN_EXCL /**< @deprecated @see APR_FOPEN_EXCL */ #define APR_BUFFERED APR_FOPEN_BUFFERED /**< @deprecated @see APR_FOPEN_BUFFERED */ #define APR_DELONCLOSE APR_FOPEN_DELONCLOSE /**< @deprecated @see APR_FOPEN_DELONCLOSE */ #define APR_XTHREAD APR_FOPEN_XTHREAD /**< @deprecated @see APR_FOPEN_XTHREAD */ #define APR_SHARELOCK APR_FOPEN_SHARELOCK /**< @deprecated @see APR_FOPEN_SHARELOCK */ #define APR_FILE_NOCLEANUP APR_FOPEN_NOCLEANUP /**< @deprecated @see APR_FOPEN_NOCLEANUP */ #define APR_SENDFILE_ENABLED APR_FOPEN_SENDFILE_ENABLED /**< @deprecated @see APR_FOPEN_SENDFILE_ENABLED */ #define APR_LARGEFILE APR_FOPEN_LARGEFILE /**< @deprecated @see APR_FOPEN_LARGEFILE */ /** @def APR_FOPEN_LARGEFILE * @warning APR_FOPEN_LARGEFILE flag only has effect on some * platforms where sizeof(apr_off_t) == 4. Where implemented, it * allows opening and writing to a file which exceeds the size which * can be represented by apr_off_t (2 gigabytes). When a file's size * does exceed 2Gb, apr_file_info_get() will fail with an error on the * descriptor, likewise apr_stat()/apr_lstat() will fail on the * filename. apr_dir_read() will fail with #APR_INCOMPLETE on a * directory entry for a large file depending on the particular * APR_FINFO_* flags. Generally, it is not recommended to use this * flag. * * @def APR_FOPEN_SPARSE * @warning APR_FOPEN_SPARSE may, depending on platform, convert a * normal file to a sparse file. Some applications may be unable * to decipher a sparse file, so it's critical that the sparse file * flag should only be used for files accessed only by APR or other * applications known to be able to decipher them. APR does not * guarantee that it will compress the file into sparse segments * if it was previously created and written without the sparse flag. * On platforms which do not understand, or on file systems which * cannot handle sparse files, the flag is ignored by apr_file_open(). * * @def APR_FOPEN_NONBLOCK * @warning APR_FOPEN_NONBLOCK is not implemented on all platforms. * Callers should be prepared for it to fail with #APR_ENOTIMPL. */ /** @} */ /** * @defgroup apr_file_seek_flags File Seek Flags * @{ */ /* flags for apr_file_seek */ /** Set the file position */ #define APR_SET SEEK_SET /** Current */ #define APR_CUR SEEK_CUR /** Go to end of file */ #define APR_END SEEK_END /** @} */ /** * @defgroup apr_file_attrs_set_flags File Attribute Flags * @{ */ /* flags for apr_file_attrs_set */ #define APR_FILE_ATTR_READONLY 0x01 /**< File is read-only */ #define APR_FILE_ATTR_EXECUTABLE 0x02 /**< File is executable */ #define APR_FILE_ATTR_HIDDEN 0x04 /**< File is hidden */ /** @} */ /** * @defgroup apr_file_writev{_full} max iovec size * @{ */ #if defined(DOXYGEN) #define APR_MAX_IOVEC_SIZE 1024 /**< System dependent maximum size of an iovec array */ #elif defined(IOV_MAX) #define APR_MAX_IOVEC_SIZE IOV_MAX #elif defined(MAX_IOVEC) #define APR_MAX_IOVEC_SIZE MAX_IOVEC #else #define APR_MAX_IOVEC_SIZE 1024 #endif /** @} */ /** File attributes */ typedef apr_uint32_t apr_fileattrs_t; /** Type to pass as whence argument to apr_file_seek. */ typedef int apr_seek_where_t; /** * Structure for referencing files. */ typedef struct apr_file_t apr_file_t; /* File lock types/flags */ /** * @defgroup apr_file_lock_types File Lock Types * @{ */ #define APR_FLOCK_SHARED 1 /**< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock. */ #define APR_FLOCK_EXCLUSIVE 2 /**< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock". */ #define APR_FLOCK_TYPEMASK 0x000F /**< mask to extract lock type */ #define APR_FLOCK_NONBLOCK 0x0010 /**< do not block while acquiring the file lock */ /** @} */ /** * Open the specified file. * @param newf The opened file descriptor. * @param fname The full path to the file (using / on all systems) * @param flag Or'ed value of: * @li #APR_FOPEN_READ open for reading * @li #APR_FOPEN_WRITE open for writing * @li #APR_FOPEN_CREATE create the file if not there * @li #APR_FOPEN_APPEND file ptr is set to end prior to all writes * @li #APR_FOPEN_TRUNCATE set length to zero if file exists * @li #APR_FOPEN_BINARY not a text file * @li #APR_FOPEN_BUFFERED buffer the data. Default is non-buffered * @li #APR_FOPEN_EXCL return error if #APR_FOPEN_CREATE and file exists * @li #APR_FOPEN_DELONCLOSE delete the file after closing * @li #APR_FOPEN_XTHREAD Platform dependent tag to open the file * for use across multiple threads * @li #APR_FOPEN_SHARELOCK Platform dependent support for higher * level locked read/write access to support * writes across process/machines * @li #APR_FOPEN_NOCLEANUP Do not register a cleanup with the pool * passed in on the @a pool argument (see below) * @li #APR_FOPEN_SENDFILE_ENABLED Open with appropriate platform semantics * for sendfile operations. Advisory only, * apr_socket_sendfile does not check this flag * @li #APR_FOPEN_LARGEFILE Platform dependent flag to enable large file * support, see WARNING below * @li #APR_FOPEN_SPARSE Platform dependent flag to enable sparse file * support, see WARNING below * @li #APR_FOPEN_NONBLOCK Platform dependent flag to enable * non blocking file io * @param perm Access permissions for file. * @param pool The pool to use. * @remark If perm is #APR_FPROT_OS_DEFAULT and the file is being created, * appropriate default permissions will be used. * @remark By default, the returned file descriptor will not be * inherited by child processes created by apr_proc_create(). This * can be changed using apr_file_inherit_set(). */ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **newf, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *pool); /** * Close the specified file. * @param file The file descriptor to close. */ APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file); /** * Delete the specified file. * @param path The full path to the file (using / on all systems) * @param pool The pool to use. * @remark If the file is open, it won't be removed until all * instances are closed. */ APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *pool); /** * Rename the specified file. * @param from_path The full path to the original file (using / on all systems) * @param to_path The full path to the new file (using / on all systems) * @param pool The pool to use. * @warning If a file exists at the new location, then it will be * overwritten. Moving files or directories across devices may not be * possible. */ APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path, apr_pool_t *pool); /** * Create a hard link to the specified file. * @param from_path The full path to the original file (using / on all systems) * @param to_path The full path to the new file (using / on all systems) * @remark Both files must reside on the same device. */ APR_DECLARE(apr_status_t) apr_file_link(const char *from_path, const char *to_path); /** * Copy the specified file to another file. * @param from_path The full path to the original file (using / on all systems) * @param to_path The full path to the new file (using / on all systems) * @param perms Access permissions for the new file if it is created. * In place of the usual or'd combination of file permissions, the * value #APR_FPROT_FILE_SOURCE_PERMS may be given, in which case the source * file's permissions are copied. * @param pool The pool to use. * @remark The new file does not need to exist, it will be created if required. * @warning If the new file already exists, its contents will be overwritten. */ APR_DECLARE(apr_status_t) apr_file_copy(const char *from_path, const char *to_path, apr_fileperms_t perms, apr_pool_t *pool); /** * Append the specified file to another file. * @param from_path The full path to the source file (use / on all systems) * @param to_path The full path to the destination file (use / on all systems) * @param perms Access permissions for the destination file if it is created. * In place of the usual or'd combination of file permissions, the * value #APR_FPROT_FILE_SOURCE_PERMS may be given, in which case the source * file's permissions are copied. * @param pool The pool to use. * @remark The new file does not need to exist, it will be created if required. */ APR_DECLARE(apr_status_t) apr_file_append(const char *from_path, const char *to_path, apr_fileperms_t perms, apr_pool_t *pool); /** * Are we at the end of the file * @param fptr The apr file we are testing. * @remark Returns #APR_EOF if we are at the end of file, #APR_SUCCESS otherwise. */ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr); /** * Open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. * @param pool The pool to allocate the file out of. * * @remark The only reason that the apr_file_open_std* functions exist * is that you may not always have a stderr/out/in on Windows. This * is generally a problem with newer versions of Windows and services. * * @remark The other problem is that the C library functions generally work * differently on Windows and Unix. So, by using apr_file_open_std* * functions, you can get a handle to an APR struct that works with * the APR functions which are supposed to work identically on all * platforms. */ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *pool); /** * open standard output as an apr file pointer. * @param thefile The apr file to use as stdout. * @param pool The pool to allocate the file out of. * * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *pool); /** * open standard input as an apr file pointer. * @param thefile The apr file to use as stdin. * @param pool The pool to allocate the file out of. * * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *pool); /** * open standard error as an apr file pointer, with flags. * @param thefile The apr file to use as stderr. * @param flags The flags to open the file with. Only the * @li #APR_FOPEN_EXCL * @li #APR_FOPEN_BUFFERED * @li #APR_FOPEN_XTHREAD * @li #APR_FOPEN_SHARELOCK * @li #APR_FOPEN_SENDFILE_ENABLED * @li #APR_FOPEN_LARGEFILE * * flags should be used. The #APR_FOPEN_WRITE flag will * be set unconditionally. * @param pool The pool to allocate the file out of. * * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_flags_stderr(apr_file_t **thefile, apr_int32_t flags, apr_pool_t *pool); /** * open standard output as an apr file pointer, with flags. * @param thefile The apr file to use as stdout. * @param flags The flags to open the file with. Only the * @li #APR_FOPEN_EXCL * @li #APR_FOPEN_BUFFERED * @li #APR_FOPEN_XTHREAD * @li #APR_FOPEN_SHARELOCK * @li #APR_FOPEN_SENDFILE_ENABLED * @li #APR_FOPEN_LARGEFILE * * flags should be used. The #APR_FOPEN_WRITE flag will * be set unconditionally. * @param pool The pool to allocate the file out of. * * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_flags_stdout(apr_file_t **thefile, apr_int32_t flags, apr_pool_t *pool); /** * open standard input as an apr file pointer, with flags. * @param thefile The apr file to use as stdin. * @param flags The flags to open the file with. Only the * @li #APR_FOPEN_EXCL * @li #APR_FOPEN_BUFFERED * @li #APR_FOPEN_XTHREAD * @li #APR_FOPEN_SHARELOCK * @li #APR_FOPEN_SENDFILE_ENABLED * @li #APR_FOPEN_LARGEFILE * * flags should be used. The #APR_FOPEN_WRITE flag will * be set unconditionally. * @param pool The pool to allocate the file out of. * * @remark See remarks for apr_file_open_stderr(). */ APR_DECLARE(apr_status_t) apr_file_open_flags_stdin(apr_file_t **thefile, apr_int32_t flags, apr_pool_t *pool); /** * Read data from the specified file. * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. * @param nbytes On entry, the number of bytes to read; on exit, the number * of bytes read. * * @remark apr_file_read() will read up to the specified number of * bytes, but never more. If there isn't enough data to fill that * number of bytes, all of the available data is read. The third * argument is modified to reflect the number of bytes read. If a * char was put back into the stream via ungetc, it will be the first * character returned. * * @remark It is not possible for both bytes to be read and an #APR_EOF * or other error to be returned. #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); /** * Write data to the specified file. * @param thefile The file descriptor to write to. * @param buf The buffer which contains the data. * @param nbytes On entry, the number of bytes to write; on exit, the number * of bytes written. * * @remark apr_file_write() will write up to the specified number of * bytes, but never more. If the OS cannot write that many bytes, it * will write as many as it can. The third argument is modified to * reflect the * number of bytes written. * * @remark It is possible for both bytes to be written and an error to * be returned. #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes); /** * Write data from iovec array to the specified file. * @param thefile The file descriptor to write to. * @param vec The array from which to get the data to write to the file. * @param nvec The number of elements in the struct iovec array. This must * be smaller than #APR_MAX_IOVEC_SIZE. If it isn't, the function * will fail with #APR_EINVAL. * @param nbytes The number of bytes written. * * @remark It is possible for both bytes to be written and an error to * be returned. #APR_EINTR is never returned. * * @remark apr_file_writev() is available even if the underlying * operating system doesn't provide writev(). */ APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes); /** * Read data from the specified file, ensuring that the buffer is filled * before returning. * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. * * @remark apr_file_read_full() will read up to the specified number of * bytes, but never more. If there isn't enough data to fill that * number of bytes, then the process/thread will block until it is * available or EOF is reached. If a char was put back into the * stream via ungetc, it will be the first character returned. * * @remark It is possible for both bytes to be read and an error to be * returned. And if *bytes_read is less than nbytes, an accompanying * error is _always_ returned. * * @remark #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read); /** * Write data to the specified file, ensuring that all of the data is * written before returning. * @param thefile The file descriptor to write to. * @param buf The buffer which contains the data. * @param nbytes The number of bytes to write. * @param bytes_written If non-NULL, set to the number of bytes written. * * @remark apr_file_write_full() will write up to the specified number of * bytes, but never more. If the OS cannot write that many bytes, the * process/thread will block until they can be written. Exceptional * error such as "out of space" or "pipe closed" will terminate with * an error. * * @remark It is possible for both bytes to be written and an error to * be returned. And if *bytes_written is less than nbytes, an * accompanying error is _always_ returned. * * @remark #APR_EINTR is never returned. */ APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written); /** * Write data from iovec array to the specified file, ensuring that all of the * data is written before returning. * @param thefile The file descriptor to write to. * @param vec The array from which to get the data to write to the file. * @param nvec The number of elements in the struct iovec array. This must * be smaller than #APR_MAX_IOVEC_SIZE. If it isn't, the function * will fail with #APR_EINVAL. * @param nbytes The number of bytes written. * * @remark apr_file_writev_full() is available even if the underlying * operating system doesn't provide writev(). */ APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes); /** * Write a character into the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to */ APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile); /** * Read a character from the specified file. * @param ch The character to read into * @param thefile The file descriptor to read from */ APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile); /** * Put a character back onto a specified stream. * @param ch The character to write. * @param thefile The file descriptor to write to */ APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile); /** * Read a line from the specified file * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from * @remark The buffer will be NUL-terminated if any characters are stored. * The newline at the end of the line will not be stripped. */ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile); /** * Write the string into the specified file. * @param str The string to write. * @param thefile The file descriptor to write to */ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile); /** * Flush the file's buffer. * @param thefile The file descriptor to flush */ APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile); /** * Transfer all file modified data and metadata to disk. * @param thefile The file descriptor to sync */ APR_DECLARE(apr_status_t) apr_file_sync(apr_file_t *thefile); /** * Transfer all file modified data to disk. * @param thefile The file descriptor to sync */ APR_DECLARE(apr_status_t) apr_file_datasync(apr_file_t *thefile); /** * Duplicate the specified file descriptor. * @param new_file The structure to duplicate into. * @param old_file The file to duplicate. * @param p The pool to use for the new file. * @remark *new_file must point to a valid apr_file_t, or point to NULL. */ APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); /** * Duplicate the specified file descriptor and close the original * @param new_file The old file that is to be closed and reused * @param old_file The file to duplicate * @param p The pool to use for the new file * * @remark new_file MUST point at a valid apr_file_t. It cannot be NULL. */ APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file, apr_file_t *old_file, apr_pool_t *p); /** * Move the specified file descriptor to a new pool * @param new_file Pointer in which to return the new apr_file_t * @param old_file The file to move * @param p The pool to which the descriptor is to be moved * @remark Unlike apr_file_dup2(), this function doesn't do an * OS dup() operation on the underlying descriptor; it just * moves the descriptor's apr_file_t wrapper to a new pool. * @remark The new pool need not be an ancestor of old_file's pool. * @remark After calling this function, old_file may not be used */ APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); /** * Give the specified apr file handle a new buffer * @param thefile The file handle that is to be modified * @param buffer The buffer * @param bufsize The size of the buffer * @remark It is possible to add a buffer to previously unbuffered * file handles, the #APR_FOPEN_BUFFERED flag will be added to * the file handle's flags. Likewise, with buffer=NULL and * bufsize=0 arguments it is possible to make a previously * buffered file handle unbuffered. */ APR_DECLARE(apr_status_t) apr_file_buffer_set(apr_file_t *thefile, char * buffer, apr_size_t bufsize); /** * Get the size of any buffer for the specified apr file handle * @param thefile The file handle */ APR_DECLARE(apr_size_t) apr_file_buffer_size_get(apr_file_t *thefile); /** * Move the read/write file offset to a specified byte within a file. * @param thefile The file descriptor * @param where How to move the pointer, one of: * @li #APR_SET -- set the offset to offset * @li #APR_CUR -- add the offset to the current position * @li #APR_END -- add the offset to the current file size * @param offset The offset to move the pointer to. * @remark The third argument is modified to be the offset the pointer was actually moved to. */ APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset); /** * Create an anonymous pipe. * @param in The newly created pipe's file for reading. * @param out The newly created pipe's file for writing. * @param pool The pool to operate on. * @remark By default, the returned file descriptors will be inherited * by child processes created using apr_proc_create(). This can be * changed using apr_file_inherit_unset(). * @bug Some platforms cannot toggle between blocking and nonblocking, * and when passing a pipe as a standard handle to an application which * does not expect it, a non-blocking stream will fluxor the client app. * @deprecated @see apr_file_pipe_create_ex() */ APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *pool); /** * Create an anonymous pipe which portably supports async timeout options. * @param in The newly created pipe's file for reading. * @param out The newly created pipe's file for writing. * @param blocking one of these values defined in apr_thread_proc.h; * @li #APR_FULL_BLOCK * @li #APR_READ_BLOCK * @li #APR_WRITE_BLOCK * @li #APR_FULL_NONBLOCK * @param pool The pool to operate on. * @remark By default, the returned file descriptors will be inherited * by child processes created using apr_proc_create(). This can be * changed using apr_file_inherit_unset(). * @remark Some platforms cannot toggle between blocking and nonblocking, * and when passing a pipe as a standard handle to an application which * does not expect it, a non-blocking stream will fluxor the client app. * Use this function rather than apr_file_pipe_create() to create pipes * where one or both ends require non-blocking semantics. */ APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, apr_file_t **out, apr_int32_t blocking, apr_pool_t *pool); /** * Create a named pipe. * @param filename The filename of the named pipe * @param perm The permissions for the newly created pipe. * @param pool The pool to operate on. */ APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *pool); /** * Get the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are getting a timeout for. * @param timeout The current timeout value in microseconds. */ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout); /** * Set the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are setting a timeout on. * @param timeout The timeout value in microseconds. Values < 0 mean wait * forever, 0 means do not wait at all. */ APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout); /** file (un)locking functions. */ /** * Establish a lock on the specified, open file. The lock may be advisory * or mandatory, at the discretion of the platform. The lock applies to * the file as a whole, rather than a specific range. Locks are established * on a per-thread/process basis; a second lock by the same thread will not * block. * @param thefile The file to lock. * @param type The type of lock to establish on the file. */ APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type); /** * Remove any outstanding locks on the file. * @param thefile The file to unlock. */ APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile); /**accessor and general file_io functions. */ /** * return the file name of the current file. * @param new_path The path of the file. * @param thefile The currently open file. */ APR_DECLARE(apr_status_t) apr_file_name_get(const char **new_path, apr_file_t *thefile); /** * Return the data associated with the current file. * @param data The user data associated with the file. * @param key The key to use for retrieving data associated with this file. * @param file The currently open file. */ APR_DECLARE(apr_status_t) apr_file_data_get(void **data, const char *key, apr_file_t *file); /** * Set the data associated with the current file. * @param file The currently open file. * @param data The user data to associate with the file. * @param key The key to use for associating data with the file. * @param cleanup The cleanup routine to use when the file is destroyed. */ APR_DECLARE(apr_status_t) apr_file_data_set(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)); /** * Write a string to a file using a printf format. * @param fptr The file to write to. * @param format The format string * @param ... The values to substitute in the format string * @return The number of bytes written */ APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); /** * set the specified file's permission bits. * @param fname The file (name) to apply the permissions to. * @param perms The permission bits to apply to the file. * * @warning Some platforms may not be able to apply all of the * available permission bits; #APR_INCOMPLETE will be returned if some * permissions are specified which could not be set. * * @warning Platforms which do not implement this feature will return * #APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms); /** * Set attributes of the specified file. * @param fname The full path to the file (using / on all systems) * @param attributes Or'd combination of * @li #APR_FILE_ATTR_READONLY - make the file readonly * @li #APR_FILE_ATTR_EXECUTABLE - make the file executable * @li #APR_FILE_ATTR_HIDDEN - make the file hidden * @param attr_mask Mask of valid bits in attributes. * @param pool the pool to use. * @remark This function should be used in preference to explicit manipulation * of the file permissions, because the operations to provide these * attributes are platform specific and may involve more than simply * setting permission bits. * @warning Platforms which do not implement this feature will return * #APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, apr_fileattrs_t attributes, apr_fileattrs_t attr_mask, apr_pool_t *pool); /** * Set the mtime of the specified file. * @param fname The full path to the file (using / on all systems) * @param mtime The mtime to apply to the file. * @param pool The pool to use. * @warning Platforms which do not implement this feature will return * #APR_ENOTIMPL. */ APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, apr_time_t mtime, apr_pool_t *pool); /** * Create a new directory on the file system. * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new directory. * @param pool the pool to use. */ APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool); /** Creates a new directory on the file system, but behaves like * 'mkdir -p'. Creates intermediate directories as required. No error * will be reported if PATH already exists. * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new directory. * @param pool the pool to use. */ APR_DECLARE(apr_status_t) apr_dir_make_recursive(const char *path, apr_fileperms_t perm, apr_pool_t *pool); /** * Remove directory from the file system. * @param path the path for the directory to be removed. (use / on all systems) * @param pool the pool to use. * @remark Removing a directory which is in-use (e.g., the current working * directory, or during apr_dir_read, or with an open file) is not portable. */ APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *pool); /** * get the specified file's stats. * @param finfo Where to store the information about the file. * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_* values * @param thefile The file to get information about. */ APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile); /** * Truncate the file's length to the specified offset * @param fp The file to truncate * @param offset The offset to truncate to. * @remark The read/write file offset is repositioned to offset. */ APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset); /** * Retrieve the flags that were passed into apr_file_open() * when the file was opened. * @return apr_int32_t the flags */ APR_DECLARE(apr_int32_t) apr_file_flags_get(apr_file_t *f); /** * Get the pool used by the file. */ APR_POOL_DECLARE_ACCESSOR(file); /** * Set a file to be inherited by child processes. * */ APR_DECLARE_INHERIT_SET(file); /** * Unset a file from being inherited by child processes. */ APR_DECLARE_INHERIT_UNSET(file); /** * Open a temporary file * @param fp The apr file to use as a temporary file. * @param templ The template to use when creating a temp file. * @param flags The flags to open the file with. If this is zero, * the file is opened with * #APR_FOPEN_CREATE | #APR_FOPEN_READ | #APR_FOPEN_WRITE | * #APR_FOPEN_EXCL | #APR_FOPEN_DELONCLOSE * @param p The pool to allocate the file out of. * @remark * This function generates a unique temporary file name from template. * The last six characters of template must be XXXXXX and these are replaced * with a string that makes the filename unique. Since it will be modified, * template must not be a string constant, but should be declared as a character * array. * */ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *templ, apr_int32_t flags, apr_pool_t *p); /** * Find an existing directory suitable as a temporary storage location. * @param temp_dir The temp directory. * @param p The pool to use for any necessary allocations. * @remark * This function uses an algorithm to search for a directory that an * an application can use for temporary storage. * */ APR_DECLARE(apr_status_t) apr_temp_dir_get(const char **temp_dir, apr_pool_t *p); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_FILE_IO_H */ ================================================ FILE: third_party/include/apr/apr_fnmatch.h ================================================ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)fnmatch.h 8.1 (Berkeley) 6/2/93 */ /* This file has been modified by the Apache Software Foundation. */ #ifndef _APR_FNMATCH_H_ #define _APR_FNMATCH_H_ /** * @file apr_fnmatch.h * @brief APR FNMatch Functions */ #include "apr_errno.h" #include "apr_tables.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup apr_fnmatch Filename Matching Functions * @ingroup APR * @{ */ #define APR_FNM_NOMATCH 1 /**< Match failed. */ #define APR_FNM_NOESCAPE 0x01 /**< Disable backslash escaping. */ #define APR_FNM_PATHNAME 0x02 /**< Slash must be matched by slash. */ #define APR_FNM_PERIOD 0x04 /**< Period must be matched by period. */ #define APR_FNM_CASE_BLIND 0x08 /**< Compare characters case-insensitively. */ /** * Try to match the string to the given pattern, return APR_SUCCESS if * match, else return APR_FNM_NOMATCH. Note that there is no such thing as * an illegal pattern. * * With all flags unset, a pattern is interpreted as such: * * PATTERN: Backslash followed by any character, including another * backslash.
* MATCHES: That character exactly. * *

* PATTERN: ?
* MATCHES: Any single character. *

* *

* PATTERN: *
* MATCHES: Any sequence of zero or more characters. (Note that multiple * *s in a row are equivalent to one.) * * PATTERN: Any character other than \?*[ or a \ at the end of the pattern
* MATCHES: That character exactly. (Case sensitive.) * * PATTERN: [ followed by a class description followed by ]
* MATCHES: A single character described by the class description. * (Never matches, if the class description reaches until the * end of the string without a ].) If the first character of * the class description is ^ or !, the sense of the description * is reversed. The rest of the class description is a list of * single characters or pairs of characters separated by -. Any * of those characters can have a backslash in front of them, * which is ignored; this lets you use the characters ] and - * in the character class, as well as ^ and ! at the * beginning. The pattern matches a single character if it * is one of the listed characters or falls into one of the * listed ranges (inclusive, case sensitive). Ranges with * the first character larger than the second are legal but * never match. Edge cases: [] never matches, and [^] and [!] * always match without consuming a character. * * Note that these patterns attempt to match the entire string, not * just find a substring matching the pattern. * * @param pattern The pattern to match to * @param strings The string we are trying to match * @param flags flags to use in the match. Bitwise OR of: *

 *              APR_FNM_NOESCAPE       Disable backslash escaping
 *              APR_FNM_PATHNAME       Slash must be matched by slash
 *              APR_FNM_PERIOD         Period must be matched by period
 *              APR_FNM_CASE_BLIND     Compare characters case-insensitively.
 * 
*/ APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *strings, int flags); /** * Determine if the given pattern is a regular expression. * @param pattern The pattern to search for glob characters. * @return non-zero if pattern has any glob characters in it */ APR_DECLARE(int) apr_fnmatch_test(const char *pattern); /** * Find all files that match a specified pattern in a directory. * @param dir_pattern The pattern to use for finding files, appended * to the search directory. The pattern is anything following the * final forward or backward slash in the parameter. If no slash * is found, the current directory is searched. * @param result Array to use when storing the results * @param p The pool to use. * @return APR_SUCCESS if no processing errors occurred, APR error * code otherwise * @remark The returned array may be empty even if APR_SUCCESS was * returned. */ APR_DECLARE(apr_status_t) apr_match_glob(const char *dir_pattern, apr_array_header_t **result, apr_pool_t *p); /** @} */ #ifdef __cplusplus } #endif #endif /* !_APR_FNMATCH_H_ */ ================================================ FILE: third_party/include/apr/apr_general.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_GENERAL_H #define APR_GENERAL_H /** * @file apr_general.h * This is collection of oddballs that didn't fit anywhere else, * and might move to more appropriate headers with the release * of APR 1.0. * @brief APR Miscellaneous library routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #if APR_HAVE_SIGNAL_H #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_general Miscellaneous library routines * @ingroup APR * This is collection of oddballs that didn't fit anywhere else, * and might move to more appropriate headers with the release * of APR 1.0. * @{ */ /** FALSE */ #ifndef FALSE #define FALSE 0 #endif /** TRUE */ #ifndef TRUE #define TRUE (!FALSE) #endif /** a space */ #define APR_ASCII_BLANK '\040' /** a carrige return */ #define APR_ASCII_CR '\015' /** a line feed */ #define APR_ASCII_LF '\012' /** a tab */ #define APR_ASCII_TAB '\011' /** signal numbers typedef */ typedef int apr_signum_t; /** * Finding offsets of elements within structures. * Taken from the X code... they've sweated portability of this stuff * so we don't have to. Sigh... * @param p_type pointer type name * @param field data field within the structure pointed to * @return offset */ #if defined(CRAY) || (defined(__arm) && !(defined(LINUX) || defined(__FreeBSD__))) #ifdef __STDC__ #define APR_OFFSET(p_type,field) _Offsetof(p_type,field) #else #ifdef CRAY2 #define APR_OFFSET(p_type,field) \ (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) #else /* !CRAY2 */ #define APR_OFFSET(p_type,field) ((unsigned int)&(((p_type)NULL)->field)) #endif /* !CRAY2 */ #endif /* __STDC__ */ #else /* ! (CRAY || __arm) */ #define APR_OFFSET(p_type,field) \ ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) #endif /* !CRAY */ /** * Finding offsets of elements within structures. * @param s_type structure type name * @param field data field within the structure * @return offset */ #if defined(offsetof) && !defined(__cplusplus) #define APR_OFFSETOF(s_type,field) offsetof(s_type,field) #else #define APR_OFFSETOF(s_type,field) APR_OFFSET(s_type*,field) #endif #ifndef DOXYGEN /* A couple of prototypes for functions in case some platform doesn't * have it */ #if (!APR_HAVE_STRCASECMP) && (APR_HAVE_STRICMP) #define strcasecmp(s1, s2) stricmp(s1, s2) #elif (!APR_HAVE_STRCASECMP) int strcasecmp(const char *a, const char *b); #endif #if (!APR_HAVE_STRNCASECMP) && (APR_HAVE_STRNICMP) #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n) #elif (!APR_HAVE_STRNCASECMP) int strncasecmp(const char *a, const char *b, size_t n); #endif #endif /** * Alignment macros */ /* APR_ALIGN() is only to be used to align on a power of 2 boundary */ #define APR_ALIGN(size, boundary) \ (((size) + ((boundary) - 1)) & ~((boundary) - 1)) /** Default alignment */ #define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8) /** * String and memory functions */ /* APR_STRINGIFY is defined here, and also in apr_release.h, so wrap it */ #ifndef APR_STRINGIFY /** Properly quote a value as a string in the C preprocessor */ #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) /** Helper macro for APR_STRINGIFY */ #define APR_STRINGIFY_HELPER(n) #n #endif #if (!APR_HAVE_MEMMOVE) #define memmove(a,b,c) bcopy(b,a,c) #endif #if (!APR_HAVE_MEMCHR) void *memchr(const void *s, int c, size_t n); #endif /** @} */ /** * @defgroup apr_library Library initialization and termination * @{ */ /** * Setup any APR internal data structures. This MUST be the first function * called for any APR library. It is safe to call apr_initialize several * times as long as apr_terminate is called the same number of times. * @remark See apr_app_initialize if this is an application, rather than * a library consumer of apr. */ APR_DECLARE(apr_status_t) apr_initialize(void); /** * Set up an application with normalized argc, argv (and optionally env) in * order to deal with platform-specific oddities, such as Win32 services, * code pages and signals. This must be the first function called for any * APR program. * @param argc Pointer to the argc that may be corrected * @param argv Pointer to the argv that may be corrected * @param env Pointer to the env that may be corrected, may be NULL * @remark See apr_initialize if this is a library consumer of apr. * Otherwise, this call is identical to apr_initialize, and must be closed * with a call to apr_terminate at the end of program execution. */ APR_DECLARE(apr_status_t) apr_app_initialize(int *argc, char const * const * *argv, char const * const * *env); /** * Tear down any APR internal data structures which aren't torn down * automatically. apr_terminate must be called once for every call to * apr_initialize() or apr_app_initialize(). * @remark An APR program must call this function at termination once it * has stopped using APR services. The APR developers suggest using * atexit to ensure this is called. When using APR from a language * other than C that has problems with the calling convention, use * apr_terminate2() instead. */ APR_DECLARE_NONSTD(void) apr_terminate(void); /** * Tear down any APR internal data structures which aren't torn down * automatically, same as apr_terminate * @remark An APR program must call either the apr_terminate or apr_terminate2 * function once it it has finished using APR services. The APR * developers suggest using atexit(apr_terminate) to ensure this is done. * apr_terminate2 exists to allow non-c language apps to tear down apr, * while apr_terminate is recommended from c language applications. */ APR_DECLARE(void) apr_terminate2(void); /** @} */ /** * @defgroup apr_random Random Functions * @{ */ #if APR_HAS_RANDOM || defined(DOXYGEN) /* TODO: I'm not sure this is the best place to put this prototype...*/ /** * Generate random bytes. * @param buf Buffer to fill with random bytes * @param length Length of buffer in bytes */ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf, apr_size_t length); #endif /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_GENERAL_H */ ================================================ FILE: third_party/include/apr/apr_getopt.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_GETOPT_H #define APR_GETOPT_H /** * @file apr_getopt.h * @brief APR Command Arguments (getopt) */ #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_getopt Command Argument Parsing * @ingroup APR * @{ */ /** * An @c apr_getopt_t error callback function. * * @a arg is this @c apr_getopt_t's @c errarg member. */ typedef void (apr_getopt_err_fn_t)(void *arg, const char *err, ...); /** @see apr_getopt_t */ typedef struct apr_getopt_t apr_getopt_t; /** * Structure to store command line argument information. */ struct apr_getopt_t { /** context for processing */ apr_pool_t *cont; /** function to print error message (NULL == no messages) */ apr_getopt_err_fn_t *errfn; /** user defined first arg to pass to error message */ void *errarg; /** index into parent argv vector */ int ind; /** character checked for validity */ int opt; /** reset getopt */ int reset; /** count of arguments */ int argc; /** array of pointers to arguments */ const char **argv; /** argument associated with option */ char const* place; /** set to nonzero to support interleaving options with regular args */ int interleave; /** start of non-option arguments skipped for interleaving */ int skip_start; /** end of non-option arguments skipped for interleaving */ int skip_end; }; /** @see apr_getopt_option_t */ typedef struct apr_getopt_option_t apr_getopt_option_t; /** * Structure used to describe options that getopt should search for. */ struct apr_getopt_option_t { /** long option name, or NULL if option has no long name */ const char *name; /** option letter, or a value greater than 255 if option has no letter */ int optch; /** nonzero if option takes an argument */ int has_arg; /** a description of the option */ const char *description; }; /** * Initialize the arguments for parsing by apr_getopt(). * @param os The options structure created for apr_getopt() * @param cont The pool to operate on * @param argc The number of arguments to parse * @param argv The array of arguments to parse * @remark Arguments 3 and 4 are most commonly argc and argv from main(argc, argv) * The (*os)->errfn is initialized to fprintf(stderr... but may be overridden. */ APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, int argc, const char * const *argv); /** * Parse the options initialized by apr_getopt_init(). * @param os The apr_opt_t structure returned by apr_getopt_init() * @param opts A string of characters that are acceptable options to the * program. Characters followed by ":" are required to have an * option associated * @param option_ch The next option character parsed * @param option_arg The argument following the option character: * @return There are four potential status values on exit. They are: *
 *             APR_EOF      --  No more options to parse
 *             APR_BADCH    --  Found a bad option character
 *             APR_BADARG   --  No argument followed the option flag
 *             APR_SUCCESS  --  The next option was found.
 * 
*/ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts, char *option_ch, const char **option_arg); /** * Parse the options initialized by apr_getopt_init(), accepting long * options beginning with "--" in addition to single-character * options beginning with "-". * @param os The apr_getopt_t structure created by apr_getopt_init() * @param opts A pointer to a list of apr_getopt_option_t structures, which * can be initialized with { "name", optch, has_args }. has_args * is nonzero if the option requires an argument. A structure * with an optch value of 0 terminates the list. * @param option_ch Receives the value of "optch" from the apr_getopt_option_t * structure corresponding to the next option matched. * @param option_arg Receives the argument following the option, if any. * @return There are four potential status values on exit. They are: *
 *             APR_EOF      --  No more options to parse
 *             APR_BADCH    --  Found a bad option character
 *             APR_BADARG   --  No argument followed the option flag
 *             APR_SUCCESS  --  The next option was found.
 * 
* When APR_SUCCESS is returned, os->ind gives the index of the first * non-option argument. On error, a message will be printed to stdout unless * os->err is set to 0. If os->interleave is set to nonzero, options can come * after arguments, and os->argv will be permuted to leave non-option arguments * at the end (the original argv is unaffected). */ APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os, const apr_getopt_option_t *opts, int *option_ch, const char **option_arg); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_GETOPT_H */ ================================================ FILE: third_party/include/apr/apr_global_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_GLOBAL_MUTEX_H #define APR_GLOBAL_MUTEX_H /** * @file apr_global_mutex.h * @brief APR Global Locking Routines */ #include "apr.h" #include "apr_proc_mutex.h" /* only for apr_lockmech_e */ #include "apr_pools.h" #include "apr_errno.h" #if APR_PROC_MUTEX_IS_GLOBAL #include "apr_proc_mutex.h" #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup APR_GlobalMutex Global Locking Routines * @ingroup APR * @{ */ #if !APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN) /** Opaque global mutex structure. */ typedef struct apr_global_mutex_t apr_global_mutex_t; /* Function definitions */ /** * Create and initialize a mutex that can be used to synchronize both * processes and threads. Note: There is considerable overhead in using * this API if only cross-process or cross-thread mutual exclusion is * required. See apr_proc_mutex.h and apr_thread_mutex.h for more * specialized lock routines. * @param mutex the memory address where the newly created mutex will be * stored. * @param fname A file name to use if the lock mechanism requires one. This * argument should always be provided. The lock code itself will * determine if it should be used. * @param mech The mechanism to use for the interprocess lock, if any; one of *
 *            APR_LOCK_FCNTL
 *            APR_LOCK_FLOCK
 *            APR_LOCK_SYSVSEM
 *            APR_LOCK_POSIXSEM
 *            APR_LOCK_PROC_PTHREAD
 *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
 * 
* @param pool the pool from which to allocate the mutex. * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. */ APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex, const char *fname, apr_lockmech_e mech, apr_pool_t *pool); /** * Re-open a mutex in a child process. * @param mutex The newly re-opened mutex structure. * @param fname A file name to use if the mutex mechanism requires one. This * argument should always be provided. The mutex code itself will * determine if it should be used. This filename should be the * same one that was passed to apr_global_mutex_create(). * @param pool The pool to operate on. * @remark This function must be called to maintain portability, even * if the underlying lock mechanism does not require it. */ APR_DECLARE(apr_status_t) apr_global_mutex_child_init( apr_global_mutex_t **mutex, const char *fname, apr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, * the current thread will be put to sleep until the lock becomes available. * @param mutex the mutex on which to acquire the lock. */ APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex); /** * Attempt to acquire the lock for the given mutex. If the mutex has already * been acquired, the call returns immediately with APR_EBUSY. Note: it * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine * if the return value was APR_EBUSY, for portability reasons. * @param mutex the mutex on which to attempt the lock acquiring. */ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex); /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. */ APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. */ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex); /** * Return the name of the lockfile for the mutex, or NULL * if the mutex doesn't use a lock file */ APR_DECLARE(const char *) apr_global_mutex_lockfile(apr_global_mutex_t *mutex); /** * Display the name of the mutex, as it relates to the actual method used * for the underlying apr_proc_mutex_t, if any. NULL is returned if * there is no underlying apr_proc_mutex_t. * @param mutex the name of the mutex */ APR_DECLARE(const char *) apr_global_mutex_name(apr_global_mutex_t *mutex); /** * Get the pool used by this global_mutex. * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(global_mutex); #else /* APR_PROC_MUTEX_IS_GLOBAL */ /* Some platforms [e.g. Win32] have cross process locks that are truly * global locks, since there isn't the concept of cross-process locks. * Define these platforms in terms of an apr_proc_mutex_t. */ #define apr_global_mutex_t apr_proc_mutex_t #define apr_global_mutex_create apr_proc_mutex_create #define apr_global_mutex_child_init apr_proc_mutex_child_init #define apr_global_mutex_lock apr_proc_mutex_lock #define apr_global_mutex_trylock apr_proc_mutex_trylock #define apr_global_mutex_unlock apr_proc_mutex_unlock #define apr_global_mutex_destroy apr_proc_mutex_destroy #define apr_global_mutex_lockfile apr_proc_mutex_lockfile #define apr_global_mutex_name apr_proc_mutex_name #define apr_global_mutex_pool_get apr_proc_mutex_pool_get #endif /** @} */ #ifdef __cplusplus } #endif #endif /* ndef APR_GLOBAL_MUTEX_H */ ================================================ FILE: third_party/include/apr/apr_hash.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_HASH_H #define APR_HASH_H /** * @file apr_hash.h * @brief APR Hash Tables */ #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup apr_hash Hash Tables * @ingroup APR * @{ */ /** * When passing a key to apr_hash_set or apr_hash_get, this value can be * passed to indicate a string-valued key, and have apr_hash compute the * length automatically. * * @remark apr_hash will use strlen(key) for the length. The NUL terminator * is not included in the hash value (why throw a constant in?). * Since the hash table merely references the provided key (rather * than copying it), apr_hash_this() will return the NUL-term'd key. */ #define APR_HASH_KEY_STRING (-1) /** * Abstract type for hash tables. */ typedef struct apr_hash_t apr_hash_t; /** * Abstract type for scanning hash tables. */ typedef struct apr_hash_index_t apr_hash_index_t; /** * Callback functions for calculating hash values. * @param key The key. * @param klen The length of the key, or APR_HASH_KEY_STRING to use the string * length. If APR_HASH_KEY_STRING then returns the actual key length. */ typedef unsigned int (*apr_hashfunc_t)(const char *key, apr_ssize_t *klen); /** * The default hash function. */ APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *key, apr_ssize_t *klen); /** * Create a hash table. * @param pool The pool to allocate the hash table out of * @return The hash table just created */ APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool); /** * Create a hash table with a custom hash function * @param pool The pool to allocate the hash table out of * @param hash_func A custom hash function. * @return The hash table just created */ APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool, apr_hashfunc_t hash_func); /** * Make a copy of a hash table * @param pool The pool from which to allocate the new hash table * @param h The hash table to clone * @return The hash table just created * @remark Makes a shallow copy */ APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool, const apr_hash_t *h); /** * Associate a value with a key in a hash table. * @param ht The hash table * @param key Pointer to the key * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length. * @param val Value to associate with the key * @remark If the value is NULL the hash entry is deleted. */ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key, apr_ssize_t klen, const void *val); /** * Look up the value associated with a key in a hash table. * @param ht The hash table * @param key Pointer to the key * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string length. * @return Returns NULL if the key is not present. */ APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key, apr_ssize_t klen); /** * Start iterating over the entries in a hash table. * @param p The pool to allocate the apr_hash_index_t iterator. If this * pool is NULL, then an internal, non-thread-safe iterator is used. * @param ht The hash table * @return The iteration state * @remark There is no restriction on adding or deleting hash entries during * an iteration (although the results may be unpredictable unless all you do * is delete the current entry) and multiple iterations can be in * progress at the same time. * * @par Example: * * @code * int sum_values(apr_pool_t *p, apr_hash_t *ht) * { * apr_hash_index_t *hi; * void *val; * int sum = 0; * for (hi = apr_hash_first(p, ht); hi; hi = apr_hash_next(hi)) { * apr_hash_this(hi, NULL, NULL, &val); * sum += *(int *)val; * } * return sum; * } * @endcode */ APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht); /** * Continue iterating over the entries in a hash table. * @param hi The iteration state * @return a pointer to the updated iteration state. NULL if there are no more * entries. */ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi); /** * Get the current entry's details from the iteration state. * @param hi The iteration state * @param key Return pointer for the pointer to the key. * @param klen Return pointer for the key length. * @param val Return pointer for the associated value. * @remark The return pointers should point to a variable that will be set to the * corresponding data, or they may be NULL if the data isn't interesting. */ APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, apr_ssize_t *klen, void **val); /** * Get the current entry's key from the iteration state. * @param hi The iteration state * @return The pointer to the key */ APR_DECLARE(const void*) apr_hash_this_key(apr_hash_index_t *hi); /** * Get the current entry's key length from the iteration state. * @param hi The iteration state * @return The key length */ APR_DECLARE(apr_ssize_t) apr_hash_this_key_len(apr_hash_index_t *hi); /** * Get the current entry's value from the iteration state. * @param hi The iteration state * @return The pointer to the value */ APR_DECLARE(void*) apr_hash_this_val(apr_hash_index_t *hi); /** * Get the number of key/value pairs in the hash table. * @param ht The hash table * @return The number of key/value pairs in the hash table. */ APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht); /** * Clear any key/value pairs in the hash table. * @param ht The hash table */ APR_DECLARE(void) apr_hash_clear(apr_hash_t *ht); /** * Merge two hash tables into one new hash table. The values of the overlay * hash override the values of the base if both have the same key. Both * hash tables must use the same hash function. * @param p The pool to use for the new hash table * @param overlay The table to add to the initial table * @param base The table that represents the initial values of the new table * @return A new hash table containing all of the data from the two passed in */ APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p, const apr_hash_t *overlay, const apr_hash_t *base); /** * Merge two hash tables into one new hash table. If the same key * is present in both tables, call the supplied merge function to * produce a merged value for the key in the new table. Both * hash tables must use the same hash function. * @param p The pool to use for the new hash table * @param h1 The first of the tables to merge * @param h2 The second of the tables to merge * @param merger A callback function to merge values, or NULL to * make values from h1 override values from h2 (same semantics as * apr_hash_overlay()) * @param data Client data to pass to the merger function * @return A new hash table containing all of the data from the two passed in */ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, const apr_hash_t *h1, const apr_hash_t *h2, void * (*merger)(apr_pool_t *p, const void *key, apr_ssize_t klen, const void *h1_val, const void *h2_val, const void *data), const void *data); /** * Declaration prototype for the iterator callback function of apr_hash_do(). * * @param rec The data passed as the first argument to apr_hash_[v]do() * @param key The key from this iteration of the hash table * @param klen The key length from this iteration of the hash table * @param value The value from this iteration of the hash table * @remark Iteration continues while this callback function returns non-zero. * To export the callback function for apr_hash_do() it must be declared * in the _NONSTD convention. */ typedef int (apr_hash_do_callback_fn_t)(void *rec, const void *key, apr_ssize_t klen, const void *value); /** * Iterate over a hash table running the provided function once for every * element in the hash table. The @param comp function will be invoked for * every element in the hash table. * * @param comp The function to run * @param rec The data to pass as the first argument to the function * @param ht The hash table to iterate over * @return FALSE if one of the comp() iterations returned zero; TRUE if all * iterations returned non-zero * @see apr_hash_do_callback_fn_t */ APR_DECLARE(int) apr_hash_do(apr_hash_do_callback_fn_t *comp, void *rec, const apr_hash_t *ht); /** * Get a pointer to the pool which the hash table was created in */ APR_POOL_DECLARE_ACCESSOR(hash); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_HASH_H */ ================================================ FILE: third_party/include/apr/apr_inherit.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_INHERIT_H #define APR_INHERIT_H /** * @file apr_inherit.h * @brief APR File Handle Inheritance Helpers * @remark This internal header includes internal declaration helpers * for other headers to declare apr_foo_inherit_[un]set functions. */ /** * Prototype for type-specific declarations of apr_foo_inherit_set * functions. * @remark Doxygen unwraps this macro (via doxygen.conf) to provide * actual help for each specific occurrence of apr_foo_inherit_set. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ #define APR_DECLARE_INHERIT_SET(type) \ APR_DECLARE(apr_status_t) apr_##type##_inherit_set( \ apr_##type##_t *the##type) /** * Prototype for type-specific declarations of apr_foo_inherit_unset * functions. * @remark Doxygen unwraps this macro (via doxygen.conf) to provide * actual help for each specific occurrence of apr_foo_inherit_unset. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ #define APR_DECLARE_INHERIT_UNSET(type) \ APR_DECLARE(apr_status_t) apr_##type##_inherit_unset( \ apr_##type##_t *the##type) #endif /* ! APR_INHERIT_H */ ================================================ FILE: third_party/include/apr/apr_lib.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_LIB_H #define APR_LIB_H /** * @file apr_lib.h * This is collection of oddballs that didn't fit anywhere else, * and might move to more appropriate headers with the release * of APR 1.0. * @brief APR general purpose library routines */ #include "apr.h" #include "apr_errno.h" #if APR_HAVE_CTYPE_H #include #endif #if APR_HAVE_STDARG_H #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_lib General Purpose Library Routines * @ingroup APR * This is collection of oddballs that didn't fit anywhere else, * and might move to more appropriate headers with the release * of APR 1.0. * @{ */ /** A constant representing a 'large' string. */ #define HUGE_STRING_LEN 8192 /* * Define the structures used by the APR general-purpose library. */ /** @see apr_vformatter_buff_t */ typedef struct apr_vformatter_buff_t apr_vformatter_buff_t; /** * Structure used by the variable-formatter routines. */ struct apr_vformatter_buff_t { /** The current position */ char *curpos; /** The end position of the format string */ char *endpos; }; /** * return the final element of the pathname * @param pathname The path to get the final element of * @return the final element of the path * @remark *
 * For example:
 *                 "/foo/bar/gum"    -> "gum"
 *                 "/foo/bar/gum/"   -> ""
 *                 "gum"             -> "gum"
 *                 "bs\\path\\stuff" -> "stuff"
 * 
*/ APR_DECLARE(const char *) apr_filepath_name_get(const char *pathname); /** * apr_killpg * Small utility macros to make things easier to read. Not usually a * goal, to be sure.. */ #ifdef WIN32 #define apr_killpg(x, y) #else /* WIN32 */ #ifdef NO_KILLPG #define apr_killpg(x, y) (kill (-(x), (y))) #else /* NO_KILLPG */ #define apr_killpg(x, y) (killpg ((x), (y))) #endif /* NO_KILLPG */ #endif /* WIN32 */ /** * apr_vformatter() is a generic printf-style formatting routine * with some extensions. * @param flush_func The function to call when the buffer is full * @param c The buffer to write to * @param fmt The format string * @param ap The arguments to use to fill out the format string. * * @remark *
 * The extensions are:
 *
 * - %%pA takes a struct in_addr *, and prints it as a.b.c.d
 * - %%pI takes an apr_sockaddr_t * and prints it as a.b.c.d:port or
 * \[ipv6-address\]:port
 * - %%pT takes an apr_os_thread_t * and prints it in decimal
 * ('0' is printed if !APR_HAS_THREADS)
 * - %%pt takes an apr_os_thread_t * and prints it in hexadecimal
 * ('0' is printed if !APR_HAS_THREADS)
 * - %%pm takes an apr_status_t * and prints the appropriate error
 * string (from apr_strerror) corresponding to that error code.
 * - %%pp takes a void * and outputs it in hex
 * - %%pB takes a apr_uint32_t * as bytes and outputs it's apr_strfsize
 * - %%pF same as above, but takes a apr_off_t *
 * - %%pS same as above, but takes a apr_size_t *
 *
 * %%pA, %%pI, %%pT, %%pp are available from APR 1.0.0 onwards (and in 0.9.x).
 * %%pt is only available from APR 1.2.0 onwards.
 * %%pm, %%pB, %%pF and %%pS are only available from APR 1.3.0 onwards.
 *
 * The %%p hacks are to force gcc's printf warning code to skip
 * over a pointer argument without complaining.  This does
 * mean that the ANSI-style %%p (output a void * in hex format) won't
 * work as expected at all, but that seems to be a fair trade-off
 * for the increased robustness of having printf-warnings work.
 *
 * Additionally, apr_vformatter allows for arbitrary output methods
 * using the apr_vformatter_buff and flush_func.
 *
 * The apr_vformatter_buff has two elements curpos and endpos.
 * curpos is where apr_vformatter will write the next byte of output.
 * It proceeds writing output to curpos, and updating curpos, until
 * either the end of output is reached, or curpos == endpos (i.e. the
 * buffer is full).
 *
 * If the end of output is reached, apr_vformatter returns the
 * number of bytes written.
 *
 * When the buffer is full, the flush_func is called.  The flush_func
 * can return -1 to indicate that no further output should be attempted,
 * and apr_vformatter will return immediately with -1.  Otherwise
 * the flush_func should flush the buffer in whatever manner is
 * appropriate, re apr_pool_t nitialize curpos and endpos, and return 0.
 *
 * Note that flush_func is only invoked as a result of attempting to
 * write another byte at curpos when curpos >= endpos.  So for
 * example, it's possible when the output exactly matches the buffer
 * space available that curpos == endpos will be true when
 * apr_vformatter returns.
 *
 * apr_vformatter does not call out to any other code, it is entirely
 * self-contained.  This allows the callers to do things which are
 * otherwise "unsafe".  For example, apr_psprintf uses the "scratch"
 * space at the unallocated end of a block, and doesn't actually
 * complete the allocation until apr_vformatter returns.  apr_psprintf
 * would be completely broken if apr_vformatter were to call anything
 * that used this same pool.  Similarly http_bprintf() uses the "scratch"
 * space at the end of its output buffer, and doesn't actually note
 * that the space is in use until it either has to flush the buffer
 * or until apr_vformatter returns.
 * 
*/ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), apr_vformatter_buff_t *c, const char *fmt, va_list ap); /** * Display a prompt and read in the password from stdin. * @param prompt The prompt to display * @param pwbuf Buffer to store the password * @param bufsize The length of the password buffer. * @remark If the password entered must be truncated to fit in * the provided buffer, APR_ENAMETOOLONG will be returned. * Note that the bufsize paramater is passed by reference for no * reason; its value will never be modified by the apr_password_get() * function. */ APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_size_t *bufsize); /** @} */ /** * @defgroup apr_ctype ctype functions * These macros allow correct support of 8-bit characters on systems which * support 8-bit characters. Pretty dumb how the cast is required, but * that's legacy libc for ya. These new macros do not support EOF like * the standard macros do. Tough. * @{ */ /** @see isalnum */ #define apr_isalnum(c) (isalnum(((unsigned char)(c)))) /** @see isalpha */ #define apr_isalpha(c) (isalpha(((unsigned char)(c)))) /** @see iscntrl */ #define apr_iscntrl(c) (iscntrl(((unsigned char)(c)))) /** @see isdigit */ #define apr_isdigit(c) (isdigit(((unsigned char)(c)))) /** @see isgraph */ #define apr_isgraph(c) (isgraph(((unsigned char)(c)))) /** @see islower*/ #define apr_islower(c) (islower(((unsigned char)(c)))) /** @see isascii */ #ifdef isascii #define apr_isascii(c) (isascii(((unsigned char)(c)))) #else #define apr_isascii(c) (((c) & ~0x7f)==0) #endif /** @see isprint */ #define apr_isprint(c) (isprint(((unsigned char)(c)))) /** @see ispunct */ #define apr_ispunct(c) (ispunct(((unsigned char)(c)))) /** @see isspace */ #define apr_isspace(c) (isspace(((unsigned char)(c)))) /** @see isupper */ #define apr_isupper(c) (isupper(((unsigned char)(c)))) /** @see isxdigit */ #define apr_isxdigit(c) (isxdigit(((unsigned char)(c)))) /** @see tolower */ #define apr_tolower(c) (tolower(((unsigned char)(c)))) /** @see toupper */ #define apr_toupper(c) (toupper(((unsigned char)(c)))) /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_LIB_H */ ================================================ FILE: third_party/include/apr/apr_mmap.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_MMAP_H #define APR_MMAP_H /** * @file apr_mmap.h * @brief APR MMAP routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #include "apr_ring.h" #include "apr_file_io.h" /* for apr_file_t */ #ifdef BEOS #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_mmap MMAP (Memory Map) Routines * @ingroup APR * @{ */ /** MMap opened for reading */ #define APR_MMAP_READ 1 /** MMap opened for writing */ #define APR_MMAP_WRITE 2 /** @see apr_mmap_t */ typedef struct apr_mmap_t apr_mmap_t; /** * @remark * As far as I can tell the only really sane way to store an MMAP is as a * void * and a length. BeOS requires this area_id, but that's just a little * something extra. I am exposing this type, because it doesn't make much * sense to keep it private, and opening it up makes some stuff easier in * Apache. */ /** The MMAP structure */ struct apr_mmap_t { /** The pool the mmap structure was allocated out of. */ apr_pool_t *cntxt; #ifdef BEOS /** An area ID. Only valid on BeOS */ area_id area; #endif #ifdef WIN32 /** The handle of the file mapping */ HANDLE mhandle; /** The start of the real memory page area (mapped view) */ void *mv; /** The physical start, size and offset */ apr_off_t pstart; apr_size_t psize; apr_off_t poffset; #endif /** The start of the memory mapped area */ void *mm; /** The amount of data in the mmap */ apr_size_t size; /** ring of apr_mmap_t's that reference the same * mmap'ed region; acts in place of a reference count */ APR_RING_ENTRY(apr_mmap_t) link; }; #if APR_HAS_MMAP || defined(DOXYGEN) /** @def APR_MMAP_THRESHOLD * Files have to be at least this big before they're mmap()d. This is to deal * with systems where the expense of doing an mmap() and an munmap() outweighs * the benefit for small files. It shouldn't be set lower than 1. */ #ifdef MMAP_THRESHOLD # define APR_MMAP_THRESHOLD MMAP_THRESHOLD #else # ifdef SUNOS4 # define APR_MMAP_THRESHOLD (8*1024) # else # define APR_MMAP_THRESHOLD 1 # endif /* SUNOS4 */ #endif /* MMAP_THRESHOLD */ /** @def APR_MMAP_LIMIT * Maximum size of MMap region */ #ifdef MMAP_LIMIT # define APR_MMAP_LIMIT MMAP_LIMIT #else # define APR_MMAP_LIMIT (4*1024*1024) #endif /* MMAP_LIMIT */ /** Can this file be MMaped */ #define APR_MMAP_CANDIDATE(filelength) \ ((filelength >= APR_MMAP_THRESHOLD) && (filelength < APR_MMAP_LIMIT)) /* Function definitions */ /** * Create a new mmap'ed file out of an existing APR file. * @param newmmap The newly created mmap'ed file. * @param file The file to turn into an mmap. * @param offset The offset into the file to start the data pointer at. * @param size The size of the file * @param flag bit-wise or of: *
 *          APR_MMAP_READ       MMap opened for reading
 *          APR_MMAP_WRITE      MMap opened for writing
 * 
* @param cntxt The pool to use when creating the mmap. */ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap, apr_file_t *file, apr_off_t offset, apr_size_t size, apr_int32_t flag, apr_pool_t *cntxt); /** * Duplicate the specified MMAP. * @param new_mmap The structure to duplicate into. * @param old_mmap The mmap to duplicate. * @param p The pool to use for new_mmap. */ APR_DECLARE(apr_status_t) apr_mmap_dup(apr_mmap_t **new_mmap, apr_mmap_t *old_mmap, apr_pool_t *p); /** * Remove a mmap'ed. * @param mm The mmap'ed file. */ APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mm); /** * Move the pointer into the mmap'ed file to the specified offset. * @param addr The pointer to the offset specified. * @param mm The mmap'ed file. * @param offset The offset to move to. */ APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mm, apr_off_t offset); #endif /* APR_HAS_MMAP */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_MMAP_H */ ================================================ FILE: third_party/include/apr/apr_network_io.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_NETWORK_IO_H #define APR_NETWORK_IO_H /** * @file apr_network_io.h * @brief APR Network library */ #include "apr.h" #include "apr_pools.h" #include "apr_file_io.h" #include "apr_errno.h" #include "apr_inherit.h" #if APR_HAVE_NETINET_IN_H #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_network_io Network Routines * @ingroup APR * @{ */ #ifndef APR_MAX_SECS_TO_LINGER /** Maximum seconds to linger */ #define APR_MAX_SECS_TO_LINGER 30 #endif #ifndef APRMAXHOSTLEN /** Maximum hostname length */ #define APRMAXHOSTLEN 256 #endif #ifndef APR_ANYADDR /** Default 'any' address */ #define APR_ANYADDR "0.0.0.0" #endif /** * @defgroup apr_sockopt Socket option definitions * @{ */ #define APR_SO_LINGER 1 /**< Linger */ #define APR_SO_KEEPALIVE 2 /**< Keepalive */ #define APR_SO_DEBUG 4 /**< Debug */ #define APR_SO_NONBLOCK 8 /**< Non-blocking IO */ #define APR_SO_REUSEADDR 16 /**< Reuse addresses */ #define APR_SO_SNDBUF 64 /**< Send buffer */ #define APR_SO_RCVBUF 128 /**< Receive buffer */ #define APR_SO_DISCONNECTED 256 /**< Disconnected */ #define APR_TCP_NODELAY 512 /**< For SCTP sockets, this is mapped * to STCP_NODELAY internally. */ #define APR_TCP_NOPUSH 1024 /**< No push */ #define APR_RESET_NODELAY 2048 /**< This flag is ONLY set internally * when we set APR_TCP_NOPUSH with * APR_TCP_NODELAY set to tell us that * APR_TCP_NODELAY should be turned on * again when NOPUSH is turned off */ #define APR_INCOMPLETE_READ 4096 /**< Set on non-blocking sockets * (timeout != 0) on which the * previous read() did not fill a buffer * completely. the next apr_socket_recv() * will first call select()/poll() rather than * going straight into read(). (Can also * be set by an application to force a * select()/poll() call before the next * read, in cases where the app expects * that an immediate read would fail.) */ #define APR_INCOMPLETE_WRITE 8192 /**< like APR_INCOMPLETE_READ, but for write * @see APR_INCOMPLETE_READ */ #define APR_IPV6_V6ONLY 16384 /**< Don't accept IPv4 connections on an * IPv6 listening socket. */ #define APR_TCP_DEFER_ACCEPT 32768 /**< Delay accepting of new connections * until data is available. * @see apr_socket_accept_filter */ #define APR_SO_BROADCAST 65536 /**< Allow broadcast */ /** @} */ /** Define what type of socket shutdown should occur. */ typedef enum { APR_SHUTDOWN_READ, /**< no longer allow read request */ APR_SHUTDOWN_WRITE, /**< no longer allow write requests */ APR_SHUTDOWN_READWRITE /**< no longer allow read or write requests */ } apr_shutdown_how_e; #define APR_IPV4_ADDR_OK 0x01 /**< @see apr_sockaddr_info_get() */ #define APR_IPV6_ADDR_OK 0x02 /**< @see apr_sockaddr_info_get() */ #if (!APR_HAVE_IN_ADDR) /** * We need to make sure we always have an in_addr type, so APR will just * define it ourselves, if the platform doesn't provide it. */ struct in_addr { apr_uint32_t s_addr; /**< storage to hold the IP# */ }; #endif /** @def APR_INADDR_NONE * Not all platforms have a real INADDR_NONE. This macro replaces * INADDR_NONE on all platforms. */ #ifdef INADDR_NONE #define APR_INADDR_NONE INADDR_NONE #else #define APR_INADDR_NONE ((unsigned int) 0xffffffff) #endif /** * @def APR_INET * Not all platforms have these defined, so we'll define them here * The default values come from FreeBSD 4.1.1 */ #define APR_INET AF_INET /** @def APR_UNSPEC * Let the system decide which address family to use */ #ifdef AF_UNSPEC #define APR_UNSPEC AF_UNSPEC #else #define APR_UNSPEC 0 #endif #if APR_HAVE_IPV6 /** @def APR_INET6 * IPv6 Address Family. Not all platforms may have this defined. */ #define APR_INET6 AF_INET6 #endif /** * @defgroup IP_Proto IP Protocol Definitions for use when creating sockets * @{ */ #define APR_PROTO_TCP 6 /**< TCP */ #define APR_PROTO_UDP 17 /**< UDP */ #define APR_PROTO_SCTP 132 /**< SCTP */ /** @} */ /** * Enum used to denote either the local and remote endpoint of a * connection. */ typedef enum { APR_LOCAL, /**< Socket information for local end of connection */ APR_REMOTE /**< Socket information for remote end of connection */ } apr_interface_e; /** * The specific declaration of inet_addr's ... some platforms fall back * inet_network (this is not good, but necessary) */ #if APR_HAVE_INET_ADDR #define apr_inet_addr inet_addr #elif APR_HAVE_INET_NETWORK /* only DGUX, as far as I know */ /** * @warning * not generally safe... inet_network() and inet_addr() perform * different functions */ #define apr_inet_addr inet_network #endif /** A structure to represent sockets */ typedef struct apr_socket_t apr_socket_t; /** * A structure to encapsulate headers and trailers for apr_socket_sendfile */ typedef struct apr_hdtr_t apr_hdtr_t; /** A structure to represent in_addr */ typedef struct in_addr apr_in_addr_t; /** A structure to represent an IP subnet */ typedef struct apr_ipsubnet_t apr_ipsubnet_t; /** @remark use apr_uint16_t just in case some system has a short that isn't 16 bits... */ typedef apr_uint16_t apr_port_t; /** @remark It's defined here as I think it should all be platform safe... * @see apr_sockaddr_t */ typedef struct apr_sockaddr_t apr_sockaddr_t; /** * APRs socket address type, used to ensure protocol independence */ struct apr_sockaddr_t { /** The pool to use... */ apr_pool_t *pool; /** The hostname */ char *hostname; /** Either a string of the port number or the service name for the port */ char *servname; /** The numeric port */ apr_port_t port; /** The family */ apr_int32_t family; /** How big is the sockaddr we're using? */ apr_socklen_t salen; /** How big is the ip address structure we're using? */ int ipaddr_len; /** How big should the address buffer be? 16 for v4 or 46 for v6 * used in inet_ntop... */ int addr_str_len; /** This points to the IP address structure within the appropriate * sockaddr structure. */ void *ipaddr_ptr; /** If multiple addresses were found by apr_sockaddr_info_get(), this * points to a representation of the next address. */ apr_sockaddr_t *next; /** Union of either IPv4 or IPv6 sockaddr. */ union { /** IPv4 sockaddr structure */ struct sockaddr_in sin; #if APR_HAVE_IPV6 /** IPv6 sockaddr structure */ struct sockaddr_in6 sin6; #endif #if APR_HAVE_SA_STORAGE /** Placeholder to ensure that the size of this union is not * dependent on whether APR_HAVE_IPV6 is defined. */ struct sockaddr_storage sas; #endif } sa; }; #if APR_HAS_SENDFILE /** * Support reusing the socket on platforms which support it (from disconnect, * specifically Win32. * @remark Optional flag passed into apr_socket_sendfile() */ #define APR_SENDFILE_DISCONNECT_SOCKET 1 #endif /** A structure to encapsulate headers and trailers for apr_socket_sendfile */ struct apr_hdtr_t { /** An iovec to store the headers sent before the file. */ struct iovec* headers; /** number of headers in the iovec */ int numheaders; /** An iovec to store the trailers sent after the file. */ struct iovec* trailers; /** number of trailers in the iovec */ int numtrailers; }; /* function definitions */ /** * Create a socket. * @param new_sock The new socket that has been set up. * @param family The address family of the socket (e.g., APR_INET). * @param type The type of the socket (e.g., SOCK_STREAM). * @param protocol The protocol of the socket (e.g., APR_PROTO_TCP). * @param cont The pool for the apr_socket_t and associated storage. * @note The pool will be used by various functions that operate on the * socket. The caller must ensure that it is not used by other threads * at the same time. */ APR_DECLARE(apr_status_t) apr_socket_create(apr_socket_t **new_sock, int family, int type, int protocol, apr_pool_t *cont); /** * Shutdown either reading, writing, or both sides of a socket. * @param thesocket The socket to close * @param how How to shutdown the socket. One of: *
 *            APR_SHUTDOWN_READ         no longer allow read requests
 *            APR_SHUTDOWN_WRITE        no longer allow write requests
 *            APR_SHUTDOWN_READWRITE    no longer allow read or write requests 
 * 
* @see apr_shutdown_how_e * @remark This does not actually close the socket descriptor, it just * controls which calls are still valid on the socket. */ APR_DECLARE(apr_status_t) apr_socket_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how); /** * Close a socket. * @param thesocket The socket to close */ APR_DECLARE(apr_status_t) apr_socket_close(apr_socket_t *thesocket); /** * Bind the socket to its associated port * @param sock The socket to bind * @param sa The socket address to bind to * @remark This may be where we will find out if there is any other process * using the selected port. */ APR_DECLARE(apr_status_t) apr_socket_bind(apr_socket_t *sock, apr_sockaddr_t *sa); /** * Listen to a bound socket for connections. * @param sock The socket to listen on * @param backlog The number of outstanding connections allowed in the sockets * listen queue. If this value is less than zero, the listen * queue size is set to zero. */ APR_DECLARE(apr_status_t) apr_socket_listen(apr_socket_t *sock, apr_int32_t backlog); /** * Accept a new connection request * @param new_sock A copy of the socket that is connected to the socket that * made the connection request. This is the socket which should * be used for all future communication. * @param sock The socket we are listening on. * @param connection_pool The pool for the new socket. * @note The pool will be used by various functions that operate on the * socket. The caller must ensure that it is not used by other threads * at the same time. */ APR_DECLARE(apr_status_t) apr_socket_accept(apr_socket_t **new_sock, apr_socket_t *sock, apr_pool_t *connection_pool); /** * Issue a connection request to a socket either on the same machine * or a different one. * @param sock The socket we wish to use for our side of the connection * @param sa The address of the machine we wish to connect to. */ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, apr_sockaddr_t *sa); /** * Determine whether the receive part of the socket has been closed by * the peer (such that a subsequent call to apr_socket_read would * return APR_EOF), if the socket's receive buffer is empty. This * function does not block waiting for I/O. * * @param sock The socket to check * @param atreadeof If APR_SUCCESS is returned, *atreadeof is set to * non-zero if a subsequent read would return APR_EOF * @return an error is returned if it was not possible to determine the * status, in which case *atreadeof is not changed. */ APR_DECLARE(apr_status_t) apr_socket_atreadeof(apr_socket_t *sock, int *atreadeof); /** * Create apr_sockaddr_t from hostname, address family, and port. * @param sa The new apr_sockaddr_t. * @param hostname The hostname or numeric address string to resolve/parse, or * NULL to build an address that corresponds to 0.0.0.0 or :: * @param family The address family to use, or APR_UNSPEC if the system should * decide. * @param port The port number. * @param flags Special processing flags: *
 *       APR_IPV4_ADDR_OK          first query for IPv4 addresses; only look
 *                                 for IPv6 addresses if the first query failed;
 *                                 only valid if family is APR_UNSPEC and hostname
 *                                 isn't NULL; mutually exclusive with
 *                                 APR_IPV6_ADDR_OK
 *       APR_IPV6_ADDR_OK          first query for IPv6 addresses; only look
 *                                 for IPv4 addresses if the first query failed;
 *                                 only valid if family is APR_UNSPEC and hostname
 *                                 isn't NULL and APR_HAVE_IPV6; mutually exclusive
 *                                 with APR_IPV4_ADDR_OK
 * 
* @param p The pool for the apr_sockaddr_t and associated storage. */ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p); /** * Look up the host name from an apr_sockaddr_t. * @param hostname The hostname. * @param sa The apr_sockaddr_t. * @param flags Special processing flags. * @remark Results can vary significantly between platforms * when processing wildcard socket addresses. */ APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname, apr_sockaddr_t *sa, apr_int32_t flags); /** * Parse hostname/IP address with scope id and port. * * Any of the following strings are accepted: * 8080 (just the port number) * www.apache.org (just the hostname) * www.apache.org:8080 (hostname and port number) * [fe80::1]:80 (IPv6 numeric address string only) * [fe80::1%eth0] (IPv6 numeric address string and scope id) * * Invalid strings: * (empty string) * [abc] (not valid IPv6 numeric address string) * abc:65536 (invalid port number) * * @param addr The new buffer containing just the hostname. On output, *addr * will be NULL if no hostname/IP address was specfied. * @param scope_id The new buffer containing just the scope id. On output, * *scope_id will be NULL if no scope id was specified. * @param port The port number. On output, *port will be 0 if no port was * specified. * ### FIXME: 0 is a legal port (per RFC 1700). this should * ### return something besides zero if the port is missing. * @param str The input string to be parsed. * @param p The pool from which *addr and *scope_id are allocated. * @remark If scope id shouldn't be allowed, check for scope_id != NULL in * addition to checking the return code. If addr/hostname should be * required, check for addr == NULL in addition to checking the * return code. */ APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr, char **scope_id, apr_port_t *port, const char *str, apr_pool_t *p); /** * Get name of the current machine * @param buf A buffer to store the hostname in. * @param len The maximum length of the hostname that can be stored in the * buffer provided. The suggested length is APRMAXHOSTLEN + 1. * @param cont The pool to use. * @remark If the buffer was not large enough, an error will be returned. */ APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont); /** * Return the data associated with the current socket * @param data The user data associated with the socket. * @param key The key to associate with the user data. * @param sock The currently open socket. */ APR_DECLARE(apr_status_t) apr_socket_data_get(void **data, const char *key, apr_socket_t *sock); /** * Set the data associated with the current socket. * @param sock The currently open socket. * @param data The user data to associate with the socket. * @param key The key to associate with the data. * @param cleanup The cleanup to call when the socket is destroyed. */ APR_DECLARE(apr_status_t) apr_socket_data_set(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*)); /** * Send data over a network. * @param sock The socket to send the data over. * @param buf The buffer which contains the data to be sent. * @param len On entry, the number of bytes to send; on exit, the number * of bytes sent. * @remark *
 * This functions acts like a blocking write by default.  To change 
 * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
 * socket option.
 *
 * It is possible for both bytes to be sent and an error to be returned.
 *
 * APR_EINTR is never returned.
 * 
*/ APR_DECLARE(apr_status_t) apr_socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len); /** * Send multiple buffers over a network. * @param sock The socket to send the data over. * @param vec The array of iovec structs containing the data to send * @param nvec The number of iovec structs in the array * @param len Receives the number of bytes actually written * @remark *
 * This functions acts like a blocking write by default.  To change 
 * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
 * socket option.
 * The number of bytes actually sent is stored in argument 4.
 *
 * It is possible for both bytes to be sent and an error to be returned.
 *
 * APR_EINTR is never returned.
 * 
*/ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len); /** * @param sock The socket to send from * @param where The apr_sockaddr_t describing where to send the data * @param flags The flags to use * @param buf The data to send * @param len The length of the data to send */ APR_DECLARE(apr_status_t) apr_socket_sendto(apr_socket_t *sock, apr_sockaddr_t *where, apr_int32_t flags, const char *buf, apr_size_t *len); /** * Read data from a socket. On success, the address of the peer from * which the data was sent is copied into the @a from parameter, and the * @a len parameter is updated to give the number of bytes written to * @a buf. * * @param from Updated with the address from which the data was received * @param sock The socket to use * @param flags The flags to use * @param buf The buffer to use * @param len The length of the available buffer */ APR_DECLARE(apr_status_t) apr_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock, apr_int32_t flags, char *buf, apr_size_t *len); #if APR_HAS_SENDFILE || defined(DOXYGEN) /** * Send a file from an open file descriptor to a socket, along with * optional headers and trailers * @param sock The socket to which we're writing * @param file The open file from which to read * @param hdtr A structure containing the headers and trailers to send * @param offset Offset into the file where we should begin writing * @param len (input) - Number of bytes to send from the file * (output) - Number of bytes actually sent, * including headers, file, and trailers * @param flags APR flags that are mapped to OS specific flags * @remark This functions acts like a blocking write by default. To change * this behavior, use apr_socket_timeout_set() or the * APR_SO_NONBLOCK socket option. * The number of bytes actually sent is stored in the len parameter. * The offset parameter is passed by reference for no reason; its * value will never be modified by the apr_socket_sendfile() function. */ APR_DECLARE(apr_status_t) apr_socket_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags); #endif /* APR_HAS_SENDFILE */ /** * Read data from a network. * @param sock The socket to read the data from. * @param buf The buffer to store the data in. * @param len On entry, the number of bytes to receive; on exit, the number * of bytes received. * @remark *
 * This functions acts like a blocking read by default.  To change 
 * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
 * socket option.
 * The number of bytes actually received is stored in argument 3.
 *
 * It is possible for both bytes to be received and an APR_EOF or
 * other error to be returned.
 *
 * APR_EINTR is never returned.
 * 
*/ APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len); /** * Setup socket options for the specified socket * @param sock The socket to set up. * @param opt The option we would like to configure. One of: *
 *            APR_SO_DEBUG      --  turn on debugging information 
 *            APR_SO_KEEPALIVE  --  keep connections active
 *            APR_SO_LINGER     --  lingers on close if data is present
 *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket
 *                                  When this option is enabled, use
 *                                  the APR_STATUS_IS_EAGAIN() macro to
 *                                  see if a send or receive function
 *                                  could not transfer data without
 *                                  blocking.
 *            APR_SO_REUSEADDR  --  The rules used in validating addresses
 *                                  supplied to bind should allow reuse
 *                                  of local addresses.
 *            APR_SO_SNDBUF     --  Set the SendBufferSize
 *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
 * 
* @param on Value for the option. */ APR_DECLARE(apr_status_t) apr_socket_opt_set(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on); /** * Setup socket timeout for the specified socket * @param sock The socket to set up. * @param t Value for the timeout. *
 *   t > 0  -- read and write calls return APR_TIMEUP if specified time
 *             elapsess with no data read or written
 *   t == 0 -- read and write calls never block
 *   t < 0  -- read and write calls block
 * 
*/ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t); /** * Query socket options for the specified socket * @param sock The socket to query * @param opt The option we would like to query. One of: *
 *            APR_SO_DEBUG      --  turn on debugging information 
 *            APR_SO_KEEPALIVE  --  keep connections active
 *            APR_SO_LINGER     --  lingers on close if data is present
 *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket
 *            APR_SO_REUSEADDR  --  The rules used in validating addresses
 *                                  supplied to bind should allow reuse
 *                                  of local addresses.
 *            APR_SO_SNDBUF     --  Set the SendBufferSize
 *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
 *            APR_SO_DISCONNECTED -- Query the disconnected state of the socket.
 *                                  (Currently only used on Windows)
 * 
* @param on Socket option returned on the call. */ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on); /** * Query socket timeout for the specified socket * @param sock The socket to query * @param t Socket timeout returned from the query. */ APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t); /** * Query the specified socket if at the OOB/Urgent data mark * @param sock The socket to query * @param atmark Is set to true if socket is at the OOB/urgent mark, * otherwise is set to false. */ APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark); /** * Return an address associated with a socket; either the address to * which the socket is bound locally or the address of the peer * to which the socket is connected. * @param sa The returned apr_sockaddr_t. * @param which Whether to retrieve the local or remote address * @param sock The socket to use */ APR_DECLARE(apr_status_t) apr_socket_addr_get(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock); /** * Return the IP address (in numeric address string format) in * an APR socket address. APR will allocate storage for the IP address * string from the pool of the apr_sockaddr_t. * @param addr The IP address. * @param sockaddr The socket address to reference. */ APR_DECLARE(apr_status_t) apr_sockaddr_ip_get(char **addr, apr_sockaddr_t *sockaddr); /** * Write the IP address (in numeric address string format) of the APR * socket address @a sockaddr into the buffer @a buf (of size @a buflen). * @param sockaddr The socket address to reference. */ APR_DECLARE(apr_status_t) apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen, apr_sockaddr_t *sockaddr); /** * See if the IP addresses in two APR socket addresses are * equivalent. Appropriate logic is present for comparing * IPv4-mapped IPv6 addresses with IPv4 addresses. * * @param addr1 One of the APR socket addresses. * @param addr2 The other APR socket address. * @remark The return value will be non-zero if the addresses * are equivalent. */ APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1, const apr_sockaddr_t *addr2); /** * See if the IP address in an APR socket address refers to the wildcard * address for the protocol family (e.g., INADDR_ANY for IPv4). * * @param addr The APR socket address to examine. * @remark The return value will be non-zero if the address is * initialized and is the wildcard address. */ APR_DECLARE(int) apr_sockaddr_is_wildcard(const apr_sockaddr_t *addr); /** * Return the type of the socket. * @param sock The socket to query. * @param type The returned type (e.g., SOCK_STREAM). */ APR_DECLARE(apr_status_t) apr_socket_type_get(apr_socket_t *sock, int *type); /** * Given an apr_sockaddr_t and a service name, set the port for the service * @param sockaddr The apr_sockaddr_t that will have its port set * @param servname The name of the service you wish to use */ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname); /** * Build an ip-subnet representation from an IP address and optional netmask or * number-of-bits. * @param ipsub The new ip-subnet representation * @param ipstr The input IP address string * @param mask_or_numbits The input netmask or number-of-bits string, or NULL * @param p The pool to allocate from */ APR_DECLARE(apr_status_t) apr_ipsubnet_create(apr_ipsubnet_t **ipsub, const char *ipstr, const char *mask_or_numbits, apr_pool_t *p); /** * Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet * representation. * @param ipsub The ip-subnet representation * @param sa The socket address to test * @return non-zero if the socket address is within the subnet, 0 otherwise */ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa); #if APR_HAS_SO_ACCEPTFILTER || defined(DOXYGEN) /** * Set an OS level accept filter. * @param sock The socket to put the accept filter on. * @param name The accept filter * @param args Any extra args to the accept filter. Passing NULL here removes * the accept filter. * @bug name and args should have been declared as const char *, as they are in * APR 2.0 */ apr_status_t apr_socket_accept_filter(apr_socket_t *sock, char *name, char *args); #endif /** * Return the protocol of the socket. * @param sock The socket to query. * @param protocol The returned protocol (e.g., APR_PROTO_TCP). */ APR_DECLARE(apr_status_t) apr_socket_protocol_get(apr_socket_t *sock, int *protocol); /** * Get the pool used by the socket. */ APR_POOL_DECLARE_ACCESSOR(socket); /** * Set a socket to be inherited by child processes. */ APR_DECLARE_INHERIT_SET(socket); /** * Unset a socket from being inherited by child processes. */ APR_DECLARE_INHERIT_UNSET(socket); /** * @defgroup apr_mcast IP Multicast * @{ */ /** * Join a Multicast Group * @param sock The socket to join a multicast group * @param join The address of the multicast group to join * @param iface Address of the interface to use. If NULL is passed, the * default multicast interface will be used. (OS Dependent) * @param source Source Address to accept transmissions from (non-NULL * implies Source-Specific Multicast) */ APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock, apr_sockaddr_t *join, apr_sockaddr_t *iface, apr_sockaddr_t *source); /** * Leave a Multicast Group. All arguments must be the same as * apr_mcast_join. * @param sock The socket to leave a multicast group * @param addr The address of the multicast group to leave * @param iface Address of the interface to use. If NULL is passed, the * default multicast interface will be used. (OS Dependent) * @param source Source Address to accept transmissions from (non-NULL * implies Source-Specific Multicast) */ APR_DECLARE(apr_status_t) apr_mcast_leave(apr_socket_t *sock, apr_sockaddr_t *addr, apr_sockaddr_t *iface, apr_sockaddr_t *source); /** * Set the Multicast Time to Live (ttl) for a multicast transmission. * @param sock The socket to set the multicast ttl * @param ttl Time to live to Assign. 0-255, default=1 * @remark If the TTL is 0, packets will only be seen by sockets on * the local machine, and only when multicast loopback is enabled. */ APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl); /** * Toggle IP Multicast Loopback * @param sock The socket to set multicast loopback * @param opt 0=disable, 1=enable */ APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock, apr_byte_t opt); /** * Set the Interface to be used for outgoing Multicast Transmissions. * @param sock The socket to set the multicast interface on * @param iface Address of the interface to use for Multicast */ APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock, apr_sockaddr_t *iface); /** @} */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_NETWORK_IO_H */ ================================================ FILE: third_party/include/apr/apr_poll.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_POLL_H #define APR_POLL_H /** * @file apr_poll.h * @brief APR Poll interface */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #include "apr_inherit.h" #include "apr_file_io.h" #include "apr_network_io.h" #if APR_HAVE_NETINET_IN_H #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_poll Poll Routines * @ingroup APR * @{ */ /** * @defgroup pollopts Poll options * @ingroup apr_poll * @{ */ #define APR_POLLIN 0x001 /**< Can read without blocking */ #define APR_POLLPRI 0x002 /**< Priority data available */ #define APR_POLLOUT 0x004 /**< Can write without blocking */ #define APR_POLLERR 0x010 /**< Pending error */ #define APR_POLLHUP 0x020 /**< Hangup occurred */ #define APR_POLLNVAL 0x040 /**< Descriptor invalid */ /** @} */ /** * @defgroup pollflags Pollset Flags * @ingroup apr_poll * @{ */ #define APR_POLLSET_THREADSAFE 0x001 /**< Adding or removing a descriptor is * thread-safe */ #define APR_POLLSET_NOCOPY 0x002 /**< Descriptors passed to apr_pollset_add() * are not copied */ #define APR_POLLSET_WAKEABLE 0x004 /**< Poll operations are interruptable by * apr_pollset_wakeup() */ #define APR_POLLSET_NODEFAULT 0x010 /**< Do not try to use the default method if * the specified non-default method cannot be * used */ /** @} */ /** * Pollset Methods */ typedef enum { APR_POLLSET_DEFAULT, /**< Platform default poll method */ APR_POLLSET_SELECT, /**< Poll uses select method */ APR_POLLSET_KQUEUE, /**< Poll uses kqueue method */ APR_POLLSET_PORT, /**< Poll uses Solaris event port method */ APR_POLLSET_EPOLL, /**< Poll uses epoll method */ APR_POLLSET_POLL, /**< Poll uses poll method */ APR_POLLSET_AIO_MSGQ /**< Poll uses z/OS asio method */ } apr_pollset_method_e; /** Used in apr_pollfd_t to determine what the apr_descriptor is */ typedef enum { APR_NO_DESC, /**< nothing here */ APR_POLL_SOCKET, /**< descriptor refers to a socket */ APR_POLL_FILE, /**< descriptor refers to a file */ APR_POLL_LASTDESC /**< @deprecated descriptor is the last one in the list */ } apr_datatype_e ; /** Union of either an APR file or socket. */ typedef union { apr_file_t *f; /**< file */ apr_socket_t *s; /**< socket */ } apr_descriptor; /** @see apr_pollfd_t */ typedef struct apr_pollfd_t apr_pollfd_t; /** Poll descriptor set. */ struct apr_pollfd_t { apr_pool_t *p; /**< associated pool */ apr_datatype_e desc_type; /**< descriptor type */ apr_int16_t reqevents; /**< requested events */ apr_int16_t rtnevents; /**< returned events */ apr_descriptor desc; /**< @see apr_descriptor */ void *client_data; /**< allows app to associate context */ }; /* General-purpose poll API for arbitrarily large numbers of * file descriptors */ /** Opaque structure used for pollset API */ typedef struct apr_pollset_t apr_pollset_t; /** * Set up a pollset object * @param pollset The pointer in which to return the newly created object * @param size The maximum number of descriptors that this pollset can hold * @param p The pool from which to allocate the pollset * @param flags Optional flags to modify the operation of the pollset. * * @remark If flags contains APR_POLLSET_THREADSAFE, then a pollset is * created on which it is safe to make concurrent calls to * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() * from separate threads. This feature is only supported on some * platforms; the apr_pollset_create() call will fail with * APR_ENOTIMPL on platforms where it is not supported. * @remark If flags contains APR_POLLSET_WAKEABLE, then a pollset is * created with an additional internal pipe object used for the * apr_pollset_wakeup() call. The actual size of pollset is * in that case @a size + 1. This feature is only supported on some * platforms; the apr_pollset_create() call will fail with * APR_ENOTIMPL on platforms where it is not supported. * @remark If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t * structures passed to apr_pollset_add() are not copied and * must have a lifetime at least as long as the pollset. * @remark Some poll methods (including APR_POLLSET_KQUEUE, * APR_POLLSET_PORT, and APR_POLLSET_EPOLL) do not have a * fixed limit on the size of the pollset. For these methods, * the size parameter controls the maximum number of * descriptors that will be returned by a single call to * apr_pollset_poll(). */ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags); /** * Set up a pollset object * @param pollset The pointer in which to return the newly created object * @param size The maximum number of descriptors that this pollset can hold * @param p The pool from which to allocate the pollset * @param flags Optional flags to modify the operation of the pollset. * @param method Poll method to use. See #apr_pollset_method_e. If this * method cannot be used, the default method will be used unless the * APR_POLLSET_NODEFAULT flag has been specified. * * @remark If flags contains APR_POLLSET_THREADSAFE, then a pollset is * created on which it is safe to make concurrent calls to * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() * from separate threads. This feature is only supported on some * platforms; the apr_pollset_create_ex() call will fail with * APR_ENOTIMPL on platforms where it is not supported. * @remark If flags contains APR_POLLSET_WAKEABLE, then a pollset is * created with additional internal pipe object used for the * apr_pollset_wakeup() call. The actual size of pollset is * in that case size + 1. This feature is only supported on some * platforms; the apr_pollset_create_ex() call will fail with * APR_ENOTIMPL on platforms where it is not supported. * @remark If flags contains APR_POLLSET_NOCOPY, then the apr_pollfd_t * structures passed to apr_pollset_add() are not copied and * must have a lifetime at least as long as the pollset. * @remark Some poll methods (including APR_POLLSET_KQUEUE, * APR_POLLSET_PORT, and APR_POLLSET_EPOLL) do not have a * fixed limit on the size of the pollset. For these methods, * the size parameter controls the maximum number of * descriptors that will be returned by a single call to * apr_pollset_poll(). */ APR_DECLARE(apr_status_t) apr_pollset_create_ex(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags, apr_pollset_method_e method); /** * Destroy a pollset object * @param pollset The pollset to destroy */ APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset); /** * Add a socket or file descriptor to a pollset * @param pollset The pollset to which to add the descriptor * @param descriptor The descriptor to add * @remark If you set client_data in the descriptor, that value * will be returned in the client_data field whenever this * descriptor is signalled in apr_pollset_poll(). * @remark If the pollset has been created with APR_POLLSET_THREADSAFE * and thread T1 is blocked in a call to apr_pollset_poll() for * this same pollset that is being modified via apr_pollset_add() * in thread T2, the currently executing apr_pollset_poll() call in * T1 will either: (1) automatically include the newly added descriptor * in the set of descriptors it is watching or (2) return immediately * with APR_EINTR. Option (1) is recommended, but option (2) is * allowed for implementations where option (1) is impossible * or impractical. * @remark If the pollset has been created with APR_POLLSET_NOCOPY, the * apr_pollfd_t structure referenced by descriptor will not be copied * and must have a lifetime at least as long as the pollset. * @remark Do not add the same socket or file descriptor to the same pollset * multiple times, even if the requested events differ for the * different calls to apr_pollset_add(). If the events of interest * for a descriptor change, you must first remove the descriptor * from the pollset with apr_pollset_remove(), then add it again * specifying all requested events. */ APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor); /** * Remove a descriptor from a pollset * @param pollset The pollset from which to remove the descriptor * @param descriptor The descriptor to remove * @remark If the descriptor is not found, APR_NOTFOUND is returned. * @remark If the pollset has been created with APR_POLLSET_THREADSAFE * and thread T1 is blocked in a call to apr_pollset_poll() for * this same pollset that is being modified via apr_pollset_remove() * in thread T2, the currently executing apr_pollset_poll() call in * T1 will either: (1) automatically exclude the newly added descriptor * in the set of descriptors it is watching or (2) return immediately * with APR_EINTR. Option (1) is recommended, but option (2) is * allowed for implementations where option (1) is impossible * or impractical. * @remark apr_pollset_remove() cannot be used to remove a subset of requested * events for a descriptor. The reqevents field in the apr_pollfd_t * parameter must contain the same value when removing as when adding. */ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor); /** * Block for activity on the descriptor(s) in a pollset * @param pollset The pollset to use * @param timeout The amount of time in microseconds to wait. This is a * maximum, not a minimum. If a descriptor is signalled, the * function will return before this time. If timeout is * negative, the function will block until a descriptor is * signalled or until apr_pollset_wakeup() has been called. * @param num Number of signalled descriptors (output parameter) * @param descriptors Array of signalled descriptors (output parameter) * @remark APR_EINTR will be returned if the pollset has been created with * APR_POLLSET_WAKEABLE, apr_pollset_wakeup() has been called while * waiting for activity, and there were no signalled descriptors at the * time of the wakeup call. * @remark Multiple signalled conditions for the same descriptor may be reported * in one or more returned apr_pollfd_t structures, depending on the * implementation. */ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, apr_interval_time_t timeout, apr_int32_t *num, const apr_pollfd_t **descriptors); /** * Interrupt the blocked apr_pollset_poll() call. * @param pollset The pollset to use * @remark If the pollset was not created with APR_POLLSET_WAKEABLE the * return value is APR_EINIT. */ APR_DECLARE(apr_status_t) apr_pollset_wakeup(apr_pollset_t *pollset); /** * Poll the descriptors in the poll structure * @param aprset The poll structure we will be using. * @param numsock The number of descriptors we are polling * @param nsds The number of descriptors signalled (output parameter) * @param timeout The amount of time in microseconds to wait. This is a * maximum, not a minimum. If a descriptor is signalled, the * function will return before this time. If timeout is * negative, the function will block until a descriptor is * signalled or until apr_pollset_wakeup() has been called. * @remark The number of descriptors signalled is returned in the third argument. * This is a blocking call, and it will not return until either a * descriptor has been signalled or the timeout has expired. * @remark The rtnevents field in the apr_pollfd_t array will only be filled- * in if the return value is APR_SUCCESS. */ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, apr_int32_t *nsds, apr_interval_time_t timeout); /** * Return a printable representation of the pollset method. * @param pollset The pollset to use */ APR_DECLARE(const char *) apr_pollset_method_name(apr_pollset_t *pollset); /** * Return a printable representation of the default pollset method * (APR_POLLSET_DEFAULT). */ APR_DECLARE(const char *) apr_poll_method_defname(void); /** Opaque structure used for pollcb API */ typedef struct apr_pollcb_t apr_pollcb_t; /** * Set up a pollcb object * @param pollcb The pointer in which to return the newly created object * @param size The maximum number of descriptors that a single _poll can return. * @param p The pool from which to allocate the pollcb * @param flags Optional flags to modify the operation of the pollcb. * * @remark Pollcb is only supported on some platforms; the apr_pollcb_create() * call will fail with APR_ENOTIMPL on platforms where it is not supported. */ APR_DECLARE(apr_status_t) apr_pollcb_create(apr_pollcb_t **pollcb, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags); /** * Set up a pollcb object * @param pollcb The pointer in which to return the newly created object * @param size The maximum number of descriptors that a single _poll can return. * @param p The pool from which to allocate the pollcb * @param flags Optional flags to modify the operation of the pollcb. * @param method Poll method to use. See #apr_pollset_method_e. If this * method cannot be used, the default method will be used unless the * APR_POLLSET_NODEFAULT flag has been specified. * * @remark Pollcb is only supported on some platforms; the apr_pollcb_create_ex() * call will fail with APR_ENOTIMPL on platforms where it is not supported. */ APR_DECLARE(apr_status_t) apr_pollcb_create_ex(apr_pollcb_t **pollcb, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags, apr_pollset_method_e method); /** * Add a socket or file descriptor to a pollcb * @param pollcb The pollcb to which to add the descriptor * @param descriptor The descriptor to add * @remark If you set client_data in the descriptor, that value will be * returned in the client_data field whenever this descriptor is * signalled in apr_pollcb_poll(). * @remark Unlike the apr_pollset API, the descriptor is not copied, and users * must retain the memory used by descriptor, as the same pointer will * be returned to them from apr_pollcb_poll. * @remark Do not add the same socket or file descriptor to the same pollcb * multiple times, even if the requested events differ for the * different calls to apr_pollcb_add(). If the events of interest * for a descriptor change, you must first remove the descriptor * from the pollcb with apr_pollcb_remove(), then add it again * specifying all requested events. */ APR_DECLARE(apr_status_t) apr_pollcb_add(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor); /** * Remove a descriptor from a pollcb * @param pollcb The pollcb from which to remove the descriptor * @param descriptor The descriptor to remove * @remark apr_pollcb_remove() cannot be used to remove a subset of requested * events for a descriptor. The reqevents field in the apr_pollfd_t * parameter must contain the same value when removing as when adding. */ APR_DECLARE(apr_status_t) apr_pollcb_remove(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor); /** Function prototype for pollcb handlers * @param baton Opaque baton passed into apr_pollcb_poll() * @param descriptor Contains the notification for an active descriptor, * the rtnevents member contains what events were triggered * for this descriptor. */ typedef apr_status_t (*apr_pollcb_cb_t)(void *baton, apr_pollfd_t *descriptor); /** * Block for activity on the descriptor(s) in a pollcb * @param pollcb The pollcb to use * @param timeout The amount of time in microseconds to wait. This is a * maximum, not a minimum. If a descriptor is signalled, the * function will return before this time. If timeout is * negative, the function will block until a descriptor is * signalled. * @param func Callback function to call for each active descriptor. * @param baton Opaque baton passed to the callback function. * @remark Multiple signalled conditions for the same descriptor may be reported * in one or more calls to the callback function, depending on the * implementation. */ APR_DECLARE(apr_status_t) apr_pollcb_poll(apr_pollcb_t *pollcb, apr_interval_time_t timeout, apr_pollcb_cb_t func, void *baton); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_POLL_H */ ================================================ FILE: third_party/include/apr/apr_pools.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_POOLS_H #define APR_POOLS_H /** * @file apr_pools.h * @brief APR memory allocation * * Resource allocation routines... * * designed so that we don't have to keep track of EVERYTHING so that * it can be explicitly freed later (a fundamentally unsound strategy --- * particularly in the presence of die()). * * Instead, we maintain pools, and allocate items (both memory and I/O * handlers) from the pools --- currently there are two, one for * per-transaction info, and one for config info. When a transaction is * over, we can delete everything in the per-transaction apr_pool_t without * fear, and without thinking too hard about it either. * * Note that most operations on pools are not thread-safe: a single pool * should only be accessed by a single thread at any given time. The one * exception to this rule is creating a subpool of a given pool: one or more * threads can safely create subpools at the same time that another thread * accesses the parent pool. */ #include "apr.h" #include "apr_errno.h" #include "apr_general.h" /* for APR_STRINGIFY */ #define APR_WANT_MEMFUNC /**< for no good reason? */ #include "apr_want.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup apr_pools Memory Pool Functions * @ingroup APR * @{ */ /** The fundamental pool type */ typedef struct apr_pool_t apr_pool_t; /** * Declaration helper macro to construct apr_foo_pool_get()s. * * This standardized macro is used by opaque (APR) data types to return * the apr_pool_t that is associated with the data type. * * APR_POOL_DECLARE_ACCESSOR() is used in a header file to declare the * accessor function. A typical usage and result would be: *
 *    APR_POOL_DECLARE_ACCESSOR(file);
 * becomes:
 *    APR_DECLARE(apr_pool_t *) apr_file_pool_get(const apr_file_t *thefile);
 * 
* @remark Doxygen unwraps this macro (via doxygen.conf) to provide * actual help for each specific occurrence of apr_foo_pool_get. * @remark the linkage is specified for APR. It would be possible to expand * the macros to support other linkages. */ #define APR_POOL_DECLARE_ACCESSOR(type) \ APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \ (const apr_##type##_t *the##type) /** * Implementation helper macro to provide apr_foo_pool_get()s. * * In the implementation, the APR_POOL_IMPLEMENT_ACCESSOR() is used to * actually define the function. It assumes the field is named "pool". */ #define APR_POOL_IMPLEMENT_ACCESSOR(type) \ APR_DECLARE(apr_pool_t *) apr_##type##_pool_get \ (const apr_##type##_t *the##type) \ { return the##type->pool; } /** * Pool debug levels * *
 * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
 * ---------------------------------
 * |   |   |   |   |   |   |   | x |  General debug code enabled (useful in
 *                                    combination with --with-efence).
 *
 * |   |   |   |   |   |   | x |   |  Verbose output on stderr (report
 *                                    CREATE, CLEAR, DESTROY).
 *
 * |   |   |   | x |   |   |   |   |  Verbose output on stderr (report
 *                                    PALLOC, PCALLOC).
 *
 * |   |   |   |   |   | x |   |   |  Lifetime checking. On each use of a
 *                                    pool, check its lifetime.  If the pool
 *                                    is out of scope, abort().
 *                                    In combination with the verbose flag
 *                                    above, it will output LIFE in such an
 *                                    event prior to aborting.
 *
 * |   |   |   |   | x |   |   |   |  Pool owner checking.  On each use of a
 *                                    pool, check if the current thread is the
 *                                    pool's owner.  If not, abort().  In
 *                                    combination with the verbose flag above,
 *                                    it will output OWNER in such an event
 *                                    prior to aborting.  Use the debug
 *                                    function apr_pool_owner_set() to switch
 *                                    a pool's ownership.
 *
 * When no debug level was specified, assume general debug mode.
 * If level 0 was specified, debugging is switched off.
 * 
*/ #if defined(APR_POOL_DEBUG) /* If APR_POOL_DEBUG is blank, we get 1; if it is a number, we get -1. */ #if (APR_POOL_DEBUG - APR_POOL_DEBUG -1 == 1) #undef APR_POOL_DEBUG #define APR_POOL_DEBUG 1 #endif #else #define APR_POOL_DEBUG 0 #endif /** the place in the code where the particular function was called */ #define APR_POOL__FILE_LINE__ __FILE__ ":" APR_STRINGIFY(__LINE__) /** A function that is called when allocation fails. */ typedef int (*apr_abortfunc_t)(int retcode); /* * APR memory structure manipulators (pools, tables, and arrays). */ /* * Initialization */ /** * Setup all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this * automatically from apr_initialize. * @internal */ APR_DECLARE(apr_status_t) apr_pool_initialize(void); /** * Tear down all of the internal structures required to use pools * @remark Programs do NOT need to call this directly. APR will call this * automatically from apr_terminate. * @internal */ APR_DECLARE(void) apr_pool_terminate(void); /* * Pool creation/destruction */ #include "apr_allocator.h" /** * Create a new pool. * @param newpool The pool we have just created. * @param parent The parent pool. If this is NULL, the new pool is a root * pool. If it is non-NULL, the new pool will inherit all * of its parent pool's attributes, except the apr_pool_t will * be a sub-pool. * @param abort_fn A function to use if the pool cannot allocate more memory. * @param allocator The allocator to use with the new pool. If NULL the * allocator of the parent pool will be used. * @remark This function is thread-safe, in the sense that multiple threads * can safely create subpools of the same parent pool concurrently. * Similarly, a subpool can be created by one thread at the same * time that another thread accesses the parent pool. */ APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_allocator_t *allocator) __attribute__((nonnull(1))); /** * Create a new pool. * @deprecated @see apr_pool_create_unmanaged_ex. */ APR_DECLARE(apr_status_t) apr_pool_create_core_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator); /** * Create a new unmanaged pool. * @param newpool The pool we have just created. * @param abort_fn A function to use if the pool cannot allocate more memory. * @param allocator The allocator to use with the new pool. If NULL a * new allocator will be created with the new pool as owner. * @remark An unmanaged pool is a special pool without a parent; it will * NOT be destroyed upon apr_terminate. It must be explicitly * destroyed by calling apr_pool_destroy, to prevent memory leaks. * Use of this function is discouraged, think twice about whether * you really really need it. * @warning Any child cleanups registered against the new pool, or * against sub-pools thereof, will not be executed during an * invocation of apr_proc_create(), so resources created in an * "unmanaged" pool hierarchy will leak to child processes. */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator) __attribute__((nonnull(1))); /** * Debug version of apr_pool_create_ex. * @param newpool @see apr_pool_create. * @param parent @see apr_pool_create. * @param abort_fn @see apr_pool_create. * @param allocator @see apr_pool_create. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. * Call this directly if you have your apr_pool_create_ex * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have * apr_pool_create_ex in a wrapper, trust the macro * and don't call apr_pool_create_ex_debug directly. */ APR_DECLARE(apr_status_t) apr_pool_create_ex_debug(apr_pool_t **newpool, apr_pool_t *parent, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, const char *file_line) __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_create_ex(newpool, parent, abort_fn, allocator) \ apr_pool_create_ex_debug(newpool, parent, abort_fn, allocator, \ APR_POOL__FILE_LINE__) #endif /** * Debug version of apr_pool_create_core_ex. * @deprecated @see apr_pool_create_unmanaged_ex_debug. */ APR_DECLARE(apr_status_t) apr_pool_create_core_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, const char *file_line); /** * Debug version of apr_pool_create_unmanaged_ex. * @param newpool @see apr_pool_create_unmanaged. * @param abort_fn @see apr_pool_create_unmanaged. * @param allocator @see apr_pool_create_unmanaged. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. * Call this directly if you have your apr_pool_create_unmanaged_ex * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have * apr_pool_create_core_ex in a wrapper, trust the macro * and don't call apr_pool_create_core_ex_debug directly. */ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpool, apr_abortfunc_t abort_fn, apr_allocator_t *allocator, const char *file_line) __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_create_core_ex(newpool, abort_fn, allocator) \ apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \ APR_POOL__FILE_LINE__) #define apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator) \ apr_pool_create_unmanaged_ex_debug(newpool, abort_fn, allocator, \ APR_POOL__FILE_LINE__) #endif /** * Create a new pool. * @param newpool The pool we have just created. * @param parent The parent pool. If this is NULL, the new pool is a root * pool. If it is non-NULL, the new pool will inherit all * of its parent pool's attributes, except the apr_pool_t will * be a sub-pool. * @remark This function is thread-safe, in the sense that multiple threads * can safely create subpools of the same parent pool concurrently. * Similarly, a subpool can be created by one thread at the same * time that another thread accesses the parent pool. */ #if defined(DOXYGEN) APR_DECLARE(apr_status_t) apr_pool_create(apr_pool_t **newpool, apr_pool_t *parent); #else #if APR_POOL_DEBUG #define apr_pool_create(newpool, parent) \ apr_pool_create_ex_debug(newpool, parent, NULL, NULL, \ APR_POOL__FILE_LINE__) #else #define apr_pool_create(newpool, parent) \ apr_pool_create_ex(newpool, parent, NULL, NULL) #endif #endif /** * Create a new unmanaged pool. * @param newpool The pool we have just created. */ #if defined(DOXYGEN) APR_DECLARE(apr_status_t) apr_pool_create_core(apr_pool_t **newpool); APR_DECLARE(apr_status_t) apr_pool_create_unmanaged(apr_pool_t **newpool); #else #if APR_POOL_DEBUG #define apr_pool_create_core(newpool) \ apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \ APR_POOL__FILE_LINE__) #define apr_pool_create_unmanaged(newpool) \ apr_pool_create_unmanaged_ex_debug(newpool, NULL, NULL, \ APR_POOL__FILE_LINE__) #else #define apr_pool_create_core(newpool) \ apr_pool_create_unmanaged_ex(newpool, NULL, NULL) #define apr_pool_create_unmanaged(newpool) \ apr_pool_create_unmanaged_ex(newpool, NULL, NULL) #endif #endif /** * Find the pool's allocator * @param pool The pool to get the allocator from. */ APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool) __attribute__((nonnull(1))); /** * Clear all memory in the pool and run all the cleanups. This also destroys all * subpools. * @param p The pool to clear * @remark This does not actually free the memory, it just allows the pool * to re-use this memory for the next allocation. * @see apr_pool_destroy() */ APR_DECLARE(void) apr_pool_clear(apr_pool_t *p) __attribute__((nonnull(1))); /** * Debug version of apr_pool_clear. * @param p See: apr_pool_clear. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. * Call this directly if you have your apr_pool_clear * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have * apr_pool_clear in a wrapper, trust the macro * and don't call apr_pool_destroy_clear directly. */ APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p, const char *file_line) __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_clear(p) \ apr_pool_clear_debug(p, APR_POOL__FILE_LINE__) #endif /** * Destroy the pool. This takes similar action as apr_pool_clear() and then * frees all the memory. * @param p The pool to destroy * @remark This will actually free the memory */ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p) __attribute__((nonnull(1))); /** * Debug version of apr_pool_destroy. * @param p See: apr_pool_destroy. * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @remark Only available when APR_POOL_DEBUG is defined. * Call this directly if you have your apr_pool_destroy * calls in a wrapper function and wish to override * the file_line argument to reflect the caller of * your wrapper function. If you do not have * apr_pool_destroy in a wrapper, trust the macro * and don't call apr_pool_destroy_debug directly. */ APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p, const char *file_line) __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pool_destroy(p) \ apr_pool_destroy_debug(p, APR_POOL__FILE_LINE__) #endif /* * Memory allocation */ /** * Allocate a block of memory from a pool * @param p The pool to allocate from * @param size The amount of memory to allocate * @return The allocated memory */ APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size) #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) __attribute__((alloc_size(2))) #endif __attribute__((nonnull(1))); /** * Debug version of apr_palloc * @param p See: apr_palloc * @param size See: apr_palloc * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @return See: apr_palloc */ APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size, const char *file_line) #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) __attribute__((alloc_size(2))) #endif __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_palloc(p, size) \ apr_palloc_debug(p, size, APR_POOL__FILE_LINE__) #endif /** * Allocate a block of memory from a pool and set all of the memory to 0 * @param p The pool to allocate from * @param size The amount of memory to allocate * @return The allocated memory */ #if defined(DOXYGEN) APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size); #elif !APR_POOL_DEBUG #define apr_pcalloc(p, size) memset(apr_palloc(p, size), 0, size) #endif /** * Debug version of apr_pcalloc * @param p See: apr_pcalloc * @param size See: apr_pcalloc * @param file_line Where the function is called from. * This is usually APR_POOL__FILE_LINE__. * @return See: apr_pcalloc */ APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size, const char *file_line) __attribute__((nonnull(1))); #if APR_POOL_DEBUG #define apr_pcalloc(p, size) \ apr_pcalloc_debug(p, size, APR_POOL__FILE_LINE__) #endif /* * Pool Properties */ /** * Set the function to be called when an allocation failure occurs. * @remark If the program wants APR to exit on a memory allocation error, * then this function can be called to set the callback to use (for * performing cleanup and then exiting). If this function is not called, * then APR will return an error and expect the calling program to * deal with the error accordingly. */ APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc, apr_pool_t *pool) __attribute__((nonnull(2))); /** * Get the abort function associated with the specified pool. * @param pool The pool for retrieving the abort function. * @return The abort function for the given pool. */ APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool) __attribute__((nonnull(1))); /** * Get the parent pool of the specified pool. * @param pool The pool for retrieving the parent pool. * @return The parent of the given pool. */ APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool) __attribute__((nonnull(1))); /** * Determine if pool a is an ancestor of pool b. * @param a The pool to search * @param b The pool to search for * @return True if a is an ancestor of b, NULL is considered an ancestor * of all pools. * @remark if compiled with APR_POOL_DEBUG, this function will also * return true if A is a pool which has been guaranteed by the caller * (using apr_pool_join) to have a lifetime at least as long as some * ancestor of pool B. */ APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t *a, apr_pool_t *b); /** * Tag a pool (give it a name) * @param pool The pool to tag * @param tag The tag */ APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag) __attribute__((nonnull(1))); /* * User data management */ /** * Set the data associated with the current pool * @param data The user data associated with the pool. * @param key The key to use for association * @param cleanup The cleanup program to use to cleanup the data (NULL if none) * @param pool The current pool * @warning The data to be attached to the pool should have a life span * at least as long as the pool it is being attached to. * * Users of APR must take EXTREME care when choosing a key to * use for their data. It is possible to accidentally overwrite * data by choosing a key that another part of the program is using. * Therefore it is advised that steps are taken to ensure that unique * keys are used for all of the userdata objects in a particular pool * (the same key in two different pools or a pool and one of its * subpools is okay) at all times. Careful namespace prefixing of * key names is a typical way to help ensure this uniqueness. * */ APR_DECLARE(apr_status_t) apr_pool_userdata_set(const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *pool) __attribute__((nonnull(2,4))); /** * Set the data associated with the current pool * @param data The user data associated with the pool. * @param key The key to use for association * @param cleanup The cleanup program to use to cleanup the data (NULL if none) * @param pool The current pool * @note same as apr_pool_userdata_set(), except that this version doesn't * make a copy of the key (this function is useful, for example, when * the key is a string literal) * @warning This should NOT be used if the key could change addresses by * any means between the apr_pool_userdata_setn() call and a * subsequent apr_pool_userdata_get() on that key, such as if a * static string is used as a userdata key in a DSO and the DSO could * be unloaded and reloaded between the _setn() and the _get(). You * MUST use apr_pool_userdata_set() in such cases. * @warning More generally, the key and the data to be attached to the * pool should have a life span at least as long as the pool itself. * */ APR_DECLARE(apr_status_t) apr_pool_userdata_setn( const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *pool) __attribute__((nonnull(2,4))); /** * Return the data associated with the current pool. * @param data The user data associated with the pool. * @param key The key for the data to retrieve * @param pool The current pool. */ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key, apr_pool_t *pool) __attribute__((nonnull(1,2,3))); /** * @defgroup PoolCleanup Pool Cleanup Functions * * Cleanups are performed in the reverse order they were registered. That is: * Last In, First Out. A cleanup function can safely allocate memory from * the pool that is being cleaned up. It can also safely register additional * cleanups which will be run LIFO, directly after the current cleanup * terminates. Cleanups have to take caution in calling functions that * create subpools. Subpools, created during cleanup will NOT automatically * be cleaned up. In other words, cleanups are to clean up after themselves. * * @{ */ /** * Register a function to be called when a pool is cleared or destroyed * @param p The pool to register the cleanup with * @param data The data to pass to the cleanup function. * @param plain_cleanup The function to call when the pool is cleared * or destroyed * @param child_cleanup The function to call when a child process is about * to exec - this function is called in the child, obviously! */ APR_DECLARE(void) apr_pool_cleanup_register( apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)) __attribute__((nonnull(3,4))); /** * Register a function to be called when a pool is cleared or destroyed. * * Unlike apr_pool_cleanup_register which registers a cleanup * that is called AFTER all subpools are destroyed, this function registers * a function that will be called before any of the subpools are destroyed. * * @param p The pool to register the cleanup with * @param data The data to pass to the cleanup function. * @param plain_cleanup The function to call when the pool is cleared * or destroyed */ APR_DECLARE(void) apr_pool_pre_cleanup_register( apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *)) __attribute__((nonnull(3))); /** * Remove a previously registered cleanup function. * * The cleanup most recently registered with @a p having the same values of * @a data and @a cleanup will be removed. * * @param p The pool to remove the cleanup from * @param data The data of the registered cleanup * @param cleanup The function to remove from cleanup * @remarks For some strange reason only the plain_cleanup is handled by this * function */ APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *)) __attribute__((nonnull(3))); /** * Replace the child cleanup function of a previously registered cleanup. * * The cleanup most recently registered with @a p having the same values of * @a data and @a plain_cleanup will have the registered child cleanup * function replaced with @a child_cleanup. * * @param p The pool of the registered cleanup * @param data The data of the registered cleanup * @param plain_cleanup The plain cleanup function of the registered cleanup * @param child_cleanup The function to register as the child cleanup */ APR_DECLARE(void) apr_pool_child_cleanup_set( apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *)) __attribute__((nonnull(3,4))); /** * Run the specified cleanup function immediately and unregister it. * * The cleanup most recently registered with @a p having the same values of * @a data and @a cleanup will be removed and @a cleanup will be called * with @a data as the argument. * * @param p The pool to remove the cleanup from * @param data The data to remove from cleanup * @param cleanup The function to remove from cleanup */ APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *)) __attribute__((nonnull(3))); /** * An empty cleanup function. * * Passed to apr_pool_cleanup_register() when no cleanup is required. * * @param data The data to cleanup, will not be used by this function. */ APR_DECLARE_NONSTD(apr_status_t) apr_pool_cleanup_null(void *data); /** * Run all registered child cleanups, in preparation for an exec() * call in a forked child -- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any * memory. */ APR_DECLARE(void) apr_pool_cleanup_for_exec(void); /** @} */ /** * @defgroup PoolDebug Pool Debugging functions. * * pools have nested lifetimes -- sub_pools are destroyed when the * parent pool is cleared. We allow certain liberties with operations * on things such as tables (and on other structures in a more general * sense) where we allow the caller to insert values into a table which * were not allocated from the table's pool. The table's data will * remain valid as long as all the pools from which its values are * allocated remain valid. * * For example, if B is a sub pool of A, and you build a table T in * pool B, then it's safe to insert data allocated in A or B into T * (because B lives at most as long as A does, and T is destroyed when * B is cleared/destroyed). On the other hand, if S is a table in * pool A, it is safe to insert data allocated in A into S, but it * is *not safe* to insert data allocated from B into S... because * B can be cleared/destroyed before A is (which would leave dangling * pointers in T's data structures). * * In general we say that it is safe to insert data into a table T * if the data is allocated in any ancestor of T's pool. This is the * basis on which the APR_POOL_DEBUG code works -- it tests these ancestor * relationships for all data inserted into tables. APR_POOL_DEBUG also * provides tools (apr_pool_find, and apr_pool_is_ancestor) for other * folks to implement similar restrictions for their own data * structures. * * However, sometimes this ancestor requirement is inconvenient -- * sometimes it's necessary to create a sub pool where the sub pool is * guaranteed to have the same lifetime as the parent pool. This is a * guarantee implemented by the *caller*, not by the pool code. That * is, the caller guarantees they won't destroy the sub pool * individually prior to destroying the parent pool. * * In this case the caller must call apr_pool_join() to indicate this * guarantee to the APR_POOL_DEBUG code. * * These functions are only implemented when #APR_POOL_DEBUG is set. * * @{ */ #if APR_POOL_DEBUG || defined(DOXYGEN) /** * Guarantee that a subpool has the same lifetime as the parent. * @param p The parent pool * @param sub The subpool */ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub) __attribute__((nonnull(2))); /** * Find a pool from something allocated in it. * @param mem The thing allocated in the pool * @return The pool it is allocated in */ APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem); /** * Report the number of bytes currently in the pool * @param p The pool to inspect * @param recurse Recurse/include the subpools' sizes * @return The number of bytes */ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse) __attribute__((nonnull(1))); /** * Lock a pool * @param pool The pool to lock * @param flag The flag */ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag); /* @} */ #else /* APR_POOL_DEBUG or DOXYGEN */ #ifdef apr_pool_join #undef apr_pool_join #endif #define apr_pool_join(a,b) #ifdef apr_pool_lock #undef apr_pool_lock #endif #define apr_pool_lock(pool, lock) #endif /* APR_POOL_DEBUG or DOXYGEN */ /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_POOLS_H */ ================================================ FILE: third_party/include/apr/apr_portable.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* This header file is where you should put ANY platform specific information. * This should be the only header file that programs need to include that * actually has platform dependent code which refers to the . */ #ifndef APR_PORTABLE_H #define APR_PORTABLE_H /** * @file apr_portable.h * @brief APR Portability Routines */ #include "apr.h" #include "apr_pools.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_network_io.h" #include "apr_errno.h" #include "apr_global_mutex.h" #include "apr_proc_mutex.h" #include "apr_time.h" #include "apr_dso.h" #include "apr_shm.h" #if APR_HAVE_DIRENT_H #include #endif #if APR_HAVE_FCNTL_H #include #endif #if APR_HAVE_PTHREAD_H #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_portabile Portability Routines * @ingroup APR * @{ */ #ifdef WIN32 /* The primitives for Windows types */ typedef HANDLE apr_os_file_t; typedef HANDLE apr_os_dir_t; typedef SOCKET apr_os_sock_t; typedef HANDLE apr_os_proc_mutex_t; typedef HANDLE apr_os_thread_t; typedef HANDLE apr_os_proc_t; typedef DWORD apr_os_threadkey_t; typedef FILETIME apr_os_imp_time_t; typedef SYSTEMTIME apr_os_exp_time_t; typedef HANDLE apr_os_dso_handle_t; typedef HANDLE apr_os_shm_t; #elif defined(OS2) typedef HFILE apr_os_file_t; typedef HDIR apr_os_dir_t; typedef int apr_os_sock_t; typedef HMTX apr_os_proc_mutex_t; typedef TID apr_os_thread_t; typedef PID apr_os_proc_t; typedef PULONG apr_os_threadkey_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; typedef HMODULE apr_os_dso_handle_t; typedef void* apr_os_shm_t; #elif defined(__BEOS__) #include #include struct apr_os_proc_mutex_t { sem_id sem; int32 ben; }; typedef int apr_os_file_t; typedef DIR apr_os_dir_t; typedef int apr_os_sock_t; typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t; typedef thread_id apr_os_thread_t; typedef thread_id apr_os_proc_t; typedef int apr_os_threadkey_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; typedef image_id apr_os_dso_handle_t; typedef void* apr_os_shm_t; #elif defined(NETWARE) typedef int apr_os_file_t; typedef DIR apr_os_dir_t; typedef int apr_os_sock_t; typedef NXMutex_t apr_os_proc_mutex_t; typedef NXThreadId_t apr_os_thread_t; typedef long apr_os_proc_t; typedef NXKey_t apr_os_threadkey_t; typedef struct timeval apr_os_imp_time_t; typedef struct tm apr_os_exp_time_t; typedef void * apr_os_dso_handle_t; typedef void* apr_os_shm_t; #else /* Any other OS should go above this one. This is the lowest common * denominator typedefs for all UNIX-like systems. :) */ /** Basic OS process mutex structure. */ struct apr_os_proc_mutex_t { #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE /** Value used for SYS V Semaphore, FCNTL and FLOCK serialization */ int crossproc; #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE /** Value used for PTHREAD serialization */ pthread_mutex_t *pthread_interproc; #endif #if APR_HAS_THREADS /* If no threads, no need for thread locks */ #if APR_USE_PTHREAD_SERIALIZE /** This value is currently unused within APR and Apache */ pthread_mutex_t *intraproc; #endif #endif }; typedef int apr_os_file_t; /**< native file */ typedef DIR apr_os_dir_t; /**< native dir */ typedef int apr_os_sock_t; /**< native dir */ typedef struct apr_os_proc_mutex_t apr_os_proc_mutex_t; /**< native process * mutex */ #if APR_HAS_THREADS && APR_HAVE_PTHREAD_H typedef pthread_t apr_os_thread_t; /**< native thread */ typedef pthread_key_t apr_os_threadkey_t; /**< native thread address * space */ #endif typedef pid_t apr_os_proc_t; /**< native pid */ typedef struct timeval apr_os_imp_time_t; /**< native timeval */ typedef struct tm apr_os_exp_time_t; /**< native tm */ /** @var apr_os_dso_handle_t * native dso types */ #if defined(HPUX) || defined(HPUX10) || defined(HPUX11) #include typedef shl_t apr_os_dso_handle_t; #elif defined(DARWIN) #include typedef NSModule apr_os_dso_handle_t; #else typedef void * apr_os_dso_handle_t; #endif typedef void* apr_os_shm_t; /**< native SHM */ #endif /** * @typedef apr_os_sock_info_t * @brief alias for local OS socket */ /** * everything APR needs to know about an active socket to construct * an APR socket from it; currently, this is platform-independent */ struct apr_os_sock_info_t { apr_os_sock_t *os_sock; /**< always required */ struct sockaddr *local; /**< NULL if not yet bound */ struct sockaddr *remote; /**< NULL if not connected */ int family; /**< always required (APR_INET, APR_INET6, etc.) */ int type; /**< always required (SOCK_STREAM, SOCK_DGRAM, etc.) */ int protocol; /**< 0 or actual protocol (APR_PROTO_SCTP, APR_PROTO_TCP, etc.) */ }; typedef struct apr_os_sock_info_t apr_os_sock_info_t; #if APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN) /** Opaque global mutex type */ #define apr_os_global_mutex_t apr_os_proc_mutex_t /** @return apr_os_global_mutex */ #define apr_os_global_mutex_get apr_os_proc_mutex_get #else /** Thread and process mutex for those platforms where process mutexes * are not held in threads. */ struct apr_os_global_mutex_t { apr_pool_t *pool; apr_proc_mutex_t *proc_mutex; #if APR_HAS_THREADS apr_thread_mutex_t *thread_mutex; #endif /* APR_HAS_THREADS */ }; typedef struct apr_os_global_mutex_t apr_os_global_mutex_t; APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex, apr_global_mutex_t *pmutex); #endif /** * convert the file from apr type to os specific type. * @param thefile The os specific file we are converting to * @param file The apr file to convert. * @remark On Unix, it is only possible to get a file descriptor from * an apr file type. */ APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file); /** * convert the dir from apr type to os specific type. * @param thedir The os specific dir we are converting to * @param dir The apr dir to convert. */ APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir); /** * Convert the socket from an apr type to an OS specific socket * @param thesock The socket to convert. * @param sock The os specific equivalent of the apr socket.. */ APR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock); /** * Convert the proc mutex from os specific type to apr type * @param ospmutex The os specific proc mutex we are converting to. * @param pmutex The apr proc mutex to convert. */ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, apr_proc_mutex_t *pmutex); /** * Get the exploded time in the platforms native format. * @param ostime the native time format * @param aprtime the time to convert */ APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, apr_time_exp_t *aprtime); /** * Get the imploded time in the platforms native format. * @param ostime the native time format * @param aprtime the time to convert */ APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime, apr_time_t *aprtime); /** * convert the shm from apr type to os specific type. * @param osshm The os specific shm representation * @param shm The apr shm to convert. */ APR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm, apr_shm_t *shm); #if APR_HAS_THREADS || defined(DOXYGEN) /** * @defgroup apr_os_thread Thread portability Routines * @{ */ /** * convert the thread to os specific type from apr type. * @param thethd The apr thread to convert * @param thd The os specific thread we are converting to */ APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd); /** * convert the thread private memory key to os specific type from an apr type. * @param thekey The apr handle we are converting from. * @param key The os specific handle we are converting to. */ APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key); /** * convert the thread from os specific type to apr type. * @param thd The apr thread we are converting to. * @param thethd The os specific thread to convert * @param cont The pool to use if it is needed. */ APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont); /** * convert the thread private memory key from os specific type to apr type. * @param key The apr handle we are converting to. * @param thekey The os specific handle to convert * @param cont The pool to use if it is needed. */ APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont); /** * Get the thread ID */ APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void); /** * Compare two thread id's * @param tid1 1st Thread ID to compare * @param tid2 2nd Thread ID to compare * @return non-zero if the two threads are equal, zero otherwise */ APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2); /** @} */ #endif /* APR_HAS_THREADS */ /** * convert the file from os specific type to apr type. * @param file The apr file we are converting to. * @param thefile The os specific file to convert * @param flags The flags that were used to open this file. * @param cont The pool to use if it is needed. * @remark On Unix, it is only possible to put a file descriptor into * an apr file type. */ APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_int32_t flags, apr_pool_t *cont); /** * convert the file from os specific type to apr type. * @param file The apr file we are converting to. * @param thefile The os specific pipe to convert * @param cont The pool to use if it is needed. * @remark On Unix, it is only possible to put a file descriptor into * an apr file type. */ APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont); /** * convert the file from os specific type to apr type. * @param file The apr file we are converting to. * @param thefile The os specific pipe to convert * @param register_cleanup A cleanup will be registered on the apr_file_t * to issue apr_file_close(). * @param cont The pool to use if it is needed. * @remark On Unix, it is only possible to put a file descriptor into * an apr file type. */ APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, apr_os_file_t *thefile, int register_cleanup, apr_pool_t *cont); /** * convert the dir from os specific type to apr type. * @param dir The apr dir we are converting to. * @param thedir The os specific dir to convert * @param cont The pool to use when creating to apr directory. */ APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont); /** * Convert a socket from the os specific type to the apr type * @param sock The pool to use. * @param thesock The socket to convert to. * @param cont The socket we are converting to an apr type. * @remark If it is a true socket, it is best to call apr_os_sock_make() * and provide APR with more information about the socket. */ APR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont); /** * Create a socket from an existing descriptor and local and remote * socket addresses. * @param apr_sock The new socket that has been set up * @param os_sock_info The os representation of the socket handle and * other characteristics of the socket * @param cont The pool to use * @remark If you only know the descriptor/handle or if it isn't really * a true socket, use apr_os_sock_put() instead. */ APR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont); /** * Convert the proc mutex from os specific type to apr type * @param pmutex The apr proc mutex we are converting to. * @param ospmutex The os specific proc mutex to convert. * @param cont The pool to use if it is needed. */ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *cont); /** * Put the imploded time in the APR format. * @param aprtime the APR time format * @param ostime the time to convert * @param cont the pool to use if necessary */ APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont); /** * Put the exploded time in the APR format. * @param aprtime the APR time format * @param ostime the time to convert * @param cont the pool to use if necessary */ APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont); /** * convert the shared memory from os specific type to apr type. * @param shm The apr shm representation of osshm * @param osshm The os specific shm identity * @param cont The pool to use if it is needed. * @remark On fork()ed architectures, this is typically nothing more than * the memory block mapped. On non-fork architectures, this is typically * some internal handle to pass the mapping from process to process. */ APR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **shm, apr_os_shm_t *osshm, apr_pool_t *cont); #if APR_HAS_DSO || defined(DOXYGEN) /** * @defgroup apr_os_dso DSO (Dynamic Loading) Portability Routines * @{ */ /** * convert the dso handle from os specific to apr * @param dso The apr handle we are converting to * @param thedso the os specific handle to convert * @param pool the pool to use if it is needed */ APR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso, apr_os_dso_handle_t thedso, apr_pool_t *pool); /** * convert the apr dso handle into an os specific one * @param aprdso The apr dso handle to convert * @param dso The os specific dso to return */ APR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso, apr_dso_handle_t *aprdso); /** @} */ #endif /* APR_HAS_DSO */ #if APR_HAS_OS_UUID /** * Private: apr-util's apr_uuid module when supported by the platform */ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data); #endif /** * Get the name of the system default character set. * @param pool the pool to allocate the name from, if needed */ APR_DECLARE(const char*) apr_os_default_encoding(apr_pool_t *pool); /** * Get the name of the current locale character set. * @param pool the pool to allocate the name from, if needed * @remark Defers to apr_os_default_encoding if the current locale's * data can't be retrieved on this system. */ APR_DECLARE(const char*) apr_os_locale_encoding(apr_pool_t *pool); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_PORTABLE_H */ ================================================ FILE: third_party/include/apr/apr_proc_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_PROC_MUTEX_H #define APR_PROC_MUTEX_H /** * @file apr_proc_mutex.h * @brief APR Process Locking Routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_proc_mutex Process Locking Routines * @ingroup APR * @{ */ /** * Enumerated potential types for APR process locking methods * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. */ typedef enum { APR_LOCK_FCNTL, /**< fcntl() */ APR_LOCK_FLOCK, /**< flock() */ APR_LOCK_SYSVSEM, /**< System V Semaphores */ APR_LOCK_PROC_PTHREAD, /**< POSIX pthread process-based locking */ APR_LOCK_POSIXSEM, /**< POSIX semaphore process-based locking */ APR_LOCK_DEFAULT /**< Use the default process lock */ } apr_lockmech_e; /** Opaque structure representing a process mutex. */ typedef struct apr_proc_mutex_t apr_proc_mutex_t; /* Function definitions */ /** * Create and initialize a mutex that can be used to synchronize processes. * @param mutex the memory address where the newly created mutex will be * stored. * @param fname A file name to use if the lock mechanism requires one. This * argument should always be provided. The lock code itself will * determine if it should be used. * @param mech The mechanism to use for the interprocess lock, if any; one of *
 *            APR_LOCK_FCNTL
 *            APR_LOCK_FLOCK
 *            APR_LOCK_SYSVSEM
 *            APR_LOCK_POSIXSEM
 *            APR_LOCK_PROC_PTHREAD
 *            APR_LOCK_DEFAULT     pick the default mechanism for the platform
 * 
* @param pool the pool from which to allocate the mutex. * @see apr_lockmech_e * @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports * APR_LOCK_foo. Only APR_LOCK_DEFAULT is portable. */ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex, const char *fname, apr_lockmech_e mech, apr_pool_t *pool); /** * Re-open a mutex in a child process. * @param mutex The newly re-opened mutex structure. * @param fname A file name to use if the mutex mechanism requires one. This * argument should always be provided. The mutex code itself will * determine if it should be used. This filename should be the * same one that was passed to apr_proc_mutex_create(). * @param pool The pool to operate on. * @remark This function must be called to maintain portability, even * if the underlying lock mechanism does not require it. */ APR_DECLARE(apr_status_t) apr_proc_mutex_child_init(apr_proc_mutex_t **mutex, const char *fname, apr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, * the current thread will be put to sleep until the lock becomes available. * @param mutex the mutex on which to acquire the lock. */ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex); /** * Attempt to acquire the lock for the given mutex. If the mutex has already * been acquired, the call returns immediately with APR_EBUSY. Note: it * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine * if the return value was APR_EBUSY, for portability reasons. * @param mutex the mutex on which to attempt the lock acquiring. */ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex); /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. */ APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. */ APR_DECLARE(apr_status_t) apr_proc_mutex_destroy(apr_proc_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. * @note This function is generally used to kill a cleanup on an already * created mutex */ APR_DECLARE(apr_status_t) apr_proc_mutex_cleanup(void *mutex); /** * Return the name of the lockfile for the mutex, or NULL * if the mutex doesn't use a lock file */ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex); /** * Display the name of the mutex, as it relates to the actual method used. * This matches the valid options for Apache's AcceptMutex directive * @param mutex the name of the mutex */ APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex); /** * Display the name of the default mutex: APR_LOCK_DEFAULT */ APR_DECLARE(const char *) apr_proc_mutex_defname(void); /** * Get the pool used by this proc_mutex. * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(proc_mutex); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_PROC_MUTEX_H */ ================================================ FILE: third_party/include/apr/apr_random.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_RANDOM_H #define APR_RANDOM_H /** * @file apr_random.h * @brief APR PRNG routines */ #include "apr_pools.h" #include "apr_thread_proc.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_random PRNG Routines * @ingroup APR * @{ */ typedef struct apr_crypto_hash_t apr_crypto_hash_t; typedef void apr_crypto_hash_init_t(apr_crypto_hash_t *hash); typedef void apr_crypto_hash_add_t(apr_crypto_hash_t *hash, const void *data, apr_size_t bytes); typedef void apr_crypto_hash_finish_t(apr_crypto_hash_t *hash, unsigned char *result); /* FIXME: make this opaque */ struct apr_crypto_hash_t { apr_crypto_hash_init_t *init; apr_crypto_hash_add_t *add; apr_crypto_hash_finish_t *finish; apr_size_t size; void *data; }; /** * Allocate and initialize the SHA-256 context * @param p The pool to allocate from */ APR_DECLARE(apr_crypto_hash_t *) apr_crypto_sha256_new(apr_pool_t *p); /** Opaque PRNG structure. */ typedef struct apr_random_t apr_random_t; /** * Initialize a PRNG state * @param g The PRNG state * @param p The pool to allocate from * @param pool_hash Pool hash functions * @param key_hash Key hash functions * @param prng_hash PRNG hash functions */ APR_DECLARE(void) apr_random_init(apr_random_t *g, apr_pool_t *p, apr_crypto_hash_t *pool_hash, apr_crypto_hash_t *key_hash, apr_crypto_hash_t *prng_hash); /** * Allocate and initialize (apr_crypto_sha256_new) a new PRNG state. * @param p The pool to allocate from */ APR_DECLARE(apr_random_t *) apr_random_standard_new(apr_pool_t *p); /** * Mix the randomness pools. * @param g The PRNG state * @param entropy_ Entropy buffer * @param bytes Length of entropy_ in bytes */ APR_DECLARE(void) apr_random_add_entropy(apr_random_t *g, const void *entropy_, apr_size_t bytes); /** * Generate cryptographically insecure random bytes. * @param g The RNG state * @param random Buffer to fill with random bytes * @param bytes Length of buffer in bytes */ APR_DECLARE(apr_status_t) apr_random_insecure_bytes(apr_random_t *g, void *random, apr_size_t bytes); /** * Generate cryptographically secure random bytes. * @param g The RNG state * @param random Buffer to fill with random bytes * @param bytes Length of buffer in bytes */ APR_DECLARE(apr_status_t) apr_random_secure_bytes(apr_random_t *g, void *random, apr_size_t bytes); /** * Ensures that E bits of conditional entropy are mixed into the PRNG * before any further randomness is extracted. * @param g The RNG state */ APR_DECLARE(void) apr_random_barrier(apr_random_t *g); /** * Return APR_SUCCESS if the cryptographic PRNG has been seeded with * enough data, APR_ENOTENOUGHENTROPY otherwise. * @param r The RNG state */ APR_DECLARE(apr_status_t) apr_random_secure_ready(apr_random_t *r); /** * Return APR_SUCCESS if the PRNG has been seeded with enough data, * APR_ENOTENOUGHENTROPY otherwise. * @param r The PRNG state */ APR_DECLARE(apr_status_t) apr_random_insecure_ready(apr_random_t *r); /** * Mix the randomness pools after forking. * @param proc The resulting process handle from apr_proc_fork() * @remark Call this in the child after forking to mix the randomness * pools. Note that its generally a bad idea to fork a process with a * real PRNG in it - better to have the PRNG externally and get the * randomness from there. However, if you really must do it, then you * should supply all your entropy to all the PRNGs - don't worry, they * won't produce the same output. * @remark Note that apr_proc_fork() calls this for you, so only weird * applications need ever call it themselves. * @internal */ APR_DECLARE(void) apr_random_after_fork(apr_proc_t *proc); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_RANDOM_H */ ================================================ FILE: third_party/include/apr/apr_ring.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * This code draws heavily from the 4.4BSD macros * and Dean Gaudet's "splim/ring.h". * * * * We'd use Dean's code directly if we could guarantee the * availability of inline functions. */ #ifndef APR_RING_H #define APR_RING_H /** * @file apr_ring.h * @brief APR Rings */ /* * for offsetof() */ #include "apr_general.h" /** * @defgroup apr_ring Ring Macro Implementations * @ingroup APR * A ring is a kind of doubly-linked list that can be manipulated * without knowing where its head is. * @{ */ /** * The Ring Element * * A ring element struct is linked to the other elements in the ring * through its ring entry field, e.g. *
 *      struct my_element_t {
 *          APR_RING_ENTRY(my_element_t) link;
 *          int foo;
 *          char *bar;
 *      };
 * 
* * An element struct may be put on more than one ring if it has more * than one APR_RING_ENTRY field. Each APR_RING_ENTRY has a corresponding * APR_RING_HEAD declaration. * * @warning For strict C standards compliance you should put the APR_RING_ENTRY * first in the element struct unless the head is always part of a larger * object with enough earlier fields to accommodate the offsetof() used * to compute the ring sentinel below. You can usually ignore this caveat. */ #define APR_RING_ENTRY(elem) \ struct { \ struct elem * volatile next; \ struct elem * volatile prev; \ } /** * The Ring Head * * Each ring is managed via its head, which is a struct declared like this: *
 *      APR_RING_HEAD(my_ring_t, my_element_t);
 *      struct my_ring_t ring, *ringp;
 * 
* * This struct looks just like the element link struct so that we can * be sure that the typecasting games will work as expected. * * The first element in the ring is next after the head, and the last * element is just before the head. */ #define APR_RING_HEAD(head, elem) \ struct head { \ struct elem * volatile next; \ struct elem * volatile prev; \ } /** * The Ring Sentinel * * This is the magic pointer value that occurs before the first and * after the last elements in the ring, computed from the address of * the ring's head. The head itself isn't an element, but in order to * get rid of all the special cases when dealing with the ends of the * ring, we play typecasting games to make it look like one. * * Here is a diagram to illustrate the arrangements of the next and * prev pointers of each element in a single ring. Note that they point * to the start of each element, not to the APR_RING_ENTRY structure. * *
 *     +->+------+<-+  +->+------+<-+  +->+------+<-+
 *     |  |struct|  |  |  |struct|  |  |  |struct|  |
 *    /   | elem |   \/   | elem |   \/   | elem |  \
 * ...    |      |   /\   |      |   /\   |      |   ...
 *        +------+  |  |  +------+  |  |  +------+
 *   ...--|prev  |  |  +--|ring  |  |  +--|prev  |
 *        |  next|--+     | entry|--+     |  next|--...
 *        +------+        +------+        +------+
 *        | etc. |        | etc. |        | etc. |
 *        :      :        :      :        :      :
 * 
* * The APR_RING_HEAD is nothing but a bare APR_RING_ENTRY. The prev * and next pointers in the first and last elements don't actually * point to the head, they point to a phantom place called the * sentinel. Its value is such that last->next->next == first because * the offset from the sentinel to the head's next pointer is the same * as the offset from the start of an element to its next pointer. * This also works in the opposite direction. * *
 *        last                            first
 *     +->+------+<-+  +->sentinel<-+  +->+------+<-+
 *     |  |struct|  |  |            |  |  |struct|  |
 *    /   | elem |   \/              \/   | elem |  \
 * ...    |      |   /\              /\   |      |   ...
 *        +------+  |  |  +------+  |  |  +------+
 *   ...--|prev  |  |  +--|ring  |  |  +--|prev  |
 *        |  next|--+     |  head|--+     |  next|--...
 *        +------+        +------+        +------+
 *        | etc. |                        | etc. |
 *        :      :                        :      :
 * 
* * Note that the offset mentioned above is different for each kind of * ring that the element may be on, and each kind of ring has a unique * name for its APR_RING_ENTRY in each element, and has its own type * for its APR_RING_HEAD. * * Note also that if the offset is non-zero (which is required if an * element has more than one APR_RING_ENTRY), the unreality of the * sentinel may have bad implications on very perverse implementations * of C -- see the warning in APR_RING_ENTRY. * * @param hp The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SENTINEL(hp, elem, link) \ (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link)) /** * The first element of the ring * @param hp The head of the ring */ #define APR_RING_FIRST(hp) (hp)->next /** * The last element of the ring * @param hp The head of the ring */ #define APR_RING_LAST(hp) (hp)->prev /** * The next element in the ring * @param ep The current element * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_NEXT(ep, link) (ep)->link.next /** * The previous element in the ring * @param ep The current element * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_PREV(ep, link) (ep)->link.prev /** * Initialize a ring * @param hp The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INIT(hp, elem, link) do { \ APR_RING_FIRST((hp)) = APR_RING_SENTINEL((hp), elem, link); \ APR_RING_LAST((hp)) = APR_RING_SENTINEL((hp), elem, link); \ } while (0) /** * Determine if a ring is empty * @param hp The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct * @return true or false */ #define APR_RING_EMPTY(hp, elem, link) \ (APR_RING_FIRST((hp)) == APR_RING_SENTINEL((hp), elem, link)) /** * Initialize a singleton element * @param ep The element * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_ELEM_INIT(ep, link) do { \ APR_RING_NEXT((ep), link) = (ep); \ APR_RING_PREV((ep), link) = (ep); \ } while (0) /** * Splice the sequence ep1..epN into the ring before element lep * (..lep.. becomes ..ep1..epN..lep..) * @warning This doesn't work for splicing before the first element or on * empty rings... see APR_RING_SPLICE_HEAD for one that does * @param lep Element in the ring to splice before * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_BEFORE(lep, ep1, epN, link) do { \ APR_RING_NEXT((epN), link) = (lep); \ APR_RING_PREV((ep1), link) = APR_RING_PREV((lep), link); \ APR_RING_NEXT(APR_RING_PREV((lep), link), link) = (ep1); \ APR_RING_PREV((lep), link) = (epN); \ } while (0) /** * Splice the sequence ep1..epN into the ring after element lep * (..lep.. becomes ..lep..ep1..epN..) * @warning This doesn't work for splicing after the last element or on * empty rings... see APR_RING_SPLICE_TAIL for one that does * @param lep Element in the ring to splice after * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_AFTER(lep, ep1, epN, link) do { \ APR_RING_PREV((ep1), link) = (lep); \ APR_RING_NEXT((epN), link) = APR_RING_NEXT((lep), link); \ APR_RING_PREV(APR_RING_NEXT((lep), link), link) = (epN); \ APR_RING_NEXT((lep), link) = (ep1); \ } while (0) /** * Insert the element nep into the ring before element lep * (..lep.. becomes ..nep..lep..) * @warning This doesn't work for inserting before the first element or on * empty rings... see APR_RING_INSERT_HEAD for one that does * @param lep Element in the ring to insert before * @param nep Element to insert * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_BEFORE(lep, nep, link) \ APR_RING_SPLICE_BEFORE((lep), (nep), (nep), link) /** * Insert the element nep into the ring after element lep * (..lep.. becomes ..lep..nep..) * @warning This doesn't work for inserting after the last element or on * empty rings... see APR_RING_INSERT_TAIL for one that does * @param lep Element in the ring to insert after * @param nep Element to insert * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_AFTER(lep, nep, link) \ APR_RING_SPLICE_AFTER((lep), (nep), (nep), link) /** * Splice the sequence ep1..epN into the ring before the first element * (..hp.. becomes ..hp..ep1..epN..) * @param hp Head of the ring * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_HEAD(hp, ep1, epN, elem, link) \ APR_RING_SPLICE_AFTER(APR_RING_SENTINEL((hp), elem, link), \ (ep1), (epN), link) /** * Splice the sequence ep1..epN into the ring after the last element * (..hp.. becomes ..ep1..epN..hp..) * @param hp Head of the ring * @param ep1 First element in the sequence to splice in * @param epN Last element in the sequence to splice in * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_SPLICE_TAIL(hp, ep1, epN, elem, link) \ APR_RING_SPLICE_BEFORE(APR_RING_SENTINEL((hp), elem, link), \ (ep1), (epN), link) /** * Insert the element nep into the ring before the first element * (..hp.. becomes ..hp..nep..) * @param hp Head of the ring * @param nep Element to insert * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_HEAD(hp, nep, elem, link) \ APR_RING_SPLICE_HEAD((hp), (nep), (nep), elem, link) /** * Insert the element nep into the ring after the last element * (..hp.. becomes ..nep..hp..) * @param hp Head of the ring * @param nep Element to insert * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_INSERT_TAIL(hp, nep, elem, link) \ APR_RING_SPLICE_TAIL((hp), (nep), (nep), elem, link) /** * Concatenate ring h2 onto the end of ring h1, leaving h2 empty. * @param h1 Head of the ring to concatenate onto * @param h2 Head of the ring to concatenate * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_CONCAT(h1, h2, elem, link) do { \ if (!APR_RING_EMPTY((h2), elem, link)) { \ APR_RING_SPLICE_BEFORE(APR_RING_SENTINEL((h1), elem, link), \ APR_RING_FIRST((h2)), \ APR_RING_LAST((h2)), link); \ APR_RING_INIT((h2), elem, link); \ } \ } while (0) /** * Prepend ring h2 onto the beginning of ring h1, leaving h2 empty. * @param h1 Head of the ring to prepend onto * @param h2 Head of the ring to prepend * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_PREPEND(h1, h2, elem, link) do { \ if (!APR_RING_EMPTY((h2), elem, link)) { \ APR_RING_SPLICE_AFTER(APR_RING_SENTINEL((h1), elem, link), \ APR_RING_FIRST((h2)), \ APR_RING_LAST((h2)), link); \ APR_RING_INIT((h2), elem, link); \ } \ } while (0) /** * Unsplice a sequence of elements from a ring * @warning The unspliced sequence is left with dangling pointers at either end * @param ep1 First element in the sequence to unsplice * @param epN Last element in the sequence to unsplice * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_UNSPLICE(ep1, epN, link) do { \ APR_RING_NEXT(APR_RING_PREV((ep1), link), link) = \ APR_RING_NEXT((epN), link); \ APR_RING_PREV(APR_RING_NEXT((epN), link), link) = \ APR_RING_PREV((ep1), link); \ } while (0) /** * Remove a single element from a ring * @warning The unspliced element is left with dangling pointers at either end * @param ep Element to remove * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_REMOVE(ep, link) \ APR_RING_UNSPLICE((ep), (ep), link) /** * Iterate over a ring * @param ep The current element * @param head The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_FOREACH(ep, head, elem, link) \ for (ep = APR_RING_FIRST(head); \ ep != APR_RING_SENTINEL(head, elem, link); \ ep = APR_RING_NEXT(ep, link)) /** * Iterate over a ring safe against removal of the current element * @param ep1 The current element * @param ep2 Iteration cursor * @param head The head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_FOREACH_SAFE(ep1, ep2, head, elem, link) \ for (ep1 = APR_RING_FIRST(head), ep2 = APR_RING_NEXT(ep1, link); \ ep1 != APR_RING_SENTINEL(head, elem, link); \ ep1 = ep2, ep2 = APR_RING_NEXT(ep1, link)) /* Debugging tools: */ #ifdef APR_RING_DEBUG #include #include #define APR_RING_CHECK_ONE(msg, ptr) \ fprintf(stderr, "*** %s %p\n", msg, ptr) #define APR_RING_CHECK(hp, elem, link, msg) \ APR_RING_CHECK_ELEM(APR_RING_SENTINEL(hp, elem, link), elem, link, msg) #define APR_RING_CHECK_ELEM(ep, elem, link, msg) do { \ struct elem *start = (ep); \ struct elem *here = start; \ fprintf(stderr, "*** ring check start -- %s\n", msg); \ do { \ fprintf(stderr, "\telem %p\n", here); \ fprintf(stderr, "\telem->next %p\n", \ APR_RING_NEXT(here, link)); \ fprintf(stderr, "\telem->prev %p\n", \ APR_RING_PREV(here, link)); \ fprintf(stderr, "\telem->next->prev %p\n", \ APR_RING_PREV(APR_RING_NEXT(here, link), link)); \ fprintf(stderr, "\telem->prev->next %p\n", \ APR_RING_NEXT(APR_RING_PREV(here, link), link)); \ if (APR_RING_PREV(APR_RING_NEXT(here, link), link) != here) { \ fprintf(stderr, "\t*** elem->next->prev != elem\n"); \ break; \ } \ if (APR_RING_NEXT(APR_RING_PREV(here, link), link) != here) { \ fprintf(stderr, "\t*** elem->prev->next != elem\n"); \ break; \ } \ here = APR_RING_NEXT(here, link); \ } while (here != start); \ fprintf(stderr, "*** ring check end\n"); \ } while (0) #define APR_RING_CHECK_CONSISTENCY(hp, elem, link) \ APR_RING_CHECK_ELEM_CONSISTENCY(APR_RING_SENTINEL(hp, elem, link),\ elem, link) #define APR_RING_CHECK_ELEM_CONSISTENCY(ep, elem, link) do { \ struct elem *start = (ep); \ struct elem *here = start; \ do { \ assert(APR_RING_PREV(APR_RING_NEXT(here, link), link) == here); \ assert(APR_RING_NEXT(APR_RING_PREV(here, link), link) == here); \ here = APR_RING_NEXT(here, link); \ } while (here != start); \ } while (0) #else /** * Print a single pointer value to STDERR * (This is a no-op unless APR_RING_DEBUG is defined.) * @param msg Descriptive message * @param ptr Pointer value to print */ #define APR_RING_CHECK_ONE(msg, ptr) /** * Dump all ring pointers to STDERR, starting with the head and looping all * the way around the ring back to the head. Aborts if an inconsistency * is found. * (This is a no-op unless APR_RING_DEBUG is defined.) * @param hp Head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct * @param msg Descriptive message */ #define APR_RING_CHECK(hp, elem, link, msg) /** * Loops around a ring and checks all the pointers for consistency. Pops * an assertion if any inconsistency is found. Same idea as APR_RING_CHECK() * except that it's silent if all is well. * (This is a no-op unless APR_RING_DEBUG is defined.) * @param hp Head of the ring * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_CHECK_CONSISTENCY(hp, elem, link) /** * Dump all ring pointers to STDERR, starting with the given element and * looping all the way around the ring back to that element. Aborts if * an inconsistency is found. * (This is a no-op unless APR_RING_DEBUG is defined.) * @param ep The element * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct * @param msg Descriptive message */ #define APR_RING_CHECK_ELEM(ep, elem, link, msg) /** * Loops around a ring, starting with the given element, and checks all * the pointers for consistency. Pops an assertion if any inconsistency * is found. Same idea as APR_RING_CHECK_ELEM() except that it's silent * if all is well. * (This is a no-op unless APR_RING_DEBUG is defined.) * @param ep The element * @param elem The name of the element struct * @param link The name of the APR_RING_ENTRY in the element struct */ #define APR_RING_CHECK_ELEM_CONSISTENCY(ep, elem, link) #endif /** @} */ #endif /* !APR_RING_H */ ================================================ FILE: third_party/include/apr/apr_shm.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_SHM_H #define APR_SHM_H /** * @file apr_shm.h * @brief APR Shared Memory Routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_shm Shared Memory Routines * @ingroup APR * @{ */ /** * Private, platform-specific data struture representing a shared memory * segment. */ typedef struct apr_shm_t apr_shm_t; /** * Create and make accessible a shared memory segment with default * properties. * @param m The shared memory structure to create. * @param reqsize The desired size of the segment. * @param filename The file to use for shared memory on platforms that * require it. * @param pool the pool from which to allocate the shared memory * structure. * @remark A note about Anonymous vs. Named shared memory segments: * Not all plaforms support anonymous shared memory segments, but in * some cases it is prefered over other types of shared memory * implementations. Passing a NULL 'file' parameter to this function * will cause the subsystem to use anonymous shared memory segments. * If such a system is not available, APR_ENOTIMPL is returned. * @remark A note about allocation sizes: * On some platforms it is necessary to store some metainformation * about the segment within the actual segment. In order to supply * the caller with the requested size it may be necessary for the * implementation to request a slightly greater segment length * from the subsystem. In all cases, the apr_shm_baseaddr_get() * function will return the first usable byte of memory. * */ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, apr_size_t reqsize, const char *filename, apr_pool_t *pool); /** * Special processing flags for apr_shm_create_ex() and apr_shm_attach_ex(). */ #define APR_SHM_NS_LOCAL 1 /* Create or attach to named shared memory * segment in the "Local" namespace on * Windows. (Ignored on other platforms.) * By default, the "Global" namespace is * used for privileged processes and the * "Local" namespace is used otherwise. */ #define APR_SHM_NS_GLOBAL 2 /* Create or attach to named shared memory * segment in the "Global" namespace on * Windows. (Ignored on other platforms.) */ /** * Create and make accessible a shared memory segment with platform- * specific processing. * @param m The shared memory structure to create. * @param reqsize The desired size of the segment. * @param filename The file to use for shared memory on platforms that * require it. * @param pool the pool from which to allocate the shared memory * structure. * @param flags mask of APR_SHM_* (defined above) * @remark A note about Anonymous vs. Named shared memory segments: * Not all plaforms support anonymous shared memory segments, but in * some cases it is prefered over other types of shared memory * implementations. Passing a NULL 'file' parameter to this function * will cause the subsystem to use anonymous shared memory segments. * If such a system is not available, APR_ENOTIMPL is returned. * @remark A note about allocation sizes: * On some platforms it is necessary to store some metainformation * about the segment within the actual segment. In order to supply * the caller with the requested size it may be necessary for the * implementation to request a slightly greater segment length * from the subsystem. In all cases, the apr_shm_baseaddr_get() * function will return the first usable byte of memory. * */ APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m, apr_size_t reqsize, const char *filename, apr_pool_t *pool, apr_int32_t flags); /** * Remove named resource associated with a shared memory segment, * preventing attachments to the resource, but not destroying it. * @param filename The filename associated with shared-memory segment which * needs to be removed * @param pool The pool used for file operations * @remark This function is only supported on platforms which support * name-based shared memory segments, and will return APR_ENOTIMPL on * platforms without such support. Removing the file while the shm * is in use is not entirely portable, caller may use this to enhance * obscurity of the resource, but be prepared for the call to fail, * and for concurrent attempts to create a resource of the same name * to also fail. The pool cleanup of apr_shm_create (apr_shm_destroy) * also removes the named resource. */ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, apr_pool_t *pool); /** * Destroy a shared memory segment and associated memory. * @param m The shared memory segment structure to destroy. */ APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shm_t *m); /** * Attach to a shared memory segment that was created * by another process. * @param m The shared memory structure to create. * @param filename The file used to create the original segment. * (This MUST match the original filename.) * @param pool the pool from which to allocate the shared memory * structure for this process. */ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m, const char *filename, apr_pool_t *pool); /** * Attach to a shared memory segment that was created * by another process, with platform-specific processing. * @param m The shared memory structure to create. * @param filename The file used to create the original segment. * (This MUST match the original filename.) * @param pool the pool from which to allocate the shared memory * structure for this process. * @param flags mask of APR_SHM_* (defined above) */ APR_DECLARE(apr_status_t) apr_shm_attach_ex(apr_shm_t **m, const char *filename, apr_pool_t *pool, apr_int32_t flags); /** * Detach from a shared memory segment without destroying it. * @param m The shared memory structure representing the segment * to detach from. */ APR_DECLARE(apr_status_t) apr_shm_detach(apr_shm_t *m); /** * Retrieve the base address of the shared memory segment. * NOTE: This address is only usable within the callers address * space, since this API does not guarantee that other attaching * processes will maintain the same address mapping. * @param m The shared memory segment from which to retrieve * the base address. * @return address, aligned by APR_ALIGN_DEFAULT. */ APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m); /** * Retrieve the length of a shared memory segment in bytes. * @param m The shared memory segment from which to retrieve * the segment length. */ APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m); /** * Get the pool used by this shared memory segment. */ APR_POOL_DECLARE_ACCESSOR(shm); /** @} */ #ifdef __cplusplus } #endif #endif /* APR_SHM_T */ ================================================ FILE: third_party/include/apr/apr_signal.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_SIGNAL_H #define APR_SIGNAL_H /** * @file apr_signal.h * @brief APR Signal Handling */ #include "apr.h" #include "apr_pools.h" #if APR_HAVE_SIGNAL_H #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_signal Signal Handling * @ingroup APR * @{ */ #if APR_HAVE_SIGACTION || defined(DOXYGEN) #if defined(DARWIN) && !defined(__cplusplus) && !defined(_ANSI_SOURCE) /* work around Darwin header file bugs * http://www.opensource.apple.com/bugs/X/BSD%20Kernel/2657228.html */ #undef SIG_DFL #undef SIG_IGN #undef SIG_ERR #define SIG_DFL (void (*)(int))0 #define SIG_IGN (void (*)(int))1 #define SIG_ERR (void (*)(int))-1 #endif /** Function prototype for signal handlers */ typedef void apr_sigfunc_t(int); /** * Set the signal handler function for a given signal * @param signo The signal (eg... SIGWINCH) * @param func the function to get called */ APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func); #if defined(SIG_IGN) && !defined(SIG_ERR) #define SIG_ERR ((apr_sigfunc_t *) -1) #endif #else /* !APR_HAVE_SIGACTION */ #define apr_signal(a, b) signal(a, b) #endif /** * Get the description for a specific signal number * @param signum The signal number * @return The description of the signal */ APR_DECLARE(const char *) apr_signal_description_get(int signum); /** * APR-private function for initializing the signal package * @internal * @param pglobal The internal, global pool */ void apr_signal_init(apr_pool_t *pglobal); /** * Block the delivery of a particular signal * @param signum The signal number * @return status */ APR_DECLARE(apr_status_t) apr_signal_block(int signum); /** * Enable the delivery of a particular signal * @param signum The signal number * @return status */ APR_DECLARE(apr_status_t) apr_signal_unblock(int signum); /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* APR_SIGNAL_H */ ================================================ FILE: third_party/include/apr/apr_skiplist.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_SKIPLIST_H #define APR_SKIPLIST_H /** * @file apr_skiplist.h * @brief APR skip list implementation */ #include "apr.h" #include "apr_portable.h" #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_skiplist Skip list implementation * Refer to http://en.wikipedia.org/wiki/Skip_list for information * about the purpose of and ideas behind skip lists. * @ingroup APR * @{ */ /** * apr_skiplist_compare is the function type that must be implemented * per object type that is used in a skip list for comparisons to maintain * order. A value <0 indicates placement after this node; a value of 0 * indicates collision with this exact node; a value >0 indicates placement * before this node. * */ typedef int (*apr_skiplist_compare) (void *, void *); /** * apr_skiplist_freefunc is the function type that must be implemented * to handle elements as they are removed from a skip list. */ typedef void (*apr_skiplist_freefunc) (void *); /** Opaque structure used to represent the skip list */ struct apr_skiplist; /** Opaque structure used to represent the skip list */ typedef struct apr_skiplist apr_skiplist; /** * Opaque structure used to represent abstract nodes in the skip list * (an abstraction above the raw elements which are collected in the * skip list). */ struct apr_skiplistnode; /** Opaque structure */ typedef struct apr_skiplistnode apr_skiplistnode; /** * Allocate memory using the same mechanism as the skip list. * @param sl The skip list * @param size The amount to allocate * @remark If a pool was provided to apr_skiplist_init(), memory will * be allocated from the pool or from a free list maintained with * the skip list. Otherwise, memory will be allocated using the * C standard library heap functions. */ APR_DECLARE(void *) apr_skiplist_alloc(apr_skiplist *sl, size_t size); /** * Free memory using the same mechanism as the skip list. * @param sl The skip list * @param mem The object to free * @remark If a pool was provided to apr_skiplist_init(), memory will * be added to a free list maintained with the skip list and be available * to operations on the skip list or to other calls to apr_skiplist_alloc(). * Otherwise, memory will be freed using the C standard library heap * functions. */ APR_DECLARE(void) apr_skiplist_free(apr_skiplist *sl, void *mem); /** * Allocate a new skip list * @param sl The pointer in which to return the newly created skip list * @param p The pool from which to allocate the skip list (optional). * @remark Unlike most APR functions, a pool is optional. If no pool * is provided, the C standard library heap functions will be used instead. */ APR_DECLARE(apr_status_t) apr_skiplist_init(apr_skiplist **sl, apr_pool_t *p); /** * Set the comparison functions to be used for searching the skip list. * @param sl The skip list * @param XXX1 FIXME * @param XXX2 FIXME * * @remark If existing comparison functions are being replaced, the index * will be replaced during this call. That is a potentially expensive * operation. */ APR_DECLARE(void) apr_skiplist_set_compare(apr_skiplist *sl, apr_skiplist_compare XXX1, apr_skiplist_compare XXX2); /** * Set the indexing functions to the specified comparison functions and * rebuild the index. * @param sl The skip list * @param XXX1 FIXME * @param XXX2 FIXME * * @remark If an index already exists, it will not be replaced and the * comparison functions will not be changed. */ APR_DECLARE(void) apr_skiplist_add_index(apr_skiplist *sl, apr_skiplist_compare XXX1, apr_skiplist_compare XXX2); /** * Return the list maintained by the skip list abstraction. * @param sl The skip list */ APR_DECLARE(apr_skiplistnode *) apr_skiplist_getlist(apr_skiplist *sl); /** * Return the next matching element in the skip list using the specified * comparison function. * @param sl The skip list * @param data The value to search for * @param iter A pointer to the returned skip list node representing the element * found * @param func The comparison function to use */ APR_DECLARE(void *) apr_skiplist_find_compare(apr_skiplist *sl, void *data, apr_skiplistnode **iter, apr_skiplist_compare func); /** * Return the next matching element in the skip list using the current comparison * function. * @param sl The skip list * @param data The value to search for * @param iter A pointer to the returned skip list node representing the element * found */ APR_DECLARE(void *) apr_skiplist_find(apr_skiplist *sl, void *data, apr_skiplistnode **iter); /** * Return the next element in the skip list. * @param sl The skip list * @param iter On entry, a pointer to the skip list node to start with; on return, * a pointer to the skip list node representing the element returned * @remark If iter points to a NULL value on entry, NULL will be returned. */ APR_DECLARE(void *) apr_skiplist_next(apr_skiplist *sl, apr_skiplistnode **iter); /** * Return the previous element in the skip list. * @param sl The skip list * @param iter On entry, a pointer to the skip list node to start with; on return, * a pointer to the skip list node representing the element returned * @remark If iter points to a NULL value on entry, NULL will be returned. */ APR_DECLARE(void *) apr_skiplist_previous(apr_skiplist *sl, apr_skiplistnode **iter); /** * Insert an element into the skip list using the specified comparison function * if it does not already exist. * @param sl The skip list * @param data The element to insert * @param comp The comparison function to use for placement into the skip list */ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert_compare(apr_skiplist *sl, void *data, apr_skiplist_compare comp); /** * Insert an element into the skip list using the existing comparison function * if it does not already exist (as determined by the comparison function) * @param sl The skip list * @param data The element to insert * @remark If no comparison function has been set for the skip list, the element * will not be inserted and NULL will be returned. */ APR_DECLARE(apr_skiplistnode *) apr_skiplist_insert(apr_skiplist* sl, void *data); /** * Remove an element from the skip list using the specified comparison function for * locating the element. In the case of duplicates, the 1st entry will be removed. * @param sl The skip list * @param data The element to remove * @param myfree A function to be called for each removed element * @param comp The comparison function to use for placement into the skip list * @remark If the element is not found, 0 will be returned. Otherwise, the heightXXX * will be returned. */ APR_DECLARE(int) apr_skiplist_remove_compare(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree, apr_skiplist_compare comp); /** * Remove an element from the skip list using the existing comparison function for * locating the element. In the case of duplicates, the 1st entry will be removed. * @param sl The skip list * @param data The element to remove * @param myfree A function to be called for each removed element * @remark If the element is not found, 0 will be returned. Otherwise, the heightXXX * will be returned. * @remark If no comparison function has been set for the skip list, the element * will not be removed and 0 will be returned. */ APR_DECLARE(int) apr_skiplist_remove(apr_skiplist *sl, void *data, apr_skiplist_freefunc myfree); /** * Remove all elements from the skip list. * @param sl The skip list * @param myfree A function to be called for each removed element */ APR_DECLARE(void) apr_skiplist_remove_all(apr_skiplist *sl, apr_skiplist_freefunc myfree); /** * Remove each element from the skip list. * @param sl The skip list * @param myfree A function to be called for each removed element */ APR_DECLARE(void) apr_skiplist_destroy(apr_skiplist *sl, apr_skiplist_freefunc myfree); /** * Return the first element in the skip list, removing the element from the skip list. * @param sl The skip list * @param myfree A function to be called for the removed element * @remark NULL will be returned if there are no elements */ APR_DECLARE(void *) apr_skiplist_pop(apr_skiplist *sl, apr_skiplist_freefunc myfree); /** * Return the first element in the skip list, leaving the element in the skip list. * @param sl The skip list * @remark NULL will be returned if there are no elements */ APR_DECLARE(void *) apr_skiplist_peek(apr_skiplist *sl); /** * Merge two skip lists. XXX SEMANTICS * @param sl1 One of two skip lists to be merged * @param sl2 The other of two skip lists to be merged */ APR_DECLARE(apr_skiplist *) apr_skiplist_merge(apr_skiplist *sl1, apr_skiplist *sl2); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_SKIPLIST_H */ ================================================ FILE: third_party/include/apr/apr_strings.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Portions of this file are covered by */ /* -*- mode: c; c-file-style: "k&r" -*- strnatcmp.c -- Perform 'natural order' comparisons of strings in C. Copyright (C) 2000 by Martin Pool This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef APR_STRINGS_H #define APR_STRINGS_H /** * @file apr_strings.h * @brief APR Strings library */ #include "apr.h" #include "apr_errno.h" #include "apr_pools.h" #define APR_WANT_IOVEC #include "apr_want.h" #if APR_HAVE_STDARG_H #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_strings String routines * @ingroup APR * @{ */ /** * Do a natural order comparison of two strings. * @param a The first string to compare * @param b The second string to compare * @return Either <0, 0, or >0. If the first string is less than the second * this returns <0, if they are equivalent it returns 0, and if the * first string is greater than second string it retuns >0. */ APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b); /** * Do a natural order comparison of two strings ignoring the case of the * strings. * @param a The first string to compare * @param b The second string to compare * @return Either <0, 0, or >0. If the first string is less than the second * this returns <0, if they are equivalent it returns 0, and if the * first string is greater than second string it retuns >0. */ APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b); /** * duplicate a string into memory allocated out of a pool * @param p The pool to allocate out of * @param s The string to duplicate * @return The new string or NULL if s == NULL */ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); /** * Create a null-terminated string by making a copy of a sequence * of characters and appending a null byte * @param p The pool to allocate out of * @param s The block of characters to duplicate * @param n The number of characters to duplicate * @return The new string or NULL if s == NULL * @remark This is a faster alternative to apr_pstrndup, for use * when you know that the string being duplicated really * has 'n' or more characters. If the string might contain * fewer characters, use apr_pstrndup. */ APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n) #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) __attribute__((alloc_size(3))) #endif ; /** * Duplicate at most n characters of a string into memory allocated * out of a pool; the new string will be NUL-terminated * @param p The pool to allocate out of * @param s The string to duplicate * @param n The maximum number of characters to duplicate * @return The new string or NULL if s == NULL * @remark The amount of memory allocated from the pool is the length * of the returned string including the NUL terminator */ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); /** * Duplicate a block of memory. * * @param p The pool to allocate from * @param m The memory to duplicate * @param n The number of bytes to duplicate * @return The new block of memory or NULL if m == NULL */ APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n) #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) __attribute__((alloc_size(3))) #endif ; /** * Concatenate multiple strings, allocating memory out a pool * @param p The pool to allocate out of * @param ... The strings to concatenate. The final string must be NULL * @return The new string */ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...) #if defined(__GNUC__) && __GNUC__ >= 4 __attribute__((sentinel)) #endif ; /** * Concatenate multiple strings specified in a writev-style vector * @param p The pool from which to allocate * @param vec The strings to concatenate * @param nvec The number of strings to concatenate * @param nbytes (output) strlen of new string (pass in NULL to omit) * @return The new string */ APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *p, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes); /** * printf-style style printing routine. The data is output to a string * allocated from a pool * @param p The pool to allocate out of * @param fmt The format of the string * @param ap The arguments to use while printing the data * @return The new string */ APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, const char *fmt, va_list ap); /** * printf-style style printing routine. The data is output to a string * allocated from a pool * @param p The pool to allocate out of * @param fmt The format of the string * @param ... The arguments to use while printing the data * @return The new string */ APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...) __attribute__((format(printf,2,3))); /** * Copy up to dst_size characters from src to dst; does not copy * past a NUL terminator in src, but always terminates dst with a NUL * regardless. * @param dst The destination string * @param src The source string * @param dst_size The space available in dst; dst always receives * NUL termination, so if src is longer than * dst_size, the actual number of characters copied is * dst_size - 1. * @return Pointer to the NUL terminator of the destination string, dst * @remark *
 * Note the differences between this function and strncpy():
 *  1) strncpy() doesn't always NUL terminate; apr_cpystrn() does.
 *  2) strncpy() pads the destination string with NULs, which is often 
 *     unnecessary; apr_cpystrn() does not.
 *  3) strncpy() returns a pointer to the beginning of the dst string;
 *     apr_cpystrn() returns a pointer to the NUL terminator of dst, 
 *     to allow a check for truncation.
 * 
*/ APR_DECLARE(char *) apr_cpystrn(char *dst, const char *src, apr_size_t dst_size); /** * Remove all whitespace from a string * @param dest The destination string. It is okay to modify the string * in place. Namely dest == src * @param src The string to rid the spaces from. * @return A pointer to the destination string's null terminator. */ APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src); /** * Convert the arguments to a program from one string to an array of * strings terminated by a NULL pointer * @param arg_str The arguments to convert * @param argv_out Output location. This is a pointer to an array of strings. * @param token_context Pool to use. */ APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context); /** * Split a string into separate null-terminated tokens. The tokens are * delimited in the string by one or more characters from the sep * argument. * @param str The string to separate; this should be specified on the * first call to apr_strtok() for a given string, and NULL * on subsequent calls. * @param sep The set of delimiters * @param last State saved by apr_strtok() between calls. * @return The next token from the string * @note the 'last' state points to the trailing NUL char of the final * token, otherwise it points to the character following the current * token (all successive or empty occurances of sep are skiped on the * subsequent call to apr_strtok). Therefore it is possible to avoid * a strlen() determination, with the following logic; * toklen = last - retval; if (*last) --toklen; */ APR_DECLARE(char *) apr_strtok(char *str, const char *sep, char **last); /** * @defgroup APR_Strings_Snprintf snprintf implementations * @warning * These are snprintf implementations based on apr_vformatter(). * * Note that various standards and implementations disagree on the return * value of snprintf, and side-effects due to %n in the formatting string. * apr_snprintf (and apr_vsnprintf) behaves as follows: * * Process the format string until the entire string is exhausted, or * the buffer fills. If the buffer fills then stop processing immediately * (so no further %n arguments are processed), and return the buffer * length. In all cases the buffer is NUL terminated. It will return the * number of characters inserted into the buffer, not including the * terminating NUL. As a special case, if len is 0, apr_snprintf will * return the number of characters that would have been inserted if * the buffer had been infinite (in this case, *buffer can be NULL) * * In no event does apr_snprintf return a negative number. * @{ */ /** * snprintf routine based on apr_vformatter. This means it understands the * same extensions. * @param buf The buffer to write to * @param len The size of the buffer * @param format The format string * @param ... The arguments to use to fill out the format string. */ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len, const char *format, ...) __attribute__((format(printf,3,4))); /** * vsnprintf routine based on apr_vformatter. This means it understands the * same extensions. * @param buf The buffer to write to * @param len The size of the buffer * @param format The format string * @param ap The arguments to use to fill out the format string. */ APR_DECLARE(int) apr_vsnprintf(char *buf, apr_size_t len, const char *format, va_list ap); /** @} */ /** * create a string representation of an int, allocated from a pool * @param p The pool from which to allocate * @param n The number to format * @return The string representation of the number */ APR_DECLARE(char *) apr_itoa(apr_pool_t *p, int n); /** * create a string representation of a long, allocated from a pool * @param p The pool from which to allocate * @param n The number to format * @return The string representation of the number */ APR_DECLARE(char *) apr_ltoa(apr_pool_t *p, long n); /** * create a string representation of an apr_off_t, allocated from a pool * @param p The pool from which to allocate * @param n The number to format * @return The string representation of the number */ APR_DECLARE(char *) apr_off_t_toa(apr_pool_t *p, apr_off_t n); /** * Convert a numeric string into an apr_off_t numeric value. * @param offset The value of the parsed string. * @param buf The string to parse. It may contain optional whitespace, * followed by an optional '+' (positive, default) or '-' (negative) * character, followed by an optional '0x' prefix if base is 0 or 16, * followed by numeric digits appropriate for base. * @param end A pointer to the end of the valid character in buf. If * not NULL, it is set to the first invalid character in buf. * @param base A numeric base in the range between 2 and 36 inclusive, * or 0. If base is zero, buf will be treated as base ten unless its * digits are prefixed with '0x', in which case it will be treated as * base 16. * @bug *end breaks type safety; where *buf is const, *end needs to be * declared as const in APR 2.0 */ APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *buf, char **end, int base); /** * parse a numeric string into a 64-bit numeric value * @param buf The string to parse. It may contain optional whitespace, * followed by an optional '+' (positive, default) or '-' (negative) * character, followed by an optional '0x' prefix if base is 0 or 16, * followed by numeric digits appropriate for base. * @param end A pointer to the end of the valid character in buf. If * not NULL, it is set to the first invalid character in buf. * @param base A numeric base in the range between 2 and 36 inclusive, * or 0. If base is zero, buf will be treated as base ten unless its * digits are prefixed with '0x', in which case it will be treated as * base 16. * @return The numeric value of the string. On overflow, errno is set * to ERANGE. On success, errno is set to 0. */ APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base); /** * parse a base-10 numeric string into a 64-bit numeric value. * Equivalent to apr_strtoi64(buf, (char**)NULL, 10). * @param buf The string to parse * @return The numeric value of the string. On overflow, errno is set * to ERANGE. On success, errno is set to 0. */ APR_DECLARE(apr_int64_t) apr_atoi64(const char *buf); /** * Format a binary size (magnitiudes are 2^10 rather than 10^3) from an apr_off_t, * as bytes, K, M, T, etc, to a four character compacted human readable string. * @param size The size to format * @param buf The 5 byte text buffer (counting the trailing null) * @return The buf passed to apr_strfsize() * @remark All negative sizes report ' - ', apr_strfsize only formats positive values. */ APR_DECLARE(char *) apr_strfsize(apr_off_t size, char *buf); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_STRINGS_H */ ================================================ FILE: third_party/include/apr/apr_support.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_SUPPORT_H #define APR_SUPPORT_H /** * @file apr_support.h * @brief APR Support functions */ #include "apr.h" #include "apr_network_io.h" #include "apr_file_io.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_support Internal APR support functions * @ingroup APR * @{ */ /** * Wait for IO to occur or timeout. * * @param f The file to wait on. * @param s The socket to wait on if @a f is @c NULL. * @param for_read If non-zero wait for data to be available to read, * otherwise wait for data to be able to be written. * @return APR_TIMEUP if we run out of time. */ apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, int for_read); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_SUPPORT_H */ ================================================ FILE: third_party/include/apr/apr_tables.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_TABLES_H #define APR_TABLES_H /** * @file apr_tables.h * @brief APR Table library */ #include "apr.h" #include "apr_pools.h" #if APR_HAVE_STDARG_H #include /* for va_list */ #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_tables Table and Array Functions * @ingroup APR * Arrays are used to store data which is referenced sequentially or * as a stack. Functions are provided to push and pop individual * elements as well as to operate on the entire array. * * Tables are used to store data which can be referenced by key. * Limited capabilities are provided for tables with multiple elements * which share a key; while key lookup will return only a single * element, iteration is available. Additionally, a table can be * compressed to resolve duplicates. * * Both arrays and tables may store string or binary data; some features, * such as concatenation or merging of elements, work only for string * data. * @{ */ /** the table abstract data type */ typedef struct apr_table_t apr_table_t; /** @see apr_array_header_t */ typedef struct apr_array_header_t apr_array_header_t; /** An opaque array type */ struct apr_array_header_t { /** The pool the array is allocated out of */ apr_pool_t *pool; /** The amount of memory allocated for each element of the array */ int elt_size; /** The number of active elements in the array */ int nelts; /** The number of elements allocated in the array */ int nalloc; /** The elements in the array */ char *elts; }; /** * The (opaque) structure for string-content tables. */ typedef struct apr_table_entry_t apr_table_entry_t; /** The type for each entry in a string-content table */ struct apr_table_entry_t { /** The key for the current table entry */ char *key; /* maybe NULL in future; * check when iterating thru table_elts */ /** The value for the current table entry */ char *val; /** A checksum for the key, for use by the apr_table internals */ apr_uint32_t key_checksum; }; /** * Get the elements from a table. * @param t The table * @return An array containing the contents of the table */ APR_DECLARE(const apr_array_header_t *) apr_table_elts(const apr_table_t *t); /** * Determine if the table is empty (either NULL or having no elements). * @param t The table to check * @return True if empty, False otherwise */ APR_DECLARE(int) apr_is_empty_table(const apr_table_t *t); /** * Determine if the array is empty (either NULL or having no elements). * @param a The array to check * @return True if empty, False otherwise */ APR_DECLARE(int) apr_is_empty_array(const apr_array_header_t *a); /** * Create an array. * @param p The pool to allocate the memory out of * @param nelts the number of elements in the initial array * @param elt_size The size of each element in the array. * @return The new array */ APR_DECLARE(apr_array_header_t *) apr_array_make(apr_pool_t *p, int nelts, int elt_size); /** * Add a new element to an array (as a first-in, last-out stack). * @param arr The array to add an element to. * @return Location for the new element in the array. * @remark If there are no free spots in the array, then this function will * allocate new space for the new element. */ APR_DECLARE(void *) apr_array_push(apr_array_header_t *arr); /** A helper macro for accessing a member of an APR array. * * @param ary the array * @param i the index into the array to return * @param type the type of the objects stored in the array * * @return the item at index i */ #define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i]) /** A helper macro for pushing elements into an APR array. * * @param ary the array * @param type the type of the objects stored in the array * * @return the location where the new object should be placed */ #define APR_ARRAY_PUSH(ary,type) (*((type *)apr_array_push(ary))) /** * Remove an element from an array (as a first-in, last-out stack). * @param arr The array to remove an element from. * @return Location of the element in the array. * @remark If there are no elements in the array, NULL is returned. */ APR_DECLARE(void *) apr_array_pop(apr_array_header_t *arr); /** * Remove all elements from an array. * @param arr The array to remove all elements from. * @remark As the underlying storage is allocated from a pool, no * memory is freed by this operation, but is available for reuse. */ APR_DECLARE(void) apr_array_clear(apr_array_header_t *arr); /** * Concatenate two arrays together. * @param dst The destination array, and the one to go first in the combined * array * @param src The source array to add to the destination array */ APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst, const apr_array_header_t *src); /** * Copy the entire array. * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in * @remark The alternate apr_array_copy_hdr copies only the header, and arranges * for the elements to be copied if (and only if) the code subsequently * does a push or arraycat. */ APR_DECLARE(apr_array_header_t *) apr_array_copy(apr_pool_t *p, const apr_array_header_t *arr); /** * Copy the headers of the array, and arrange for the elements to be copied if * and only if the code subsequently does a push or arraycat. * @param p The pool to allocate the copy of the array out of * @param arr The array to copy * @return An exact copy of the array passed in * @remark The alternate apr_array_copy copies the *entire* array. */ APR_DECLARE(apr_array_header_t *) apr_array_copy_hdr(apr_pool_t *p, const apr_array_header_t *arr); /** * Append one array to the end of another, creating a new array in the process. * @param p The pool to allocate the new array out of * @param first The array to put first in the new array. * @param second The array to put second in the new array. * @return A new array containing the data from the two arrays passed in. */ APR_DECLARE(apr_array_header_t *) apr_array_append(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second); /** * Generate a new string from the apr_pool_t containing the concatenated * sequence of substrings referenced as elements within the array. The string * will be empty if all substrings are empty or null, or if there are no * elements in the array. If sep is non-NUL, it will be inserted between * elements as a separator. * @param p The pool to allocate the string out of * @param arr The array to generate the string from * @param sep The separator to use * @return A string containing all of the data in the array. */ APR_DECLARE(char *) apr_array_pstrcat(apr_pool_t *p, const apr_array_header_t *arr, const char sep); /** * Make a new table. * @param p The pool to allocate the pool out of * @param nelts The number of elements in the initial table. * @return The new table. * @warning This table can only store text data */ APR_DECLARE(apr_table_t *) apr_table_make(apr_pool_t *p, int nelts); /** * Create a new table and copy another table into it. * @param p The pool to allocate the new table out of * @param t The table to copy * @return A copy of the table passed in * @warning The table keys and respective values are not copied */ APR_DECLARE(apr_table_t *) apr_table_copy(apr_pool_t *p, const apr_table_t *t); /** * Create a new table whose contents are deep copied from the given * table. A deep copy operation copies all fields, and makes copies * of dynamically allocated memory pointed to by the fields. * @param p The pool to allocate the new table out of * @param t The table to clone * @return A deep copy of the table passed in */ APR_DECLARE(apr_table_t *) apr_table_clone(apr_pool_t *p, const apr_table_t *t); /** * Delete all of the elements from a table. * @param t The table to clear */ APR_DECLARE(void) apr_table_clear(apr_table_t *t); /** * Get the value associated with a given key from the table. After this call, * the data is still in the table. * @param t The table to search for the key * @param key The key to search for (case does not matter) * @return The value associated with the key, or NULL if the key does not exist. */ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key); /** * Get values associated with a given key from the table. If more than one * value exists, return a comma separated list of values. After this call, the * data is still in the table. * @param p The pool to allocate the combined value from, if necessary * @param t The table to search for the key * @param key The key to search for (case does not matter) * @return The value associated with the key, or NULL if the key does not exist. */ APR_DECLARE(const char *) apr_table_getm(apr_pool_t *p, const apr_table_t *t, const char *key); /** * Add a key/value pair to a table. If another element already exists with the * same key, this will overwrite the old data. * @param t The table to add the data to. * @param key The key to use (case does not matter) * @param val The value to add * @remark When adding data, this function makes a copy of both the key and the * value. */ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key, const char *val); /** * Add a key/value pair to a table. If another element already exists with the * same key, this will overwrite the old data. * @param t The table to add the data to. * @param key The key to use (case does not matter) * @param val The value to add * @warning When adding data, this function does not make a copy of the key or * the value, so care should be taken to ensure that the values will * not change after they have been added.. */ APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key, const char *val); /** * Remove data from the table. * @param t The table to remove data from * @param key The key of the data being removed (case does not matter) */ APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key); /** * Add data to a table by merging the value with data that has already been * stored. The merging is done by concatenating the two values, separated * by the string ", ". * @param t The table to search for the data * @param key The key to merge data for (case does not matter) * @param val The data to add * @remark If the key is not found, then this function acts like apr_table_add */ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key, const char *val); /** * Add data to a table by merging the value with data that has already been * stored. The merging is done by concatenating the two values, separated * by the string ", ". * @param t The table to search for the data * @param key The key to merge data for (case does not matter) * @param val The data to add * @remark If the key is not found, then this function acts like apr_table_addn */ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, const char *val); /** * Add data to a table, regardless of whether there is another element with the * same key. * @param t The table to add to * @param key The key to use * @param val The value to add. * @remark When adding data, this function makes a copy of both the key and the * value. */ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key, const char *val); /** * Add data to a table, regardless of whether there is another element with the * same key. * @param t The table to add to * @param key The key to use * @param val The value to add. * @remark When adding data, this function does not make a copy of the key or the * value, so care should be taken to ensure that the values will not * change after they have been added. */ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key, const char *val); /** * Merge two tables into one new table. * @param p The pool to use for the new table * @param overlay The first table to put in the new table * @param base The table to add at the end of the new table * @return A new table containing all of the data from the two passed in */ APR_DECLARE(apr_table_t *) apr_table_overlay(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base); /** * Declaration prototype for the iterator callback function of apr_table_do() * and apr_table_vdo(). * @param rec The data passed as the first argument to apr_table_[v]do() * @param key The key from this iteration of the table * @param value The value from this iteration of the table * @remark Iteration continues while this callback function returns non-zero. * To export the callback function for apr_table_[v]do() it must be declared * in the _NONSTD convention. */ typedef int (apr_table_do_callback_fn_t)(void *rec, const char *key, const char *value); /** * Iterate over a table running the provided function once for every * element in the table. The varargs array must be a list of zero or * more (char *) keys followed by a NULL pointer. If zero keys are * given, the @param comp function will be invoked for every element * in the table. Otherwise, the function is invoked only for those * elements matching the keys specified. * * If an invocation of the @param comp function returns zero, * iteration will continue using the next specified key, if any. * * @param comp The function to run * @param rec The data to pass as the first argument to the function * @param t The table to iterate over * @param ... A varargs array of zero or more (char *) keys followed by NULL * @return FALSE if one of the comp() iterations returned zero; TRUE if all * iterations returned non-zero * @see apr_table_do_callback_fn_t */ APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp, void *rec, const apr_table_t *t, ...) #if defined(__GNUC__) && __GNUC__ >= 4 __attribute__((sentinel)) #endif ; /** * Iterate over a table running the provided function once for every * element in the table. The @param vp varargs parameter must be a * list of zero or more (char *) keys followed by a NULL pointer. If * zero keys are given, the @param comp function will be invoked for * every element in the table. Otherwise, the function is invoked * only for those elements matching the keys specified. * * If an invocation of the @param comp function returns zero, * iteration will continue using the next specified key, if any. * * @param comp The function to run * @param rec The data to pass as the first argument to the function * @param t The table to iterate over * @param vp List of zero or more (char *) keys followed by NULL * @return FALSE if one of the comp() iterations returned zero; TRUE if all * iterations returned non-zero * @see apr_table_do_callback_fn_t */ APR_DECLARE(int) apr_table_vdo(apr_table_do_callback_fn_t *comp, void *rec, const apr_table_t *t, va_list vp); /** flag for overlap to use apr_table_setn */ #define APR_OVERLAP_TABLES_SET (0) /** flag for overlap to use apr_table_mergen */ #define APR_OVERLAP_TABLES_MERGE (1) /** * For each element in table b, either use setn or mergen to add the data * to table a. Which method is used is determined by the flags passed in. * @param a The table to add the data to. * @param b The table to iterate over, adding its data to table a * @param flags How to add the table to table a. One of: * APR_OVERLAP_TABLES_SET Use apr_table_setn * APR_OVERLAP_TABLES_MERGE Use apr_table_mergen * @remark When merging duplicates, the two values are concatenated, * separated by the string ", ". * @remark This function is highly optimized, and uses less memory and CPU cycles * than a function that just loops through table b calling other functions. */ /** * Conceptually, apr_table_overlap does this: * *
 *  apr_array_header_t *barr = apr_table_elts(b);
 *  apr_table_entry_t *belt = (apr_table_entry_t *)barr->elts;
 *  int i;
 *
 *  for (i = 0; i < barr->nelts; ++i) {
 *      if (flags & APR_OVERLAP_TABLES_MERGE) {
 *          apr_table_mergen(a, belt[i].key, belt[i].val);
 *      }
 *      else {
 *          apr_table_setn(a, belt[i].key, belt[i].val);
 *      }
 *  }
 * 
* * Except that it is more efficient (less space and cpu-time) especially * when b has many elements. * * Notice the assumptions on the keys and values in b -- they must be * in an ancestor of a's pool. In practice b and a are usually from * the same pool. */ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags); /** * Eliminate redundant entries in a table by either overwriting * or merging duplicates. * * @param t Table. * @param flags APR_OVERLAP_TABLES_MERGE to merge, or * APR_OVERLAP_TABLES_SET to overwrite * @remark When merging duplicates, the two values are concatenated, * separated by the string ", ". */ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_TABLES_H */ ================================================ FILE: third_party/include/apr/apr_thread_cond.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_THREAD_COND_H #define APR_THREAD_COND_H /** * @file apr_thread_cond.h * @brief APR Condition Variable Routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #include "apr_time.h" #include "apr_thread_mutex.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #if APR_HAS_THREADS || defined(DOXYGEN) /** * @defgroup apr_thread_cond Condition Variable Routines * @ingroup APR * @{ */ /** Opaque structure for thread condition variables */ typedef struct apr_thread_cond_t apr_thread_cond_t; /** * Note: destroying a condition variable (or likewise, destroying or * clearing the pool from which a condition variable was allocated) if * any threads are blocked waiting on it gives undefined results. */ /** * Create and initialize a condition variable that can be used to signal * and schedule threads in a single process. * @param cond the memory address where the newly created condition variable * will be stored. * @param pool the pool from which to allocate the condition. */ APR_DECLARE(apr_status_t) apr_thread_cond_create(apr_thread_cond_t **cond, apr_pool_t *pool); /** * Put the active calling thread to sleep until signaled to wake up. Each * condition variable must be associated with a mutex, and that mutex must * be locked before calling this function, or the behavior will be * undefined. As the calling thread is put to sleep, the given mutex * will be simultaneously released; and as this thread wakes up the lock * is again simultaneously acquired. * @param cond the condition variable on which to block. * @param mutex the mutex that must be locked upon entering this function, * is released while the thread is asleep, and is again acquired before * returning from this function. * @remark Spurious wakeups may occur. Before and after every call to wait on * a condition variable, the caller should test whether the condition is already * met. */ APR_DECLARE(apr_status_t) apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex); /** * Put the active calling thread to sleep until signaled to wake up or * the timeout is reached. Each condition variable must be associated * with a mutex, and that mutex must be locked before calling this * function, or the behavior will be undefined. As the calling thread * is put to sleep, the given mutex will be simultaneously released; * and as this thread wakes up the lock is again simultaneously acquired. * @param cond the condition variable on which to block. * @param mutex the mutex that must be locked upon entering this function, * is released while the thread is asleep, and is again acquired before * returning from this function. * @param timeout The amount of time in microseconds to wait. This is * a maximum, not a minimum. If the condition is signaled, we * will wake up before this time, otherwise the error APR_TIMEUP * is returned. */ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex, apr_interval_time_t timeout); /** * Signals a single thread, if one exists, that is blocking on the given * condition variable. That thread is then scheduled to wake up and acquire * the associated mutex. Although it is not required, if predictable scheduling * is desired, that mutex must be locked while calling this function. * @param cond the condition variable on which to produce the signal. * @remark If no threads are waiting on the condition variable, nothing happens. */ APR_DECLARE(apr_status_t) apr_thread_cond_signal(apr_thread_cond_t *cond); /** * Signals all threads blocking on the given condition variable. * Each thread that was signaled is then scheduled to wake up and acquire * the associated mutex. This will happen in a serialized manner. * @param cond the condition variable on which to produce the broadcast. * @remark If no threads are waiting on the condition variable, nothing happens. */ APR_DECLARE(apr_status_t) apr_thread_cond_broadcast(apr_thread_cond_t *cond); /** * Destroy the condition variable and free the associated memory. * @param cond the condition variable to destroy. */ APR_DECLARE(apr_status_t) apr_thread_cond_destroy(apr_thread_cond_t *cond); /** * Get the pool used by this thread_cond. * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(thread_cond); #endif /* APR_HAS_THREADS */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_THREAD_COND_H */ ================================================ FILE: third_party/include/apr/apr_thread_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_THREAD_MUTEX_H #define APR_THREAD_MUTEX_H /** * @file apr_thread_mutex.h * @brief APR Thread Mutex Routines */ #include "apr.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #if APR_HAS_THREADS || defined(DOXYGEN) /** * @defgroup apr_thread_mutex Thread Mutex Routines * @ingroup APR * @{ */ /** Opaque thread-local mutex structure */ typedef struct apr_thread_mutex_t apr_thread_mutex_t; #define APR_THREAD_MUTEX_DEFAULT 0x0 /**< platform-optimal lock behavior */ #define APR_THREAD_MUTEX_NESTED 0x1 /**< enable nested (recursive) locks */ #define APR_THREAD_MUTEX_UNNESTED 0x2 /**< disable nested locks */ /* Delayed the include to avoid a circular reference */ #include "apr_pools.h" /** * Create and initialize a mutex that can be used to synchronize threads. * @param mutex the memory address where the newly created mutex will be * stored. * @param flags Or'ed value of: *
 *           APR_THREAD_MUTEX_DEFAULT   platform-optimal lock behavior.
 *           APR_THREAD_MUTEX_NESTED    enable nested (recursive) locks.
 *           APR_THREAD_MUTEX_UNNESTED  disable nested locks (non-recursive).
 * 
* @param pool the pool from which to allocate the mutex. * @warning Be cautious in using APR_THREAD_MUTEX_DEFAULT. While this is the * most optimal mutex based on a given platform's performance characteristics, * it will behave as either a nested or an unnested lock. */ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, unsigned int flags, apr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, * the current thread will be put to sleep until the lock becomes available. * @param mutex the mutex on which to acquire the lock. */ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex); /** * Attempt to acquire the lock for the given mutex. If the mutex has already * been acquired, the call returns immediately with APR_EBUSY. Note: it * is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine * if the return value was APR_EBUSY, for portability reasons. * @param mutex the mutex on which to attempt the lock acquiring. */ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex); /** * Release the lock for the given mutex. * @param mutex the mutex from which to release the lock. */ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex); /** * Destroy the mutex and free the memory associated with the lock. * @param mutex the mutex to destroy. */ APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex); /** * Get the pool used by this thread_mutex. * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(thread_mutex); #endif /* APR_HAS_THREADS */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_THREAD_MUTEX_H */ ================================================ FILE: third_party/include/apr/apr_thread_proc.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_THREAD_PROC_H #define APR_THREAD_PROC_H /** * @file apr_thread_proc.h * @brief APR Thread and Process Library */ #include "apr.h" #include "apr_file_io.h" #include "apr_pools.h" #include "apr_errno.h" #if APR_HAVE_STRUCT_RLIMIT #include #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_thread_proc Threads and Process Functions * @ingroup APR * @{ */ typedef enum { APR_SHELLCMD, /**< use the shell to invoke the program */ APR_PROGRAM, /**< invoke the program directly, no copied env */ APR_PROGRAM_ENV, /**< invoke the program, replicating our environment */ APR_PROGRAM_PATH, /**< find program on PATH, use our environment */ APR_SHELLCMD_ENV /**< use the shell to invoke the program, * replicating our environment */ } apr_cmdtype_e; typedef enum { APR_WAIT, /**< wait for the specified process to finish */ APR_NOWAIT /**< do not wait -- just see if it has finished */ } apr_wait_how_e; /* I am specifically calling out the values so that the macros below make * more sense. Yes, I know I don't need to, but I am hoping this makes what * I am doing more clear. If you want to add more reasons to exit, continue * to use bitmasks. */ typedef enum { APR_PROC_EXIT = 1, /**< process exited normally */ APR_PROC_SIGNAL = 2, /**< process exited due to a signal */ APR_PROC_SIGNAL_CORE = 4 /**< process exited and dumped a core file */ } apr_exit_why_e; /** did we exit the process */ #define APR_PROC_CHECK_EXIT(x) (x & APR_PROC_EXIT) /** did we get a signal */ #define APR_PROC_CHECK_SIGNALED(x) (x & APR_PROC_SIGNAL) /** did we get core */ #define APR_PROC_CHECK_CORE_DUMP(x) (x & APR_PROC_SIGNAL_CORE) /** @see apr_procattr_io_set */ #define APR_NO_PIPE 0 /** @see apr_procattr_io_set and apr_file_pipe_create_ex */ #define APR_FULL_BLOCK 1 /** @see apr_procattr_io_set and apr_file_pipe_create_ex */ #define APR_FULL_NONBLOCK 2 /** @see apr_procattr_io_set */ #define APR_PARENT_BLOCK 3 /** @see apr_procattr_io_set */ #define APR_CHILD_BLOCK 4 /** @see apr_procattr_io_set */ #define APR_NO_FILE 8 /** @see apr_file_pipe_create_ex */ #define APR_READ_BLOCK 3 /** @see apr_file_pipe_create_ex */ #define APR_WRITE_BLOCK 4 /** @see apr_procattr_io_set * @note Win32 only effective with version 1.2.12, portably introduced in 1.3.0 */ #define APR_NO_FILE 8 /** @see apr_procattr_limit_set */ #define APR_LIMIT_CPU 0 /** @see apr_procattr_limit_set */ #define APR_LIMIT_MEM 1 /** @see apr_procattr_limit_set */ #define APR_LIMIT_NPROC 2 /** @see apr_procattr_limit_set */ #define APR_LIMIT_NOFILE 3 /** * @defgroup APR_OC Other Child Flags * @{ */ #define APR_OC_REASON_DEATH 0 /**< child has died, caller must call * unregister still */ #define APR_OC_REASON_UNWRITABLE 1 /**< write_fd is unwritable */ #define APR_OC_REASON_RESTART 2 /**< a restart is occurring, perform * any necessary cleanup (including * sending a special signal to child) */ #define APR_OC_REASON_UNREGISTER 3 /**< unregister has been called, do * whatever is necessary (including * kill the child) */ #define APR_OC_REASON_LOST 4 /**< somehow the child exited without * us knowing ... buggy os? */ #define APR_OC_REASON_RUNNING 5 /**< a health check is occurring, * for most maintainence functions * this is a no-op. */ /** @} */ /** The APR process type */ typedef struct apr_proc_t { /** The process ID */ pid_t pid; /** Parent's side of pipe to child's stdin */ apr_file_t *in; /** Parent's side of pipe to child's stdout */ apr_file_t *out; /** Parent's side of pipe to child's stdouterr */ apr_file_t *err; #if APR_HAS_PROC_INVOKED || defined(DOXYGEN) /** Diagnositics/debugging string of the command invoked for * this process [only present if APR_HAS_PROC_INVOKED is true] * @remark Only enabled on Win32 by default. * @bug This should either always or never be present in release * builds - since it breaks binary compatibility. We may enable * it always in APR 1.0 yet leave it undefined in most cases. */ char *invoked; #endif #if defined(WIN32) || defined(DOXYGEN) /** (Win32 only) Creator's handle granting access to the process * @remark This handle is closed and reset to NULL in every case * corresponding to a waitpid() on Unix which returns the exit status. * Therefore Win32 correspond's to Unix's zombie reaping characteristics * and avoids potential handle leaks. */ HANDLE hproc; #endif } apr_proc_t; /** * The prototype for APR child errfn functions. (See the description * of apr_procattr_child_errfn_set() for more information.) * It is passed the following parameters: * @param pool Pool associated with the apr_proc_t. If your child * error function needs user data, associate it with this * pool. * @param err APR error code describing the error * @param description Text description of type of processing which failed */ typedef void (apr_child_errfn_t)(apr_pool_t *proc, apr_status_t err, const char *description); /** Opaque Thread structure. */ typedef struct apr_thread_t apr_thread_t; /** Opaque Thread attributes structure. */ typedef struct apr_threadattr_t apr_threadattr_t; /** Opaque Process attributes structure. */ typedef struct apr_procattr_t apr_procattr_t; /** Opaque control variable for one-time atomic variables. */ typedef struct apr_thread_once_t apr_thread_once_t; /** Opaque thread private address space. */ typedef struct apr_threadkey_t apr_threadkey_t; /** Opaque record of child process. */ typedef struct apr_other_child_rec_t apr_other_child_rec_t; /** * The prototype for any APR thread worker functions. */ typedef void *(APR_THREAD_FUNC *apr_thread_start_t)(apr_thread_t*, void*); typedef enum { APR_KILL_NEVER, /**< process is never killed (i.e., never sent * any signals), but it will be reaped if it exits * before the pool is cleaned up */ APR_KILL_ALWAYS, /**< process is sent SIGKILL on apr_pool_t cleanup */ APR_KILL_AFTER_TIMEOUT, /**< SIGTERM, wait 3 seconds, SIGKILL */ APR_JUST_WAIT, /**< wait forever for the process to complete */ APR_KILL_ONLY_ONCE /**< send SIGTERM and then wait */ } apr_kill_conditions_e; /* Thread Function definitions */ #if APR_HAS_THREADS /** * Create and initialize a new threadattr variable * @param new_attr The newly created threadattr. * @param cont The pool to use */ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new_attr, apr_pool_t *cont); /** * Set if newly created threads should be created in detached state. * @param attr The threadattr to affect * @param on Non-zero if detached threads should be created. */ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on); /** * Get the detach state for this threadattr. * @param attr The threadattr to reference * @return APR_DETACH if threads are to be detached, or APR_NOTDETACH * if threads are to be joinable. */ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr); /** * Set the stack size of newly created threads. * @param attr The threadattr to affect * @param stacksize The stack size in bytes */ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, apr_size_t stacksize); /** * Set the stack guard area size of newly created threads. * @param attr The threadattr to affect * @param guardsize The stack guard area size in bytes * @note Thread library implementations commonly use a "guard area" * after each thread's stack which is not readable or writable such that * stack overflows cause a segfault; this consumes e.g. 4K of memory * and increases memory management overhead. Setting the guard area * size to zero hence trades off reliable behaviour on stack overflow * for performance. */ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, apr_size_t guardsize); /** * Create a new thread of execution * @param new_thread The newly created thread handle. * @param attr The threadattr to use to determine how to create the thread * @param func The function to start the new thread in * @param data Any data to be passed to the starting function * @param cont The pool to use */ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont); /** * stop the current thread * @param thd The thread to stop * @param retval The return value to pass back to any thread that cares */ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval); /** * block until the desired thread stops executing. * @param retval The return value from the dead thread. * @param thd The thread to join */ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd); /** * force the current thread to yield the processor */ APR_DECLARE(void) apr_thread_yield(void); /** * Initialize the control variable for apr_thread_once. If this isn't * called, apr_initialize won't work. * @param control The control variable to initialize * @param p The pool to allocate data from. */ APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control, apr_pool_t *p); /** * Run the specified function one time, regardless of how many threads * call it. * @param control The control variable. The same variable should * be passed in each time the function is tried to be * called. This is how the underlying functions determine * if the function has ever been called before. * @param func The function to call. */ APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control, void (*func)(void)); /** * detach a thread * @param thd The thread to detach */ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd); /** * Return user data associated with the current thread. * @param data The user data associated with the thread. * @param key The key to associate with the data * @param thread The currently open thread. */ APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread); /** * Set user data associated with the current thread. * @param data The user data to associate with the thread. * @param key The key to use for associating the data with the thread * @param cleanup The cleanup routine to use when the thread is destroyed. * @param thread The currently open thread. */ APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread); /** * Create and initialize a new thread private address space * @param key The thread private handle. * @param dest The destructor to use when freeing the private memory. * @param cont The pool to use */ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont); /** * Get a pointer to the thread private memory * @param new_mem The data stored in private memory * @param key The handle for the desired thread private memory */ APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key); /** * Set the data to be stored in thread private memory * @param priv The data to be stored in private memory * @param key The handle for the desired thread private memory */ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key); /** * Free the thread private memory * @param key The handle for the desired thread private memory */ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key); /** * Return the pool associated with the current threadkey. * @param data The user data associated with the threadkey. * @param key The key associated with the data * @param threadkey The currently open threadkey. */ APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey); /** * Return the pool associated with the current threadkey. * @param data The data to set. * @param key The key to associate with the data. * @param cleanup The cleanup routine to use when the file is destroyed. * @param threadkey The currently open threadkey. */ APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey); #endif /** * Create and initialize a new procattr variable * @param new_attr The newly created procattr. * @param cont The pool to use */ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new_attr, apr_pool_t *cont); /** * Determine if any of stdin, stdout, or stderr should be linked to pipes * when starting a child process. * @param attr The procattr we care about. * @param in Should stdin be a pipe back to the parent? * @param out Should stdout be a pipe back to the parent? * @param err Should stderr be a pipe back to the parent? * @note If APR_NO_PIPE, there will be no special channel, the child * inherits the parent's corresponding stdio stream. If APR_NO_FILE is * specified, that corresponding stream is closed in the child (and will * be INVALID_HANDLE_VALUE when inspected on Win32). This can have ugly * side effects, as the next file opened in the child on Unix will fall * into the stdio stream fd slot! */ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err); /** * Set the child_in and/or parent_in values to existing apr_file_t values. * @param attr The procattr we care about. * @param child_in apr_file_t value to use as child_in. Must be a valid file. * @param parent_in apr_file_t value to use as parent_in. Must be a valid file. * @remark This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. You can save some * extra function calls by not creating your own pipe since this * creates one in the process space for you. * @bug Note that calling this function with two NULL files on some platforms * creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor * is it supported. @see apr_procattr_io_set instead for simple pipes. */ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in); /** * Set the child_out and parent_out values to existing apr_file_t values. * @param attr The procattr we care about. * @param child_out apr_file_t value to use as child_out. Must be a valid file. * @param parent_out apr_file_t value to use as parent_out. Must be a valid file. * @remark This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. * @bug Note that calling this function with two NULL files on some platforms * creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor * is it supported. @see apr_procattr_io_set instead for simple pipes. */ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out); /** * Set the child_err and parent_err values to existing apr_file_t values. * @param attr The procattr we care about. * @param child_err apr_file_t value to use as child_err. Must be a valid file. * @param parent_err apr_file_t value to use as parent_err. Must be a valid file. * @remark This is NOT a required initializer function. This is * useful if you have already opened a pipe (or multiple files) * that you wish to use, perhaps persistently across multiple * process invocations - such as a log file. * @bug Note that calling this function with two NULL files on some platforms * creates an APR_FULL_BLOCK pipe, but this behavior is neither portable nor * is it supported. @see apr_procattr_io_set instead for simple pipes. */ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err); /** * Set which directory the child process should start executing in. * @param attr The procattr we care about. * @param dir Which dir to start in. By default, this is the same dir as * the parent currently resides in, when the createprocess call * is made. */ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir); /** * Set what type of command the child process will call. * @param attr The procattr we care about. * @param cmd The type of command. One of: *
 *            APR_SHELLCMD     --  Anything that the shell can handle
 *            APR_PROGRAM      --  Executable program   (default) 
 *            APR_PROGRAM_ENV  --  Executable program, copy environment
 *            APR_PROGRAM_PATH --  Executable program on PATH, copy env
 * 
*/ APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd); /** * Determine if the child should start in detached state. * @param attr The procattr we care about. * @param detach Should the child start in detached state? Default is no. */ APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach); #if APR_HAVE_STRUCT_RLIMIT /** * Set the Resource Utilization limits when starting a new process. * @param attr The procattr we care about. * @param what Which limit to set, one of: *
 *                 APR_LIMIT_CPU
 *                 APR_LIMIT_MEM
 *                 APR_LIMIT_NPROC
 *                 APR_LIMIT_NOFILE
 * 
* @param limit Value to set the limit to. */ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit); #endif /** * Specify an error function to be called in the child process if APR * encounters an error in the child prior to running the specified program. * @param attr The procattr describing the child process to be created. * @param errfn The function to call in the child process. * @remark At the present time, it will only be called from apr_proc_create() * on platforms where fork() is used. It will never be called on other * platforms, on those platforms apr_proc_create() will return the error * in the parent process rather than invoke the callback in the now-forked * child process. */ APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr, apr_child_errfn_t *errfn); /** * Specify that apr_proc_create() should do whatever it can to report * failures to the caller of apr_proc_create(), rather than find out in * the child. * @param attr The procattr describing the child process to be created. * @param chk Flag to indicate whether or not extra work should be done * to try to report failures to the caller. * @remark This flag only affects apr_proc_create() on platforms where * fork() is used. This leads to extra overhead in the calling * process, but that may help the application handle such * errors more gracefully. */ APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr, apr_int32_t chk); /** * Determine if the child should start in its own address space or using the * current one from its parent * @param attr The procattr we care about. * @param addrspace Should the child start in its own address space? Default * is no on NetWare and yes on other platforms. */ APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr, apr_int32_t addrspace); /** * Set the username used for running process * @param attr The procattr we care about. * @param username The username used * @param password User password if needed. Password is needed on WIN32 * or any other platform having * APR_PROCATTR_USER_SET_REQUIRES_PASSWORD set. */ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, const char *username, const char *password); /** * Set the group used for running process * @param attr The procattr we care about. * @param groupname The group name used */ APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr, const char *groupname); #if APR_HAS_FORK /** * This is currently the only non-portable call in APR. This executes * a standard unix fork. * @param proc The resulting process handle. * @param cont The pool to use. * @remark returns APR_INCHILD for the child, and APR_INPARENT for the parent * or an error. */ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont); #endif /** * Create a new process and execute a new program within that process. * @param new_proc The resulting process handle. * @param progname The program to run * @param args the arguments to pass to the new program. The first * one should be the program name. * @param env The new environment table for the new process. This * should be a list of NULL-terminated strings. This argument * is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and * APR_SHELLCMD_ENV types of commands. * @param attr the procattr we should use to determine how to create the new * process * @param pool The pool to use. * @note This function returns without waiting for the new process to terminate; * use apr_proc_wait for that. */ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *pool); /** * Wait for a child process to die * @param proc The process handle that corresponds to the desired child process * @param exitcode The returned exit status of the child, if a child process * dies, or the signal that caused the child to die. * On platforms that don't support obtaining this information, * the status parameter will be returned as APR_ENOTIMPL. * @param exitwhy Why the child died, the bitwise or of: *
 *            APR_PROC_EXIT         -- process terminated normally
 *            APR_PROC_SIGNAL       -- process was killed by a signal
 *            APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and
 *                                     generated a core dump.
 * 
* @param waithow How should we wait. One of: *
 *            APR_WAIT   -- block until the child process dies.
 *            APR_NOWAIT -- return immediately regardless of if the 
 *                          child is dead or not.
 * 
* @remark The child's status is in the return code to this process. It is one of: *
 *            APR_CHILD_DONE     -- child is no longer running.
 *            APR_CHILD_NOTDONE  -- child is still running.
 * 
*/ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, int *exitcode, apr_exit_why_e *exitwhy, apr_wait_how_e waithow); /** * Wait for any current child process to die and return information * about that child. * @param proc Pointer to NULL on entry, will be filled out with child's * information * @param exitcode The returned exit status of the child, if a child process * dies, or the signal that caused the child to die. * On platforms that don't support obtaining this information, * the status parameter will be returned as APR_ENOTIMPL. * @param exitwhy Why the child died, the bitwise or of: *
 *            APR_PROC_EXIT         -- process terminated normally
 *            APR_PROC_SIGNAL       -- process was killed by a signal
 *            APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and
 *                                     generated a core dump.
 * 
* @param waithow How should we wait. One of: *
 *            APR_WAIT   -- block until the child process dies.
 *            APR_NOWAIT -- return immediately regardless of if the 
 *                          child is dead or not.
 * 
* @param p Pool to allocate child information out of. * @bug Passing proc as a *proc rather than **proc was an odd choice * for some platforms... this should be revisited in 1.0 */ APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc, int *exitcode, apr_exit_why_e *exitwhy, apr_wait_how_e waithow, apr_pool_t *p); #define APR_PROC_DETACH_FOREGROUND 0 /**< Do not detach */ #define APR_PROC_DETACH_DAEMONIZE 1 /**< Detach */ /** * Detach the process from the controlling terminal. * @param daemonize set to non-zero if the process should daemonize * and become a background process, else it will * stay in the foreground. */ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize); /** * Register an other_child -- a child associated to its registered * maintence callback. This callback is invoked when the process * dies, is disconnected or disappears. * @param proc The child process to register. * @param maintenance maintenance is a function that is invoked with a * reason and the data pointer passed here. * @param data Opaque context data passed to the maintenance function. * @param write_fd An fd that is probed for writing. If it is ever unwritable * then the maintenance is invoked with reason * OC_REASON_UNWRITABLE. * @param p The pool to use for allocating memory. * @bug write_fd duplicates the proc->out stream, it's really redundant * and should be replaced in the APR 1.0 API with a bitflag of which * proc->in/out/err handles should be health checked. * @bug no platform currently tests the pipes health. */ APR_DECLARE(void) apr_proc_other_child_register(apr_proc_t *proc, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p); /** * Stop watching the specified other child. * @param data The data to pass to the maintenance function. This is * used to find the process to unregister. * @warning Since this can be called by a maintenance function while we're * scanning the other_children list, all scanners should protect * themself by loading ocr->next before calling any maintenance * function. */ APR_DECLARE(void) apr_proc_other_child_unregister(void *data); /** * Notify the maintenance callback of a registered other child process * that application has detected an event, such as death. * @param proc The process to check * @param reason The reason code to pass to the maintenance function * @param status The status to pass to the maintenance function * @remark An example of code using this behavior; *
 * rv = apr_proc_wait_all_procs(&proc, &exitcode, &status, APR_WAIT, p);
 * if (APR_STATUS_IS_CHILD_DONE(rv)) {
 * \#if APR_HAS_OTHER_CHILD
 *     if (apr_proc_other_child_alert(&proc, APR_OC_REASON_DEATH, status)
 *             == APR_SUCCESS) {
 *         ;  (already handled)
 *     }
 *     else
 * \#endif
 *         [... handling non-otherchild processes death ...]
 * 
*/ APR_DECLARE(apr_status_t) apr_proc_other_child_alert(apr_proc_t *proc, int reason, int status); /** * Test one specific other child processes and invoke the maintenance callback * with the appropriate reason code, if still running, or the appropriate reason * code if the process is no longer healthy. * @param ocr The registered other child * @param reason The reason code (e.g. APR_OC_REASON_RESTART) if still running */ APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, int reason); /** * Test all registered other child processes and invoke the maintenance callback * with the appropriate reason code, if still running, or the appropriate reason * code if the process is no longer healthy. * @param reason The reason code (e.g. APR_OC_REASON_RESTART) to running processes */ APR_DECLARE(void) apr_proc_other_child_refresh_all(int reason); /** * Terminate a process. * @param proc The process to terminate. * @param sig How to kill the process. */ APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int sig); /** * Register a process to be killed when a pool dies. * @param a The pool to use to define the processes lifetime * @param proc The process to register * @param how How to kill the process, one of: *
 *         APR_KILL_NEVER         -- process is never sent any signals
 *         APR_KILL_ALWAYS        -- process is sent SIGKILL on apr_pool_t cleanup
 *         APR_KILL_AFTER_TIMEOUT -- SIGTERM, wait 3 seconds, SIGKILL
 *         APR_JUST_WAIT          -- wait forever for the process to complete
 *         APR_KILL_ONLY_ONCE     -- send SIGTERM and then wait
 * 
*/ APR_DECLARE(void) apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *proc, apr_kill_conditions_e how); #if APR_HAS_THREADS #if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2) /** * Setup the process for a single thread to be used for all signal handling. * @warning This must be called before any threads are created */ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void); /** * Make the current thread listen for signals. This thread will loop * forever, calling a provided function whenever it receives a signal. That * functions should return 1 if the signal has been handled, 0 otherwise. * @param signal_handler The function to call when a signal is received * apr_status_t apr_signal_thread((int)(*signal_handler)(int signum)) */ APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum)); #endif /* (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2) */ /** * Get the child-pool used by the thread from the thread info. * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(thread); #endif /* APR_HAS_THREADS */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_THREAD_PROC_H */ ================================================ FILE: third_party/include/apr/apr_thread_rwlock.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_THREAD_RWLOCK_H #define APR_THREAD_RWLOCK_H /** * @file apr_thread_rwlock.h * @brief APR Reader/Writer Lock Routines */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #if APR_HAS_THREADS /** * @defgroup apr_thread_rwlock Reader/Writer Lock Routines * @ingroup APR * @{ */ /** Opaque read-write thread-safe lock. */ typedef struct apr_thread_rwlock_t apr_thread_rwlock_t; /** * Note: The following operations have undefined results: unlocking a * read-write lock which is not locked in the calling thread; write * locking a read-write lock which is already locked by the calling * thread; destroying a read-write lock more than once; clearing or * destroying the pool from which a locked read-write lock is * allocated. */ /** * Create and initialize a read-write lock that can be used to synchronize * threads. * @param rwlock the memory address where the newly created readwrite lock * will be stored. * @param pool the pool from which to allocate the mutex. */ APR_DECLARE(apr_status_t) apr_thread_rwlock_create(apr_thread_rwlock_t **rwlock, apr_pool_t *pool); /** * Acquire a shared-read lock on the given read-write lock. This will allow * multiple threads to enter the same critical section while they have acquired * the read lock. * @param rwlock the read-write lock on which to acquire the shared read. */ APR_DECLARE(apr_status_t) apr_thread_rwlock_rdlock(apr_thread_rwlock_t *rwlock); /** * Attempt to acquire the shared-read lock on the given read-write lock. This * is the same as apr_thread_rwlock_rdlock(), only that the function fails * if there is another thread holding the write lock, or if there are any * write threads blocking on the lock. If the function fails for this case, * APR_EBUSY will be returned. Note: it is important that the * APR_STATUS_IS_EBUSY(s) macro be used to determine if the return value was * APR_EBUSY, for portability reasons. * @param rwlock the rwlock on which to attempt the shared read. */ APR_DECLARE(apr_status_t) apr_thread_rwlock_tryrdlock(apr_thread_rwlock_t *rwlock); /** * Acquire an exclusive-write lock on the given read-write lock. This will * allow only one single thread to enter the critical sections. If there * are any threads currently holding the read-lock, this thread is put to * sleep until it can have exclusive access to the lock. * @param rwlock the read-write lock on which to acquire the exclusive write. */ APR_DECLARE(apr_status_t) apr_thread_rwlock_wrlock(apr_thread_rwlock_t *rwlock); /** * Attempt to acquire the exclusive-write lock on the given read-write lock. * This is the same as apr_thread_rwlock_wrlock(), only that the function fails * if there is any other thread holding the lock (for reading or writing), * in which case the function will return APR_EBUSY. Note: it is important * that the APR_STATUS_IS_EBUSY(s) macro be used to determine if the return * value was APR_EBUSY, for portability reasons. * @param rwlock the rwlock on which to attempt the exclusive write. */ APR_DECLARE(apr_status_t) apr_thread_rwlock_trywrlock(apr_thread_rwlock_t *rwlock); /** * Release either the read or write lock currently held by the calling thread * associated with the given read-write lock. * @param rwlock the read-write lock to be released (unlocked). */ APR_DECLARE(apr_status_t) apr_thread_rwlock_unlock(apr_thread_rwlock_t *rwlock); /** * Destroy the read-write lock and free the associated memory. * @param rwlock the rwlock to destroy. */ APR_DECLARE(apr_status_t) apr_thread_rwlock_destroy(apr_thread_rwlock_t *rwlock); /** * Get the pool used by this thread_rwlock. * @return apr_pool_t the pool */ APR_POOL_DECLARE_ACCESSOR(thread_rwlock); #endif /* APR_HAS_THREADS */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_THREAD_RWLOCK_H */ ================================================ FILE: third_party/include/apr/apr_time.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_TIME_H #define APR_TIME_H /** * @file apr_time.h * @brief APR Time Library */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_time Time Routines * @ingroup APR * @{ */ /** month names */ APR_DECLARE_DATA extern const char apr_month_snames[12][4]; /** day names */ APR_DECLARE_DATA extern const char apr_day_snames[7][4]; /** number of microseconds since 00:00:00 January 1, 1970 UTC */ typedef apr_int64_t apr_time_t; /** mechanism to properly type apr_time_t literals */ #define APR_TIME_C(val) APR_INT64_C(val) /** mechanism to properly print apr_time_t values */ #define APR_TIME_T_FMT APR_INT64_T_FMT /** intervals for I/O timeouts, in microseconds */ typedef apr_int64_t apr_interval_time_t; /** short interval for I/O timeouts, in microseconds */ typedef apr_int32_t apr_short_interval_time_t; /** number of microseconds per second */ #define APR_USEC_PER_SEC APR_TIME_C(1000000) /** @return apr_time_t as a second */ #define apr_time_sec(time) ((time) / APR_USEC_PER_SEC) /** @return apr_time_t as a usec */ #define apr_time_usec(time) ((time) % APR_USEC_PER_SEC) /** @return apr_time_t as a msec */ #define apr_time_msec(time) (((time) / 1000) % 1000) /** @return apr_time_t as a msec */ #define apr_time_as_msec(time) ((time) / 1000) /** @return milliseconds as an apr_time_t */ #define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000) /** @return seconds as an apr_time_t */ #define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) /** @return a second and usec combination as an apr_time_t */ #define apr_time_make(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \ + (apr_time_t)(usec)) /** * @return the current time */ APR_DECLARE(apr_time_t) apr_time_now(void); /** @see apr_time_exp_t */ typedef struct apr_time_exp_t apr_time_exp_t; /** * a structure similar to ANSI struct tm with the following differences: * - tm_usec isn't an ANSI field * - tm_gmtoff isn't an ANSI field (it's a BSDism) */ struct apr_time_exp_t { /** microseconds past tm_sec */ apr_int32_t tm_usec; /** (0-61) seconds past tm_min */ apr_int32_t tm_sec; /** (0-59) minutes past tm_hour */ apr_int32_t tm_min; /** (0-23) hours past midnight */ apr_int32_t tm_hour; /** (1-31) day of the month */ apr_int32_t tm_mday; /** (0-11) month of the year */ apr_int32_t tm_mon; /** year since 1900 */ apr_int32_t tm_year; /** (0-6) days since Sunday */ apr_int32_t tm_wday; /** (0-365) days since January 1 */ apr_int32_t tm_yday; /** daylight saving time */ apr_int32_t tm_isdst; /** seconds east of UTC */ apr_int32_t tm_gmtoff; }; /** * Convert an ansi time_t to an apr_time_t * @param result the resulting apr_time_t * @param input the time_t to convert */ APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result, time_t input); /** * Convert a time to its human readable components using an offset * from GMT. * @param result the exploded time * @param input the time to explode * @param offs the number of seconds offset to apply */ APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, apr_time_t input, apr_int32_t offs); /** * Convert a time to its human readable components (GMT). * @param result the exploded time * @param input the time to explode */ APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result, apr_time_t input); /** * Convert a time to its human readable components in the local timezone. * @param result the exploded time * @param input the time to explode */ APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result, apr_time_t input); /** * Convert time value from human readable format to a numeric apr_time_t * (elapsed microseconds since the epoch). * @param result the resulting imploded time * @param input the input exploded time */ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *result, apr_time_exp_t *input); /** * Convert time value from human readable format to a numeric apr_time_t that * always represents GMT. * @param result the resulting imploded time * @param input the input exploded time */ APR_DECLARE(apr_status_t) apr_time_exp_gmt_get(apr_time_t *result, apr_time_exp_t *input); /** * Sleep for the specified number of micro-seconds. * @param t desired amount of time to sleep. * @warning May sleep for longer than the specified time. */ APR_DECLARE(void) apr_sleep(apr_interval_time_t t); /** length of a RFC822 Date */ #define APR_RFC822_DATE_LEN (30) /** * apr_rfc822_date formats dates in the RFC822 * format in an efficient manner. It is a fixed length * format which requires APR_RFC822_DATA_LEN bytes of storage, * including the trailing NUL terminator. * @param date_str String to write to. * @param t the time to convert */ APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t); /** length of a CTIME date */ #define APR_CTIME_LEN (25) /** * apr_ctime formats dates in the ctime() format * in an efficient manner. It is a fixed length format * and requires APR_CTIME_LEN bytes of storage including * the trailing NUL terminator. * Unlike ANSI/ISO C ctime(), apr_ctime() does not include * a \\n at the end of the string. * @param date_str String to write to. * @param t the time to convert */ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t); /** * Formats the exploded time according to the format specified * @param s string to write to * @param retsize The length of the returned string * @param max The maximum length of the string * @param format The format for the time string * @param tm The time to convert */ APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_time_exp_t *tm); /** * Improve the clock resolution for the lifetime of the given pool. * Generally this is only desirable on benchmarking and other very * time-sensitive applications, and has no impact on most platforms. * @param p The pool to associate the finer clock resolution */ APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_TIME_H */ ================================================ FILE: third_party/include/apr/apr_user.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_USER_H #define APR_USER_H /** * @file apr_user.h * @brief APR User ID Services */ #include "apr.h" #include "apr_errno.h" #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apr_user User and Group ID Services * @ingroup APR * @{ */ /** * Structure for determining user ownership. */ #ifdef WIN32 typedef PSID apr_uid_t; #else typedef uid_t apr_uid_t; #endif /** * Structure for determining group ownership. */ #ifdef WIN32 typedef PSID apr_gid_t; #else typedef gid_t apr_gid_t; #endif #if APR_HAS_USER /** * Get the userid (and groupid) of the calling process * @param userid Returns the user id * @param groupid Returns the user's group id * @param p The pool from which to allocate working space * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_uid_current(apr_uid_t *userid, apr_gid_t *groupid, apr_pool_t *p); /** * Get the user name for a specified userid * @param username Pointer to new string containing user name (on output) * @param userid The userid * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_uid_name_get(char **username, apr_uid_t userid, apr_pool_t *p); /** * Get the userid (and groupid) for the specified username * @param userid Returns the user id * @param groupid Returns the user's group id * @param username The username to look up * @param p The pool from which to allocate working space * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_uid_get(apr_uid_t *userid, apr_gid_t *groupid, const char *username, apr_pool_t *p); /** * Get the home directory for the named user * @param dirname Pointer to new string containing directory name (on output) * @param username The named user * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_uid_homepath_get(char **dirname, const char *username, apr_pool_t *p); /** * Compare two user identifiers for equality. * @param left One uid to test * @param right Another uid to test * @return APR_SUCCESS if the apr_uid_t structures identify the same user, * APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid. * @remark This function is available only if APR_HAS_USER is defined. */ #if defined(WIN32) APR_DECLARE(apr_status_t) apr_uid_compare(apr_uid_t left, apr_uid_t right); #else #define apr_uid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) #endif /** * Get the group name for a specified groupid * @param groupname Pointer to new string containing group name (on output) * @param groupid The groupid * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_gid_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p); /** * Get the groupid for a specified group name * @param groupid Pointer to the group id (on output) * @param groupname The group name to look up * @param p The pool from which to allocate the string * @remark This function is available only if APR_HAS_USER is defined. */ APR_DECLARE(apr_status_t) apr_gid_get(apr_gid_t *groupid, const char *groupname, apr_pool_t *p); /** * Compare two group identifiers for equality. * @param left One gid to test * @param right Another gid to test * @return APR_SUCCESS if the apr_gid_t structures identify the same group, * APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid. * @remark This function is available only if APR_HAS_USER is defined. */ #if defined(WIN32) APR_DECLARE(apr_status_t) apr_gid_compare(apr_gid_t left, apr_gid_t right); #else #define apr_gid_compare(left,right) (((left) == (right)) ? APR_SUCCESS : APR_EMISMATCH) #endif #endif /* ! APR_HAS_USER */ /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_USER_H */ ================================================ FILE: third_party/include/apr/apr_version.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_VERSION_H #define APR_VERSION_H /** * @file apr_version.h * @brief APR Versioning Interface * * APR's Version * * There are several different mechanisms for accessing the version. There * is a string form, and a set of numbers; in addition, there are constants * which can be compiled into your application, and you can query the library * being used for its actual version. * * Note that it is possible for an application to detect that it has been * compiled against a different version of APR by use of the compile-time * constants and the use of the run-time query function. * * APR version numbering follows the guidelines specified in: * * http://apr.apache.org/versioning.html */ #define APR_COPYRIGHT "Copyright (c) 2000-2015 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the * authoritative version numbers for APR. */ /** major version * Major API changes that could cause compatibility problems for older * programs such as structure size changes. No binary compatibility is * possible across a change in the major version. */ #define APR_MAJOR_VERSION 1 /** minor version * Minor API changes that do not cause binary compatibility problems. * Reset to 0 when upgrading APR_MAJOR_VERSION */ #define APR_MINOR_VERSION 5 /** patch level * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ #define APR_PATCH_VERSION 2 /** * The symbol APR_IS_DEV_VERSION is only defined for internal, * "development" copies of APR. It is undefined for released versions * of APR. */ /* #define APR_IS_DEV_VERSION */ /** * Check at compile time if the APR version is at least a certain * level. * @param major The major version component of the version checked * for (e.g., the "1" of "1.3.0"). * @param minor The minor version component of the version checked * for (e.g., the "3" of "1.3.0"). * @param patch The patch level component of the version checked * for (e.g., the "0" of "1.3.0"). * @remark This macro is available with APR versions starting with * 1.3.0. */ #define APR_VERSION_AT_LEAST(major,minor,patch) \ (((major) < APR_MAJOR_VERSION) \ || ((major) == APR_MAJOR_VERSION && (minor) < APR_MINOR_VERSION) \ || ((major) == APR_MAJOR_VERSION && (minor) == APR_MINOR_VERSION && (patch) <= APR_PATCH_VERSION)) #if defined(APR_IS_DEV_VERSION) || defined(DOXYGEN) /** Internal: string form of the "is dev" flag */ #ifndef APR_IS_DEV_STRING #define APR_IS_DEV_STRING "-dev" #endif #else #define APR_IS_DEV_STRING "" #endif /* APR_STRINGIFY is defined here, and also in apr_general.h, so wrap it */ #ifndef APR_STRINGIFY /** Properly quote a value as a string in the C preprocessor */ #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n) /** Helper macro for APR_STRINGIFY */ #define APR_STRINGIFY_HELPER(n) #n #endif /** The formatted string of APR's version */ #define APR_VERSION_STRING \ APR_STRINGIFY(APR_MAJOR_VERSION) "." \ APR_STRINGIFY(APR_MINOR_VERSION) "." \ APR_STRINGIFY(APR_PATCH_VERSION) \ APR_IS_DEV_STRING /** An alternative formatted string of APR's version */ /* macro for Win32 .rc files using numeric csv representation */ #define APR_VERSION_STRING_CSV APR_MAJOR_VERSION ##, \ ##APR_MINOR_VERSION ##, \ ##APR_PATCH_VERSION #ifndef APR_VERSION_ONLY /* The C language API to access the version at run time, * as opposed to compile time. APR_VERSION_ONLY may be defined * externally when preprocessing apr_version.h to obtain strictly * the C Preprocessor macro declarations. */ #include "apr.h" #ifdef __cplusplus extern "C" { #endif /** * The numeric version information is broken out into fields within this * structure. */ typedef struct { int major; /**< major number */ int minor; /**< minor number */ int patch; /**< patch number */ int is_dev; /**< is development (1 or 0) */ } apr_version_t; /** * Return APR's version information information in a numeric form. * * @param pvsn Pointer to a version structure for returning the version * information. */ APR_DECLARE(void) apr_version(apr_version_t *pvsn); /** Return APR's version information as a string. */ APR_DECLARE(const char *) apr_version_string(void); #ifdef __cplusplus } #endif #endif /* ndef APR_VERSION_ONLY */ #endif /* ndef APR_VERSION_H */ ================================================ FILE: third_party/include/apr/apr_want.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apr.h" /* configuration data */ /** * @file apr_want.h * @brief APR Standard Headers Support * *
 * Features:
 *
 *   APR_WANT_STRFUNC:  strcmp, strcat, strcpy, etc
 *   APR_WANT_MEMFUNC:  memcmp, memcpy, etc
 *   APR_WANT_STDIO:     and related bits
 *   APR_WANT_IOVEC:    struct iovec
 *   APR_WANT_BYTEFUNC: htons, htonl, ntohl, ntohs
 *
 * Typical usage:
 *
 *   \#define APR_WANT_STRFUNC
 *   \#define APR_WANT_MEMFUNC
 *   \#include "apr_want.h"
 *
 * The appropriate headers will be included.
 *
 * Note: it is safe to use this in a header (it won't interfere with other
 *       headers' or source files' use of apr_want.h)
 * 
*/ /* --------------------------------------------------------------------- */ #ifdef APR_WANT_STRFUNC #if APR_HAVE_STRING_H #include #endif #if APR_HAVE_STRINGS_H #include #endif #undef APR_WANT_STRFUNC #endif /* --------------------------------------------------------------------- */ #ifdef APR_WANT_MEMFUNC #if APR_HAVE_STRING_H #include #endif #undef APR_WANT_MEMFUNC #endif /* --------------------------------------------------------------------- */ #ifdef APR_WANT_STDIO #if APR_HAVE_STDIO_H #include #endif #undef APR_WANT_STDIO #endif /* --------------------------------------------------------------------- */ #ifdef APR_WANT_IOVEC #if APR_HAVE_IOVEC #if APR_HAVE_SYS_UIO_H #include #endif #else #ifndef APR_IOVEC_DEFINED #define APR_IOVEC_DEFINED struct iovec { void *iov_base; size_t iov_len; }; #endif /* !APR_IOVEC_DEFINED */ #endif /* APR_HAVE_IOVEC */ #undef APR_WANT_IOVEC #endif /* --------------------------------------------------------------------- */ #ifdef APR_WANT_BYTEFUNC /* Single Unix says they are in arpa/inet.h. Linux has them in * netinet/in.h. FreeBSD has them in arpa/inet.h but requires that * netinet/in.h be included first. */ #if APR_HAVE_NETINET_IN_H #include #endif #if APR_HAVE_ARPA_INET_H #include #endif #undef APR_WANT_BYTEFUNC #endif /* --------------------------------------------------------------------- */ ================================================ FILE: third_party/include/apr/arch/aix/apr_arch_dso.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef DSO_H #define DSO_H #include "apr_private.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" #include "apr.h" #if APR_HAS_DSO void *dlopen(const char *path, int mode); void *dlsym(void *handle, const char *symbol); const char *dlerror(void); int dlclose(void *handle); struct apr_dso_handle_t { apr_pool_t *pool; void *handle; const char *errormsg; }; #endif #endif ================================================ FILE: third_party/include/apr/arch/apr_private_common.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * This file contains private declarations common to all architectures. */ #ifndef APR_PRIVATE_COMMON_H #define APR_PRIVATE_COMMON_H #include "apr_pools.h" #include "apr_tables.h" apr_status_t apr_filepath_list_split_impl(apr_array_header_t **pathelts, const char *liststr, char separator, apr_pool_t *p); apr_status_t apr_filepath_list_merge_impl(char **liststr, apr_array_header_t *pathelts, char separator, apr_pool_t *p); /* temporary defines to handle 64bit compile mismatches */ #define APR_INT_TRUNC_CAST int #define APR_UINT32_TRUNC_CAST apr_uint32_t #endif /*APR_PRIVATE_COMMON_H*/ ================================================ FILE: third_party/include/apr/arch/beos/apr_arch_dso.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef DSO_H #define DSO_H #include "apr_private.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_errno.h" #include "apr_dso.h" #include "apr.h" #include #include #if APR_HAS_DSO struct apr_dso_handle_t { image_id handle; /* Handle to the DSO loaded */ apr_pool_t *pool; const char *errormsg; /* if the load fails, we have an error * message here :) */ }; #endif #endif ================================================ FILE: third_party/include/apr/arch/beos/apr_arch_proc_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PROC_MUTEX_H #define PROC_MUTEX_H #include "apr_pools.h" #include "apr_proc_mutex.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_portable.h" struct apr_proc_mutex_t { apr_pool_t *pool; /* Our lock :) */ sem_id Lock; int32 LockCount; }; #endif /* PROC_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/beos/apr_arch_thread_cond.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_COND_H #define THREAD_COND_H #include #include "apr_pools.h" #include "apr_thread_cond.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_portable.h" #include "apr_ring.h" struct waiter_t { APR_RING_ENTRY(waiter_t) link; sem_id sem; }; struct apr_thread_cond_t { apr_pool_t *pool; sem_id lock; apr_thread_mutex_t *condlock; thread_id owner; /* active list */ APR_RING_HEAD(active_list, waiter_t) alist; /* free list */ APR_RING_HEAD(free_list, waiter_t) flist; }; #endif /* THREAD_COND_H */ ================================================ FILE: third_party/include/apr/arch/beos/apr_arch_thread_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H #include #include "apr_pools.h" #include "apr_thread_mutex.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_portable.h" struct apr_thread_mutex_t { apr_pool_t *pool; /* Our lock :) */ sem_id Lock; int32 LockCount; /* If we nest locks we need these... */ int nested; apr_os_thread_t owner; int owner_ref; }; #endif /* THREAD_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/beos/apr_arch_thread_rwlock.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_RWLOCK_H #define THREAD_RWLOCK_H #include #include "apr_pools.h" #include "apr_thread_rwlock.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_portable.h" struct apr_thread_rwlock_t { apr_pool_t *pool; /* Our lock :) */ sem_id Lock; int32 LockCount; /* Read/Write lock stuff */ sem_id Read; int32 ReadCount; sem_id Write; int32 WriteCount; int32 Nested; thread_id writer; }; #endif /* THREAD_RWLOCK_H */ ================================================ FILE: third_party/include/apr/arch/beos/apr_arch_threadproc.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apr_thread_proc.h" #include "apr_arch_file_io.h" #include "apr_file_io.h" #include "apr_thread_proc.h" #include "apr_general.h" #include "apr_portable.h" #include #include #include #include #include #ifndef THREAD_PROC_H #define THREAD_PROC_H #define SHELL_PATH "/bin/sh" #define PTHREAD_CANCEL_AYNCHRONOUS CANCEL_ASYNCH; #define PTHREAD_CANCEL_DEFERRED CANCEL_DEFER; #define PTHREAD_CANCEL_ENABLE CANCEL_ENABLE; #define PTHREAD_CANCEL_DISABLE CANCEL_DISABLE; #define BEOS_MAX_DATAKEYS 128 struct apr_thread_t { apr_pool_t *pool; thread_id td; void *data; apr_thread_start_t func; apr_status_t exitval; }; struct apr_threadattr_t { apr_pool_t *pool; int32 attr; int detached; int joinable; }; struct apr_threadkey_t { apr_pool_t *pool; int32 key; }; struct beos_private_data { const void ** data; int count; volatile thread_id td; }; struct beos_key { int assigned; int count; sem_id lock; int32 ben_lock; void (* destructor) (void *); }; struct apr_procattr_t { apr_pool_t *pool; apr_file_t *parent_in; apr_file_t *child_in; apr_file_t *parent_out; apr_file_t *child_out; apr_file_t *parent_err; apr_file_t *child_err; char *currdir; apr_int32_t cmdtype; apr_int32_t detached; }; struct apr_thread_once_t { sem_id sem; int hit; }; #endif /* ! THREAD_PROC_H */ ================================================ FILE: third_party/include/apr/arch/netware/apr_arch_dso.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef DSO_H #define DSO_H #include "apr_private.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" #include "apr.h" #include typedef struct sym_list sym_list; struct sym_list { sym_list *next; char *symbol; }; struct apr_dso_handle_t { apr_pool_t *pool; void *handle; const char *errormsg; sym_list *symbols; char *path; }; #endif ================================================ FILE: third_party/include/apr/arch/netware/apr_arch_file_io.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FILE_IO_H #define FILE_IO_H #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_tables.h" #include "apr_file_io.h" #include "apr_file_info.h" #include "apr_errno.h" #include "apr_lib.h" #include "apr_poll.h" /* System headers the file I/O library needs */ #if APR_HAVE_FCNTL_H #include #endif #if APR_HAVE_SYS_TYPES_H #include #endif #if APR_HAVE_ERRNO_H #include #endif #if APR_HAVE_STRING_H #include #endif #if APR_HAVE_STRINGS_H #include #endif #if APR_HAVE_DIRENT_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #if APR_HAVE_UNISTD_H #include #endif #if APR_HAVE_STDIO_H #include #endif #if APR_HAVE_STDLIB_H #include #endif #if APR_HAVE_SYS_UIO_H #include #endif #if APR_HAVE_SYS_TIME_H #include #endif #include /* End System headers */ #define APR_FILE_DEFAULT_BUFSIZE 4096 /* For backwards compat */ #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE #if APR_HAS_THREADS #define file_lock(f) do { \ if ((f)->thlock) \ apr_thread_mutex_lock((f)->thlock); \ } while (0) #define file_unlock(f) do { \ if ((f)->thlock) \ apr_thread_mutex_unlock((f)->thlock); \ } while (0) #else #define file_lock(f) do {} while (0) #define file_unlock(f) do {} while (0) #endif #if APR_HAS_LARGE_FILES #define lseek(f,o,w) lseek64(f,o,w) #define ftruncate(f,l) ftruncate64(f,l) #endif typedef struct stat struct_stat; struct apr_file_t { apr_pool_t *pool; int filedes; char *fname; apr_int32_t flags; int eof_hit; int is_pipe; apr_interval_time_t timeout; int buffered; enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ /* if there is a timeout set, then this pollset is used */ apr_pollset_t *pollset; /* Stuff for buffered mode */ char *buffer; apr_size_t bufpos; /* Read/Write position in buffer */ apr_size_t bufsize; /* The buffer size */ apr_off_t dataRead; /* amount of valid data read into buffer */ int direction; /* buffer being used for 0 = read, 1 = write */ apr_off_t filePtr; /* position in file of handle */ #if APR_HAS_THREADS struct apr_thread_mutex_t *thlock; #endif }; struct apr_dir_t { apr_pool_t *pool; char *dirname; DIR *dirstruct; struct dirent *entry; }; typedef struct apr_stat_entry_t apr_stat_entry_t; struct apr_stat_entry_t { struct stat info; char *casedName; apr_time_t expire; NXPathCtx_t pathCtx; }; #define MAX_SERVER_NAME 64 #define MAX_VOLUME_NAME 64 #define MAX_PATH_NAME 256 #define MAX_FILE_NAME 256 #define DRIVE_ONLY 1 /* If the user passes d: vs. D: (or //mach/share vs. //MACH/SHARE), * we need to fold the case to canonical form. This function is * supposed to do so. */ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); /* This function check to see of the given path includes a drive/volume * specifier. If the _only_ parameter is set to DRIVE_ONLY then it * check to see of the path only contains a drive/volume specifier and * nothing else. */ apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p); /* This function compares the drive/volume specifiers for each given path. * It returns zero if they match or non-zero if not. */ apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_pool_t *p); apr_status_t apr_unix_file_cleanup(void *); apr_status_t apr_unix_child_file_cleanup(void *); mode_t apr_unix_perms2mode(apr_fileperms_t perms); apr_fileperms_t apr_unix_mode2perms(mode_t mode); apr_status_t apr_file_flush_locked(apr_file_t *thefile); apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile); #endif /* ! FILE_IO_H */ ================================================ FILE: third_party/include/apr/arch/netware/apr_arch_global_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef GLOBAL_MUTEX_H #define GLOBAL_MUTEX_H #include "apr_global_mutex.h" #include "apr_thread_mutex.h" struct apr_global_mutex_t { apr_pool_t *pool; apr_thread_mutex_t *mutex; }; #endif /* GLOBAL_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/netware/apr_arch_internal_time.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TIME_INTERNAL_H #define TIME_INTERNAL_H #include "apr.h" #define TZONE (*___timezone()) void apr_netware_setup_time(void); #endif /* TIME_INTERNAL_H */ ================================================ FILE: third_party/include/apr/arch/netware/apr_arch_networkio.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef NETWORK_IO_H #ifdef USE_WINSOCK /* Making sure that we include the correct networkio.h since the the project file is configured to first look for headers in arch/netware and then arch/unix. But in this specific case we want arch/win32. */ #include <../win32/apr_arch_networkio.h> #else #include <../unix/apr_arch_networkio.h> #endif #endif /* ! NETWORK_IO_H */ ================================================ FILE: third_party/include/apr/arch/netware/apr_arch_pre_nw.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __pre_nw__ #define __pre_nw__ #include #ifndef __GNUC__ #pragma precompile_target "precomp.mch" #endif #define NETWARE #define N_PLAT_NLM #define FAR #define far /* no-op for Codewarrior C compiler; a functions are cdecl by default */ #define cdecl /* if we have wchar_t enabled in C++, predefine this type to avoid a conflict in Novell's header files */ #ifndef __GNUC__ #ifndef DOXYGEN #if (__option(cplusplus) && __option(wchar_type)) #define _WCHAR_T #endif #endif #endif /* C9X defintion used by MSL C++ library */ #define DECIMAL_DIG 17 /* some code may want to use the MS convention for long long */ #ifndef __int64 #define __int64 long long #endif #endif ================================================ FILE: third_party/include/apr/arch/netware/apr_arch_proc_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PROC_MUTEX_H #define PROC_MUTEX_H #include "apr_proc_mutex.h" #include "apr_thread_mutex.h" struct apr_proc_mutex_t { apr_pool_t *pool; apr_thread_mutex_t *mutex; }; #endif /* PROC_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/netware/apr_arch_thread_cond.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_COND_H #define THREAD_COND_H #include "apr_thread_cond.h" #include struct apr_thread_cond_t { apr_pool_t *pool; NXCond_t *cond; }; #endif /* THREAD_COND_H */ ================================================ FILE: third_party/include/apr/arch/netware/apr_arch_thread_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H #include "apr_thread_mutex.h" #include struct apr_thread_mutex_t { apr_pool_t *pool; NXMutex_t *mutex; }; #endif /* THREAD_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/netware/apr_arch_thread_rwlock.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_RWLOCK_H #define THREAD_RWLOCK_H #include "apr_thread_rwlock.h" #include struct apr_thread_rwlock_t { apr_pool_t *pool; NXRwLock_t *rwlock; }; #endif /* THREAD_RWLOCK_H */ ================================================ FILE: third_party/include/apr/arch/netware/apr_arch_threadproc.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apr.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include #ifndef THREAD_PROC_H #define THREAD_PROC_H #define SHELL_PATH "" #define APR_DEFAULT_STACK_SIZE 65536 struct apr_thread_t { apr_pool_t *pool; NXContext_t ctx; NXThreadId_t td; char *thread_name; apr_int32_t cancel; apr_int32_t cancel_how; void *data; apr_thread_start_t func; apr_status_t exitval; }; struct apr_threadattr_t { apr_pool_t *pool; apr_size_t stack_size; apr_int32_t detach; char *thread_name; }; struct apr_threadkey_t { apr_pool_t *pool; NXKey_t key; }; struct apr_procattr_t { apr_pool_t *pool; apr_file_t *parent_in; apr_file_t *child_in; apr_file_t *parent_out; apr_file_t *child_out; apr_file_t *parent_err; apr_file_t *child_err; char *currdir; apr_int32_t cmdtype; apr_int32_t detached; apr_int32_t addrspace; }; struct apr_thread_once_t { unsigned long value; }; /* struct apr_proc_t { apr_pool_t *pool; pid_t pid; apr_procattr_t *attr; }; */ #endif /* ! THREAD_PROC_H */ ================================================ FILE: third_party/include/apr/arch/netware/apr_private.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Note: * This is the netware-specific autoconf-like config file * which unix creates at ./configure time. */ #ifdef NETWARE #ifndef APR_PRIVATE_H #define APR_PRIVATE_H /* Pick up publicly advertised headers and symbols before the * APR internal private headers and symbols */ #include /* Pick up privately consumed headers */ #include /* Include alloca.h to get compiler-dependent defines */ #include #include #include #include #include #include #include #include /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. */ #define HAVE_DLFCN_H 1 #define HAVE_LIMITS_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_STDDEF_H 1 #define HAVE_STDLIB_H 1 #ifndef USE_WINSOCK #define HAVE_SYS_SELECT_H 1 #define HAVE_WRITEV 1 #endif #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_MMAN_H 1 #define HAVE_FCNTL_H 1 #define HAVE_ICONV_H 1 #define HAVE_UTIME_H 1 #define HAVE_STRICMP 1 #define HAVE_STRNICMP 1 #define HAVE_STRDUP 1 #define HAVE_STRSTR 1 #define HAVE_MEMCHR 1 #define HAVE_CALLOC 1 #define HAVE_UTIME 1 #define HAVE_GETENV 1 #define HAVE_SETENV 1 #define HAVE_UNSETENV 1 #define HAVE_WRITEV 1 #define HAVE_GETPASS_R 1 /* * Hack around older NDKs which have only the getpassword() function, * a threadsafe, API-equivalent of getpass_r(). */ #if (CURRENT_NDK_THRESHOLD < 709060000) #define getpass_r getpassword #endif /*#define DSO_USE_DLFCN */ #ifdef NW_BUILD_IPV6 #define HAVE_GETADDRINFO 1 #define HAVE_GETNAMEINFO 1 #endif /* 1 is used for SIGABRT on netware */ /* 2 is used for SIGFPE on netware */ /* 3 is used for SIGILL on netware */ /* 4 is used for SIGINT on netware */ /* 5 is used for SIGSEGV on netware */ /* 6 is used for SIGTERM on netware */ /* 7 is used for SIGPOLL on netware */ #if (CURRENT_NDK_THRESHOLD < 306030000) #define SIGKILL 11 #define SIGALRM 13 #define SIGCHLD 14 #define SIGCONT 15 #define SIGHUP 16 #define SIGPIPE 17 #define SIGQUIT 18 #define SIGSTOP 19 #define SIGTSTP 20 #define SIGTTIN 21 #define SIGTTOU 22 #define SIGUSR1 23 #define SIGUSR2 24 #endif #define SIGTRAP 25 #define SIGIOT 26 #define SIGSTKFLT 28 #define SIGURG 29 #define SIGXCPU 30 #define SIGXFSZ 31 #define SIGVTALRM 32 #define SIGPROF 33 #define SIGWINCH 34 #define SIGIO 35 #if (CURRENT_NDK_THRESHOLD < 406230000) #undef SA_NOCLDSTOP #define SA_NOCLDSTOP 0x00000001 #endif #ifndef SIGBUS #define SIGBUS SIGSEGV #endif #define _getch getcharacter #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONGLONG 8 #define SIZEOF_CHAR 1 #define SIZEOF_SSIZE_T SIZEOF_INT void netware_pool_proc_cleanup(); /* NLM registration routines for managing which NLMs are using the library. */ int register_NLM(void *NLMHandle); int unregister_NLM(void *NLMHandle); /* Application global data management */ extern int gLibId; extern void *gLibHandle; typedef struct app_data { int initialized; void* gPool; void* gs_aHooksToSort; void* gs_phOptionalHooks; void* gs_phOptionalFunctions; void* gs_nlmhandle; rtag_t gs_startup_rtag; rtag_t gs_socket_rtag; rtag_t gs_lookup_rtag; rtag_t gs_event_rtag; rtag_t gs_pcp_rtag; void* gs_ldap_xref_lock; void* gs_xref_head; } APP_DATA; int setGlobalPool(void *data); void* getGlobalPool(); int setStatCache(void *data); void* getStatCache(); /* Redefine malloc to use the library malloc call so that all of the memory resources will be owned and can be shared by the library. */ #undef malloc #define malloc(x) library_malloc(gLibHandle,x) #ifndef __MWERKS__ #define _alloca alloca #endif /* 64-bit integer conversion function */ #define APR_INT64_STRFN strtoll #if APR_HAS_LARGE_FILES #define APR_OFF_T_STRFN strtoll #else #define APR_OFF_T_STRFN strtol #endif /* used to check DWORD overflow for 64bit compiles */ #define APR_DWORD_MAX 0xFFFFFFFFUL /* * Include common private declarations. */ #include "../apr_private_common.h" #endif /*APR_PRIVATE_H*/ #endif /*NETWARE*/ ================================================ FILE: third_party/include/apr/arch/os2/apr_arch_dso.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef DSO_H #define DSO_H #include "apr_private.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" #include "apr.h" #if APR_HAS_DSO struct apr_dso_handle_t { apr_pool_t *cont; /* Context for returning error strings */ HMODULE handle; /* Handle to the DSO loaded */ apr_status_t load_error; char *failed_module; }; #endif #endif ================================================ FILE: third_party/include/apr/arch/os2/apr_arch_file_io.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FILE_IO_H #define FILE_IO_H #include "apr_private.h" #include "apr_general.h" #include "apr_thread_mutex.h" #include "apr_file_io.h" #include "apr_file_info.h" #include "apr_errno.h" #include "apr_poll.h" /* We have an implementation of mkstemp but it's not very multi-threading * friendly & is part of the POSIX emulation rather than native so don't * use it. */ #undef HAVE_MKSTEMP #define APR_FILE_DEFAULT_BUFSIZE 4096 #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE struct apr_file_t { apr_pool_t *pool; HFILE filedes; char * fname; int isopen; int buffered; int eof_hit; apr_int32_t flags; int timeout; int pipe; HEV pipeSem; enum { BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; /* Stuff for buffered mode */ char *buffer; apr_size_t bufsize; /* Read/Write position in buffer */ apr_size_t bufpos; /* Read/Write position in buffer */ unsigned long dataRead; /* amount of valid data read into buffer */ int direction; /* buffer being used for 0 = read, 1 = write */ unsigned long filePtr; /* position in file of handle */ apr_thread_mutex_t *mutex; /* mutex semaphore, must be owned to access the above fields */ }; struct apr_dir_t { apr_pool_t *pool; char *dirname; ULONG handle; FILEFINDBUF3 entry; int validentry; }; apr_status_t apr_file_cleanup(void *); apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, FTIME os2time); apr_status_t apr_apr_time_to_os2_time(FDATE *os2date, FTIME *os2time, apr_time_t aprtime); /* see win32/fileio.h for description of these */ extern const char c_is_fnchar[256]; #define IS_FNCHAR(c) c_is_fnchar[(unsigned char)c] apr_status_t filepath_root_test(char *path, apr_pool_t *p); apr_status_t filepath_drive_get(char **rootpath, char drive, apr_int32_t flags, apr_pool_t *p); apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); #endif /* ! FILE_IO_H */ ================================================ FILE: third_party/include/apr/arch/os2/apr_arch_inherit.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef INHERIT_H #define INHERIT_H #include "apr_inherit.h" #define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ int rv; \ ULONG state; \ if (((rv = DosQueryFHState(attr->parent_err->filedes, &state)) \ != 0) || \ ((rv = DosSetFHState(attr->parent_err->filedes, \ state & ~OPEN_FLAGS_NOINHERIT)) != 0)) \ return APR_FROM_OS_ERROR(rv); \ return APR_SUCCESS; \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ { \ int rv; \ ULONG state; \ if (((rv = DosQueryFHState(attr->parent_err->filedes, &state)) \ != 0) || \ ((rv = DosSetFHState(attr->parent_err->filedes, \ state | OPEN_FLAGS_NOINHERIT)) != 0)) \ return APR_FROM_OS_ERROR(rv); \ return APR_SUCCESS; \ } #endif /* ! INHERIT_H */ ================================================ FILE: third_party/include/apr/arch/os2/apr_arch_networkio.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef NETWORK_IO_H #define NETWORK_IO_H #include "apr_private.h" #include "apr_network_io.h" #include "apr_general.h" #include "apr_arch_os2calls.h" #include "apr_poll.h" #if APR_HAVE_NETDB_H #include #endif typedef struct sock_userdata_t sock_userdata_t; struct sock_userdata_t { sock_userdata_t *next; const char *key; void *data; }; struct apr_socket_t { apr_pool_t *pool; int socketdes; int type; int protocol; apr_sockaddr_t *local_addr; apr_sockaddr_t *remote_addr; apr_interval_time_t timeout; int nonblock; int local_port_unknown; int local_interface_unknown; int remote_addr_unknown; apr_int32_t options; apr_int32_t inherit; sock_userdata_t *userdata; /* if there is a timeout set, then this pollset is used */ apr_pollset_t *pollset; }; /* Error codes returned from sock_errno() */ #define SOCBASEERR 10000 #define SOCEPERM (SOCBASEERR+1) /* Not owner */ #define SOCESRCH (SOCBASEERR+3) /* No such process */ #define SOCEINTR (SOCBASEERR+4) /* Interrupted system call */ #define SOCENXIO (SOCBASEERR+6) /* No such device or address */ #define SOCEBADF (SOCBASEERR+9) /* Bad file number */ #define SOCEACCES (SOCBASEERR+13) /* Permission denied */ #define SOCEFAULT (SOCBASEERR+14) /* Bad address */ #define SOCEINVAL (SOCBASEERR+22) /* Invalid argument */ #define SOCEMFILE (SOCBASEERR+24) /* Too many open files */ #define SOCEPIPE (SOCBASEERR+32) /* Broken pipe */ #define SOCEOS2ERR (SOCBASEERR+100) /* OS/2 Error */ const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); #endif /* ! NETWORK_IO_H */ ================================================ FILE: third_party/include/apr/arch/os2/apr_arch_os2calls.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apr_errno.h" #include #include extern int (*apr_os2_socket)(int, int, int); extern int (*apr_os2_select)(int *, int, int, int, long); extern int (*apr_os2_sock_errno)(); extern int (*apr_os2_accept)(int, struct sockaddr *, int *); extern int (*apr_os2_bind)(int, struct sockaddr *, int); extern int (*apr_os2_connect)(int, struct sockaddr *, int); extern int (*apr_os2_getpeername)(int, struct sockaddr *, int *); extern int (*apr_os2_getsockname)(int, struct sockaddr *, int *); extern int (*apr_os2_getsockopt)(int, int, int, char *, int *); extern int (*apr_os2_ioctl)(int, int, caddr_t, int); extern int (*apr_os2_listen)(int, int); extern int (*apr_os2_recv)(int, char *, int, int); extern int (*apr_os2_send)(int, const char *, int, int); extern int (*apr_os2_setsockopt)(int, int, int, char *, int); extern int (*apr_os2_shutdown)(int, int); extern int (*apr_os2_soclose)(int); extern int (*apr_os2_writev)(int, struct iovec *, int); extern int (*apr_os2_sendto)(int, const char *, int, int, const struct sockaddr *, int); extern int (*apr_os2_recvfrom)(int, char *, int, int, struct sockaddr *, int *); #define socket apr_os2_socket #define select apr_os2_select #define sock_errno apr_os2_sock_errno #define accept apr_os2_accept #define bind apr_os2_bind #define connect apr_os2_connect #define getpeername apr_os2_getpeername #define getsockname apr_os2_getsockname #define getsockopt apr_os2_getsockopt #define ioctl apr_os2_ioctl #define listen apr_os2_listen #define recv apr_os2_recv #define send apr_os2_send #define setsockopt apr_os2_setsockopt #define shutdown apr_os2_shutdown #define soclose apr_os2_soclose #define writev apr_os2_writev #define sendto apr_os2_sendto #define recvfrom apr_os2_recvfrom ================================================ FILE: third_party/include/apr/arch/os2/apr_arch_proc_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PROC_MUTEX_H #define PROC_MUTEX_H #include "apr_proc_mutex.h" #include "apr_file_io.h" struct apr_proc_mutex_t { apr_pool_t *pool; HMTX hMutex; TID owner; int lock_count; }; #endif /* PROC_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/os2/apr_arch_thread_cond.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_COND_H #define THREAD_COND_H #include "apr_thread_cond.h" #include "apr_file_io.h" struct apr_thread_cond_t { apr_pool_t *pool; }; #endif /* THREAD_COND_H */ ================================================ FILE: third_party/include/apr/arch/os2/apr_arch_thread_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H #include "apr_thread_mutex.h" #include "apr_file_io.h" struct apr_thread_mutex_t { apr_pool_t *pool; HMTX hMutex; }; #endif /* THREAD_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/os2/apr_arch_thread_rwlock.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_RWLOCK_H #define THREAD_RWLOCK_H #include "apr_thread_rwlock.h" #include "apr_file_io.h" struct apr_thread_rwlock_t { apr_pool_t *pool; int readers; HMTX write_lock; HEV read_done; }; #endif /* THREAD_RWLOCK_H */ ================================================ FILE: third_party/include/apr/arch/os2/apr_arch_threadproc.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apr_thread_proc.h" #include "apr_file_io.h" #ifndef THREAD_PROC_H #define THREAD_PROC_H #define APR_THREADATTR_DETACHED 1 #define SHELL_PATH "cmd.exe" #define APR_THREAD_STACKSIZE 65536 struct apr_threadattr_t { apr_pool_t *pool; unsigned long attr; apr_size_t stacksize; }; struct apr_thread_t { apr_pool_t *pool; struct apr_threadattr_t *attr; unsigned long tid; apr_thread_start_t func; void *data; apr_status_t exitval; }; struct apr_threadkey_t { apr_pool_t *pool; unsigned long *key; }; struct apr_procattr_t { apr_pool_t *pool; apr_file_t *parent_in; apr_file_t *child_in; apr_file_t *parent_out; apr_file_t *child_out; apr_file_t *parent_err; apr_file_t *child_err; char *currdir; apr_int32_t cmdtype; apr_int32_t detached; }; struct apr_thread_once_t { unsigned long sem; char hit; }; #endif /* ! THREAD_PROC_H */ ================================================ FILE: third_party/include/apr/arch/os390/apr_arch_dso.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef DSO_H #define DSO_H #include "apr_private.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" #include "apr.h" #if APR_HAS_DSO #include struct apr_dso_handle_t { dllhandle *handle; /* Handle to the DSO loaded */ int failing_errno; /* Don't save the buffer returned by strerror(); it gets reused */ apr_pool_t *pool; }; #endif #endif ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_atomic.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ATOMIC_H #define ATOMIC_H #include "apr.h" #include "apr_private.h" #include "apr_atomic.h" #include "apr_thread_mutex.h" #if defined(USE_ATOMICS_GENERIC) /* noop */ #elif defined(__GNUC__) && defined(__STRICT_ANSI__) /* force use of generic atomics if building e.g. with -std=c89, which * doesn't allow inline asm */ # define USE_ATOMICS_GENERIC #elif HAVE_ATOMIC_BUILTINS # define USE_ATOMICS_BUILTINS #elif defined(SOLARIS2) && SOLARIS2 >= 10 # define USE_ATOMICS_SOLARIS #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) # define USE_ATOMICS_IA32 #elif defined(__GNUC__) && (defined(__PPC__) || defined(__ppc__)) # define USE_ATOMICS_PPC #elif defined(__GNUC__) && (defined(__s390__) || defined(__s390x__)) # define USE_ATOMICS_S390 #else # define USE_ATOMICS_GENERIC #endif #endif /* ATOMIC_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_dso.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef DSO_H #define DSO_H #include "apr_private.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" #include "apr.h" #if APR_HAS_DSO #ifdef HAVE_MACH_O_DYLD_H #include #endif #ifdef HAVE_DLFCN_H #include #endif #ifdef HAVE_DL_H #include #endif #ifndef RTLD_NOW #define RTLD_NOW 1 #endif #ifndef RTLD_GLOBAL #define RTLD_GLOBAL 0 #endif #if (defined(__DragonFly__) ||\ defined(__FreeBSD__) ||\ defined(__OpenBSD__) ||\ defined(__NetBSD__) ) && !defined(__ELF__) #define DLSYM_NEEDS_UNDERSCORE #endif struct apr_dso_handle_t { apr_pool_t *pool; void *handle; const char *errormsg; }; #endif #endif ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_file_io.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FILE_IO_H #define FILE_IO_H #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_tables.h" #include "apr_file_io.h" #include "apr_file_info.h" #include "apr_errno.h" #include "apr_lib.h" #include "apr_thread_mutex.h" #ifndef WAITIO_USES_POLL #include "apr_poll.h" #endif /* System headers the file I/O library needs */ #if APR_HAVE_FCNTL_H #include #endif #if APR_HAVE_SYS_TYPES_H #include #endif #if APR_HAVE_ERRNO_H #include #endif #if APR_HAVE_STRING_H #include #endif #if APR_HAVE_STRINGS_H #include #endif #if APR_HAVE_DIRENT_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #if APR_HAVE_UNISTD_H #include #endif #if APR_HAVE_STDIO_H #include #endif #if APR_HAVE_STDLIB_H #include #endif #if APR_HAVE_SYS_UIO_H #include #endif #if APR_HAVE_SYS_TIME_H #include #endif #ifdef BEOS #include #endif /* Hunting down DEV_BSIZE if not from dirent.h, sys/stat.h etc */ #ifdef HAVE_SYS_PARAM_H #include #endif #if BEOS_BONE # ifndef BONE7 /* prior to BONE/7 fd_set & select were defined in sys/socket.h */ # include # else /* Be moved the fd_set stuff and also the FIONBIO definition... */ # include # endif #endif /* End System headers */ #define APR_FILE_DEFAULT_BUFSIZE 4096 /* For backwards-compat */ #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE struct apr_file_t { apr_pool_t *pool; int filedes; char *fname; apr_int32_t flags; int eof_hit; int is_pipe; apr_interval_time_t timeout; int buffered; enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking; int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/ #ifndef WAITIO_USES_POLL /* if there is a timeout set, then this pollset is used */ apr_pollset_t *pollset; #endif /* Stuff for buffered mode */ char *buffer; apr_size_t bufpos; /* Read/Write position in buffer */ apr_size_t bufsize; /* The size of the buffer */ unsigned long dataRead; /* amount of valid data read into buffer */ int direction; /* buffer being used for 0 = read, 1 = write */ apr_off_t filePtr; /* position in file of handle */ #if APR_HAS_THREADS struct apr_thread_mutex_t *thlock; #endif }; #if APR_HAS_THREADS #define file_lock(f) do { \ if ((f)->thlock) \ apr_thread_mutex_lock((f)->thlock); \ } while (0) #define file_unlock(f) do { \ if ((f)->thlock) \ apr_thread_mutex_unlock((f)->thlock); \ } while (0) #else #define file_lock(f) do {} while (0) #define file_unlock(f) do {} while (0) #endif #if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE) #define stat(f,b) stat64(f,b) #define lstat(f,b) lstat64(f,b) #define fstat(f,b) fstat64(f,b) #define lseek(f,o,w) lseek64(f,o,w) #define ftruncate(f,l) ftruncate64(f,l) typedef struct stat64 struct_stat; #else typedef struct stat struct_stat; #endif /* readdir64_r is only used in specific cases: */ #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && !defined(READDIR_IS_THREAD_SAFE) && defined(HAVE_READDIR64_R) #define APR_USE_READDIR64_R #endif struct apr_dir_t { apr_pool_t *pool; char *dirname; DIR *dirstruct; #ifdef APR_USE_READDIR64_R struct dirent64 *entry; #else struct dirent *entry; #endif }; apr_status_t apr_unix_file_cleanup(void *); apr_status_t apr_unix_child_file_cleanup(void *); mode_t apr_unix_perms2mode(apr_fileperms_t perms); apr_fileperms_t apr_unix_mode2perms(mode_t mode); apr_status_t apr_file_flush_locked(apr_file_t *thefile); apr_status_t apr_file_info_get_locked(apr_finfo_t *finfo, apr_int32_t wanted, apr_file_t *thefile); #endif /* ! FILE_IO_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_global_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef GLOBAL_MUTEX_H #define GLOBAL_MUTEX_H #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_global_mutex.h" #include "apr_arch_proc_mutex.h" #include "apr_arch_thread_mutex.h" struct apr_global_mutex_t { apr_pool_t *pool; apr_proc_mutex_t *proc_mutex; #if APR_HAS_THREADS apr_thread_mutex_t *thread_mutex; #endif /* APR_HAS_THREADS */ }; #endif /* GLOBAL_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_inherit.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef INHERIT_H #define INHERIT_H #include "apr_inherit.h" #define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ if (the##name->flag & APR_FOPEN_NOCLEANUP) \ return APR_EINVAL; \ if (!(the##name->flag & APR_INHERIT)) { \ int flags = fcntl(the##name->name##des, F_GETFD); \ if (flags == -1) \ return errno; \ flags &= ~(FD_CLOEXEC); \ if (fcntl(the##name->name##des, F_SETFD, flags) == -1) \ return errno; \ the##name->flag |= APR_INHERIT; \ apr_pool_child_cleanup_set(the##name->pool, \ (void *)the##name, \ cleanup, apr_pool_cleanup_null); \ } \ return APR_SUCCESS; \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \ { \ if (the##name->flag & APR_FOPEN_NOCLEANUP) \ return APR_EINVAL; \ if (the##name->flag & APR_INHERIT) { \ int flags; \ if ((flags = fcntl(the##name->name##des, F_GETFD)) == -1) \ return errno; \ flags |= FD_CLOEXEC; \ if (fcntl(the##name->name##des, F_SETFD, flags) == -1) \ return errno; \ the##name->flag &= ~APR_INHERIT; \ apr_pool_child_cleanup_set(the##name->pool, \ (void *)the##name, \ cleanup, cleanup); \ } \ return APR_SUCCESS; \ } #endif /* ! INHERIT_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_internal_time.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TIME_INTERNAL_H #define TIME_INTERNAL_H #include "apr.h" void apr_unix_setup_time(void); #endif /* TIME_INTERNAL_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_misc.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MISC_H #define MISC_H #include "apr.h" #include "apr_portable.h" #include "apr_private.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_getopt.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_errno.h" #include "apr_getopt.h" #if APR_HAVE_STDIO_H #include #endif #if APR_HAVE_SIGNAL_H #include #endif #if APR_HAVE_PTHREAD_H #include #endif #if APR_HAVE_STDLIB_H #include #endif #if APR_HAVE_STRING_H #include #endif #ifdef BEOS #include #endif struct apr_other_child_rec_t { apr_pool_t *p; struct apr_other_child_rec_t *next; apr_proc_t *proc; void (*maintenance) (int, void *, int); void *data; apr_os_file_t write_fd; }; #if defined(WIN32) || defined(NETWARE) #define WSAHighByte 2 #define WSALowByte 0 #endif #endif /* ! MISC_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_networkio.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef NETWORK_IO_H #define NETWORK_IO_H #include "apr.h" #include "apr_private.h" #include "apr_network_io.h" #include "apr_errno.h" #include "apr_general.h" #include "apr_lib.h" #ifndef WAITIO_USES_POLL #include "apr_poll.h" #endif /* System headers the network I/O library needs */ #if APR_HAVE_SYS_TYPES_H #include #endif #if APR_HAVE_SYS_UIO_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #if APR_HAVE_ERRNO_H #include #endif #if APR_HAVE_SYS_TIME_H #include #endif #if APR_HAVE_UNISTD_H #include #endif #if APR_HAVE_STRING_H #include #endif #if APR_HAVE_NETINET_TCP_H #include #endif #if APR_HAVE_NETINET_SCTP_UIO_H #include #endif #if APR_HAVE_NETINET_SCTP_H #include #endif #if APR_HAVE_NETINET_IN_H #include #endif #if APR_HAVE_ARPA_INET_H #include #endif #if APR_HAVE_SYS_SOCKET_H #include #endif #if APR_HAVE_SYS_SOCKIO_H #include #endif #if APR_HAVE_NETDB_H #include #endif #if APR_HAVE_FCNTL_H #include #endif #if APR_HAVE_SYS_SENDFILE_H #include #endif #if APR_HAVE_SYS_IOCTL_H #include #endif /* End System Headers */ #ifndef HAVE_POLLIN #define POLLIN 1 #define POLLPRI 2 #define POLLOUT 4 #define POLLERR 8 #define POLLHUP 16 #define POLLNVAL 32 #endif typedef struct sock_userdata_t sock_userdata_t; struct sock_userdata_t { sock_userdata_t *next; const char *key; void *data; }; struct apr_socket_t { apr_pool_t *pool; int socketdes; int type; int protocol; apr_sockaddr_t *local_addr; apr_sockaddr_t *remote_addr; apr_interval_time_t timeout; #ifndef HAVE_POLL int connected; #endif int local_port_unknown; int local_interface_unknown; int remote_addr_unknown; apr_int32_t options; apr_int32_t inherit; sock_userdata_t *userdata; #ifndef WAITIO_USES_POLL /* if there is a timeout set, then this pollset is used */ apr_pollset_t *pollset; #endif }; const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); #define apr_is_option_set(skt, option) \ (((skt)->options & (option)) == (option)) #define apr_set_option(skt, option, on) \ do { \ if (on) \ (skt)->options |= (option); \ else \ (skt)->options &= ~(option); \ } while (0) #endif /* ! NETWORK_IO_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_poll_private.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_ARCH_POLL_PRIVATE_H #define APR_ARCH_POLL_PRIVATE_H #if HAVE_POLL_H #include #endif #if HAVE_SYS_POLL_H #include #endif #ifdef HAVE_PORT_CREATE #include #include #endif #ifdef HAVE_KQUEUE #include #include #include #endif #ifdef HAVE_EPOLL #include #endif #ifdef NETWARE #define HAS_SOCKETS(dt) (dt == APR_POLL_SOCKET) ? 1 : 0 #define HAS_PIPES(dt) (dt == APR_POLL_FILE) ? 1 : 0 #endif #if defined(HAVE_AIO_H) && defined(HAVE_AIO_MSGQ) #define _AIO_OS390 /* enable a bunch of z/OS aio.h definitions */ #include /* aiocb */ #endif /* Choose the best method platform specific to use in apr_pollset */ #ifdef HAVE_KQUEUE #define POLLSET_USES_KQUEUE #define POLLSET_DEFAULT_METHOD APR_POLLSET_KQUEUE #elif defined(HAVE_PORT_CREATE) #define POLLSET_USES_PORT #define POLLSET_DEFAULT_METHOD APR_POLLSET_PORT #elif defined(HAVE_EPOLL) #define POLLSET_USES_EPOLL #define POLLSET_DEFAULT_METHOD APR_POLLSET_EPOLL #elif defined(HAVE_AIO_MSGQ) #define POLLSET_USES_AIO_MSGQ #define POLLSET_DEFAULT_METHOD APR_POLLSET_AIO_MSGQ #elif defined(HAVE_POLL) #define POLLSET_USES_POLL #define POLLSET_DEFAULT_METHOD APR_POLLSET_POLL #else #define POLLSET_USES_SELECT #define POLLSET_DEFAULT_METHOD APR_POLLSET_SELECT #endif #ifdef WIN32 #define POLL_USES_SELECT #undef POLLSET_DEFAULT_METHOD #define POLLSET_DEFAULT_METHOD APR_POLLSET_SELECT #else #ifdef HAVE_POLL #define POLL_USES_POLL #else #define POLL_USES_SELECT #endif #endif #if defined(POLLSET_USES_KQUEUE) || defined(POLLSET_USES_EPOLL) || defined(POLLSET_USES_PORT) || defined(POLLSET_USES_AIO_MSGQ) #include "apr_ring.h" #if APR_HAS_THREADS #include "apr_thread_mutex.h" #define pollset_lock_rings() \ if (pollset->flags & APR_POLLSET_THREADSAFE) \ apr_thread_mutex_lock(pollset->p->ring_lock); #define pollset_unlock_rings() \ if (pollset->flags & APR_POLLSET_THREADSAFE) \ apr_thread_mutex_unlock(pollset->p->ring_lock); #else #define pollset_lock_rings() #define pollset_unlock_rings() #endif typedef struct pfd_elem_t pfd_elem_t; struct pfd_elem_t { APR_RING_ENTRY(pfd_elem_t) link; apr_pollfd_t pfd; #ifdef HAVE_PORT_CREATE int on_query_ring; #endif }; #endif typedef struct apr_pollset_private_t apr_pollset_private_t; typedef struct apr_pollset_provider_t apr_pollset_provider_t; typedef struct apr_pollcb_provider_t apr_pollcb_provider_t; struct apr_pollset_t { apr_pool_t *pool; apr_uint32_t nelts; apr_uint32_t nalloc; apr_uint32_t flags; /* Pipe descriptors used for wakeup */ apr_file_t *wakeup_pipe[2]; apr_pollfd_t wakeup_pfd; apr_pollset_private_t *p; apr_pollset_provider_t *provider; }; typedef union { #if defined(HAVE_EPOLL) struct epoll_event *epoll; #endif #if defined(HAVE_PORT_CREATE) port_event_t *port; #endif #if defined(HAVE_KQUEUE) struct kevent *ke; #endif #if defined(HAVE_POLL) struct pollfd *ps; #endif void *undef; } apr_pollcb_pset; struct apr_pollcb_t { apr_pool_t *pool; apr_uint32_t nelts; apr_uint32_t nalloc; int fd; apr_pollcb_pset pollset; apr_pollfd_t **copyset; apr_pollcb_provider_t *provider; }; struct apr_pollset_provider_t { apr_status_t (*create)(apr_pollset_t *, apr_uint32_t, apr_pool_t *, apr_uint32_t); apr_status_t (*add)(apr_pollset_t *, const apr_pollfd_t *); apr_status_t (*remove)(apr_pollset_t *, const apr_pollfd_t *); apr_status_t (*poll)(apr_pollset_t *, apr_interval_time_t, apr_int32_t *, const apr_pollfd_t **); apr_status_t (*cleanup)(apr_pollset_t *); const char *name; }; struct apr_pollcb_provider_t { apr_status_t (*create)(apr_pollcb_t *, apr_uint32_t, apr_pool_t *, apr_uint32_t); apr_status_t (*add)(apr_pollcb_t *, apr_pollfd_t *); apr_status_t (*remove)(apr_pollcb_t *, apr_pollfd_t *); apr_status_t (*poll)(apr_pollcb_t *, apr_interval_time_t, apr_pollcb_cb_t, void *); const char *name; }; /* Private functions */ void apr_pollset_drain_wakeup_pipe(apr_pollset_t *pollset); #endif /* APR_ARCH_POLL_PRIVATE_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_proc_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PROC_MUTEX_H #define PROC_MUTEX_H #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_proc_mutex.h" #include "apr_pools.h" #include "apr_portable.h" #include "apr_file_io.h" #include "apr_arch_file_io.h" /* System headers required by Locks library */ #if APR_HAVE_SYS_TYPES_H #include #endif #if APR_HAVE_STDIO_H #include #endif #if APR_HAVE_FCNTL_H #include #endif #ifdef HAVE_SYS_IPC_H #include #endif #ifdef HAVE_SYS_SEM_H #include #endif #ifdef HAVE_SYS_FILE_H #include #endif #if APR_HAVE_STDLIB_H #include #endif #if APR_HAVE_UNISTD_H #include #endif #if APR_HAVE_STRING_H #include #endif #ifdef HAVE_SYS_MMAN_H #include #endif #if APR_HAVE_PTHREAD_H #include #endif #if APR_HAVE_SEMAPHORE_H #include #endif /* End System Headers */ struct apr_proc_mutex_unix_lock_methods_t { unsigned int flags; apr_status_t (*create)(apr_proc_mutex_t *, const char *); apr_status_t (*acquire)(apr_proc_mutex_t *); apr_status_t (*tryacquire)(apr_proc_mutex_t *); apr_status_t (*release)(apr_proc_mutex_t *); apr_status_t (*cleanup)(void *); apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *); const char *name; }; typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t; /* bit values for flags field in apr_unix_lock_methods_t */ #define APR_PROCESS_LOCK_MECH_IS_GLOBAL 1 #if !APR_HAVE_UNION_SEMUN && defined(APR_HAS_SYSVSEM_SERIALIZE) union semun { int val; struct semid_ds *buf; unsigned short *array; }; #endif struct apr_proc_mutex_t { apr_pool_t *pool; const apr_proc_mutex_unix_lock_methods_t *meth; const apr_proc_mutex_unix_lock_methods_t *inter_meth; int curr_locked; char *fname; #if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE apr_file_t *interproc; #endif #if APR_HAS_POSIXSEM_SERIALIZE sem_t *psem_interproc; #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE pthread_mutex_t *pthread_interproc; #endif }; void apr_proc_mutex_unix_setup_lock(void); #endif /* PROC_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_shm.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SHM_H #define SHM_H #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_shm.h" #include "apr_pools.h" #include "apr_file_io.h" #include "apr_network_io.h" #include "apr_portable.h" #if APR_HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_MMAN_H #include #endif #ifdef HAVE_SYS_IPC_H #include #endif #ifdef HAVE_SYS_MUTEX_H #include #endif #ifdef HAVE_SYS_SHM_H #include #endif #if !defined(SHM_R) #define SHM_R 0400 #endif #if !defined(SHM_W) #define SHM_W 0200 #endif #ifdef HAVE_SYS_FILE_H #include #endif /* Not all systems seem to have MAP_FAILED defined, but it should always * just be (void *)-1. */ #ifndef MAP_FAILED #define MAP_FAILED ((void *)-1) #endif struct apr_shm_t { apr_pool_t *pool; void *base; /* base real address */ void *usable; /* base usable address */ apr_size_t reqsize; /* requested segment size */ apr_size_t realsize; /* actual segment size */ const char *filename; /* NULL if anonymous */ #if APR_USE_SHMEM_SHMGET || APR_USE_SHMEM_SHMGET_ANON int shmid; /* shmem ID returned from shmget() */ #endif }; #endif /* SHM_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_thread_cond.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_COND_H #define THREAD_COND_H #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_lib.h" #include "apr_thread_mutex.h" #include "apr_thread_cond.h" #include "apr_pools.h" #if APR_HAVE_PTHREAD_H #include #endif /* XXX: Should we have a better autoconf search, something like * APR_HAS_PTHREAD_COND? -aaron */ #if APR_HAS_THREADS struct apr_thread_cond_t { apr_pool_t *pool; pthread_cond_t cond; }; #endif #endif /* THREAD_COND_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_thread_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_thread_mutex.h" #include "apr_portable.h" #include "apr_atomic.h" #if APR_HAVE_PTHREAD_H #include #endif #if APR_HAS_THREADS struct apr_thread_mutex_t { apr_pool_t *pool; pthread_mutex_t mutex; }; #endif #endif /* THREAD_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_thread_rwlock.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_RWLOCK_H #define THREAD_RWLOCK_H #include "apr.h" #include "apr_private.h" #include "apr_general.h" #include "apr_thread_rwlock.h" #include "apr_pools.h" #if APR_HAVE_PTHREAD_H /* this gives us pthread_rwlock_t */ #include #endif #if APR_HAS_THREADS #ifdef HAVE_PTHREAD_RWLOCKS struct apr_thread_rwlock_t { apr_pool_t *pool; pthread_rwlock_t rwlock; }; #else struct apr_thread_rwlock_t { apr_pool_t *pool; }; #endif #endif #endif /* THREAD_RWLOCK_H */ ================================================ FILE: third_party/include/apr/arch/unix/apr_arch_threadproc.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apr.h" #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_arch_file_io.h" /* System headers required for thread/process library */ #if APR_HAVE_PTHREAD_H #include #endif #ifdef HAVE_SYS_RESOURCE_H #include #endif #if APR_HAVE_SIGNAL_H #include #endif #if APR_HAVE_STRING_H #include #endif #if APR_HAVE_SYS_WAIT_H #include #endif #if APR_HAVE_STRING_H #include #endif #ifdef HAVE_SCHED_H #include #endif /* End System Headers */ #ifndef THREAD_PROC_H #define THREAD_PROC_H #define SHELL_PATH "/bin/sh" #if APR_HAS_THREADS struct apr_thread_t { apr_pool_t *pool; pthread_t *td; void *data; apr_thread_start_t func; apr_status_t exitval; }; struct apr_threadattr_t { apr_pool_t *pool; pthread_attr_t attr; }; struct apr_threadkey_t { apr_pool_t *pool; pthread_key_t key; }; struct apr_thread_once_t { pthread_once_t once; }; #endif struct apr_procattr_t { apr_pool_t *pool; apr_file_t *parent_in; apr_file_t *child_in; apr_file_t *parent_out; apr_file_t *child_out; apr_file_t *parent_err; apr_file_t *child_err; char *currdir; apr_int32_t cmdtype; apr_int32_t detached; #ifdef RLIMIT_CPU struct rlimit *limit_cpu; #endif #if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) struct rlimit *limit_mem; #endif #ifdef RLIMIT_NPROC struct rlimit *limit_nproc; #endif #ifdef RLIMIT_NOFILE struct rlimit *limit_nofile; #endif apr_child_errfn_t *errfn; apr_int32_t errchk; apr_uid_t uid; apr_gid_t gid; }; #endif /* ! THREAD_PROC_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_atime.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ATIME_H #define ATIME_H #include "apr_private.h" #include "apr_time.h" #if APR_HAVE_TIME_H #include #endif struct atime_t { apr_pool_t *cntxt; apr_time_t currtime; SYSTEMTIME *explodedtime; }; /* Number of micro-seconds between the beginning of the Windows epoch * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970) */ #define APR_DELTA_EPOCH_IN_USEC APR_TIME_C(11644473600000000); static APR_INLINE void FileTimeToAprTime(apr_time_t *result, FILETIME *input) { /* Convert FILETIME one 64 bit number so we can work with it. */ *result = input->dwHighDateTime; *result = (*result) << 32; *result |= input->dwLowDateTime; *result /= 10; /* Convert from 100 nano-sec periods to micro-seconds. */ *result -= APR_DELTA_EPOCH_IN_USEC; /* Convert from Windows epoch to Unix epoch */ return; } static APR_INLINE void AprTimeToFileTime(LPFILETIME pft, apr_time_t t) { LONGLONG ll; t += APR_DELTA_EPOCH_IN_USEC; ll = t * 10; pft->dwLowDateTime = (DWORD)ll; pft->dwHighDateTime = (DWORD) (ll >> 32); return; } #endif /* ! ATIME_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_dso.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef DSO_H #define DSO_H #include "apr_private.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_dso.h" #include "apr.h" #if APR_HAS_DSO struct apr_dso_handle_t { apr_pool_t *cont; void *handle; apr_status_t load_error; }; #endif #endif ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_file_io.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FILE_IO_H #define FILE_IO_H #include "apr.h" #include "apr_private.h" #include "apr_pools.h" #include "apr_general.h" #include "apr_tables.h" #include "apr_thread_mutex.h" #include "apr_file_io.h" #include "apr_file_info.h" #include "apr_errno.h" #include "apr_arch_misc.h" #include "apr_poll.h" #ifdef HAVE_SYS_STAT_H #include #endif #if APR_HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_FCNTL_H #include #endif #ifdef HAVE_TIME_H #include #endif #if APR_HAVE_DIRENT_H #include #endif #ifdef HAVE_MALLOC_H #include #endif #if APR_HAS_UNICODE_FS #include "arch/win32/apr_arch_utf8.h" #include /* Helper functions for the WinNT ApiW() functions. APR treats all * resource identifiers (files, etc) by their UTF-8 name, to provide * access to all named identifiers. [UTF-8 completely maps Unicode * into char type strings.] * * The _path flavors below provide us fast mappings of the * Unicode filename //?/D:/path and //?/UNC/mach/share/path mappings, * which allow unlimited (well, 32000 wide character) length names. * These prefixes may appear in Unicode, but must not appear in the * Ascii API calls. So we tack them on in utf8_to_unicode_path, and * strip them right back off in unicode_to_utf8_path. */ apr_status_t utf8_to_unicode_path(apr_wchar_t* dststr, apr_size_t dstchars, const char* srcstr); apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars, const apr_wchar_t* srcstr); #endif /* APR_HAS_UNICODE_FS */ /* Another Helper functions for the WinNT ApiW() functions. We need to * derive some 'resource' names (max length 255 characters, prefixed with * Global/ or Local/ on WinNT) from something that looks like a filename. * Since 'resource' names never contain slashes, convert these to '_'s * and return the appropriate char* or wchar* for ApiA or ApiW calls. */ void *res_name_from_filename(const char *file, int global, apr_pool_t *pool); #define APR_FILE_MAX MAX_PATH #define APR_FILE_DEFAULT_BUFSIZE 4096 /* For backwards-compat */ #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE /* obscure ommissions from msvc's sys/stat.h */ #ifdef _MSC_VER #define S_IFIFO _S_IFIFO /* pipe */ #define S_IFBLK 0060000 /* Block Special */ #define S_IFLNK 0120000 /* Symbolic Link */ #define S_IFSOCK 0140000 /* Socket */ #define S_IFWHT 0160000 /* Whiteout */ #endif /* Internal Flags for apr_file_open */ #define APR_OPENINFO 0x00100000 /* Open without READ or WRITE access */ #define APR_OPENLINK 0x00200000 /* Open a link itself, if supported */ #define APR_READCONTROL 0x00400000 /* Read the file's owner/perms */ #define APR_WRITECONTROL 0x00800000 /* Modify the file's owner/perms */ /* #define APR_INHERIT 0x01000000 -- Defined in apr_arch_inherit.h! */ #define APR_STDIN_FLAG 0x02000000 /* Obtained via apr_file_open_stdin() */ #define APR_STDOUT_FLAG 0x04000000 /* Obtained via apr_file_open_stdout() */ #define APR_STDERR_FLAG 0x06000000 /* Obtained via apr_file_open_stderr() */ #define APR_STD_FLAGS (APR_STDIN_FLAG | APR_STDOUT_FLAG | APR_STDERR_FLAG) #define APR_WRITEATTRS 0x08000000 /* Modify the file's attributes */ /* Entries missing from the MSVC 5.0 Win32 SDK: */ #ifndef FILE_ATTRIBUTE_DEVICE #define FILE_ATTRIBUTE_DEVICE 0x00000040 #endif #ifndef FILE_ATTRIBUTE_REPARSE_POINT #define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 #endif #ifndef FILE_FLAG_OPEN_NO_RECALL #define FILE_FLAG_OPEN_NO_RECALL 0x00100000 #endif #ifndef FILE_FLAG_OPEN_REPARSE_POINT #define FILE_FLAG_OPEN_REPARSE_POINT 0x00200000 #endif #ifndef TRUSTEE_IS_WELL_KNOWN_GROUP #define TRUSTEE_IS_WELL_KNOWN_GROUP 5 #endif /* Information bits available from the WIN32 FindFirstFile function */ #define APR_FINFO_WIN32_DIR (APR_FINFO_NAME | APR_FINFO_TYPE \ | APR_FINFO_CTIME | APR_FINFO_ATIME \ | APR_FINFO_MTIME | APR_FINFO_SIZE) /* Sneak the Readonly bit through finfo->protection for internal use _only_ */ #define APR_FREADONLY 0x10000000 /* Private function for apr_stat/lstat/getfileinfo/dir_read */ int fillin_fileinfo(apr_finfo_t *finfo, WIN32_FILE_ATTRIBUTE_DATA *wininfo, int byhandle, apr_int32_t wanted); /* Private function that extends apr_stat/lstat/getfileinfo/dir_read */ apr_status_t more_finfo(apr_finfo_t *finfo, const void *ufile, apr_int32_t wanted, int whatfile); /* whatfile types for the ufile arg */ #define MORE_OF_HANDLE 0 #define MORE_OF_FSPEC 1 #define MORE_OF_WFSPEC 2 /* quick run-down of fields in windows' apr_file_t structure that may have * obvious uses. * fname -- the filename as passed to the open call. * dwFileAttricutes -- Attributes used to open the file. * append -- Windows doesn't support the append concept when opening files. * APR needs to keep track of this, and always make sure we append * correctly when writing to a file with this flag set TRUE. */ /* for apr_poll.c */ #define filedes filehand struct apr_file_t { apr_pool_t *pool; HANDLE filehand; BOOLEAN pipe; /* Is this a pipe of a file? */ OVERLAPPED *pOverlapped; apr_interval_time_t timeout; apr_int32_t flags; /* File specific info */ apr_finfo_t *finfo; char *fname; DWORD dwFileAttributes; int eof_hit; BOOLEAN buffered; /* Use buffered I/O? */ int ungetchar; /* Last char provided by an unget op. (-1 = no char) */ int append; /* Stuff for buffered mode */ char *buffer; apr_size_t bufpos; /* Read/Write position in buffer */ apr_size_t bufsize; /* The size of the buffer */ apr_size_t dataRead; /* amount of valid data read into buffer */ int direction; /* buffer being used for 0 = read, 1 = write */ apr_off_t filePtr; /* position in file of handle */ apr_thread_mutex_t *mutex; /* mutex semaphore, must be owned to access * the above fields */ #if APR_FILES_AS_SOCKETS /* if there is a timeout set, then this pollset is used */ apr_pollset_t *pollset; #endif /* Pipe specific info */ }; struct apr_dir_t { apr_pool_t *pool; HANDLE dirhand; apr_size_t rootlen; char *dirname; char *name; union { #if APR_HAS_UNICODE_FS struct { WIN32_FIND_DATAW *entry; } w; #endif #if APR_HAS_ANSI_FS struct { WIN32_FIND_DATAA *entry; } n; #endif }; int bof; }; /* There are many goofy characters the filesystem can't accept * or can confound the cmd.exe shell. Here's the list * [declared in filesys.c] */ extern const char apr_c_is_fnchar[256]; #define IS_FNCHAR(c) (apr_c_is_fnchar[(unsigned char)(c)] & 1) #define IS_SHCHAR(c) ((apr_c_is_fnchar[(unsigned char)(c)] & 2) == 2) /* If the user passes APR_FILEPATH_TRUENAME to either * apr_filepath_root or apr_filepath_merge, this fn determines * that the root really exists. It's expensive, wouldn't want * to do this too frequenly. */ apr_status_t filepath_root_test(char *path, apr_pool_t *p); /* The apr_filepath_merge wants to canonicalize the cwd to the * addpath if the user passes NULL as the old root path (this * isn't true of an empty string "", which won't be concatenated. * * But we need to figure out what the cwd of a given volume is, * when the user passes D:foo. This fn will determine D:'s cwd. * * If flags includes the bit APR_FILEPATH_NATIVE, the path returned * is in the os-native format. */ apr_status_t filepath_drive_get(char **rootpath, char drive, apr_int32_t flags, apr_pool_t *p); /* If the user passes d: vs. D: (or //mach/share vs. //MACH/SHARE), * we need to fold the case to canonical form. This function is * supposed to do so. */ apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p); apr_status_t file_cleanup(void *); extern apr_status_t apr_file_socket_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *p); extern apr_status_t apr_file_socket_pipe_close(apr_file_t *file); #endif /* ! FILE_IO_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_inherit.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef INHERIT_H #define INHERIT_H #include "apr_inherit.h" #define APR_INHERIT (1 << 24) /* Must not conflict with other bits */ #if APR_HAS_UNICODE_FS && APR_HAS_ANSI_FS /* !defined(_WIN32_WCE) is implicit here */ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ IF_WIN_OS_IS_UNICODE \ { \ /* if (!SetHandleInformation(the##name->filehand, \ * HANDLE_FLAG_INHERIT, \ * HANDLE_FLAG_INHERIT)) \ * return apr_get_os_error(); \ */ } \ ELSE_WIN_OS_IS_ANSI \ { \ HANDLE temp, hproc = GetCurrentProcess(); \ if (!DuplicateHandle(hproc, the##name->filehand, \ hproc, &temp, 0, TRUE, \ DUPLICATE_SAME_ACCESS)) \ return apr_get_os_error(); \ CloseHandle(the##name->filehand); \ the##name->filehand = temp; \ } \ return APR_SUCCESS; \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ { \ IF_WIN_OS_IS_UNICODE \ { \ /* if (!SetHandleInformation(the##name->filehand, \ * HANDLE_FLAG_INHERIT, 0)) \ * return apr_get_os_error(); \ */ } \ ELSE_WIN_OS_IS_ANSI \ { \ HANDLE temp, hproc = GetCurrentProcess(); \ if (!DuplicateHandle(hproc, the##name->filehand, \ hproc, &temp, 0, FALSE, \ DUPLICATE_SAME_ACCESS)) \ return apr_get_os_error(); \ CloseHandle(the##name->filehand); \ the##name->filehand = temp; \ } \ return APR_SUCCESS; \ } #elif APR_HAS_ANSI_FS || defined(_WIN32_WCE) #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ HANDLE temp, hproc = GetCurrentProcess(); \ if (!DuplicateHandle(hproc, the##name->filehand, \ hproc, &temp, 0, TRUE, \ DUPLICATE_SAME_ACCESS)) \ return apr_get_os_error(); \ CloseHandle(the##name->filehand); \ the##name->filehand = temp; \ return APR_SUCCESS; \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ { \ HANDLE temp, hproc = GetCurrentProcess(); \ if (!DuplicateHandle(hproc, the##name->filehand, \ hproc, &temp, 0, FALSE, \ DUPLICATE_SAME_ACCESS)) \ return apr_get_os_error(); \ CloseHandle(the##name->filehand); \ the##name->filehand = temp; \ return APR_SUCCESS; \ } #else /* APR_HAS_UNICODE_FS && !APR_HAS_ANSI_FS && !defined(_WIN32_WCE) */ #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup) \ APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \ { \ /* if (!SetHandleInformation(the##name->filehand, \ * HANDLE_FLAG_INHERIT, \ * HANDLE_FLAG_INHERIT)) \ * return apr_get_os_error(); \ */ return APR_SUCCESS; \ } #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup) \ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\ { \ /* if (!SetHandleInformation(the##name->filehand, \ * HANDLE_FLAG_INHERIT, 0)) \ * return apr_get_os_error(); \ */ return APR_SUCCESS; \ } #endif /* defined(APR_HAS_UNICODE_FS) */ #endif /* ! INHERIT_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_misc.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MISC_H #define MISC_H #include "apr.h" #include "apr_portable.h" #include "apr_private.h" #include "apr_general.h" #include "apr_pools.h" #include "apr_getopt.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #include "apr_errno.h" #include "apr_getopt.h" #if APR_HAVE_STDIO_H #include #endif #if APR_HAVE_SIGNAL_H #include #endif #if APR_HAVE_PTHREAD_H #include #endif #if APR_HAVE_STDLIB_H #include #endif #if APR_HAVE_STRING_H #include #endif #ifndef _WIN32_WCE #include #endif struct apr_other_child_rec_t { apr_pool_t *p; struct apr_other_child_rec_t *next; apr_proc_t *proc; void (*maintenance) (int, void *, int); void *data; apr_os_file_t write_fd; }; #define WSAHighByte 2 #define WSALowByte 0 /* start.c and apr_app.c helpers and communication within misc.c * * They are not for public consumption, although apr_app_init_complete * must be an exported symbol to avoid reinitialization. */ extern int APR_DECLARE_DATA apr_app_init_complete; int apr_wastrtoastr(char const * const * *retarr, wchar_t const * const *arr, int args); /* Platform specific designation of run time os version. * Gaps allow for specific service pack levels that * export new kernel or winsock functions or behavior. */ typedef enum { APR_WIN_UNK = 0, APR_WIN_UNSUP = 1, APR_WIN_95 = 10, APR_WIN_95_B = 11, APR_WIN_95_OSR2 = 12, APR_WIN_98 = 14, APR_WIN_98_SE = 16, APR_WIN_ME = 18, APR_WIN_UNICODE = 20, /* Prior versions support only narrow chars */ APR_WIN_CE_3 = 23, /* CE is an odd beast, not supporting */ /* some pre-NT features, such as the */ APR_WIN_NT = 30, /* narrow charset APIs (fooA fns), while */ APR_WIN_NT_3_5 = 35, /* not supporting some NT-family features. */ APR_WIN_NT_3_51 = 36, APR_WIN_NT_4 = 40, APR_WIN_NT_4_SP2 = 42, APR_WIN_NT_4_SP3 = 43, APR_WIN_NT_4_SP4 = 44, APR_WIN_NT_4_SP5 = 45, APR_WIN_NT_4_SP6 = 46, APR_WIN_2000 = 50, APR_WIN_2000_SP1 = 51, APR_WIN_2000_SP2 = 52, APR_WIN_XP = 60, APR_WIN_XP_SP1 = 61, APR_WIN_XP_SP2 = 62, APR_WIN_2003 = 70, APR_WIN_VISTA = 80, APR_WIN_7 = 90 } apr_oslevel_e; extern APR_DECLARE_DATA apr_oslevel_e apr_os_level; apr_status_t apr_get_oslevel(apr_oslevel_e *); /* The APR_HAS_ANSI_FS symbol is PRIVATE, and internal to APR. * APR only supports char data for filenames. Like most applications, * characters >127 are essentially undefined. APR_HAS_UNICODE_FS lets * the application know that utf-8 is the encoding method of APR, and * only incidently hints that we have Wide OS calls. * * APR_HAS_ANSI_FS is simply an OS flag to tell us all calls must be * the unicode eqivilant. */ #if defined(_WIN32_WCE) || defined(WINNT) #define APR_HAS_ANSI_FS 0 #else #define APR_HAS_ANSI_FS 1 #endif /* IF_WIN_OS_IS_UNICODE / ELSE_WIN_OS_IS_ANSI help us keep the code trivial * where have runtime tests for unicode-ness, that aren't needed in any * build which supports only WINNT or WCE. */ #if APR_HAS_ANSI_FS && APR_HAS_UNICODE_FS #define IF_WIN_OS_IS_UNICODE if (apr_os_level >= APR_WIN_UNICODE) #define ELSE_WIN_OS_IS_ANSI else #else /* APR_HAS_UNICODE_FS */ #define IF_WIN_OS_IS_UNICODE #define ELSE_WIN_OS_IS_ANSI #endif /* WINNT */ #if defined(_MSC_VER) && !defined(_WIN32_WCE) #include "crtdbg.h" static APR_INLINE void* apr_malloc_dbg(size_t size, const char* filename, int linenumber) { return _malloc_dbg(size, _CRT_BLOCK, filename, linenumber); } static APR_INLINE void* apr_realloc_dbg(void* userData, size_t newSize, const char* filename, int linenumber) { return _realloc_dbg(userData, newSize, _CRT_BLOCK, filename, linenumber); } #else static APR_INLINE void* apr_malloc_dbg(size_t size, const char* filename, int linenumber) { return malloc(size); } static APR_INLINE void* apr_realloc_dbg(void* userData, size_t newSize, const char* filename, int linenumber) { return realloc(userData, newSize); } #endif /* ! _MSC_VER */ typedef enum { DLL_WINBASEAPI = 0, /* kernel32 From WinBase.h */ DLL_WINADVAPI = 1, /* advapi32 From WinBase.h */ DLL_WINSOCKAPI = 2, /* mswsock From WinSock.h */ DLL_WINSOCK2API = 3, /* ws2_32 From WinSock2.h */ DLL_SHSTDAPI = 4, /* shell32 From ShellAPI.h */ DLL_NTDLL = 5, /* shell32 From our real kernel */ DLL_defined = 6 /* must define as last idx_ + 1 */ } apr_dlltoken_e; FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal); /* The apr_load_dll_func call WILL return 0 set error to * ERROR_INVALID_FUNCTION if the function cannot be loaded */ #define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \ typedef rettype (calltype *apr_winapi_fpt_##fn) args; \ static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \ static int apr_winapi_chk_##fn = 0; \ static APR_INLINE int apr_winapi_ld_##fn(void) \ { if (apr_winapi_pfn_##fn) return 1; \ if (apr_winapi_chk_##fn ++) return 0; \ if (!apr_winapi_pfn_##fn) \ apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \ apr_load_dll_func(lib, #fn, ord); \ if (apr_winapi_pfn_##fn) return 1; else return 0; }; \ static APR_INLINE rettype apr_winapi_##fn args \ { if (apr_winapi_ld_##fn()) \ return (*(apr_winapi_pfn_##fn)) names; \ else { SetLastError(ERROR_INVALID_FUNCTION); return 0;} }; \ #define APR_HAVE_LATE_DLL_FUNC(fn) apr_winapi_ld_##fn() /* Provide late bound declarations of every API function missing from * one or more supported releases of the Win32 API * * lib is the enumerated token from apr_dlltoken_e, and must correspond * to the string table entry in start.c used by the apr_load_dll_func(). * Token names (attempt to) follow Windows.h declarations prefixed by DLL_ * in order to facilitate comparison. Use the exact declaration syntax * and names from Windows.h to prevent ambigutity and bugs. * * rettype and calltype follow the original declaration in Windows.h * fn is the true function name - beware Ansi/Unicode #defined macros * ord is the ordinal within the library, use 0 if it varies between versions * args is the parameter list following the original declaration, in parens * names is the parameter list sans data types, enclosed in parens * * #undef/re#define the Ansi/Unicode generic name to abate confusion * In the case of non-text functions, simply #define the original name */ #if !defined(_WIN32_WCE) && !defined(WINNT) /* This group is available to all versions of WINNT 4.0 SP6 and later */ #ifdef GetFileAttributesExA #undef GetFileAttributesExA #endif APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExA, 0, ( IN LPCSTR lpFileName, IN GET_FILEEX_INFO_LEVELS fInfoLevelId, OUT LPVOID lpFileInformation), (lpFileName, fInfoLevelId, lpFileInformation)); #define GetFileAttributesExA apr_winapi_GetFileAttributesExA #undef GetFileAttributesEx #define GetFileAttributesEx apr_winapi_GetFileAttributesExA #ifdef GetFileAttributesExW #undef GetFileAttributesExW #endif APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, GetFileAttributesExW, 0, ( IN LPCWSTR lpFileName, IN GET_FILEEX_INFO_LEVELS fInfoLevelId, OUT LPVOID lpFileInformation), (lpFileName, fInfoLevelId, lpFileInformation)); #define GetFileAttributesExW apr_winapi_GetFileAttributesExW APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, CancelIo, 0, ( IN HANDLE hFile), (hFile)); #define CancelIo apr_winapi_CancelIo APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, TryEnterCriticalSection, 0, ( LPCRITICAL_SECTION lpCriticalSection), (lpCriticalSection)); #define TryEnterCriticalSection apr_winapi_TryEnterCriticalSection APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, SwitchToThread, 0, ( void), ()); #define SwitchToThread apr_winapi_SwitchToThread APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetEffectiveRightsFromAclW, 0, ( IN PACL pacl, IN PTRUSTEE_W pTrustee, OUT PACCESS_MASK pAccessRights), (pacl, pTrustee, pAccessRights)); #define GetEffectiveRightsFromAclW apr_winapi_GetEffectiveRightsFromAclW APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoW, 0, ( IN LPWSTR pObjectName, IN SE_OBJECT_TYPE ObjectType, IN SECURITY_INFORMATION SecurityInfo, OUT PSID *ppsidOwner, OUT PSID *ppsidGroup, OUT PACL *ppDacl, OUT PACL *ppSacl, OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), (pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor)); #define GetNamedSecurityInfoW apr_winapi_GetNamedSecurityInfoW APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetNamedSecurityInfoA, 0, ( IN LPSTR pObjectName, IN SE_OBJECT_TYPE ObjectType, IN SECURITY_INFORMATION SecurityInfo, OUT PSID *ppsidOwner, OUT PSID *ppsidGroup, OUT PACL *ppDacl, OUT PACL *ppSacl, OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), (pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor)); #define GetNamedSecurityInfoA apr_winapi_GetNamedSecurityInfoA #undef GetNamedSecurityInfo #define GetNamedSecurityInfo apr_winapi_GetNamedSecurityInfoA APR_DECLARE_LATE_DLL_FUNC(DLL_WINADVAPI, BOOL, WINAPI, GetSecurityInfo, 0, ( IN HANDLE handle, IN SE_OBJECT_TYPE ObjectType, IN SECURITY_INFORMATION SecurityInfo, OUT PSID *ppsidOwner, OUT PSID *ppsidGroup, OUT PACL *ppDacl, OUT PACL *ppSacl, OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor), (handle, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor)); #define GetSecurityInfo apr_winapi_GetSecurityInfo APR_DECLARE_LATE_DLL_FUNC(DLL_SHSTDAPI, LPWSTR *, WINAPI, CommandLineToArgvW, 0, ( LPCWSTR lpCmdLine, int *pNumArgs), (lpCmdLine, pNumArgs)); #define CommandLineToArgvW apr_winapi_CommandLineToArgvW #endif /* !defined(_WIN32_WCE) && !defined(WINNT) */ #if !defined(_WIN32_WCE) /* This group is NOT available to all versions of WinNT, * these we must always look up */ #ifdef GetCompressedFileSizeA #undef GetCompressedFileSizeA #endif APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, DWORD, WINAPI, GetCompressedFileSizeA, 0, ( IN LPCSTR lpFileName, OUT LPDWORD lpFileSizeHigh), (lpFileName, lpFileSizeHigh)); #define GetCompressedFileSizeA apr_winapi_GetCompressedFileSizeA #undef GetCompressedFileSize #define GetCompressedFileSize apr_winapi_GetCompressedFileSizeA #ifdef GetCompressedFileSizeW #undef GetCompressedFileSizeW #endif APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, DWORD, WINAPI, GetCompressedFileSizeW, 0, ( IN LPCWSTR lpFileName, OUT LPDWORD lpFileSizeHigh), (lpFileName, lpFileSizeHigh)); #define GetCompressedFileSizeW apr_winapi_GetCompressedFileSizeW APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryTimerResolution, 0, ( ULONG *pMaxRes, /* Minimum NS Resolution */ ULONG *pMinRes, /* Maximum NS Resolution */ ULONG *pCurRes), /* Current NS Resolution */ (pMaxRes, pMinRes, pCurRes)); #define QueryTimerResolution apr_winapi_NtQueryTimerResolution APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtSetTimerResolution, 0, ( ULONG ReqRes, /* Requested NS Clock Resolution */ BOOL Acquire, /* Aquire (1) or Release (0) our interest */ ULONG *pNewRes), /* The NS Clock Resolution granted */ (ReqRes, Acquire, pNewRes)); #define SetTimerResolution apr_winapi_NtSetTimerResolution typedef struct PBI { LONG ExitStatus; PVOID PebBaseAddress; apr_uintptr_t AffinityMask; LONG BasePriority; apr_uintptr_t UniqueProcessId; apr_uintptr_t InheritedFromUniqueProcessId; } PBI, *PPBI; APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryInformationProcess, 0, ( HANDLE hProcess, /* Obvious */ INT info, /* Use 0 for PBI documented above */ PVOID pPI, /* The PIB buffer */ ULONG LenPI, /* Use sizeof(PBI) */ ULONG *pSizePI), /* returns pPI buffer used (may pass NULL) */ (hProcess, info, pPI, LenPI, pSizePI)); #define QueryInformationProcess apr_winapi_NtQueryInformationProcess APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, NtQueryObject, 0, ( HANDLE hObject, /* Obvious */ INT info, /* Use 0 for PBI documented above */ PVOID pOI, /* The PIB buffer */ ULONG LenOI, /* Use sizeof(PBI) */ ULONG *pSizeOI), /* returns pPI buffer used (may pass NULL) */ (hObject, info, pOI, LenOI, pSizeOI)); #define QueryObject apr_winapi_NtQueryObject typedef struct IOSB { union { UINT Status; PVOID reserved; }; apr_uintptr_t Information; /* Varies by op, consumed buffer size for FSI below */ } IOSB, *PIOSB; typedef struct FSI { LONGLONG AllocationSize; LONGLONG EndOfFile; ULONG NumberOfLinks; BOOL DeletePending; BOOL Directory; } FSI, *PFSI; APR_DECLARE_LATE_DLL_FUNC(DLL_NTDLL, LONG, WINAPI, ZwQueryInformationFile, 0, ( HANDLE hObject, /* Obvious */ PVOID pIOSB, /* Point to the IOSB buffer for detailed return results */ PVOID pFI, /* The buffer, using FIB above */ ULONG LenFI, /* Use sizeof(FI) */ ULONG info), /* Use 5 for FSI documented above*/ (hObject, pIOSB, pFI, LenFI, info)); #define ZwQueryInformationFile apr_winapi_ZwQueryInformationFile #ifdef CreateToolhelp32Snapshot #undef CreateToolhelp32Snapshot #endif APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, HANDLE, WINAPI, CreateToolhelp32Snapshot, 0, ( DWORD dwFlags, DWORD th32ProcessID), (dwFlags, th32ProcessID)); #define CreateToolhelp32Snapshot apr_winapi_CreateToolhelp32Snapshot #ifdef Process32FirstW #undef Process32FirstW #endif APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, Process32FirstW, 0, ( HANDLE hSnapshot, LPPROCESSENTRY32W lppe), (hSnapshot, lppe)); #define Process32FirstW apr_winapi_Process32FirstW #ifdef Process32NextW #undef Process32NextW #endif APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, Process32NextW, 0, ( HANDLE hSnapshot, LPPROCESSENTRY32W lppe), (hSnapshot, lppe)); #define Process32NextW apr_winapi_Process32NextW #if !defined(POLLERR) /* Event flag definitions for WSAPoll(). */ #define POLLRDNORM 0x0100 #define POLLRDBAND 0x0200 #define POLLIN (POLLRDNORM | POLLRDBAND) #define POLLPRI 0x0400 #define POLLWRNORM 0x0010 #define POLLOUT (POLLWRNORM) #define POLLWRBAND 0x0020 #define POLLERR 0x0001 #define POLLHUP 0x0002 #define POLLNVAL 0x0004 typedef struct pollfd { SOCKET fd; SHORT events; SHORT revents; } WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD; #endif /* !defined(POLLERR) */ #ifdef WSAPoll #undef WSAPoll #endif APR_DECLARE_LATE_DLL_FUNC(DLL_WINSOCK2API, int, WSAAPI, WSAPoll, 0, ( IN OUT LPWSAPOLLFD fdArray, IN ULONG fds, IN INT timeout), (fdArray, fds, timeout)); #define WSAPoll apr_winapi_WSAPoll #define HAVE_POLL 1 #ifdef SetDllDirectoryW #undef SetDllDirectoryW #endif APR_DECLARE_LATE_DLL_FUNC(DLL_WINBASEAPI, BOOL, WINAPI, SetDllDirectoryW, 0, ( IN LPCWSTR lpPathName), (lpPathName)); #define SetDllDirectoryW apr_winapi_SetDllDirectoryW #endif /* !defined(_WIN32_WCE) */ #endif /* ! MISC_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_networkio.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef NETWORK_IO_H #define NETWORK_IO_H #include "apr_network_io.h" #include "apr_general.h" #include "apr_poll.h" typedef struct sock_userdata_t sock_userdata_t; struct sock_userdata_t { sock_userdata_t *next; const char *key; void *data; }; struct apr_socket_t { apr_pool_t *pool; SOCKET socketdes; int type; /* SOCK_STREAM, SOCK_DGRAM */ int protocol; apr_sockaddr_t *local_addr; apr_sockaddr_t *remote_addr; int timeout_ms; /* MUST MATCH if timeout > 0 */ apr_interval_time_t timeout; apr_int32_t disconnected; int local_port_unknown; int local_interface_unknown; int remote_addr_unknown; apr_int32_t options; apr_int32_t inherit; #if APR_HAS_SENDFILE /* As of 07.20.04, the overlapped structure is only used by * apr_socket_sendfile and that's where it will be allocated * and initialized. */ OVERLAPPED *overlapped; #endif sock_userdata_t *userdata; /* if there is a timeout set, then this pollset is used */ apr_pollset_t *pollset; }; #ifdef _WIN32_WCE #ifndef WSABUF typedef struct _WSABUF { u_long len; /* the length of the buffer */ char FAR * buf; /* the pointer to the buffer */ } WSABUF, FAR * LPWSABUF; #endif #else #ifdef _MSC_VER #define HAVE_STRUCT_IPMREQ #endif #endif apr_status_t status_from_res_error(int); const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); int apr_inet_pton(int af, const char *src, void *dst); void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); #define apr_is_option_set(skt, option) \ (((skt)->options & (option)) == (option)) #define apr_set_option(skt, option, on) \ do { \ if (on) \ (skt)->options |= (option); \ else \ (skt)->options &= ~(option); \ } while (0) #endif /* ! NETWORK_IO_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_proc_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PROC_MUTEX_H #define PROC_MUTEX_H #include "apr_proc_mutex.h" struct apr_proc_mutex_t { apr_pool_t *pool; HANDLE handle; const char *fname; }; #endif /* PROC_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_thread_cond.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_COND_H #define THREAD_COND_H #include "apr_thread_cond.h" struct apr_thread_cond_t { apr_pool_t *pool; HANDLE semaphore; CRITICAL_SECTION csection; unsigned long num_waiting; unsigned long num_wake; unsigned long generation; }; #endif /* THREAD_COND_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_thread_mutex.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H #include "apr_pools.h" typedef enum thread_mutex_type { thread_mutex_critical_section, thread_mutex_unnested_event, thread_mutex_nested_mutex } thread_mutex_type; /* handle applies only to unnested_event on all platforms * and nested_mutex on Win9x only. Otherwise critical_section * is used for NT nexted mutexes providing optimal performance. */ struct apr_thread_mutex_t { apr_pool_t *pool; thread_mutex_type type; HANDLE handle; CRITICAL_SECTION section; }; #endif /* THREAD_MUTEX_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_thread_rwlock.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef THREAD_RWLOCK_H #define THREAD_RWLOCK_H #include "apr_thread_rwlock.h" struct apr_thread_rwlock_t { apr_pool_t *pool; HANDLE write_mutex; HANDLE read_event; LONG readers; }; #endif /* THREAD_RWLOCK_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_threadproc.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apr_private.h" #include "apr_thread_proc.h" #include "apr_file_io.h" #ifndef THREAD_PROC_H #define THREAD_PROC_H #define SHELL_PATH "cmd.exe" struct apr_thread_t { apr_pool_t *pool; HANDLE td; apr_int32_t cancel; apr_int32_t cancel_how; void *data; apr_thread_start_t func; apr_status_t exitval; }; struct apr_threadattr_t { apr_pool_t *pool; apr_int32_t detach; apr_size_t stacksize; }; struct apr_threadkey_t { apr_pool_t *pool; DWORD key; }; struct apr_procattr_t { apr_pool_t *pool; apr_file_t *parent_in; apr_file_t *child_in; apr_file_t *parent_out; apr_file_t *child_out; apr_file_t *parent_err; apr_file_t *child_err; char *currdir; apr_int32_t cmdtype; apr_int32_t detached; apr_child_errfn_t *errfn; apr_int32_t errchk; #ifndef _WIN32_WCE HANDLE user_token; LPSECURITY_ATTRIBUTES sa; LPVOID sd; #endif }; struct apr_thread_once_t { long value; }; extern apr_status_t apr_threadproc_init(apr_pool_t *pool); #endif /* ! THREAD_PROC_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_arch_utf8.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef UTF8_H #define UTF8_H #include "apr.h" #include "apr_lib.h" #include "apr_errno.h" /* If we ever support anything more exciting than char... this could move. */ typedef apr_uint16_t apr_wchar_t; /** * An APR internal function for fast utf-8 octet-encoded Unicode conversion * to the ucs-2 wide Unicode format. This function is used for filename and * other resource conversions for platforms providing native Unicode support. * * @tip Only the errors APR_EINVAL and APR_INCOMPLETE may occur, the former * when the character code is invalid (in or out of context) and the later * when more characters were expected, but insufficient characters remain. */ APR_DECLARE(apr_status_t) apr_conv_utf8_to_ucs2(const char *in, apr_size_t *inbytes, apr_wchar_t *out, apr_size_t *outwords); /** * An APR internal function for fast ucs-2 wide Unicode format conversion to * the utf-8 octet-encoded Unicode. This function is used for filename and * other resource conversions for platforms providing native Unicode support. * * @tip Only the errors APR_EINVAL and APR_INCOMPLETE may occur, the former * when the character code is invalid (in or out of context) and the later * when more words were expected, but insufficient words remain. */ APR_DECLARE(apr_status_t) apr_conv_ucs2_to_utf8(const apr_wchar_t *in, apr_size_t *inwords, char *out, apr_size_t *outbytes); #endif /* def UTF8_H */ ================================================ FILE: third_party/include/apr/arch/win32/apr_dbg_win32_handles.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_DBG_WIN32_HANDLES_H #define APR_DBG_WIN32_HANDLES_H #ifdef __cplusplus extern "C" { #endif /* USAGE: * * Add the following include to apr_private.h for internal debugging, * or copy this header into apr/include add the include below to apr.h * for really global debugging; * * #include "apr_dbg_win32_handles.h" * * apr_dbg_log is the crux of this function ... it uses Win32 API and * no apr calls itself to log all activity to a file named for the * executing application with a .pid suffix. Ergo several instances * may be executing and logged at once. * * HANDLE apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh * [, HANDLE *hv, char *dsc...]) * * returns: the handle passed in ha, which is cast back to the real return type. * * formats one line into the debug log file if nh is zero; * ha (hex) seq(hex) tid(hex) fn fl ln * xxxxxxxx xxxxxxxx xxxxxxxx func() sourcefile:lineno * The macro apr_dbg_rv makes this simple to implement for many APIs * that simply take args that don't interest us, and return a handle. * * formats multiple lines (nh) into the debug log file for each hv/dsc pair * (nh must correspond to the number of pairs); * hv (hex) seq(hex) tid(hex) fn dsc fl ln * xxxxxxxx xxxxxxxx xxxxxxxx func(arg) sourcefile:lineno * In this later usage, hv is the still the return value but is not * treated as a handle. */ APR_DECLARE_NONSTD(HANDLE) apr_dbg_log(char* fn, HANDLE ha, char* fl, int ln, int nh,/* HANDLE *hv, char *dsc */...); #define apr_dbg_rv(fn, args) (apr_dbg_log(#fn,(fn) args,__FILE__,__LINE__,0)) #define CloseHandle(h) \ ((BOOL)apr_dbg_log("CloseHandle", \ (HANDLE)(CloseHandle)(h), \ __FILE__,__LINE__,1, \ &(h),"")) #define CreateEventA(sd,b1,b2,nm) apr_dbg_rv(CreateEventA,(sd,b1,b2,nm)) #define CreateEventW(sd,b1,b2,nm) apr_dbg_rv(CreateEventW,(sd,b1,b2,nm)) #define CreateFileA(nm,d1,d2,sd,d3,d4,h) apr_dbg_rv(CreateFileA,(nm,d1,d2,sd,d3,d4,h)) #define CreateFileW(nm,d1,d2,sd,d3,d4,h) apr_dbg_rv(CreateFileW,(nm,d1,d2,sd,d3,d4,h)) #define CreateFileMappingA(fh,sd,d1,d2,d3,nm) apr_dbg_rv(CreateFileMappingA,(fh,sd,d1,d2,d3,nm)) #define CreateFileMappingW(fh,sd,d1,d2,d3,nm) apr_dbg_rv(CreateFileMappingW,(fh,sd,d1,d2,d3,nm)) #define CreateMutexA(sd,b,nm) apr_dbg_rv(CreateMutexA,(sd,b,nm)) #define CreateMutexW(sd,b,nm) apr_dbg_rv(CreateMutexW,(sd,b,nm)) #define CreateIoCompletionPort(h1,h2,pd1,d2) apr_dbg_rv(CreateIoCompletionPort,(h1,h2,pd1,d2)) #define CreateNamedPipeA(nm,d1,d2,d3,d4,d5,d6,sd) apr_dbg_rv(CreateNamedPipeA,(nm,d1,d2,d3,d4,d5,d6,sd)) #define CreateNamedPipeW(nm,d1,d2,d3,d4,d5,d6,sd) apr_dbg_rv(CreateNamedPipeW,(nm,d1,d2,d3,d4,d5,d6,sd)) #define CreatePipe(ph1,ph2,sd,d) \ ((BOOL)apr_dbg_log("CreatePipe", \ (HANDLE)(CreatePipe)(ph1,ph2,sd,d), \ __FILE__,__LINE__,2, \ (ph1),"hRead", \ (ph2),"hWrite")) #define CreateProcessA(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr) \ ((BOOL)apr_dbg_log("CreateProcessA", \ (HANDLE)(CreateProcessA)(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr), \ __FILE__,__LINE__,2, \ &((hr)->hProcess),"hProcess", \ &((hr)->hThread),"hThread")) #define CreateProcessW(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr) \ ((BOOL)apr_dbg_log("CreateProcessW", \ (HANDLE)(CreateProcessW)(s1,s2,sd1,sd2,b,d1,s3,s4,pd2,hr), \ __FILE__,__LINE__,2, \ &((hr)->hProcess),"hProcess", \ &((hr)->hThread),"hThread")) #define CreateSemaphoreA(sd,d1,d2,nm) apr_dbg_rv(CreateSemaphoreA,(sd,d1,d2,nm)) #define CreateSemaphoreW(sd,d1,d2,nm) apr_dbg_rv(CreateSemaphoreW,(sd,d1,d2,nm)) #define CreateThread(sd,d1,fn,pv,d2,pd3) apr_dbg_rv(CreateThread,(sd,d1,fn,pv,d2,pd3)) #define DeregisterEventSource(h) \ ((BOOL)apr_dbg_log("DeregisterEventSource", \ (HANDLE)(DeregisterEventSource)(h), \ __FILE__,__LINE__,1, \ &(h),"")) #define DuplicateHandle(h1,h2,h3,ph4,d1,b,d2) \ ((BOOL)apr_dbg_log("DuplicateHandle", \ (HANDLE)(DuplicateHandle)(h1,h2,h3,ph4,d1,b,d2), \ __FILE__,__LINE__,2, \ (ph4),((h3)==GetCurrentProcess()) \ ? "Target" : "EXTERN Target", \ &(h2),((h1)==GetCurrentProcess()) \ ? "Source" : "EXTERN Source")) #define GetCurrentProcess() \ (apr_dbg_log("GetCurrentProcess", \ (GetCurrentProcess)(),__FILE__,__LINE__,0)) #define GetCurrentThread() \ (apr_dbg_log("GetCurrentThread", \ (GetCurrentThread)(),__FILE__,__LINE__,0)) #define GetModuleHandleA(nm) apr_dbg_rv(GetModuleHandleA,(nm)) #define GetModuleHandleW(nm) apr_dbg_rv(GetModuleHandleW,(nm)) #define GetStdHandle(d) apr_dbg_rv(GetStdHandle,(d)) #define LoadLibraryA(nm) apr_dbg_rv(LoadLibraryA,(nm)) #define LoadLibraryW(nm) apr_dbg_rv(LoadLibraryW,(nm)) #define LoadLibraryExA(nm,h,d) apr_dbg_rv(LoadLibraryExA,(nm,h,d)) #define LoadLibraryExW(nm,h,d) apr_dbg_rv(LoadLibraryExW,(nm,h,d)) #define OpenEventA(d,b,nm) apr_dbg_rv(OpenEventA,(d,b,nm)) #define OpenEventW(d,b,nm) apr_dbg_rv(OpenEventW,(d,b,nm)) #define OpenFileMappingA(d,b,nm) apr_dbg_rv(OpenFileMappingA,(d,b,nm)) #define OpenFileMappingW(d,b,nm) apr_dbg_rv(OpenFileMappingW,(d,b,nm)) #define RegisterEventSourceA(s1,s2) apr_dbg_rv(RegisterEventSourceA,(s1,s2)) #define RegisterEventSourceW(s1,s2) apr_dbg_rv(RegisterEventSourceW,(s1,s2)) #define SetEvent(h) \ ((BOOL)apr_dbg_log("SetEvent", \ (HANDLE)(SetEvent)(h), \ __FILE__,__LINE__,1, \ &(h),"")) #define SetStdHandle(d,h) \ ((BOOL)apr_dbg_log("SetStdHandle", \ (HANDLE)(SetStdHandle)(d,h), \ __FILE__,__LINE__,1,&(h),"")) #define socket(i1,i2,i3) \ ((SOCKET)apr_dbg_log("socket", \ (HANDLE)(socket)(i1,i2,i3), \ __FILE__,__LINE__,0)) #define WaitForSingleObject(h,d) \ ((DWORD)apr_dbg_log("WaitForSingleObject", \ (HANDLE)(WaitForSingleObject)(h,d), \ __FILE__,__LINE__,1,&(h),"Signaled")) #define WaitForSingleObjectEx(h,d,b) \ ((DWORD)apr_dbg_log("WaitForSingleObjectEx", \ (HANDLE)(WaitForSingleObjectEx)(h,d,b), \ __FILE__,__LINE__,1,&(h),"Signaled")) #define WaitForMultipleObjects(d1,ah,b,d2) \ ((DWORD)apr_dbg_log("WaitForMultipleObjects", \ (HANDLE)(WaitForMultipleObjects)(d1,ah,b,d2), \ __FILE__,__LINE__,1,ah,"Signaled")) #define WaitForMultipleObjectsEx(d1,ah,b1,d2,b2) \ ((DWORD)apr_dbg_log("WaitForMultipleObjectsEx", \ (HANDLE)(WaitForMultipleObjectsEx)(d1,ah,b1,d2,b2), \ __FILE__,__LINE__,1,ah,"Signaled")) #define WSASocketA(i1,i2,i3,pi,g,dw) \ ((SOCKET)apr_dbg_log("WSASocketA", \ (HANDLE)(WSASocketA)(i1,i2,i3,pi,g,dw), \ __FILE__,__LINE__,0)) #define WSASocketW(i1,i2,i3,pi,g,dw) \ ((SOCKET)apr_dbg_log("WSASocketW", \ (HANDLE)(WSASocketW)(i1,i2,i3,pi,g,dw), \ __FILE__,__LINE__,0)) #define closesocket(sh) \ ((int)apr_dbg_log("closesocket", \ (HANDLE)(closesocket)(sh), \ __FILE__,__LINE__,1,&(sh),"")) #define _beginthread(fn,d,pv) \ ((unsigned long)apr_dbg_log("_beginthread", \ (HANDLE)(_beginthread)(fn,d,pv), \ __FILE__,__LINE__,0)) #define _beginthreadex(sd,d1,fn,pv,d2,pd3) \ ((unsigned long)apr_dbg_log("_beginthreadex", \ (HANDLE)(_beginthreadex)(sd,d1,fn,pv,d2,pd3), \ __FILE__,__LINE__,0)) #ifdef __cplusplus } #endif #endif /* !defined(APR_DBG_WIN32_HANDLES_H) */ ================================================ FILE: third_party/include/apr/arch/win32/apr_private.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Note: * This is the windows specific autoconf-like config file * which unix would create at build time. */ #ifdef WIN32 #ifndef APR_PRIVATE_H #define APR_PRIVATE_H /* Include the public APR symbols, include our idea of the 'right' * subset of the Windows.h header. This saves us repetition. */ #include "apr.h" /* * Add a _very_few_ declarations missing from the restricted set of headers * (If this list becomes extensive, re-enable the required headers above!) * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now */ #ifndef SW_HIDE #define SW_HIDE 0 #endif /* For the misc.h late-loaded dynamic symbols, we need some obscure types * Avoid dragging in wtypes.h unless it's absolutely necessary [generally * not with APR itself, until some GUI-related security is introduced.] */ #ifndef _WIN32_WCE #define HAVE_ACLAPI 1 #ifdef __wtypes_h__ #include #else #define __wtypes_h__ #include #undef __wtypes_h__ #endif #else #define HAVE_ACLAPI 0 #endif #if APR_HAVE_SYS_TYPES_H #include #endif #if APR_HAVE_STDDEF_H #include #endif #include #if APR_HAVE_TIME_H #include #endif /* Use this section to define all of the HAVE_FOO_H * that are required to build properly. */ #define HAVE_LIMITS_H 1 #define HAVE_MALLOC_H 1 #define HAVE_SIGNAL_H 1 /* #define HAVE_STDDEF_H 1 why not? */ #define HAVE_STDLIB_H 1 #define HAVE_STRICMP 1 #define HAVE_STRNICMP 1 #define HAVE_STRDUP 1 #define HAVE_STRSTR 1 #define HAVE_MEMCHR 1 #define SIGHUP 1 /* 2 is used for SIGINT on windows */ #define SIGQUIT 3 /* 4 is used for SIGILL on windows */ #define SIGTRAP 5 #define SIGIOT 6 #define SIGBUS 7 /* 8 is used for SIGFPE on windows */ #define SIGKILL 9 #define SIGUSR1 10 /* 11 is used for SIGSEGV on windows */ #define SIGUSR2 12 #define SIGPIPE 13 #define SIGALRM 14 /* 15 is used for SIGTERM on windows */ #define SIGSTKFLT 16 #define SIGCHLD 17 #define SIGCONT 18 #define SIGSTOP 19 #define SIGTSTP 20 /* 21 is used for SIGBREAK on windows */ /* 22 is used for SIGABRT on windows */ #define SIGTTIN 23 #define SIGTTOU 24 #define SIGURG 25 #define SIGXCPU 26 #define SIGXFSZ 27 #define SIGVTALRM 28 #define SIGPROF 29 #define SIGWINCH 30 #define SIGIO 31 /* APR COMPATABILITY FUNCTIONS * This section should be used to define functions and * macros which are need to make Windows features look * like POSIX features. */ typedef void (Sigfunc)(int); #define sleep(t) Sleep((t) * 1000) #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONGLONG 8 #define SIZEOF_CHAR 1 #define SIZEOF_SSIZE_T SIZEOF_INT unsigned __stdcall SignalHandling(void *); int thread_ready(void); #if !APR_HAVE_ERRNO_H APR_DECLARE_DATA int errno; #define ENOSPC 1 #endif #if APR_HAVE_IPV6 #define HAVE_GETADDRINFO 1 #define HAVE_GETNAMEINFO 1 #endif /* MSVC 7.0 introduced _strtoi64 */ #if _MSC_VER >= 1300 && _INTEGRAL_MAX_BITS >= 64 && !defined(_WIN32_WCE) #define APR_INT64_STRFN _strtoi64 #endif #if APR_HAS_LARGE_FILES #ifdef APR_INT64_STRFN #define APR_OFF_T_STRFN APR_INT64_STRFN #else #define APR_OFF_T_STRFN apr_strtoi64 #endif #else #if defined(_WIN32_WCE) #define APR_OFF_T_STRFN strtol #else #define APR_OFF_T_STRFN strtoi #endif #endif /* used to check for DWORD overflow in 64bit compiles */ #define APR_DWORD_MAX 0xFFFFFFFFUL /* * Include common private declarations. */ #include "../apr_private_common.h" #endif /*APR_PRIVATE_H*/ #endif /*WIN32*/ ================================================ FILE: third_party/include/aprutil/apr_anylock.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_anylock.h * @brief APR-Util transparent any lock flavor wrapper */ #ifndef APR_ANYLOCK_H #define APR_ANYLOCK_H #include "apr_proc_mutex.h" #include "apr_thread_mutex.h" #include "apr_thread_rwlock.h" /** Structure that may contain any APR lock type */ typedef struct apr_anylock_t { /** Indicates what type of lock is in lock */ enum tm_lock { apr_anylock_none, /**< None */ apr_anylock_procmutex, /**< Process-based */ apr_anylock_threadmutex, /**< Thread-based */ apr_anylock_readlock, /**< Read lock */ apr_anylock_writelock /**< Write lock */ } type; /** Union of all possible APR locks */ union apr_anylock_u_t { apr_proc_mutex_t *pm; /**< Process mutex */ #if APR_HAS_THREADS apr_thread_mutex_t *tm; /**< Thread mutex */ apr_thread_rwlock_t *rw; /**< Read-write lock */ #endif } lock; } apr_anylock_t; #if APR_HAS_THREADS /** Lock an apr_anylock_t structure */ #define APR_ANYLOCK_LOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_threadmutex) \ ? apr_thread_mutex_lock((lck)->lock.tm) \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_lock((lck)->lock.pm) \ : (((lck)->type == apr_anylock_readlock) \ ? apr_thread_rwlock_rdlock((lck)->lock.rw) \ : (((lck)->type == apr_anylock_writelock) \ ? apr_thread_rwlock_wrlock((lck)->lock.rw) \ : APR_EINVAL))))) #else /* APR_HAS_THREADS */ #define APR_ANYLOCK_LOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_lock((lck)->lock.pm) \ : APR_EINVAL)) #endif /* APR_HAS_THREADS */ #if APR_HAS_THREADS /** Try to lock an apr_anylock_t structure */ #define APR_ANYLOCK_TRYLOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_threadmutex) \ ? apr_thread_mutex_trylock((lck)->lock.tm) \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_trylock((lck)->lock.pm) \ : (((lck)->type == apr_anylock_readlock) \ ? apr_thread_rwlock_tryrdlock((lck)->lock.rw) \ : (((lck)->type == apr_anylock_writelock) \ ? apr_thread_rwlock_trywrlock((lck)->lock.rw) \ : APR_EINVAL))))) #else /* APR_HAS_THREADS */ #define APR_ANYLOCK_TRYLOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_trylock((lck)->lock.pm) \ : APR_EINVAL)) #endif /* APR_HAS_THREADS */ #if APR_HAS_THREADS /** Unlock an apr_anylock_t structure */ #define APR_ANYLOCK_UNLOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_threadmutex) \ ? apr_thread_mutex_unlock((lck)->lock.tm) \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_unlock((lck)->lock.pm) \ : ((((lck)->type == apr_anylock_readlock) || \ ((lck)->type == apr_anylock_writelock)) \ ? apr_thread_rwlock_unlock((lck)->lock.rw) \ : APR_EINVAL)))) #else /* APR_HAS_THREADS */ #define APR_ANYLOCK_UNLOCK(lck) \ (((lck)->type == apr_anylock_none) \ ? APR_SUCCESS \ : (((lck)->type == apr_anylock_procmutex) \ ? apr_proc_mutex_unlock((lck)->lock.pm) \ : APR_EINVAL)) #endif /* APR_HAS_THREADS */ #endif /* !APR_ANYLOCK_H */ ================================================ FILE: third_party/include/aprutil/apr_base64.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * The apr_vsnprintf/apr_snprintf functions are based on, and used with the * permission of, the SIO stdio-replacement strx_* functions by Panos * Tsirigotis for xinetd. */ /** * @file apr_base64.h * @brief APR-UTIL Base64 Encoding */ #ifndef APR_BASE64_H #define APR_BASE64_H #include "apu.h" #include "apr_general.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_Base64 Base64 Encoding * @ingroup APR_Util * @{ */ /* Simple BASE64 encode/decode functions. * * As we might encode binary strings, hence we require the length of * the incoming plain source. And return the length of what we decoded. * * The decoding function takes any non valid char (i.e. whitespace, \0 * or anything non A-Z,0-9 etc as terminal. * * plain strings/binary sequences are not assumed '\0' terminated. Encoded * strings are neither. But probably should. * */ /** * Given the length of an un-encoded string, get the length of the * encoded string. * @param len the length of an unencoded string. * @return the length of the string after it is encoded, including the * trailing \0 */ APU_DECLARE(int) apr_base64_encode_len(int len); /** * Encode a text string using base64encoding. * @param coded_dst The destination string for the encoded string. * @param plain_src The original string in plain text * @param len_plain_src The length of the plain text string * @return the length of the encoded string */ APU_DECLARE(int) apr_base64_encode(char * coded_dst, const char *plain_src, int len_plain_src); /** * Encode an EBCDIC string using base64encoding. * @param coded_dst The destination string for the encoded string. * @param plain_src The original string in plain text * @param len_plain_src The length of the plain text string * @return the length of the encoded string */ APU_DECLARE(int) apr_base64_encode_binary(char * coded_dst, const unsigned char *plain_src, int len_plain_src); /** * Determine the maximum buffer length required to decode the plain text * string given the encoded string. * @param coded_src The encoded string * @return the maximum required buffer length for the plain text string */ APU_DECLARE(int) apr_base64_decode_len(const char * coded_src); /** * Decode a string to plain text * @param plain_dst The destination string for the plain text * @param coded_src The encoded string * @return the length of the plain text string */ APU_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src); /** * Decode an EBCDIC string to plain text * @param plain_dst The destination string for the plain text * @param coded_src The encoded string * @return the length of the plain text string */ APU_DECLARE(int) apr_base64_decode_binary(unsigned char * plain_dst, const char *coded_src); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_BASE64_H */ ================================================ FILE: third_party/include/aprutil/apr_buckets.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_buckets.h * @brief APR-UTIL Buckets/Bucket Brigades */ #ifndef APR_BUCKETS_H #define APR_BUCKETS_H #if defined(APR_BUCKET_DEBUG) && !defined(APR_RING_DEBUG) #define APR_RING_DEBUG #endif #include "apu.h" #include "apr_network_io.h" #include "apr_file_io.h" #include "apr_general.h" #include "apr_mmap.h" #include "apr_errno.h" #include "apr_ring.h" #include "apr.h" #if APR_HAVE_SYS_UIO_H #include /* for struct iovec */ #endif #if APR_HAVE_STDARG_H #include #endif #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_Bucket_Brigades Bucket Brigades * @ingroup APR_Util * @{ */ /** default bucket buffer size - 8KB minus room for memory allocator headers */ #define APR_BUCKET_BUFF_SIZE 8000 /** Determines how a bucket or brigade should be read */ typedef enum { APR_BLOCK_READ, /**< block until data becomes available */ APR_NONBLOCK_READ /**< return immediately if no data is available */ } apr_read_type_e; /** * The one-sentence buzzword-laden overview: Bucket brigades represent * a complex data stream that can be passed through a layered IO * system without unnecessary copying. A longer overview follows... * * A bucket brigade is a doubly linked list (ring) of buckets, so we * aren't limited to inserting at the front and removing at the end. * Buckets are only passed around as members of a brigade, although * singleton buckets can occur for short periods of time. * * Buckets are data stores of various types. They can refer to data in * memory, or part of a file or mmap area, or the output of a process, * etc. Buckets also have some type-dependent accessor functions: * read, split, copy, setaside, and destroy. * * read returns the address and size of the data in the bucket. If the * data isn't in memory then it is read in and the bucket changes type * so that it can refer to the new location of the data. If all the * data doesn't fit in the bucket then a new bucket is inserted into * the brigade to hold the rest of it. * * split divides the data in a bucket into two regions. After a split * the original bucket refers to the first part of the data and a new * bucket inserted into the brigade after the original bucket refers * to the second part of the data. Reference counts are maintained as * necessary. * * setaside ensures that the data in the bucket has a long enough * lifetime. Sometimes it is convenient to create a bucket referring * to data on the stack in the expectation that it will be consumed * (output to the network) before the stack is unwound. If that * expectation turns out not to be valid, the setaside function is * called to move the data somewhere safer. * * copy makes a duplicate of the bucket structure as long as it's * possible to have multiple references to a single copy of the * data itself. Not all bucket types can be copied. * * destroy maintains the reference counts on the resources used by a * bucket and frees them if necessary. * * Note: all of the above functions have wrapper macros (apr_bucket_read(), * apr_bucket_destroy(), etc), and those macros should be used rather * than using the function pointers directly. * * To write a bucket brigade, they are first made into an iovec, so that we * don't write too little data at one time. Currently we ignore compacting the * buckets into as few buckets as possible, but if we really want good * performance, then we need to compact the buckets before we convert to an * iovec, or possibly while we are converting to an iovec. */ /* * Forward declaration of the main types. */ /** @see apr_bucket_brigade */ typedef struct apr_bucket_brigade apr_bucket_brigade; /** @see apr_bucket */ typedef struct apr_bucket apr_bucket; /** @see apr_bucket_alloc_t */ typedef struct apr_bucket_alloc_t apr_bucket_alloc_t; /** @see apr_bucket_type_t */ typedef struct apr_bucket_type_t apr_bucket_type_t; /** * Basic bucket type */ struct apr_bucket_type_t { /** * The name of the bucket type */ const char *name; /** * The number of functions this bucket understands. Can not be less than * five. */ int num_func; /** * Whether the bucket contains metadata (ie, information that * describes the regular contents of the brigade). The metadata * is not returned by apr_bucket_read() and is not indicated by * the ->length of the apr_bucket itself. In other words, an * empty bucket is safe to arbitrarily remove if and only if it * contains no metadata. In this sense, "data" is just raw bytes * that are the "content" of the brigade and "metadata" describes * that data but is not a proper part of it. */ enum { /** This bucket type represents actual data to send to the client. */ APR_BUCKET_DATA = 0, /** This bucket type represents metadata. */ APR_BUCKET_METADATA = 1 } is_metadata; /** * Free the private data and any resources used by the bucket (if they * aren't shared with another bucket). This function is required to be * implemented for all bucket types, though it might be a no-op on some * of them (namely ones that never allocate any private data structures). * @param data The private data pointer from the bucket to be destroyed */ void (*destroy)(void *data); /** * Read the data from the bucket. This is required to be implemented * for all bucket types. * @param b The bucket to read from * @param str A place to store the data read. Allocation should only be * done if absolutely necessary. * @param len The amount of data read. * @param block Should this read function block if there is more data that * cannot be read immediately. */ apr_status_t (*read)(apr_bucket *b, const char **str, apr_size_t *len, apr_read_type_e block); /** * Make it possible to set aside the data for at least as long as the * given pool. Buckets containing data that could potentially die before * this pool (e.g. the data resides on the stack, in a child pool of * the given pool, or in a disjoint pool) must somehow copy, shift, or * transform the data to have the proper lifetime. * @param e The bucket to convert * @remark Some bucket types contain data that will always outlive the * bucket itself. For example no data (EOS and FLUSH), or the data * resides in global, constant memory (IMMORTAL), or the data is on * the heap (HEAP). For these buckets, apr_bucket_setaside_noop can * be used. */ apr_status_t (*setaside)(apr_bucket *e, apr_pool_t *pool); /** * Split one bucket in two at the specified position by duplicating * the bucket structure (not the data) and modifying any necessary * start/end/offset information. If it's not possible to do this * for the bucket type (perhaps the length of the data is indeterminate, * as with pipe and socket buckets), then APR_ENOTIMPL is returned. * @param e The bucket to split * @param point The offset of the first byte in the new bucket */ apr_status_t (*split)(apr_bucket *e, apr_size_t point); /** * Copy the bucket structure (not the data), assuming that this is * possible for the bucket type. If it's not, APR_ENOTIMPL is returned. * @param e The bucket to copy * @param c Returns a pointer to the new bucket */ apr_status_t (*copy)(apr_bucket *e, apr_bucket **c); }; /** * apr_bucket structures are allocated on the malloc() heap and * their lifetime is controlled by the parent apr_bucket_brigade * structure. Buckets can move from one brigade to another e.g. by * calling APR_BRIGADE_CONCAT(). In general the data in a bucket has * the same lifetime as the bucket and is freed when the bucket is * destroyed; if the data is shared by more than one bucket (e.g. * after a split) the data is freed when the last bucket goes away. */ struct apr_bucket { /** Links to the rest of the brigade */ APR_RING_ENTRY(apr_bucket) link; /** The type of bucket. */ const apr_bucket_type_t *type; /** The length of the data in the bucket. This could have been implemented * with a function, but this is an optimization, because the most * common thing to do will be to get the length. If the length is unknown, * the value of this field will be (apr_size_t)(-1). */ apr_size_t length; /** The start of the data in the bucket relative to the private base * pointer. The vast majority of bucket types allow a fixed block of * data to be referenced by multiple buckets, each bucket pointing to * a different segment of the data. That segment starts at base+start * and ends at base+start+length. * If the length == (apr_size_t)(-1), then start == -1. */ apr_off_t start; /** type-dependent data hangs off this pointer */ void *data; /** * Pointer to function used to free the bucket. This function should * always be defined and it should be consistent with the memory * function used to allocate the bucket. For example, if malloc() is * used to allocate the bucket, this pointer should point to free(). * @param e Pointer to the bucket being freed */ void (*free)(void *e); /** The freelist from which this bucket was allocated */ apr_bucket_alloc_t *list; }; /** A list of buckets */ struct apr_bucket_brigade { /** The pool to associate the brigade with. The data is not allocated out * of the pool, but a cleanup is registered with this pool. If the * brigade is destroyed by some mechanism other than pool destruction, * the destroying function is responsible for killing the cleanup. */ apr_pool_t *p; /** The buckets in the brigade are on this list. */ /* * The apr_bucket_list structure doesn't actually need a name tag * because it has no existence independent of struct apr_bucket_brigade; * the ring macros are designed so that you can leave the name tag * argument empty in this situation but apparently the Windows compiler * doesn't like that. */ APR_RING_HEAD(apr_bucket_list, apr_bucket) list; /** The freelist from which this bucket was allocated */ apr_bucket_alloc_t *bucket_alloc; }; /** * Function called when a brigade should be flushed */ typedef apr_status_t (*apr_brigade_flush)(apr_bucket_brigade *bb, void *ctx); /* * define APR_BUCKET_DEBUG if you want your brigades to be checked for * validity at every possible instant. this will slow your code down * substantially but is a very useful debugging tool. */ #ifdef APR_BUCKET_DEBUG #define APR_BRIGADE_CHECK_CONSISTENCY(b) \ APR_RING_CHECK_CONSISTENCY(&(b)->list, apr_bucket, link) #define APR_BUCKET_CHECK_CONSISTENCY(e) \ APR_RING_CHECK_ELEM_CONSISTENCY((e), apr_bucket, link) #else /** * checks the ring pointers in a bucket brigade for consistency. an * abort() will be triggered if any inconsistencies are found. * note: this is a no-op unless APR_BUCKET_DEBUG is defined. * @param b The brigade */ #define APR_BRIGADE_CHECK_CONSISTENCY(b) /** * checks the brigade a bucket is in for ring consistency. an * abort() will be triggered if any inconsistencies are found. * note: this is a no-op unless APR_BUCKET_DEBUG is defined. * @param e The bucket */ #define APR_BUCKET_CHECK_CONSISTENCY(e) #endif /** * Wrappers around the RING macros to reduce the verbosity of the code * that handles bucket brigades. */ /** * The magic pointer value that indicates the head of the brigade * @remark This is used to find the beginning and end of the brigade, eg: *
 *      while (e != APR_BRIGADE_SENTINEL(b)) {
 *          ...
 *          e = APR_BUCKET_NEXT(e);
 *      }
 * 
* @param b The brigade * @return The magic pointer value */ #define APR_BRIGADE_SENTINEL(b) APR_RING_SENTINEL(&(b)->list, apr_bucket, link) /** * Determine if the bucket brigade is empty * @param b The brigade to check * @return true or false */ #define APR_BRIGADE_EMPTY(b) APR_RING_EMPTY(&(b)->list, apr_bucket, link) /** * Return the first bucket in a brigade * @param b The brigade to query * @return The first bucket in the brigade */ #define APR_BRIGADE_FIRST(b) APR_RING_FIRST(&(b)->list) /** * Return the last bucket in a brigade * @param b The brigade to query * @return The last bucket in the brigade */ #define APR_BRIGADE_LAST(b) APR_RING_LAST(&(b)->list) /** * Insert a single bucket at the front of a brigade * @param b The brigade to add to * @param e The bucket to insert */ #define APR_BRIGADE_INSERT_HEAD(b, e) do { \ apr_bucket *ap__b = (e); \ APR_RING_INSERT_HEAD(&(b)->list, ap__b, apr_bucket, link); \ APR_BRIGADE_CHECK_CONSISTENCY((b)); \ } while (0) /** * Insert a single bucket at the end of a brigade * @param b The brigade to add to * @param e The bucket to insert */ #define APR_BRIGADE_INSERT_TAIL(b, e) do { \ apr_bucket *ap__b = (e); \ APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link); \ APR_BRIGADE_CHECK_CONSISTENCY((b)); \ } while (0) /** * Concatenate brigade b onto the end of brigade a, leaving brigade b empty * @param a The first brigade * @param b The second brigade */ #define APR_BRIGADE_CONCAT(a, b) do { \ APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link); \ APR_BRIGADE_CHECK_CONSISTENCY((a)); \ } while (0) /** * Prepend brigade b onto the beginning of brigade a, leaving brigade b empty * @param a The first brigade * @param b The second brigade */ #define APR_BRIGADE_PREPEND(a, b) do { \ APR_RING_PREPEND(&(a)->list, &(b)->list, apr_bucket, link); \ APR_BRIGADE_CHECK_CONSISTENCY((a)); \ } while (0) /** * Insert a single bucket before a specified bucket * @param a The bucket to insert before * @param b The bucket to insert */ #define APR_BUCKET_INSERT_BEFORE(a, b) do { \ apr_bucket *ap__a = (a), *ap__b = (b); \ APR_RING_INSERT_BEFORE(ap__a, ap__b, link); \ APR_BUCKET_CHECK_CONSISTENCY(ap__a); \ } while (0) /** * Insert a single bucket after a specified bucket * @param a The bucket to insert after * @param b The bucket to insert */ #define APR_BUCKET_INSERT_AFTER(a, b) do { \ apr_bucket *ap__a = (a), *ap__b = (b); \ APR_RING_INSERT_AFTER(ap__a, ap__b, link); \ APR_BUCKET_CHECK_CONSISTENCY(ap__a); \ } while (0) /** * Get the next bucket in the list * @param e The current bucket * @return The next bucket */ #define APR_BUCKET_NEXT(e) APR_RING_NEXT((e), link) /** * Get the previous bucket in the list * @param e The current bucket * @return The previous bucket */ #define APR_BUCKET_PREV(e) APR_RING_PREV((e), link) /** * Remove a bucket from its bucket brigade * @param e The bucket to remove */ #define APR_BUCKET_REMOVE(e) APR_RING_REMOVE((e), link) /** * Initialize a new bucket's prev/next pointers * @param e The bucket to initialize */ #define APR_BUCKET_INIT(e) APR_RING_ELEM_INIT((e), link) /** * Determine if a bucket contains metadata. An empty bucket is * safe to arbitrarily remove if and only if this is false. * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_METADATA(e) ((e)->type->is_metadata) /** * Determine if a bucket is a FLUSH bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_FLUSH(e) ((e)->type == &apr_bucket_type_flush) /** * Determine if a bucket is an EOS bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_EOS(e) ((e)->type == &apr_bucket_type_eos) /** * Determine if a bucket is a FILE bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_FILE(e) ((e)->type == &apr_bucket_type_file) /** * Determine if a bucket is a PIPE bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_PIPE(e) ((e)->type == &apr_bucket_type_pipe) /** * Determine if a bucket is a SOCKET bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_SOCKET(e) ((e)->type == &apr_bucket_type_socket) /** * Determine if a bucket is a HEAP bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_HEAP(e) ((e)->type == &apr_bucket_type_heap) /** * Determine if a bucket is a TRANSIENT bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_TRANSIENT(e) ((e)->type == &apr_bucket_type_transient) /** * Determine if a bucket is a IMMORTAL bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_IMMORTAL(e) ((e)->type == &apr_bucket_type_immortal) #if APR_HAS_MMAP /** * Determine if a bucket is a MMAP bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_MMAP(e) ((e)->type == &apr_bucket_type_mmap) #endif /** * Determine if a bucket is a POOL bucket * @param e The bucket to inspect * @return true or false */ #define APR_BUCKET_IS_POOL(e) ((e)->type == &apr_bucket_type_pool) /* * General-purpose reference counting for the various bucket types. * * Any bucket type that keeps track of the resources it uses (i.e. * most of them except for IMMORTAL, TRANSIENT, and EOS) needs to * attach a reference count to the resource so that it can be freed * when the last bucket that uses it goes away. Resource-sharing may * occur because of bucket splits or buckets that refer to globally * cached data. */ /** @see apr_bucket_refcount */ typedef struct apr_bucket_refcount apr_bucket_refcount; /** * The structure used to manage the shared resource must start with an * apr_bucket_refcount which is updated by the general-purpose refcount * code. A pointer to the bucket-type-dependent private data structure * can be cast to a pointer to an apr_bucket_refcount and vice versa. */ struct apr_bucket_refcount { /** The number of references to this bucket */ int refcount; }; /* ***** Reference-counted bucket types ***** */ /** @see apr_bucket_heap */ typedef struct apr_bucket_heap apr_bucket_heap; /** * A bucket referring to data allocated off the heap. */ struct apr_bucket_heap { /** Number of buckets using this memory */ apr_bucket_refcount refcount; /** The start of the data actually allocated. This should never be * modified, it is only used to free the bucket. */ char *base; /** how much memory was allocated */ apr_size_t alloc_len; /** function to use to delete the data */ void (*free_func)(void *data); }; /** @see apr_bucket_pool */ typedef struct apr_bucket_pool apr_bucket_pool; /** * A bucket referring to data allocated from a pool */ struct apr_bucket_pool { /** The pool bucket must be able to be easily morphed to a heap * bucket if the pool gets cleaned up before all references are * destroyed. This apr_bucket_heap structure is populated automatically * when the pool gets cleaned up, and subsequent calls to pool_read() * will result in the apr_bucket in question being morphed into a * regular heap bucket. (To avoid having to do many extra refcount * manipulations and b->data manipulations, the apr_bucket_pool * struct actually *contains* the apr_bucket_heap struct that it * will become as its first element; the two share their * apr_bucket_refcount members.) */ apr_bucket_heap heap; /** The block of data actually allocated from the pool. * Segments of this block are referenced by adjusting * the start and length of the apr_bucket accordingly. * This will be NULL after the pool gets cleaned up. */ const char *base; /** The pool the data was allocated from. When the pool * is cleaned up, this gets set to NULL as an indicator * to pool_read() that the data is now on the heap and * so it should morph the bucket into a regular heap * bucket before continuing. */ apr_pool_t *pool; /** The freelist this structure was allocated from, which is * needed in the cleanup phase in order to allocate space on the heap */ apr_bucket_alloc_t *list; }; #if APR_HAS_MMAP /** @see apr_bucket_mmap */ typedef struct apr_bucket_mmap apr_bucket_mmap; /** * A bucket referring to an mmap()ed file */ struct apr_bucket_mmap { /** Number of buckets using this memory */ apr_bucket_refcount refcount; /** The mmap this sub_bucket refers to */ apr_mmap_t *mmap; }; #endif /** @see apr_bucket_file */ typedef struct apr_bucket_file apr_bucket_file; /** * A bucket referring to an file */ struct apr_bucket_file { /** Number of buckets using this memory */ apr_bucket_refcount refcount; /** The file this bucket refers to */ apr_file_t *fd; /** The pool into which any needed structures should * be created while reading from this file bucket */ apr_pool_t *readpool; #if APR_HAS_MMAP /** Whether this bucket should be memory-mapped if * a caller tries to read from it */ int can_mmap; #endif /* APR_HAS_MMAP */ }; /** @see apr_bucket_structs */ typedef union apr_bucket_structs apr_bucket_structs; /** * A union of all bucket structures so we know what * the max size is. */ union apr_bucket_structs { apr_bucket b; /**< Bucket */ apr_bucket_heap heap; /**< Heap */ apr_bucket_pool pool; /**< Pool */ #if APR_HAS_MMAP apr_bucket_mmap mmap; /**< MMap */ #endif apr_bucket_file file; /**< File */ }; /** * The amount that apr_bucket_alloc() should allocate in the common case. * Note: this is twice as big as apr_bucket_structs to allow breathing * room for third-party bucket types. */ #define APR_BUCKET_ALLOC_SIZE APR_ALIGN_DEFAULT(2*sizeof(apr_bucket_structs)) /* ***** Bucket Brigade Functions ***** */ /** * Create a new bucket brigade. The bucket brigade is originally empty. * @param p The pool to associate with the brigade. Data is not allocated out * of the pool, but a cleanup is registered. * @param list The bucket allocator to use * @return The empty bucket brigade */ APU_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p, apr_bucket_alloc_t *list); /** * destroy an entire bucket brigade. This includes destroying all of the * buckets within the bucket brigade's bucket list. * @param b The bucket brigade to destroy */ APU_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b); /** * empty out an entire bucket brigade. This includes destroying all of the * buckets within the bucket brigade's bucket list. This is similar to * apr_brigade_destroy(), except that it does not deregister the brigade's * pool cleanup function. * @param data The bucket brigade to clean up * @remark Generally, you should use apr_brigade_destroy(). This function * can be useful in situations where you have a single brigade that * you wish to reuse many times by destroying all of the buckets in * the brigade and putting new buckets into it later. */ APU_DECLARE(apr_status_t) apr_brigade_cleanup(void *data); /** * Move the buckets from the tail end of the existing brigade @a b into * the brigade @a a. If @a a is NULL a new brigade is created. Buckets * from @a e to the last bucket (inclusively) of brigade @a b are moved * from @a b to the returned brigade @a a. * * @param b The brigade to split * @param e The first bucket to move * @param a The brigade which should be used for the result or NULL if * a new brigade should be created. The brigade @a a will be * cleared if it is not empty. * @return The brigade supplied in @a a or a new one if @a a was NULL. * @warning Note that this function allocates a new brigade if @a a is * NULL so memory consumption should be carefully considered. */ APU_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b, apr_bucket *e, apr_bucket_brigade *a); /** * Create a new bucket brigade and move the buckets from the tail end * of an existing brigade into the new brigade. Buckets from * @a e to the last bucket (inclusively) of brigade @a b * are moved from @a b to the returned brigade. * @param b The brigade to split * @param e The first bucket to move * @return The new brigade * @warning Note that this function always allocates a new brigade * so memory consumption should be carefully considered. */ APU_DECLARE(apr_bucket_brigade *) apr_brigade_split(apr_bucket_brigade *b, apr_bucket *e); /** * Partition a bucket brigade at a given offset (in bytes from the start of * the brigade). This is useful whenever a filter wants to use known ranges * of bytes from the brigade; the ranges can even overlap. * @param b The brigade to partition * @param point The offset at which to partition the brigade * @param after_point Returns a pointer to the first bucket after the partition * @return APR_SUCCESS on success, APR_INCOMPLETE if the contents of the * brigade were shorter than @a point, or an error code. * @remark if APR_INCOMPLETE is returned, @a after_point will be set to * the brigade sentinel. */ APU_DECLARE(apr_status_t) apr_brigade_partition(apr_bucket_brigade *b, apr_off_t point, apr_bucket **after_point); /** * Return the total length of the brigade. * @param bb The brigade to compute the length of * @param read_all Read unknown-length buckets to force a size * @param length Returns the length of the brigade (up to the end, or up * to a bucket read error), or -1 if the brigade has buckets * of indeterminate length and read_all is 0. */ APU_DECLARE(apr_status_t) apr_brigade_length(apr_bucket_brigade *bb, int read_all, apr_off_t *length); /** * Take a bucket brigade and store the data in a flat char* * @param bb The bucket brigade to create the char* from * @param c The char* to write into * @param len The maximum length of the char array. On return, it is the * actual length of the char array. */ APU_DECLARE(apr_status_t) apr_brigade_flatten(apr_bucket_brigade *bb, char *c, apr_size_t *len); /** * Creates a pool-allocated string representing a flat bucket brigade * @param bb The bucket brigade to create the char array from * @param c On return, the allocated char array * @param len On return, the length of the char array. * @param pool The pool to allocate the string from. */ APU_DECLARE(apr_status_t) apr_brigade_pflatten(apr_bucket_brigade *bb, char **c, apr_size_t *len, apr_pool_t *pool); /** * Split a brigade to represent one LF line. * @param bbOut The bucket brigade that will have the LF line appended to. * @param bbIn The input bucket brigade to search for a LF-line. * @param block The blocking mode to be used to split the line. * @param maxbytes The maximum bytes to read. If this many bytes are seen * without a LF, the brigade will contain a partial line. */ APU_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut, apr_bucket_brigade *bbIn, apr_read_type_e block, apr_off_t maxbytes); /** * Create an iovec of the elements in a bucket_brigade... return number * of elements used. This is useful for writing to a file or to the * network efficiently. * @param b The bucket brigade to create the iovec from * @param vec The iovec to create * @param nvec The number of elements in the iovec. On return, it is the * number of iovec elements actually filled out. */ APU_DECLARE(apr_status_t) apr_brigade_to_iovec(apr_bucket_brigade *b, struct iovec *vec, int *nvec); /** * This function writes a list of strings into a bucket brigade. * @param b The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param va A list of strings to add * @return APR_SUCCESS or error code. */ APU_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, va_list va); /** * This function writes a string into a bucket brigade. * * The apr_brigade_write function attempts to be efficient with the * handling of heap buckets. Regardless of the amount of data stored * inside a heap bucket, heap buckets are a fixed size to promote their * reuse. * * If an attempt is made to write a string to a brigade that already * ends with a heap bucket, this function will attempt to pack the * string into the remaining space in the previous heap bucket, before * allocating a new heap bucket. * * This function always returns APR_SUCCESS, unless a flush function is * passed, in which case the return value of the flush function will be * returned if used. * @param b The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param str The string to add * @param nbyte The number of bytes to write * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char *str, apr_size_t nbyte); /** * This function writes multiple strings into a bucket brigade. * @param b The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param vec The strings to add (address plus length for each) * @param nvec The number of entries in iovec * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_writev(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const struct iovec *vec, apr_size_t nvec); /** * This function writes a string into a bucket brigade. * @param bb The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param str The string to add * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, apr_brigade_flush flush, void *ctx, const char *str); /** * This function writes a character into a bucket brigade. * @param b The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param c The character to add * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_putc(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char c); /** * This function writes an unspecified number of strings into a bucket brigade. * @param b The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param ... The strings to add * @return APR_SUCCESS or error code */ APU_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, ...); /** * Evaluate a printf and put the resulting string at the end * of the bucket brigade. * @param b The brigade to write to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param fmt The format of the string to write * @param ... The arguments to fill out the format * @return APR_SUCCESS or error code */ APU_DECLARE_NONSTD(apr_status_t) apr_brigade_printf(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char *fmt, ...) __attribute__((format(printf,4,5))); /** * Evaluate a printf and put the resulting string at the end * of the bucket brigade. * @param b The brigade to write to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param fmt The format of the string to write * @param va The arguments to fill out the format * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_vprintf(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char *fmt, va_list va); /** * Utility function to insert a file (or a segment of a file) onto the * end of the brigade. The file is split into multiple buckets if it * is larger than the maximum size which can be represented by a * single bucket. * @param bb the brigade to insert into * @param f the file to insert * @param start the offset of the start of the segment * @param len the length of the segment of the file to insert * @param p pool from which file buckets are allocated * @return the last bucket inserted */ APU_DECLARE(apr_bucket *) apr_brigade_insert_file(apr_bucket_brigade *bb, apr_file_t *f, apr_off_t start, apr_off_t len, apr_pool_t *p); /* ***** Bucket freelist functions ***** */ /** * Create a bucket allocator. * @param p This pool's underlying apr_allocator_t is used to allocate memory * for the bucket allocator. When the pool is destroyed, the bucket * allocator's cleanup routine will free all memory that has been * allocated from it. * @remark The reason the allocator gets its memory from the pool's * apr_allocator_t rather than from the pool itself is because * the bucket allocator will free large memory blocks back to the * allocator when it's done with them, thereby preventing memory * footprint growth that would occur if we allocated from the pool. * @warning The allocator must never be used by more than one thread at a time. */ APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create(apr_pool_t *p); /** * Create a bucket allocator. * @param allocator This apr_allocator_t is used to allocate both the bucket * allocator and all memory handed out by the bucket allocator. The * caller is responsible for destroying the bucket allocator and the * apr_allocator_t -- no automatic cleanups will happen. * @warning The allocator must never be used by more than one thread at a time. */ APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex(apr_allocator_t *allocator); /** * Destroy a bucket allocator. * @param list The allocator to be destroyed */ APU_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list); /** * Allocate memory for use by the buckets. * @param size The amount to allocate. * @param list The allocator from which to allocate the memory. */ APU_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, apr_bucket_alloc_t *list); /** * Free memory previously allocated with apr_bucket_alloc(). * @param block The block of memory to be freed. */ APU_DECLARE_NONSTD(void) apr_bucket_free(void *block); /* ***** Bucket Functions ***** */ /** * Free the resources used by a bucket. If multiple buckets refer to * the same resource it is freed when the last one goes away. * @see apr_bucket_delete() * @param e The bucket to destroy */ #define apr_bucket_destroy(e) do { \ (e)->type->destroy((e)->data); \ (e)->free(e); \ } while (0) /** * Delete a bucket by removing it from its brigade (if any) and then * destroying it. * @remark This mainly acts as an aid in avoiding code verbosity. It is * the preferred exact equivalent to: *
 *      APR_BUCKET_REMOVE(e);
 *      apr_bucket_destroy(e);
 * 
* @param e The bucket to delete */ #define apr_bucket_delete(e) do { \ APR_BUCKET_REMOVE(e); \ apr_bucket_destroy(e); \ } while (0) /** * Read some data from the bucket. * * The apr_bucket_read function returns a convenient amount of data * from the bucket provided, writing the address and length of the * data to the pointers provided by the caller. The function tries * as hard as possible to avoid a memory copy. * * Buckets are expected to be a member of a brigade at the time they * are read. * * In typical application code, buckets are read in a loop, and after * each bucket is read and processed, it is moved or deleted from the * brigade and the next bucket read. * * The definition of "convenient" depends on the type of bucket that * is being read, and is decided by APR. In the case of memory based * buckets such as heap and immortal buckets, a pointer will be * returned to the location of the buffer containing the complete * contents of the bucket. * * Some buckets, such as the socket bucket, might have no concept * of length. If an attempt is made to read such a bucket, the * apr_bucket_read function will read a convenient amount of data * from the socket. The socket bucket is magically morphed into a * heap bucket containing the just-read data, and a new socket bucket * is inserted just after this heap bucket. * * To understand why apr_bucket_read might do this, consider the loop * described above to read and process buckets. The current bucket * is magically morphed into a heap bucket and returned to the caller. * The caller processes the data, and deletes the heap bucket, moving * onto the next bucket, the new socket bucket. This process repeats, * giving the illusion of a bucket brigade that contains potentially * infinite amounts of data. It is up to the caller to decide at what * point to stop reading buckets. * * Some buckets, such as the file bucket, might have a fixed size, * but be significantly larger than is practical to store in RAM in * one go. As with the socket bucket, if an attempt is made to read * from a file bucket, the file bucket is magically morphed into a * heap bucket containing a convenient amount of data read from the * current offset in the file. During the read, the offset will be * moved forward on the file, and a new file bucket will be inserted * directly after the current bucket representing the remainder of the * file. If the heap bucket was large enough to store the whole * remainder of the file, no more file buckets are inserted, and the * file bucket will disappear completely. * * The pattern for reading buckets described above does create the * illusion that the code is willing to swallow buckets that might be * too large for the system to handle in one go. This however is just * an illusion: APR will always ensure that large (file) or infinite * (socket) buckets are broken into convenient bite sized heap buckets * before data is returned to the caller. * * There is a potential gotcha to watch for: if buckets are read in a * loop, and aren't deleted after being processed, the potentially large * bucket will slowly be converted into RAM resident heap buckets. If * the file is larger than available RAM, an out of memory condition * could be caused if the application is not careful to manage this. * * @param e The bucket to read from * @param str The location to store a pointer to the data in * @param len The location to store the amount of data read * @param block Whether the read function blocks */ #define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block) /** * Setaside data so that stack data is not destroyed on returning from * the function * @param e The bucket to setaside * @param p The pool to setaside into */ #define apr_bucket_setaside(e,p) (e)->type->setaside(e,p) /** * Split one bucket in two at the point provided. * * Once split, the original bucket becomes the first of the two new buckets. * * (It is assumed that the bucket is a member of a brigade when this * function is called). * @param e The bucket to split * @param point The offset to split the bucket at */ #define apr_bucket_split(e,point) (e)->type->split(e, point) /** * Copy a bucket. * @param e The bucket to copy * @param c Returns a pointer to the new bucket */ #define apr_bucket_copy(e,c) (e)->type->copy(e, c) /* Bucket type handling */ /** * This function simply returns APR_SUCCESS to denote that the bucket does * not require anything to happen for its setaside() function. This is * appropriate for buckets that have "immortal" data -- the data will live * at least as long as the bucket. * @param data The bucket to setaside * @param pool The pool defining the desired lifetime of the bucket data * @return APR_SUCCESS */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_setaside_noop(apr_bucket *data, apr_pool_t *pool); /** * A place holder function that signifies that the setaside function was not * implemented for this bucket * @param data The bucket to setaside * @param pool The pool defining the desired lifetime of the bucket data * @return APR_ENOTIMPL */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_setaside_notimpl(apr_bucket *data, apr_pool_t *pool); /** * A place holder function that signifies that the split function was not * implemented for this bucket * @param data The bucket to split * @param point The location to split the bucket * @return APR_ENOTIMPL */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_split_notimpl(apr_bucket *data, apr_size_t point); /** * A place holder function that signifies that the copy function was not * implemented for this bucket * @param e The bucket to copy * @param c Returns a pointer to the new bucket * @return APR_ENOTIMPL */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_copy_notimpl(apr_bucket *e, apr_bucket **c); /** * A place holder function that signifies that this bucket does not need * to do anything special to be destroyed. That's only the case for buckets * that either have no data (metadata buckets) or buckets whose data pointer * points to something that's not a bucket-type-specific structure, as with * simple buckets where data points to a string and pipe buckets where data * points directly to the apr_file_t. * @param data The bucket data to destroy */ APU_DECLARE_NONSTD(void) apr_bucket_destroy_noop(void *data); /** * There is no apr_bucket_destroy_notimpl, because destruction is required * to be implemented (it could be a noop, but only if that makes sense for * the bucket type) */ /* There is no apr_bucket_read_notimpl, because it is a required function */ /* All of the bucket types implemented by the core */ /** * The flush bucket type. This signifies that all data should be flushed to * the next filter. The flush bucket should be sent with the other buckets. */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_flush; /** * The EOS bucket type. This signifies that there will be no more data, ever. * All filters MUST send all data to the next filter when they receive a * bucket of this type */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_eos; /** * The FILE bucket type. This bucket represents a file on disk */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_file; /** * The HEAP bucket type. This bucket represents a data allocated from the * heap. */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_heap; #if APR_HAS_MMAP /** * The MMAP bucket type. This bucket represents an MMAP'ed file */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_mmap; #endif /** * The POOL bucket type. This bucket represents a data that was allocated * from a pool. IF this bucket is still available when the pool is cleared, * the data is copied on to the heap. */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_pool; /** * The PIPE bucket type. This bucket represents a pipe to another program. */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_pipe; /** * The IMMORTAL bucket type. This bucket represents a segment of data that * the creator is willing to take responsibility for. The core will do * nothing with the data in an immortal bucket */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_immortal; /** * The TRANSIENT bucket type. This bucket represents a data allocated off * the stack. When the setaside function is called, this data is copied on * to the heap */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_transient; /** * The SOCKET bucket type. This bucket represents a socket to another machine */ APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_socket; /* ***** Simple buckets ***** */ /** * Split a simple bucket into two at the given point. Most non-reference * counting buckets that allow multiple references to the same block of * data (eg transient and immortal) will use this as their split function * without any additional type-specific handling. * @param b The bucket to be split * @param point The offset of the first byte in the new bucket * @return APR_EINVAL if the point is not within the bucket; * APR_ENOMEM if allocation failed; * or APR_SUCCESS */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_split(apr_bucket *b, apr_size_t point); /** * Copy a simple bucket. Most non-reference-counting buckets that allow * multiple references to the same block of data (eg transient and immortal) * will use this as their copy function without any additional type-specific * handling. * @param a The bucket to copy * @param b Returns a pointer to the new bucket * @return APR_ENOMEM if allocation failed; * or APR_SUCCESS */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_copy(apr_bucket *a, apr_bucket **b); /* ***** Shared, reference-counted buckets ***** */ /** * Initialize a bucket containing reference-counted data that may be * shared. The caller must allocate the bucket if necessary and * initialize its type-dependent fields, and allocate and initialize * its own private data structure. This function should only be called * by type-specific bucket creation functions. * @param b The bucket to initialize * @param data A pointer to the private data structure * with the reference count at the start * @param start The start of the data in the bucket * relative to the private base pointer * @param length The length of the data in the bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_shared_make(apr_bucket *b, void *data, apr_off_t start, apr_size_t length); /** * Decrement the refcount of the data in the bucket. This function * should only be called by type-specific bucket destruction functions. * @param data The private data pointer from the bucket to be destroyed * @return TRUE or FALSE; TRUE if the reference count is now * zero, indicating that the shared resource itself can * be destroyed by the caller. */ APU_DECLARE(int) apr_bucket_shared_destroy(void *data); /** * Split a bucket into two at the given point, and adjust the refcount * to the underlying data. Most reference-counting bucket types will * be able to use this function as their split function without any * additional type-specific handling. * @param b The bucket to be split * @param point The offset of the first byte in the new bucket * @return APR_EINVAL if the point is not within the bucket; * APR_ENOMEM if allocation failed; * or APR_SUCCESS */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_shared_split(apr_bucket *b, apr_size_t point); /** * Copy a refcounted bucket, incrementing the reference count. Most * reference-counting bucket types will be able to use this function * as their copy function without any additional type-specific handling. * @param a The bucket to copy * @param b Returns a pointer to the new bucket * @return APR_ENOMEM if allocation failed; or APR_SUCCESS */ APU_DECLARE_NONSTD(apr_status_t) apr_bucket_shared_copy(apr_bucket *a, apr_bucket **b); /* ***** Functions to Create Buckets of varying types ***** */ /* * Each bucket type foo has two initialization functions: * apr_bucket_foo_make which sets up some already-allocated memory as a * bucket of type foo; and apr_bucket_foo_create which allocates memory * for the bucket, calls apr_bucket_make_foo, and initializes the * bucket's list pointers. The apr_bucket_foo_make functions are used * inside the bucket code to change the type of buckets in place; * other code should call apr_bucket_foo_create. All the initialization * functions change nothing if they fail. */ /** * Create an End of Stream bucket. This indicates that there is no more data * coming from down the filter stack. All filters should flush at this point. * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t *list); /** * Make the bucket passed in an EOS bucket. This indicates that there is no * more data coming from down the filter stack. All filters should flush at * this point. * @param b The bucket to make into an EOS bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b); /** * Create a flush bucket. This indicates that filters should flush their * data. There is no guarantee that they will flush it, but this is the * best we can do. * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t *list); /** * Make the bucket passed in a FLUSH bucket. This indicates that filters * should flush their data. There is no guarantee that they will flush it, * but this is the best we can do. * @param b The bucket to make into a FLUSH bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_flush_make(apr_bucket *b); /** * Create a bucket referring to long-lived data. * @param buf The data to insert into the bucket * @param nbyte The size of the data to insert. * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf, apr_size_t nbyte, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to long-lived data * @param b The bucket to make into a IMMORTAL bucket * @param buf The data to insert into the bucket * @param nbyte The size of the data to insert. * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_immortal_make(apr_bucket *b, const char *buf, apr_size_t nbyte); /** * Create a bucket referring to data on the stack. * @param buf The data to insert into the bucket * @param nbyte The size of the data to insert. * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf, apr_size_t nbyte, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to stack data * @param b The bucket to make into a TRANSIENT bucket * @param buf The data to insert into the bucket * @param nbyte The size of the data to insert. * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_transient_make(apr_bucket *b, const char *buf, apr_size_t nbyte); /** * Create a bucket referring to memory on the heap. If the caller asks * for the data to be copied, this function always allocates 4K of * memory so that more data can be added to the bucket without * requiring another allocation. Therefore not all the data may be put * into the bucket. If copying is not requested then the bucket takes * over responsibility for free()ing the memory. * @param buf The buffer to insert into the bucket * @param nbyte The size of the buffer to insert. * @param free_func Function to use to free the data; NULL indicates that the * bucket should make a copy of the data * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf, apr_size_t nbyte, void (*free_func)(void *data), apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to heap data * @param b The bucket to make into a HEAP bucket * @param buf The buffer to insert into the bucket * @param nbyte The size of the buffer to insert. * @param free_func Function to use to free the data; NULL indicates that the * bucket should make a copy of the data * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_heap_make(apr_bucket *b, const char *buf, apr_size_t nbyte, void (*free_func)(void *data)); /** * Create a bucket referring to memory allocated from a pool. * * @param buf The buffer to insert into the bucket * @param length The number of bytes referred to by this bucket * @param pool The pool the memory was allocated from * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf, apr_size_t length, apr_pool_t *pool, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to pool data * @param b The bucket to make into a pool bucket * @param buf The buffer to insert into the bucket * @param length The number of bytes referred to by this bucket * @param pool The pool the memory was allocated from * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_pool_make(apr_bucket *b, const char *buf, apr_size_t length, apr_pool_t *pool); #if APR_HAS_MMAP /** * Create a bucket referring to mmap()ed memory. * @param mm The mmap to insert into the bucket * @param start The offset of the first byte in the mmap * that this bucket refers to * @param length The number of bytes referred to by this bucket * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_mmap_create(apr_mmap_t *mm, apr_off_t start, apr_size_t length, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to an MMAP'ed file * @param b The bucket to make into a MMAP bucket * @param mm The mmap to insert into the bucket * @param start The offset of the first byte in the mmap * that this bucket refers to * @param length The number of bytes referred to by this bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_mmap_make(apr_bucket *b, apr_mmap_t *mm, apr_off_t start, apr_size_t length); #endif /** * Create a bucket referring to a socket. * @param thissock The socket to put in the bucket * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *thissock, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to a socket * @param b The bucket to make into a SOCKET bucket * @param thissock The socket to put in the bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_socket_make(apr_bucket *b, apr_socket_t *thissock); /** * Create a bucket referring to a pipe. * @param thispipe The pipe to put in the bucket * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *thispipe, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to a pipe * @param b The bucket to make into a PIPE bucket * @param thispipe The pipe to put in the bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_pipe_make(apr_bucket *b, apr_file_t *thispipe); /** * Create a bucket referring to a file. * @param fd The file to put in the bucket * @param offset The offset where the data of interest begins in the file * @param len The amount of data in the file we are interested in * @param p The pool into which any needed structures should be created * while reading from this file bucket * @param list The freelist from which this bucket should be allocated * @return The new bucket, or NULL if allocation failed * @remark If the file is truncated such that the segment of the file * referenced by the bucket no longer exists, an attempt to read * from the bucket will fail with APR_EOF. * @remark apr_brigade_insert_file() should generally be used to * insert files into brigades, since that function can correctly * handle large file issues. */ APU_DECLARE(apr_bucket *) apr_bucket_file_create(apr_file_t *fd, apr_off_t offset, apr_size_t len, apr_pool_t *p, apr_bucket_alloc_t *list); /** * Make the bucket passed in a bucket refer to a file * @param b The bucket to make into a FILE bucket * @param fd The file to put in the bucket * @param offset The offset where the data of interest begins in the file * @param len The amount of data in the file we are interested in * @param p The pool into which any needed structures should be created * while reading from this file bucket * @return The new bucket, or NULL if allocation failed */ APU_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd, apr_off_t offset, apr_size_t len, apr_pool_t *p); /** * Enable or disable memory-mapping for a FILE bucket (default is enabled) * @param b The bucket * @param enabled Whether memory-mapping should be enabled * @return APR_SUCCESS normally, or an error code if the operation fails */ APU_DECLARE(apr_status_t) apr_bucket_file_enable_mmap(apr_bucket *b, int enabled); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_BUCKETS_H */ ================================================ FILE: third_party/include/aprutil/apr_crypto.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_CRYPTO_H #define APR_CRYPTO_H #include "apu.h" #include "apr_pools.h" #include "apr_tables.h" #include "apr_hash.h" #include "apu_errno.h" #ifdef __cplusplus extern "C" { #endif /** * @file apr_crypto.h * @brief APR-UTIL Crypto library */ /** * @defgroup APR_Util_Crypto Crypto routines * @ingroup APR_Util * @{ */ #if APU_HAVE_CRYPTO #ifndef APU_CRYPTO_RECOMMENDED_DRIVER #if APU_HAVE_OPENSSL #define APU_CRYPTO_RECOMMENDED_DRIVER "openssl" #else #if APU_HAVE_NSS #define APU_CRYPTO_RECOMMENDED_DRIVER "nss" #else #if APU_HAVE_MSCNG #define APU_CRYPTO_RECOMMENDED_DRIVER "mscng" #else #if APU_HAVE_MSCAPI #define APU_CRYPTO_RECOMMENDED_DRIVER "mscapi" #else #endif #endif #endif #endif #endif /** * Symmetric Key types understood by the library. * * NOTE: It is expected that this list will grow over time. * * Interoperability Matrix: * * The matrix is based on the testcrypto.c unit test, which attempts to * test whether a simple encrypt/decrypt will succeed, as well as testing * whether an encrypted string by one library can be decrypted by the * others. * * Some libraries will successfully encrypt and decrypt their own data, * but won't decrypt data from another library. It is hoped that over * time these anomalies will be found and fixed, but until then it is * recommended that ciphers are chosen that interoperate across platform. * * An X below means the test passes, it does not necessarily mean that * encryption performed is correct or secure. Applications should stick * to ciphers that pass the interoperablity tests on the right hand side * of the table. * * Aligned data is data whose length is a multiple of the block size for * the chosen cipher. Padded data is data that is not aligned by block * size and must be padded by the crypto library. * * OpenSSL NSS Interop * Align Pad Align Pad Align Pad * 3DES_192/CBC X X X X X X * 3DES_192/ECB X X * AES_256/CBC X X X X X X * AES_256/ECB X X X X * AES_192/CBC X X X X * AES_192/ECB X X X * AES_128/CBC X X X X * AES_128/ECB X X X * * Conclusion: for padded data, use 3DES_192/CBC or AES_256/CBC. For * aligned data, use 3DES_192/CBC, AES_256/CBC or AES_256/ECB. */ typedef enum { APR_KEY_NONE, APR_KEY_3DES_192, /** 192 bit (3-Key) 3DES */ APR_KEY_AES_128, /** 128 bit AES */ APR_KEY_AES_192, /** 192 bit AES */ APR_KEY_AES_256 /** 256 bit AES */ } apr_crypto_block_key_type_e; typedef enum { APR_MODE_NONE, /** An error condition */ APR_MODE_ECB, /** Electronic Code Book */ APR_MODE_CBC /** Cipher Block Chaining */ } apr_crypto_block_key_mode_e; /* These are opaque structs. Instantiation is up to each backend */ typedef struct apr_crypto_driver_t apr_crypto_driver_t; typedef struct apr_crypto_t apr_crypto_t; typedef struct apr_crypto_config_t apr_crypto_config_t; typedef struct apr_crypto_key_t apr_crypto_key_t; typedef struct apr_crypto_block_t apr_crypto_block_t; /** * @brief Perform once-only initialisation. Call once only. * * @param pool - pool to register any shutdown cleanups, etc * @return APR_NOTIMPL in case of no crypto support. */ APU_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool); /** * @brief Register a cleanup to zero out the buffer provided * when the pool is cleaned up. * * @param pool - pool to register the cleanup * @param buffer - buffer to zero out * @param size - size of the buffer to zero out */ APU_DECLARE(apr_status_t) apr_crypto_clear(apr_pool_t *pool, void *buffer, apr_size_t size); /** * @brief Get the driver struct for a name * * @param driver - pointer to driver struct. * @param name - driver name * @param params - array of initialisation parameters * @param result - result and error message on failure * @param pool - (process) pool to register cleanup * @return APR_SUCCESS for success * @return APR_ENOTIMPL for no driver (when DSO not enabled) * @return APR_EDSOOPEN if DSO driver file can't be opened * @return APR_ESYMNOTFOUND if the driver file doesn't contain a driver * @remarks NSS: the params can have "dir", "key3", "cert7" and "secmod" * keys, each followed by an equal sign and a value. Such key/value pairs can * be delimited by space or tab. If the value contains a space, surround the * whole key value pair in quotes: "dir=My Directory". * @remarks OpenSSL: currently no params are supported. */ APU_DECLARE(apr_status_t) apr_crypto_get_driver( const apr_crypto_driver_t **driver, const char *name, const char *params, const apu_err_t **result, apr_pool_t *pool); /** * @brief Return the name of the driver. * * @param driver - The driver in use. * @return The name of the driver. */ APU_DECLARE(const char *) apr_crypto_driver_name( const apr_crypto_driver_t *driver); /** * @brief Get the result of the last operation on a context. If the result * is NULL, the operation was successful. * @param result - the result structure * @param f - context pointer * @return APR_SUCCESS for success */ APU_DECLARE(apr_status_t) apr_crypto_error(const apu_err_t **result, const apr_crypto_t *f); /** * @brief Create a context for supporting encryption. Keys, certificates, * algorithms and other parameters will be set per context. More than * one context can be created at one time. A cleanup will be automatically * registered with the given pool to guarantee a graceful shutdown. * @param f - context pointer will be written here * @param driver - driver to use * @param params - array of key parameters * @param pool - process pool * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. * @remarks NSS: currently no params are supported. * @remarks OpenSSL: the params can have "engine" as a key, followed by an equal * sign and a value. */ APU_DECLARE(apr_status_t) apr_crypto_make(apr_crypto_t **f, const apr_crypto_driver_t *driver, const char *params, apr_pool_t *pool); /** * @brief Get a hash table of key types, keyed by the name of the type against * an integer pointer constant. * * @param types - hashtable of key types keyed to constants. * @param f - encryption context * @return APR_SUCCESS for success */ APU_DECLARE(apr_status_t) apr_crypto_get_block_key_types(apr_hash_t **types, const apr_crypto_t *f); /** * @brief Get a hash table of key modes, keyed by the name of the mode against * an integer pointer constant. * * @param modes - hashtable of key modes keyed to constants. * @param f - encryption context * @return APR_SUCCESS for success */ APU_DECLARE(apr_status_t) apr_crypto_get_block_key_modes(apr_hash_t **modes, const apr_crypto_t *f); /** * @brief Create a key from the given passphrase. By default, the PBKDF2 * algorithm is used to generate the key from the passphrase. It is expected * that the same pass phrase will generate the same key, regardless of the * backend crypto platform used. The key is cleaned up when the context * is cleaned, and may be reused with multiple encryption or decryption * operations. * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If * *key is not NULL, *key must point at a previously created structure. * @param key The key returned, see note. * @param ivSize The size of the initialisation vector will be returned, based * on whether an IV is relevant for this type of crypto. * @param pass The passphrase to use. * @param passLen The passphrase length in bytes * @param salt The salt to use. * @param saltLen The salt length in bytes * @param type 3DES_192, AES_128, AES_192, AES_256. * @param mode Electronic Code Book / Cipher Block Chaining. * @param doPad Pad if necessary. * @param iterations Number of iterations to use in algorithm * @param f The context to use. * @param p The pool to use. * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend * error occurred while generating the key. APR_ENOCIPHER if the type or mode * is not supported by the particular backend. APR_EKEYTYPE if the key type is * not known. APR_EPADDING if padding was requested but is not supported. * APR_ENOTIMPL if not implemented. */ APU_DECLARE(apr_status_t) apr_crypto_passphrase(apr_crypto_key_t **key, apr_size_t *ivSize, const char *pass, apr_size_t passLen, const unsigned char * salt, apr_size_t saltLen, const apr_crypto_block_key_type_e type, const apr_crypto_block_key_mode_e mode, const int doPad, const int iterations, const apr_crypto_t *f, apr_pool_t *p); /** * @brief Initialise a context for encrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. * @param ctx The block context returned, see note. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. * If the buffer pointed to is not NULL, the IV in the buffer will be * used. * @param key The key structure to use. * @param blockSize The block size of the cipher. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ APU_DECLARE(apr_status_t) apr_crypto_block_encrypt_init( apr_crypto_block_t **ctx, const unsigned char **iv, const apr_crypto_key_t *key, apr_size_t *blockSize, apr_pool_t *p); /** * @brief Encrypt data provided by in, write it to out. * @note The number of bytes written will be written to outlen. If * out is NULL, outlen will contain the maximum size of the * buffer needed to hold the data, including any data * generated by apr_crypto_block_encrypt_finish below. If *out points * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ APU_DECLARE(apr_status_t) apr_crypto_block_encrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx); /** * @brief Encrypt final data block, write it to out. * @note If necessary the final block will be written out after being * padded. Typically the final block will be written to the * same buffer used by apr_crypto_block_encrypt, offset by the * number of bytes returned as actually written by the * apr_crypto_block_encrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_encrypt_init(). * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ APU_DECLARE(apr_status_t) apr_crypto_block_encrypt_finish(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *ctx); /** * @brief Initialise a context for decrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. * @param ctx The block context returned, see note. * @param blockSize The block size of the cipher. * @param iv Optional initialisation vector. * @param key The key structure to use. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ APU_DECLARE(apr_status_t) apr_crypto_block_decrypt_init( apr_crypto_block_t **ctx, apr_size_t *blockSize, const unsigned char *iv, const apr_crypto_key_t *key, apr_pool_t *p); /** * @brief Decrypt data provided by in, write it to out. * @note The number of bytes written will be written to outlen. If * out is NULL, outlen will contain the maximum size of the * buffer needed to hold the data, including any data * generated by apr_crypto_block_decrypt_finish below. If *out points * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ APU_DECLARE(apr_status_t) apr_crypto_block_decrypt(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx); /** * @brief Decrypt final data block, write it to out. * @note If necessary the final block will be written out after being * padded. Typically the final block will be written to the * same buffer used by apr_crypto_block_decrypt, offset by the * number of bytes returned as actually written by the * apr_crypto_block_decrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_decrypt_init(). * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ APU_DECLARE(apr_status_t) apr_crypto_block_decrypt_finish(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *ctx); /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. * @param ctx The block context to use. * @return Returns APR_ENOTIMPL if not supported. */ APU_DECLARE(apr_status_t) apr_crypto_block_cleanup(apr_crypto_block_t *ctx); /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ APU_DECLARE(apr_status_t) apr_crypto_cleanup(apr_crypto_t *f); /** * @brief Shutdown the crypto library. * @note After shutdown, it is expected that the init function can be called again. * @param driver - driver to use * @return Returns APR_ENOTIMPL if not supported. */ APU_DECLARE(apr_status_t) apr_crypto_shutdown( const apr_crypto_driver_t *driver); #endif /* APU_HAVE_CRYPTO */ /** @} */ #ifdef __cplusplus } #endif #endif ================================================ FILE: third_party/include/aprutil/apr_date.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_DATE_H #define APR_DATE_H /** * @file apr_date.h * @brief APR-UTIL date routines */ /** * @defgroup APR_Util_Date Date routines * @ingroup APR_Util * @{ */ /* * apr_date.h: prototypes for date parsing utility routines */ #include "apu.h" #include "apr_time.h" #ifdef __cplusplus extern "C" { #endif /** A bad date. */ #define APR_DATE_BAD ((apr_time_t)0) /** * Compare a string to a mask * @param data The string to compare * @param mask Mask characters (arbitrary maximum is 256 characters): *
 *   '\@' - uppercase letter
 *   '\$' - lowercase letter
 *   '\&' - hex digit
 *   '#' - digit
 *   '~' - digit or space
 *   '*' - swallow remaining characters
 * 
* @remark The mask tests for an exact match for any other character * @return 1 if the string matches, 0 otherwise */ APU_DECLARE(int) apr_date_checkmask(const char *data, const char *mask); /** * Parses an HTTP date in one of three standard forms: *
 *     Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
 *     Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
 *     Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
 * 
* @param date The date in one of the three formats above * @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or * 0 if this would be out of range or if the date is invalid. */ APU_DECLARE(apr_time_t) apr_date_parse_http(const char *date); /** * Parses a string resembling an RFC 822 date. This is meant to be * leinent in its parsing of dates. Hence, this will parse a wider * range of dates than apr_date_parse_http. * * The prominent mailer (or poster, if mailer is unknown) that has * been seen in the wild is included for the unknown formats. *
 *     Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
 *     Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
 *     Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
 *     Sun, 6 Nov 1994 08:49:37 GMT   ; RFC 822, updated by RFC 1123
 *     Sun, 06 Nov 94 08:49:37 GMT    ; RFC 822
 *     Sun, 6 Nov 94 08:49:37 GMT     ; RFC 822
 *     Sun, 06 Nov 94 08:49 GMT       ; Unknown [drtr\@ast.cam.ac.uk] 
 *     Sun, 6 Nov 94 08:49 GMT        ; Unknown [drtr\@ast.cam.ac.uk]
 *     Sun, 06 Nov 94 8:49:37 GMT     ; Unknown [Elm 70.85]
 *     Sun, 6 Nov 94 8:49:37 GMT      ; Unknown [Elm 70.85] 
 * 
* * @param date The date in one of the formats above * @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or * 0 if this would be out of range or if the date is invalid. */ APU_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_DATE_H */ ================================================ FILE: third_party/include/aprutil/apr_dbd.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Overview of what this is and does: * http://www.apache.org/~niq/dbd.html */ #ifndef APR_DBD_H #define APR_DBD_H #include "apu.h" #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /** * @file apr_dbd.h * @brief APR-UTIL DBD library */ /** * @defgroup APR_Util_DBD DBD routines * @ingroup APR_Util * @{ */ /** * Mapping of C to SQL types, used for prepared statements. * @remarks * For apr_dbd_p[v]query/select functions, in and out parameters are always * const char * (i.e. regular nul terminated strings). LOB types are passed * with four (4) arguments: payload, length, table and column, all as const * char *, where table and column are reserved for future use by Oracle. * @remarks * For apr_dbd_p[v]bquery/select functions, in and out parameters are * described next to each enumeration constant and are generally native binary * types or some APR data type. LOB types are passed with four (4) arguments: * payload (char*), length (apr_size_t*), table (char*) and column (char*). * Table and column are reserved for future use by Oracle. */ typedef enum { APR_DBD_TYPE_NONE, APR_DBD_TYPE_TINY, /**< \%hhd : in, out: char* */ APR_DBD_TYPE_UTINY, /**< \%hhu : in, out: unsigned char* */ APR_DBD_TYPE_SHORT, /**< \%hd : in, out: short* */ APR_DBD_TYPE_USHORT, /**< \%hu : in, out: unsigned short* */ APR_DBD_TYPE_INT, /**< \%d : in, out: int* */ APR_DBD_TYPE_UINT, /**< \%u : in, out: unsigned int* */ APR_DBD_TYPE_LONG, /**< \%ld : in, out: long* */ APR_DBD_TYPE_ULONG, /**< \%lu : in, out: unsigned long* */ APR_DBD_TYPE_LONGLONG, /**< \%lld : in, out: apr_int64_t* */ APR_DBD_TYPE_ULONGLONG, /**< \%llu : in, out: apr_uint64_t* */ APR_DBD_TYPE_FLOAT, /**< \%f : in, out: float* */ APR_DBD_TYPE_DOUBLE, /**< \%lf : in, out: double* */ APR_DBD_TYPE_STRING, /**< \%s : in: char*, out: char** */ APR_DBD_TYPE_TEXT, /**< \%pDt : in: char*, out: char** */ APR_DBD_TYPE_TIME, /**< \%pDi : in: char*, out: char** */ APR_DBD_TYPE_DATE, /**< \%pDd : in: char*, out: char** */ APR_DBD_TYPE_DATETIME, /**< \%pDa : in: char*, out: char** */ APR_DBD_TYPE_TIMESTAMP, /**< \%pDs : in: char*, out: char** */ APR_DBD_TYPE_ZTIMESTAMP, /**< \%pDz : in: char*, out: char** */ APR_DBD_TYPE_BLOB, /**< \%pDb : in: char* apr_size_t* char* char*, out: apr_bucket_brigade* */ APR_DBD_TYPE_CLOB, /**< \%pDc : in: char* apr_size_t* char* char*, out: apr_bucket_brigade* */ APR_DBD_TYPE_NULL /**< \%pDn : in: void*, out: void** */ } apr_dbd_type_e; /* These are opaque structs. Instantiation is up to each backend */ typedef struct apr_dbd_driver_t apr_dbd_driver_t; typedef struct apr_dbd_t apr_dbd_t; typedef struct apr_dbd_transaction_t apr_dbd_transaction_t; typedef struct apr_dbd_results_t apr_dbd_results_t; typedef struct apr_dbd_row_t apr_dbd_row_t; typedef struct apr_dbd_prepared_t apr_dbd_prepared_t; /** apr_dbd_init: perform once-only initialisation. Call once only. * * @param pool - pool to register any shutdown cleanups, etc */ APU_DECLARE(apr_status_t) apr_dbd_init(apr_pool_t *pool); /** apr_dbd_get_driver: get the driver struct for a name * * @param pool - (process) pool to register cleanup * @param name - driver name * @param driver - pointer to driver struct. * @return APR_SUCCESS for success * @return APR_ENOTIMPL for no driver (when DSO not enabled) * @return APR_EDSOOPEN if DSO driver file can't be opened * @return APR_ESYMNOTFOUND if the driver file doesn't contain a driver */ APU_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name, const apr_dbd_driver_t **driver); /** apr_dbd_open_ex: open a connection to a backend * * @param driver - driver struct. * @param pool - working pool * @param params - arguments to driver (implementation-dependent) * @param handle - pointer to handle to return * @param error - descriptive error. * @return APR_SUCCESS for success * @return APR_EGENERAL if driver exists but connection failed * @remarks PostgreSQL: the params is passed directly to the PQconnectdb() * function (check PostgreSQL documentation for more details on the syntax). * @remarks SQLite2: the params is split on a colon, with the first part used * as the filename and second part converted to an integer and used as file * mode. * @remarks SQLite3: the params is passed directly to the sqlite3_open() * function as a filename to be opened (check SQLite3 documentation for more * details). * @remarks Oracle: the params can have "user", "pass", "dbname" and "server" * keys, each followed by an equal sign and a value. Such key/value pairs can * be delimited by space, CR, LF, tab, semicolon, vertical bar or comma. * @remarks MySQL: the params can have "host", "port", "user", "pass", * "dbname", "sock", "flags" "fldsz", "group" and "reconnect" keys, each * followed by an equal sign and a value. Such key/value pairs can be * delimited by space, CR, LF, tab, semicolon, vertical bar or comma. For * now, "flags" can only recognise CLIENT_FOUND_ROWS (check MySQL manual for * details). The value associated with "fldsz" determines maximum amount of * memory (in bytes) for each of the fields in the result set of prepared * statements. By default, this value is 1 MB. The value associated with * "group" determines which group from configuration file to use (see * MYSQL_READ_DEFAULT_GROUP option of mysql_options() in MySQL manual). * Reconnect is set to 1 by default (i.e. true). * @remarks FreeTDS: the params can have "username", "password", "appname", * "dbname", "host", "charset", "lang" and "server" keys, each followed by an * equal sign and a value. */ APU_DECLARE(apr_status_t) apr_dbd_open_ex(const apr_dbd_driver_t *driver, apr_pool_t *pool, const char *params, apr_dbd_t **handle, const char **error); /** apr_dbd_open: open a connection to a backend * * @param driver - driver struct. * @param pool - working pool * @param params - arguments to driver (implementation-dependent) * @param handle - pointer to handle to return * @return APR_SUCCESS for success * @return APR_EGENERAL if driver exists but connection failed * @see apr_dbd_open_ex */ APU_DECLARE(apr_status_t) apr_dbd_open(const apr_dbd_driver_t *driver, apr_pool_t *pool, const char *params, apr_dbd_t **handle); /** apr_dbd_close: close a connection to a backend * * @param driver - driver struct. * @param handle - handle to close * @return APR_SUCCESS for success or error status */ APU_DECLARE(apr_status_t) apr_dbd_close(const apr_dbd_driver_t *driver, apr_dbd_t *handle); /* apr-function-shaped versions of things */ /** apr_dbd_name: get the name of the driver * * @param driver - the driver * @return - name */ APU_DECLARE(const char*) apr_dbd_name(const apr_dbd_driver_t *driver); /** apr_dbd_native_handle: get native database handle of the underlying db * * @param driver - the driver * @param handle - apr_dbd handle * @return - native handle */ APU_DECLARE(void*) apr_dbd_native_handle(const apr_dbd_driver_t *driver, apr_dbd_t *handle); /** check_conn: check status of a database connection * * @param driver - the driver * @param pool - working pool * @param handle - the connection to check * @return APR_SUCCESS or error */ APU_DECLARE(int) apr_dbd_check_conn(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle); /** apr_dbd_set_dbname: select database name. May be a no-op if not supported. * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param name - the database to select * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_set_dbname(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, const char *name); /** apr_dbd_transaction_start: start a transaction. May be a no-op. * * @param driver - the driver * @param pool - a pool to use for error messages (if any). * @param handle - the db connection * @param trans - ptr to a transaction. May be null on entry * @return 0 for success or error code * @remarks Note that transaction modes, set by calling * apr_dbd_transaction_mode_set(), will affect all query/select calls within * a transaction. By default, any error in query/select during a transaction * will cause the transaction to inherit the error code and any further * query/select calls will fail immediately. Put transaction in "ignore * errors" mode to avoid that. Use "rollback" mode to do explicit rollback. */ APU_DECLARE(int) apr_dbd_transaction_start(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_transaction_t **trans); /** apr_dbd_transaction_end: end a transaction * (commit on success, rollback on error). * May be a no-op. * * @param driver - the driver * @param handle - the db connection * @param trans - the transaction. * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_transaction_end(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_transaction_t *trans); #define APR_DBD_TRANSACTION_COMMIT 0x00 /**< commit the transaction */ #define APR_DBD_TRANSACTION_ROLLBACK 0x01 /**< rollback the transaction */ #define APR_DBD_TRANSACTION_IGNORE_ERRORS 0x02 /**< ignore transaction errors */ /** apr_dbd_transaction_mode_get: get the mode of transaction * * @param driver - the driver * @param trans - the transaction * @return mode of transaction */ APU_DECLARE(int) apr_dbd_transaction_mode_get(const apr_dbd_driver_t *driver, apr_dbd_transaction_t *trans); /** apr_dbd_transaction_mode_set: set the mode of transaction * * @param driver - the driver * @param trans - the transaction * @param mode - new mode of the transaction * @return the mode of transaction in force after the call */ APU_DECLARE(int) apr_dbd_transaction_mode_set(const apr_dbd_driver_t *driver, apr_dbd_transaction_t *trans, int mode); /** apr_dbd_query: execute an SQL query that doesn't return a result set * * @param driver - the driver * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the SQL statement to execute * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_query(const apr_dbd_driver_t *driver, apr_dbd_t *handle, int *nrows, const char *statement); /** apr_dbd_select: execute an SQL query that returns a result set * * @param driver - the driver * @param pool - pool to allocate the result set * @param handle - the connection * @param res - pointer to result set pointer. May point to NULL on entry * @param statement - the SQL statement to execute * @param random - 1 to support random access to results (seek any row); * 0 to support only looping through results in order * (async access - faster) * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_select(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, const char *statement, int random); /** apr_dbd_num_cols: get the number of columns in a results set * * @param driver - the driver * @param res - result set. * @return number of columns */ APU_DECLARE(int) apr_dbd_num_cols(const apr_dbd_driver_t *driver, apr_dbd_results_t *res); /** apr_dbd_num_tuples: get the number of rows in a results set * of a synchronous select * * @param driver - the driver * @param res - result set. * @return number of rows, or -1 if the results are asynchronous */ APU_DECLARE(int) apr_dbd_num_tuples(const apr_dbd_driver_t *driver, apr_dbd_results_t *res); /** apr_dbd_get_row: get a row from a result set * * @param driver - the driver * @param pool - pool to allocate the row * @param res - result set pointer * @param row - pointer to row pointer. May point to NULL on entry * @param rownum - row number (counting from 1), or -1 for "next row". * Ignored if random access is not supported. * @return 0 for success, -1 for rownum out of range or data finished */ APU_DECLARE(int) apr_dbd_get_row(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_results_t *res, apr_dbd_row_t **row, int rownum); /** apr_dbd_get_entry: get an entry from a row * * @param driver - the driver * @param row - row pointer * @param col - entry number * @return value from the row, or NULL if col is out of bounds. */ APU_DECLARE(const char*) apr_dbd_get_entry(const apr_dbd_driver_t *driver, apr_dbd_row_t *row, int col); /** apr_dbd_get_name: get an entry name from a result set * * @param driver - the driver * @param res - result set pointer * @param col - entry number * @return name of the entry, or NULL if col is out of bounds. */ APU_DECLARE(const char*) apr_dbd_get_name(const apr_dbd_driver_t *driver, apr_dbd_results_t *res, int col); /** apr_dbd_error: get current error message (if any) * * @param driver - the driver * @param handle - the connection * @param errnum - error code from operation that returned an error * @return the database current error message, or message for errnum * (implementation-dependent whether errnum is ignored) */ APU_DECLARE(const char*) apr_dbd_error(const apr_dbd_driver_t *driver, apr_dbd_t *handle, int errnum); /** apr_dbd_escape: escape a string so it is safe for use in query/select * * @param driver - the driver * @param pool - pool to alloc the result from * @param string - the string to escape * @param handle - the connection * @return the escaped, safe string */ APU_DECLARE(const char*) apr_dbd_escape(const apr_dbd_driver_t *driver, apr_pool_t *pool, const char *string, apr_dbd_t *handle); /** apr_dbd_prepare: prepare a statement * * @param driver - the driver * @param pool - pool to alloc the result from * @param handle - the connection * @param query - the SQL query * @param label - A label for the prepared statement. * use NULL for temporary prepared statements * (eg within a Request in httpd) * @param statement - statement to prepare. May point to null on entry. * @return 0 for success or error code * @remarks To specify parameters of the prepared query, use \%s, \%d etc. * (see below for full list) in place of database specific parameter syntax * (e.g. for PostgreSQL, this would be $1, $2, for SQLite3 this would be ? * etc.). For instance: "SELECT name FROM customers WHERE name=%s" would be * a query that this function understands. * @remarks Here is the full list of format specifiers that this function * understands and what they map to in SQL: \%hhd (TINY INT), \%hhu (UNSIGNED * TINY INT), \%hd (SHORT), \%hu (UNSIGNED SHORT), \%d (INT), \%u (UNSIGNED * INT), \%ld (LONG), \%lu (UNSIGNED LONG), \%lld (LONG LONG), \%llu * (UNSIGNED LONG LONG), \%f (FLOAT, REAL), \%lf (DOUBLE PRECISION), \%s * (VARCHAR), \%pDt (TEXT), \%pDi (TIME), \%pDd (DATE), \%pDa (DATETIME), * \%pDs (TIMESTAMP), \%pDz (TIMESTAMP WITH TIME ZONE), \%pDb (BLOB), \%pDc * (CLOB) and \%pDn (NULL). Not all databases have support for all these * types, so the underlying driver will attempt the "best match" where * possible. A \% followed by any letter not in the above list will be * interpreted as VARCHAR (i.e. \%s). */ APU_DECLARE(int) apr_dbd_prepare(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, const char *query, const char *label, apr_dbd_prepared_t **statement); /** apr_dbd_pquery: query using a prepared statement + args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param nargs - ignored (for backward compatibility only) * @param args - args to prepared statement * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_pquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, int nargs, const char **args); /** apr_dbd_pselect: select using a prepared statement + args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param nargs - ignored (for backward compatibility only) * @param args - args to prepared statement * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_pselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, int nargs, const char **args); /** apr_dbd_pvquery: query using a prepared statement + args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param ... - varargs list * @return 0 for success or error code */ APU_DECLARE_NONSTD(int) apr_dbd_pvquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, ...); /** apr_dbd_pvselect: select using a prepared statement + args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param ... - varargs list * @return 0 for success or error code */ APU_DECLARE_NONSTD(int) apr_dbd_pvselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, ...); /** apr_dbd_pbquery: query using a prepared statement + binary args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param args - binary args to prepared statement * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_pbquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, const void **args); /** apr_dbd_pbselect: select using a prepared statement + binary args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param args - binary args to prepared statement * @return 0 for success or error code */ APU_DECLARE(int) apr_dbd_pbselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, const void **args); /** apr_dbd_pvbquery: query using a prepared statement + binary args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param ... - varargs list of binary args * @return 0 for success or error code */ APU_DECLARE_NONSTD(int) apr_dbd_pvbquery(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, ...); /** apr_dbd_pvbselect: select using a prepared statement + binary args * * @param driver - the driver * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param ... - varargs list of binary args * @return 0 for success or error code */ APU_DECLARE_NONSTD(int) apr_dbd_pvbselect(const apr_dbd_driver_t *driver, apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, ...); /** apr_dbd_datum_get: get a binary entry from a row * * @param driver - the driver * @param row - row pointer * @param col - entry number * @param type - type of data to get * @param data - pointer to data, allocated by the caller * @return APR_SUCCESS on success, APR_ENOENT if data is NULL or APR_EGENERAL */ APU_DECLARE(apr_status_t) apr_dbd_datum_get(const apr_dbd_driver_t *driver, apr_dbd_row_t *row, int col, apr_dbd_type_e type, void *data); /** @} */ #ifdef __cplusplus } #endif #endif ================================================ FILE: third_party/include/aprutil/apr_dbm.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_DBM_H #define APR_DBM_H #include "apu.h" #include "apr.h" #include "apr_errno.h" #include "apr_pools.h" #include "apr_file_info.h" #ifdef __cplusplus extern "C" { #endif /** * @file apr_dbm.h * @brief APR-UTIL DBM library */ /** * @defgroup APR_Util_DBM DBM routines * @ingroup APR_Util * @{ */ /** * Structure for referencing a dbm */ typedef struct apr_dbm_t apr_dbm_t; /** * Structure for referencing the datum record within a dbm */ typedef struct { /** pointer to the 'data' to retrieve/store in the DBM */ char *dptr; /** size of the 'data' to retrieve/store in the DBM */ apr_size_t dsize; } apr_datum_t; /* modes to open the DB */ #define APR_DBM_READONLY 1 /**< open for read-only access */ #define APR_DBM_READWRITE 2 /**< open for read-write access */ #define APR_DBM_RWCREATE 3 /**< open for r/w, create if needed */ #define APR_DBM_RWTRUNC 4 /**< open for r/w, truncating an existing DB if present */ /** * Open a dbm file by file name and type of DBM * @param dbm The newly opened database * @param type The type of the DBM (not all may be available at run time) *
 *  db   for Berkeley DB files
 *  gdbm for GDBM files
 *  ndbm for NDBM files
 *  sdbm for SDBM files (always available)
 *  default for the default DBM type
 *  
* @param name The dbm file name to open * @param mode The flag value *
 *           APR_DBM_READONLY   open for read-only access
 *           APR_DBM_READWRITE  open for read-write access
 *           APR_DBM_RWCREATE   open for r/w, create if needed
 *           APR_DBM_RWTRUNC    open for r/w, truncate if already there
 * 
* @param perm Permissions to apply to if created * @param cntxt The pool to use when creating the dbm * @remark The dbm name may not be a true file name, as many dbm packages * append suffixes for seperate data and index files. * @bug In apr-util 0.9 and 1.x, the type arg was case insensitive. This * was highly inefficient, and as of 2.x the dbm name must be provided in * the correct case (lower case for all bundled providers) */ APU_DECLARE(apr_status_t) apr_dbm_open_ex(apr_dbm_t **dbm, const char* type, const char *name, apr_int32_t mode, apr_fileperms_t perm, apr_pool_t *cntxt); /** * Open a dbm file by file name * @param dbm The newly opened database * @param name The dbm file name to open * @param mode The flag value *
 *           APR_DBM_READONLY   open for read-only access
 *           APR_DBM_READWRITE  open for read-write access
 *           APR_DBM_RWCREATE   open for r/w, create if needed
 *           APR_DBM_RWTRUNC    open for r/w, truncate if already there
 * 
* @param perm Permissions to apply to if created * @param cntxt The pool to use when creating the dbm * @remark The dbm name may not be a true file name, as many dbm packages * append suffixes for seperate data and index files. */ APU_DECLARE(apr_status_t) apr_dbm_open(apr_dbm_t **dbm, const char *name, apr_int32_t mode, apr_fileperms_t perm, apr_pool_t *cntxt); /** * Close a dbm file previously opened by apr_dbm_open * @param dbm The database to close */ APU_DECLARE(void) apr_dbm_close(apr_dbm_t *dbm); /** * Fetch a dbm record value by key * @param dbm The database * @param key The key datum to find this record * @param pvalue The value datum retrieved for this record */ APU_DECLARE(apr_status_t) apr_dbm_fetch(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t *pvalue); /** * Store a dbm record value by key * @param dbm The database * @param key The key datum to store this record by * @param value The value datum to store in this record */ APU_DECLARE(apr_status_t) apr_dbm_store(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value); /** * Delete a dbm record value by key * @param dbm The database * @param key The key datum of the record to delete * @remark It is not an error to delete a non-existent record. */ APU_DECLARE(apr_status_t) apr_dbm_delete(apr_dbm_t *dbm, apr_datum_t key); /** * Search for a key within the dbm * @param dbm The database * @param key The datum describing a key to test */ APU_DECLARE(int) apr_dbm_exists(apr_dbm_t *dbm, apr_datum_t key); /** * Retrieve the first record key from a dbm * @param dbm The database * @param pkey The key datum of the first record */ APU_DECLARE(apr_status_t) apr_dbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey); /** * Retrieve the next record key from a dbm * @param dbm The database * @param pkey The key datum of the next record */ APU_DECLARE(apr_status_t) apr_dbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey); /** * Proactively toss any memory associated with the apr_datum_t. * @param dbm The database * @param data The datum to free. */ APU_DECLARE(void) apr_dbm_freedatum(apr_dbm_t *dbm, apr_datum_t data); /** * Report more information when an apr_dbm function fails. * @param dbm The database * @param errcode A DBM-specific value for the error (for logging). If this * isn't needed, it may be NULL. * @param errbuf Location to store the error text * @param errbufsize The size of the provided buffer * @return The errbuf parameter, for convenience. */ APU_DECLARE(char *) apr_dbm_geterror(apr_dbm_t *dbm, int *errcode, char *errbuf, apr_size_t errbufsize); /** * If the specified file/path were passed to apr_dbm_open(), return the * actual file/path names which would be (created and) used. At most, two * files may be used; used2 may be NULL if only one file is used. * @param pool The pool for allocating used1 and used2. * @param type The type of DBM you require info on @see apr_dbm_open_ex * @param pathname The path name to generate used-names from. * @param used1 The first pathname used by the apr_dbm implementation. * @param used2 The second pathname used by apr_dbm. If only one file is * used by the specific implementation, this will be set to NULL. * @return An error if the specified type is invalid. * @remark The dbm file(s) don't need to exist. This function only manipulates * the pathnames. */ APU_DECLARE(apr_status_t) apr_dbm_get_usednames_ex(apr_pool_t *pool, const char *type, const char *pathname, const char **used1, const char **used2); /** * If the specified file/path were passed to apr_dbm_open(), return the * actual file/path names which would be (created and) used. At most, two * files may be used; used2 may be NULL if only one file is used. * @param pool The pool for allocating used1 and used2. * @param pathname The path name to generate used-names from. * @param used1 The first pathname used by the apr_dbm implementation. * @param used2 The second pathname used by apr_dbm. If only one file is * used by the specific implementation, this will be set to NULL. * @remark The dbm file(s) don't need to exist. This function only manipulates * the pathnames. */ APU_DECLARE(void) apr_dbm_get_usednames(apr_pool_t *pool, const char *pathname, const char **used1, const char **used2); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_DBM_H */ ================================================ FILE: third_party/include/aprutil/apr_hooks.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_HOOKS_H #define APR_HOOKS_H #include "apu.h" /* For apr_array_header_t */ #include "apr_tables.h" /** * @file apr_hooks.h * @brief Apache hook functions */ #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_Hook Hook Functions * @ingroup APR_Util * @{ */ /** * @defgroup apr_hook_probes Hook probe capability * APR hooks provide a trace probe capability for capturing * the flow of control and return values with hooks. * * In order to use this facility, the application must define * the symbol APR_HOOK_PROBES_ENABLED and the four APR_HOOK_PROBE_ * macros described below before including apr_hooks.h in files * that use the APR_IMPLEMENT_EXTERNAL_HOOK_* macros. * * This probe facility is not provided for APR optional hooks. * @{ */ #ifdef APR_HOOK_PROBES_ENABLED #define APR_HOOK_INT_DCL_UD void *ud = NULL #else /** internal implementation detail to avoid the ud declaration when * hook probes are not used */ #define APR_HOOK_INT_DCL_UD /** * User-defined hook probe macro that is invoked when the hook * is run, before calling any hook functions. * @param ud A void * user data field that should be filled in by * this macro, and will be provided to the other hook probe macros. * @param ns The namespace prefix of the hook functions * @param name The name of the hook * @param args The argument list to the hook functions, with enclosing * parens. */ #define APR_HOOK_PROBE_ENTRY(ud,ns,name,args) /** * User-defined hook probe macro that is invoked after the hook * has run. * @param ud A void * user data field that was filled in by the user- * provided APR_HOOK_PROBE_ENTRY(). * @param ns The namespace prefix of the hook functions * @param name The name of the hook * @param rv The return value of the hook, or 0 if the hook is void. * @param args The argument list to the hook functions, with enclosing * parens. */ #define APR_HOOK_PROBE_RETURN(ud,ns,name,rv,args) /** * User-defined hook probe macro that is invoked before calling a * hook function. * @param ud A void * user data field that was filled in by the user- * provided APR_HOOK_PROBE_ENTRY(). * @param ns The namespace prefix of the hook functions * @param name The name of the hook * @param src The value of apr_hook_debug_current at the time the function * was hooked (usually the source file implementing the hook function). * @param args The argument list to the hook functions, with enclosing * parens. */ #define APR_HOOK_PROBE_INVOKE(ud,ns,name,src,args) /** * User-defined hook probe macro that is invoked after calling a * hook function. * @param ud A void * user data field that was filled in by the user- * provided APR_HOOK_PROBE_ENTRY(). * @param ns The namespace prefix of the hook functions * @param name The name of the hook * @param src The value of apr_hook_debug_current at the time the function * was hooked (usually the source file implementing the hook function). * @param rv The return value of the hook function, or 0 if the hook is void. * @param args The argument list to the hook functions, with enclosing * parens. */ #define APR_HOOK_PROBE_COMPLETE(ud,ns,name,src,rv,args) #endif /** @} */ /** macro to return the prototype of the hook function */ #define APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name) \ link##_DECLARE(apr_array_header_t *) ns##_hook_get_##name(void) /** macro to declare the hook correctly */ #define APR_DECLARE_EXTERNAL_HOOK(ns,link,ret,name,args) \ typedef ret ns##_HOOK_##name##_t args; \ link##_DECLARE(void) ns##_hook_##name(ns##_HOOK_##name##_t *pf, \ const char * const *aszPre, \ const char * const *aszSucc, int nOrder); \ link##_DECLARE(ret) ns##_run_##name args; \ APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name); \ typedef struct ns##_LINK_##name##_t \ { \ ns##_HOOK_##name##_t *pFunc; \ const char *szName; \ const char * const *aszPredecessors; \ const char * const *aszSuccessors; \ int nOrder; \ } ns##_LINK_##name##_t; /** macro to declare the hook structure */ #define APR_HOOK_STRUCT(members) \ static struct { members } _hooks; /** macro to link the hook structure */ #define APR_HOOK_LINK(name) \ apr_array_header_t *link_##name; /** macro to implement the hook */ #define APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \ link##_DECLARE(void) ns##_hook_##name(ns##_HOOK_##name##_t *pf,const char * const *aszPre, \ const char * const *aszSucc,int nOrder) \ { \ ns##_LINK_##name##_t *pHook; \ if(!_hooks.link_##name) \ { \ _hooks.link_##name=apr_array_make(apr_hook_global_pool,1,sizeof(ns##_LINK_##name##_t)); \ apr_hook_sort_register(#name,&_hooks.link_##name); \ } \ pHook=apr_array_push(_hooks.link_##name); \ pHook->pFunc=pf; \ pHook->aszPredecessors=aszPre; \ pHook->aszSuccessors=aszSucc; \ pHook->nOrder=nOrder; \ pHook->szName=apr_hook_debug_current; \ if(apr_hook_debug_enabled) \ apr_hook_debug_show(#name,aszPre,aszSucc); \ } \ APR_IMPLEMENT_HOOK_GET_PROTO(ns,link,name) \ { \ return _hooks.link_##name; \ } /** * Implement a hook that has no return code, and therefore runs all of the * registered functions * @param ns The namespace prefix of the hook functions * @param link The linkage declaration prefix of the hook * @param name The name of the hook * @param args_decl The declaration of the arguments for the hook * @param args_use The names for the arguments for the hook * @note The link prefix FOO corresponds to FOO_DECLARE() macros, which * provide export linkage from the module that IMPLEMENTs the hook, and * import linkage from external modules that link to the hook's module. */ #define APR_IMPLEMENT_EXTERNAL_HOOK_VOID(ns,link,name,args_decl,args_use) \ APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \ link##_DECLARE(void) ns##_run_##name args_decl \ { \ ns##_LINK_##name##_t *pHook; \ int n; \ APR_HOOK_INT_DCL_UD; \ \ APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \ \ if(_hooks.link_##name) \ { \ pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ { \ APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \ pHook[n].pFunc args_use; \ APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, 0, args_use); \ } \ } \ \ APR_HOOK_PROBE_RETURN(ud, ns, name, 0, args_use); \ \ } /* FIXME: note that this returns ok when nothing is run. I suspect it should really return decline, but that breaks Apache currently - Ben */ /** * Implement a hook that runs until one of the functions returns something * other than OK or DECLINE * @param ns The namespace prefix of the hook functions * @param link The linkage declaration prefix of the hook * @param ret Type to return * @param name The name of the hook * @param args_decl The declaration of the arguments for the hook * @param args_use The names for the arguments for the hook * @param ok Success value * @param decline Decline value * @note The link prefix FOO corresponds to FOO_DECLARE() macros, which * provide export linkage from the module that IMPLEMENTs the hook, and * import linkage from external modules that link to the hook's module. */ #define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ns,link,ret,name,args_decl,args_use,ok,decline) \ APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \ link##_DECLARE(ret) ns##_run_##name args_decl \ { \ ns##_LINK_##name##_t *pHook; \ int n; \ ret rv = ok; \ APR_HOOK_INT_DCL_UD; \ \ APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \ \ if(_hooks.link_##name) \ { \ pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ { \ APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \ rv=pHook[n].pFunc args_use; \ APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv, args_use); \ if(rv != ok && rv != decline) \ break; \ rv = ok; \ } \ } \ \ APR_HOOK_PROBE_RETURN(ud, ns, name, rv, args_use); \ \ return rv; \ } /** * Implement a hook that runs until the first function returns something * other than the value of decline * @param ns The namespace prefix of the hook functions * @param link The linkage declaration prefix of the hook * @param name The name of the hook * @param ret Type to return * @param args_decl The declaration of the arguments for the hook * @param args_use The names for the arguments for the hook * @param decline Decline value * @note The link prefix FOO corresponds to FOO_DECLARE() macros, which * provide export linkage from the module that IMPLEMENTs the hook, and * import linkage from external modules that link to the hook's module. */ #define APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ns,link,ret,name,args_decl,args_use,decline) \ APR_IMPLEMENT_EXTERNAL_HOOK_BASE(ns,link,name) \ link##_DECLARE(ret) ns##_run_##name args_decl \ { \ ns##_LINK_##name##_t *pHook; \ int n; \ ret rv = decline; \ APR_HOOK_INT_DCL_UD; \ \ APR_HOOK_PROBE_ENTRY(ud, ns, name, args_use); \ \ if(_hooks.link_##name) \ { \ pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \ for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \ { \ APR_HOOK_PROBE_INVOKE(ud, ns, name, (char *)pHook[n].szName, args_use); \ rv=pHook[n].pFunc args_use; \ APR_HOOK_PROBE_COMPLETE(ud, ns, name, (char *)pHook[n].szName, rv, args_use); \ \ if(rv != decline) \ break; \ } \ } \ \ APR_HOOK_PROBE_RETURN(ud, ns, name, rv, args_use); \ \ return rv; \ } /* Hook orderings */ /** run this hook first, before ANYTHING */ #define APR_HOOK_REALLY_FIRST (-10) /** run this hook first */ #define APR_HOOK_FIRST 0 /** run this hook somewhere */ #define APR_HOOK_MIDDLE 10 /** run this hook after every other hook which is defined*/ #define APR_HOOK_LAST 20 /** run this hook last, after EVERYTHING */ #define APR_HOOK_REALLY_LAST 30 /** * The global pool used to allocate any memory needed by the hooks. */ APU_DECLARE_DATA extern apr_pool_t *apr_hook_global_pool; /** * A global variable to determine if debugging information about the * hooks functions should be printed. */ APU_DECLARE_DATA extern int apr_hook_debug_enabled; /** * The name of the module that is currently registering a function. */ APU_DECLARE_DATA extern const char *apr_hook_debug_current; /** * Register a hook function to be sorted. * @param szHookName The name of the Hook the function is registered for * @param aHooks The array which stores all of the functions for this hook */ APU_DECLARE(void) apr_hook_sort_register(const char *szHookName, apr_array_header_t **aHooks); /** * Sort all of the registered functions for a given hook. */ APU_DECLARE(void) apr_hook_sort_all(void); /** * Print all of the information about the current hook. This is used for * debugging purposes. * @param szName The name of the hook * @param aszPre All of the functions in the predecessor array * @param aszSucc All of the functions in the successor array */ APU_DECLARE(void) apr_hook_debug_show(const char *szName, const char * const *aszPre, const char * const *aszSucc); /** * Remove all currently registered functions. */ APU_DECLARE(void) apr_hook_deregister_all(void); /** @} */ #ifdef __cplusplus } #endif #endif /* APR_HOOKS_H */ ================================================ FILE: third_party/include/aprutil/apr_ldap.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h */ /** * @file apr_ldap.h * @brief APR-UTIL LDAP */ #ifndef APU_LDAP_H #define APU_LDAP_H /** * @defgroup APR_Util_LDAP LDAP * @ingroup APR_Util * @{ */ /* this will be defined if LDAP support was compiled into apr-util */ #define APR_HAS_LDAP 1 /* identify the LDAP toolkit used */ #define APR_HAS_NETSCAPE_LDAPSDK 0 #define APR_HAS_SOLARIS_LDAPSDK 0 #define APR_HAS_NOVELL_LDAPSDK 0 #define APR_HAS_MOZILLA_LDAPSDK 0 #define APR_HAS_OPENLDAP_LDAPSDK 0 #define APR_HAS_MICROSOFT_LDAPSDK 1 #define APR_HAS_TIVOLI_LDAPSDK 0 #define APR_HAS_ZOS_LDAPSDK 0 #define APR_HAS_OTHER_LDAPSDK 0 /* * Handle the case when LDAP is enabled */ #if APR_HAS_LDAP /* * The following #defines are DEPRECATED and should not be used for * anything. They remain to maintain binary compatibility. * The original code defined the OPENLDAP SDK as present regardless * of what really was there, which was way bogus. In addition, the * apr_ldap_url_parse*() functions have been rewritten specifically for * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. */ #if APR_HAS_TIVOLI_LDAPSDK #define APR_HAS_LDAP_SSL 0 #else #define APR_HAS_LDAP_SSL 1 #endif #define APR_HAS_LDAP_URL_PARSE 0 #if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED) /* Ensure that the "deprecated" interfaces are still exposed * with OpenLDAP >= 2.3; these were exposed by default in earlier * releases. */ #define LDAP_DEPRECATED 1 #endif /* * Include the standard LDAP header files. */ #include /* * Detected standard functions */ #define APR_HAS_LDAPSSL_CLIENT_INIT 0 #define APR_HAS_LDAPSSL_CLIENT_DEINIT 0 #define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 0 #define APR_HAS_LDAP_START_TLS_S 0 #define APR_HAS_LDAP_SSLINIT 1 #define APR_HAS_LDAPSSL_INIT 0 #define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0 /* * Make sure the secure LDAP port is defined */ #ifndef LDAPS_PORT #define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ #endif /* * For ldap function calls that input a size limit on the number of returned elements * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0) * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK * or process is configured for. */ #ifdef LDAP_DEFAULT_LIMIT #define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT #else #ifdef LDAP_NO_LIMIT #define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT #endif #endif #ifndef APR_LDAP_SIZELIMIT #define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */ #endif /* * z/OS is missing some defines */ #ifndef LDAP_VERSION_MAX #define LDAP_VERSION_MAX LDAP_VERSION #endif #if APR_HAS_ZOS_LDAPSDK #define LDAP_VENDOR_NAME "IBM z/OS" #endif /* Note: Macros defining const casting has been removed in APR v1.0, * pending real support for LDAP v2.0 toolkits. * * In the mean time, please use an LDAP v3.0 toolkit. */ #if LDAP_VERSION_MAX <= 2 #error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * This structure allows the C LDAP API error codes to be returned * along with plain text error messages that explain to us mere mortals * what really happened. */ typedef struct apr_ldap_err_t { const char *reason; const char *msg; int rc; } apr_ldap_err_t; #ifdef __cplusplus } #endif /* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone * manually chooses another SDK on Windows */ #if APR_HAS_MICROSOFT_LDAPSDK #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \ || (s) == LDAP_UNAVAILABLE) #else #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) #endif /* These symbols are not actually exported in a DSO build, but mapped into * a private exported function array for apr_ldap_stub to bind dynamically. * Rename them appropriately to protect the global namespace. */ #ifdef APU_DSO_LDAP_BUILD #define apr_ldap_info apr__ldap_info #define apr_ldap_init apr__ldap_init #define apr_ldap_ssl_init apr__ldap_ssl_init #define apr_ldap_ssl_deinit apr__ldap_ssl_deinit #define apr_ldap_get_option apr__ldap_get_option #define apr_ldap_set_option apr__ldap_set_option #define apr_ldap_rebind_init apr__ldap_rebind_init #define apr_ldap_rebind_add apr__ldap_rebind_add #define apr_ldap_rebind_remove apr__ldap_rebind_remove #define APU_DECLARE_LDAP(type) type #else #define APU_DECLARE_LDAP(type) APU_DECLARE(type) #endif #include "apr_ldap_url.h" #include "apr_ldap_init.h" #include "apr_ldap_option.h" #include "apr_ldap_rebind.h" /** @} */ #endif /* APR_HAS_LDAP */ #endif /* APU_LDAP_H */ ================================================ FILE: third_party/include/aprutil/apr_ldap.h.in ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h */ /** * @file apr_ldap.h * @brief APR-UTIL LDAP */ #ifndef APU_LDAP_H #define APU_LDAP_H /** * @defgroup APR_Util_LDAP LDAP * @ingroup APR_Util * @{ */ /* this will be defined if LDAP support was compiled into apr-util */ #define APR_HAS_LDAP @apu_has_ldap@ /* identify the LDAP toolkit used */ #define APR_HAS_NETSCAPE_LDAPSDK @apu_has_ldap_netscape@ #define APR_HAS_SOLARIS_LDAPSDK @apu_has_ldap_solaris@ #define APR_HAS_NOVELL_LDAPSDK @apu_has_ldap_novell@ #define APR_HAS_MOZILLA_LDAPSDK @apu_has_ldap_mozilla@ #define APR_HAS_OPENLDAP_LDAPSDK @apu_has_ldap_openldap@ #define APR_HAS_MICROSOFT_LDAPSDK @apu_has_ldap_microsoft@ #define APR_HAS_TIVOLI_LDAPSDK @apu_has_ldap_tivoli@ #define APR_HAS_ZOS_LDAPSDK @apu_has_ldap_zos@ #define APR_HAS_OTHER_LDAPSDK @apu_has_ldap_other@ /* * Handle the case when LDAP is enabled */ #if APR_HAS_LDAP /* * The following #defines are DEPRECATED and should not be used for * anything. They remain to maintain binary compatibility. * The original code defined the OPENLDAP SDK as present regardless * of what really was there, which was way bogus. In addition, the * apr_ldap_url_parse*() functions have been rewritten specifically for * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. */ #if APR_HAS_TIVOLI_LDAPSDK #define APR_HAS_LDAP_SSL 0 #else #define APR_HAS_LDAP_SSL 1 #endif #define APR_HAS_LDAP_URL_PARSE 0 #if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED) /* Ensure that the "deprecated" interfaces are still exposed * with OpenLDAP >= 2.3; these were exposed by default in earlier * releases. */ #define LDAP_DEPRECATED 1 #endif /* * Include the standard LDAP header files. */ @lber_h@ @ldap_h@ @ldap_ssl_h@ /* * Detected standard functions */ #define APR_HAS_LDAPSSL_CLIENT_INIT @apu_has_ldapssl_client_init@ #define APR_HAS_LDAPSSL_CLIENT_DEINIT @apu_has_ldapssl_client_deinit@ #define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT @apu_has_ldapssl_add_trusted_cert@ #define APR_HAS_LDAP_START_TLS_S @apu_has_ldap_start_tls_s@ #define APR_HAS_LDAP_SSLINIT @apu_has_ldap_sslinit@ #define APR_HAS_LDAPSSL_INIT @apu_has_ldapssl_init@ #define APR_HAS_LDAPSSL_INSTALL_ROUTINES @apu_has_ldapssl_install_routines@ /* * Make sure the secure LDAP port is defined */ #ifndef LDAPS_PORT #define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ #endif /* * For ldap function calls that input a size limit on the number of returned elements * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0) * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK * or process is configured for. */ #ifdef LDAP_DEFAULT_LIMIT #define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT #else #ifdef LDAP_NO_LIMIT #define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT #endif #endif #ifndef APR_LDAP_SIZELIMIT #define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */ #endif /* * z/OS is missing some defines */ #ifndef LDAP_VERSION_MAX #define LDAP_VERSION_MAX LDAP_VERSION #endif #if APR_HAS_ZOS_LDAPSDK #define LDAP_VENDOR_NAME "IBM z/OS" #endif /* Note: Macros defining const casting has been removed in APR v1.0, * pending real support for LDAP v2.0 toolkits. * * In the mean time, please use an LDAP v3.0 toolkit. */ #if LDAP_VERSION_MAX <= 2 #error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * This structure allows the C LDAP API error codes to be returned * along with plain text error messages that explain to us mere mortals * what really happened. */ typedef struct apr_ldap_err_t { const char *reason; const char *msg; int rc; } apr_ldap_err_t; #ifdef __cplusplus } #endif /* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone * manually chooses another SDK on Windows */ #if APR_HAS_MICROSOFT_LDAPSDK #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \ || (s) == LDAP_UNAVAILABLE) #else #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) #endif /* These symbols are not actually exported in a DSO build, but mapped into * a private exported function array for apr_ldap_stub to bind dynamically. * Rename them appropriately to protect the global namespace. */ #ifdef APU_DSO_LDAP_BUILD #define apr_ldap_info apr__ldap_info #define apr_ldap_init apr__ldap_init #define apr_ldap_ssl_init apr__ldap_ssl_init #define apr_ldap_ssl_deinit apr__ldap_ssl_deinit #define apr_ldap_get_option apr__ldap_get_option #define apr_ldap_set_option apr__ldap_set_option #define apr_ldap_rebind_init apr__ldap_rebind_init #define apr_ldap_rebind_add apr__ldap_rebind_add #define apr_ldap_rebind_remove apr__ldap_rebind_remove #define APU_DECLARE_LDAP(type) type #else #define APU_DECLARE_LDAP(type) APU_DECLARE(type) #endif #include "apr_ldap_url.h" #include "apr_ldap_init.h" #include "apr_ldap_option.h" #include "apr_ldap_rebind.h" #endif /* APR_HAS_LDAP */ /** @} */ #endif /* APU_LDAP_H */ ================================================ FILE: third_party/include/aprutil/apr_ldap.hnw ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h */ /** * @file apr_ldap.h * @brief APR-UTIL LDAP */ #ifndef APU_LDAP_H #define APU_LDAP_H /** * @defgroup APR_Util_LDAP LDAP * @ingroup APR_Util * @{ */ /* this will be defined if LDAP support was compiled into apr-util */ #define APR_HAS_LDAP 1 /* identify the LDAP toolkit used */ #define APR_HAS_NETSCAPE_LDAPSDK 0 #define APR_HAS_SOLARIS_LDAPSDK 0 #define APR_HAS_NOVELL_LDAPSDK 1 #define APR_HAS_MOZILLA_LDAPSDK 0 #define APR_HAS_OPENLDAP_LDAPSDK 0 #define APR_HAS_MICROSOFT_LDAPSDK 0 #define APR_HAS_OTHER_LDAPSDK 0 /* * Handle the case when LDAP is enabled */ #if APR_HAS_LDAP /* * The following #defines are DEPRECATED and should not be used for * anything. They remain to maintain binary compatibility. * The original code defined the OPENLDAP SDK as present regardless * of what really was there, which was way bogus. In addition, the * apr_ldap_url_parse*() functions have been rewritten specifically for * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. */ #define APR_HAS_LDAP_SSL 1 #define APR_HAS_LDAP_URL_PARSE 0 /* * Include the standard LDAP header files. */ #ifdef GENEXPORTS #define LDAP_VERSION_MAX 3 #define LDAP_INSUFFICIENT_ACCESS #else #include #include #if APR_HAS_LDAP_SSL #include #endif #endif /* * Detected standard functions */ #define APR_HAS_LDAPSSL_CLIENT_INIT 1 #define APR_HAS_LDAPSSL_CLIENT_DEINIT 1 #define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 1 #define APR_HAS_LDAP_START_TLS_S 0 #define APR_HAS_LDAP_SSLINIT 0 #define APR_HAS_LDAPSSL_INIT 1 #define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0 /* * Make sure the secure LDAP port is defined */ #ifndef LDAPS_PORT #define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ #endif /* Note: Macros defining const casting has been removed in APR v1.0, * pending real support for LDAP v2.0 toolkits. * * In the mean time, please use an LDAP v3.0 toolkit. */ #if LDAP_VERSION_MAX <= 2 #error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * This structure allows the C LDAP API error codes to be returned * along with plain text error messages that explain to us mere mortals * what really happened. */ typedef struct apr_ldap_err_t { const char *reason; const char *msg; int rc; } apr_ldap_err_t; #ifdef __cplusplus } #endif #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) /* These symbols are not actually exported in a DSO build, but mapped into * a private exported function array for apr_ldap_stub to bind dynamically. * Rename them appropriately to protect the global namespace. */ #ifdef APU_DSO_LDAP_BUILD #define apr_ldap_info apr__ldap_info #define apr_ldap_init apr__ldap_init #define apr_ldap_ssl_init apr__ldap_ssl_init #define apr_ldap_ssl_deinit apr__ldap_ssl_deinit #define apr_ldap_get_option apr__ldap_get_option #define apr_ldap_set_option apr__ldap_set_option #define apr_ldap_rebind_init apr__ldap_rebind_init #define apr_ldap_rebind_add apr__ldap_rebind_add #define apr_ldap_rebind_remove apr__ldap_rebind_remove #define APU_DECLARE_LDAP(type) type #else #define APU_DECLARE_LDAP(type) APU_DECLARE(type) #endif #include "apr_ldap_url.h" #include "apr_ldap_init.h" #include "apr_ldap_option.h" #include "apr_ldap_rebind.h" /** @} */ #endif /* APR_HAS_LDAP */ #endif /* APU_LDAP_H */ ================================================ FILE: third_party/include/aprutil/apr_ldap.hw ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h */ /** * @file apr_ldap.h * @brief APR-UTIL LDAP */ #ifndef APU_LDAP_H #define APU_LDAP_H /** * @defgroup APR_Util_LDAP LDAP * @ingroup APR_Util * @{ */ /* this will be defined if LDAP support was compiled into apr-util */ #define APR_HAS_LDAP 1 /* identify the LDAP toolkit used */ #define APR_HAS_NETSCAPE_LDAPSDK 0 #define APR_HAS_SOLARIS_LDAPSDK 0 #define APR_HAS_NOVELL_LDAPSDK 0 #define APR_HAS_MOZILLA_LDAPSDK 0 #define APR_HAS_OPENLDAP_LDAPSDK 0 #define APR_HAS_MICROSOFT_LDAPSDK 1 #define APR_HAS_TIVOLI_LDAPSDK 0 #define APR_HAS_ZOS_LDAPSDK 0 #define APR_HAS_OTHER_LDAPSDK 0 /* * Handle the case when LDAP is enabled */ #if APR_HAS_LDAP /* * The following #defines are DEPRECATED and should not be used for * anything. They remain to maintain binary compatibility. * The original code defined the OPENLDAP SDK as present regardless * of what really was there, which was way bogus. In addition, the * apr_ldap_url_parse*() functions have been rewritten specifically for * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. */ #if APR_HAS_TIVOLI_LDAPSDK #define APR_HAS_LDAP_SSL 0 #else #define APR_HAS_LDAP_SSL 1 #endif #define APR_HAS_LDAP_URL_PARSE 0 #if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED) /* Ensure that the "deprecated" interfaces are still exposed * with OpenLDAP >= 2.3; these were exposed by default in earlier * releases. */ #define LDAP_DEPRECATED 1 #endif /* * Include the standard LDAP header files. */ #include /* * Detected standard functions */ #define APR_HAS_LDAPSSL_CLIENT_INIT 0 #define APR_HAS_LDAPSSL_CLIENT_DEINIT 0 #define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 0 #define APR_HAS_LDAP_START_TLS_S 0 #define APR_HAS_LDAP_SSLINIT 1 #define APR_HAS_LDAPSSL_INIT 0 #define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0 /* * Make sure the secure LDAP port is defined */ #ifndef LDAPS_PORT #define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ #endif /* * For ldap function calls that input a size limit on the number of returned elements * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0) * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK * or process is configured for. */ #ifdef LDAP_DEFAULT_LIMIT #define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT #else #ifdef LDAP_NO_LIMIT #define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT #endif #endif #ifndef APR_LDAP_SIZELIMIT #define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */ #endif /* * z/OS is missing some defines */ #ifndef LDAP_VERSION_MAX #define LDAP_VERSION_MAX LDAP_VERSION #endif #if APR_HAS_ZOS_LDAPSDK #define LDAP_VENDOR_NAME "IBM z/OS" #endif /* Note: Macros defining const casting has been removed in APR v1.0, * pending real support for LDAP v2.0 toolkits. * * In the mean time, please use an LDAP v3.0 toolkit. */ #if LDAP_VERSION_MAX <= 2 #error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * This structure allows the C LDAP API error codes to be returned * along with plain text error messages that explain to us mere mortals * what really happened. */ typedef struct apr_ldap_err_t { const char *reason; const char *msg; int rc; } apr_ldap_err_t; #ifdef __cplusplus } #endif /* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone * manually chooses another SDK on Windows */ #if APR_HAS_MICROSOFT_LDAPSDK #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \ || (s) == LDAP_UNAVAILABLE) #else #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) #endif /* These symbols are not actually exported in a DSO build, but mapped into * a private exported function array for apr_ldap_stub to bind dynamically. * Rename them appropriately to protect the global namespace. */ #ifdef APU_DSO_LDAP_BUILD #define apr_ldap_info apr__ldap_info #define apr_ldap_init apr__ldap_init #define apr_ldap_ssl_init apr__ldap_ssl_init #define apr_ldap_ssl_deinit apr__ldap_ssl_deinit #define apr_ldap_get_option apr__ldap_get_option #define apr_ldap_set_option apr__ldap_set_option #define apr_ldap_rebind_init apr__ldap_rebind_init #define apr_ldap_rebind_add apr__ldap_rebind_add #define apr_ldap_rebind_remove apr__ldap_rebind_remove #define APU_DECLARE_LDAP(type) type #else #define APU_DECLARE_LDAP(type) APU_DECLARE(type) #endif #include "apr_ldap_url.h" #include "apr_ldap_init.h" #include "apr_ldap_option.h" #include "apr_ldap_rebind.h" /** @} */ #endif /* APR_HAS_LDAP */ #endif /* APU_LDAP_H */ ================================================ FILE: third_party/include/aprutil/apr_ldap.hwc ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * apr_ldap.h is generated from apr_ldap.h.in by configure -- do not edit apr_ldap.h */ /** * @file apr_ldap.h * @brief APR-UTIL LDAP */ #ifndef APU_LDAP_H #define APU_LDAP_H /** * @defgroup APR_Util_LDAP LDAP * @ingroup APR_Util * @{ */ /* this will be defined if LDAP support was compiled into apr-util */ #define APR_HAS_LDAP @apr_has_ldap_10@ /* identify the LDAP toolkit used */ #define APR_HAS_NETSCAPE_LDAPSDK 0 #define APR_HAS_SOLARIS_LDAPSDK 0 #define APR_HAS_NOVELL_LDAPSDK 0 #define APR_HAS_MOZILLA_LDAPSDK 0 #define APR_HAS_OPENLDAP_LDAPSDK 0 #define APR_HAS_MICROSOFT_LDAPSDK 1 #define APR_HAS_TIVOLI_LDAPSDK 0 #define APR_HAS_ZOS_LDAPSDK 0 #define APR_HAS_OTHER_LDAPSDK 0 /* * Handle the case when LDAP is enabled */ #if APR_HAS_LDAP /* * The following #defines are DEPRECATED and should not be used for * anything. They remain to maintain binary compatibility. * The original code defined the OPENLDAP SDK as present regardless * of what really was there, which was way bogus. In addition, the * apr_ldap_url_parse*() functions have been rewritten specifically for * APR, so the APR_HAS_LDAP_URL_PARSE macro is forced to zero. */ #if APR_HAS_TIVOLI_LDAPSDK #define APR_HAS_LDAP_SSL 0 #else #define APR_HAS_LDAP_SSL 1 #endif #define APR_HAS_LDAP_URL_PARSE 0 #if APR_HAS_OPENLDAP_LDAPSDK && !defined(LDAP_DEPRECATED) /* Ensure that the "deprecated" interfaces are still exposed * with OpenLDAP >= 2.3; these were exposed by default in earlier * releases. */ #define LDAP_DEPRECATED 1 #endif /* * Include the standard LDAP header files. */ #include /* * Detected standard functions */ #define APR_HAS_LDAPSSL_CLIENT_INIT 0 #define APR_HAS_LDAPSSL_CLIENT_DEINIT 0 #define APR_HAS_LDAPSSL_ADD_TRUSTED_CERT 0 #define APR_HAS_LDAP_START_TLS_S 0 #define APR_HAS_LDAP_SSLINIT 1 #define APR_HAS_LDAPSSL_INIT 0 #define APR_HAS_LDAPSSL_INSTALL_ROUTINES 0 /* * Make sure the secure LDAP port is defined */ #ifndef LDAPS_PORT #define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */ #endif /* * For ldap function calls that input a size limit on the number of returned elements * Some SDKs do not have the define for LDAP_DEFAULT_LIMIT (-1) or LDAP_NO_LIMIT (0) * LDAP_DEFAULT_LIMIT is preferred as it allows inheritance from whatever the SDK * or process is configured for. */ #ifdef LDAP_DEFAULT_LIMIT #define APR_LDAP_SIZELIMIT LDAP_DEFAULT_LIMIT #else #ifdef LDAP_NO_LIMIT #define APR_LDAP_SIZELIMIT LDAP_NO_LIMIT #endif #endif #ifndef APR_LDAP_SIZELIMIT #define APR_LDAP_SIZELIMIT 0 /* equivalent to LDAP_NO_LIMIT, and what goes on the wire */ #endif /* * z/OS is missing some defines */ #ifndef LDAP_VERSION_MAX #define LDAP_VERSION_MAX LDAP_VERSION #endif #if APR_HAS_ZOS_LDAPSDK #define LDAP_VENDOR_NAME "IBM z/OS" #endif /* Note: Macros defining const casting has been removed in APR v1.0, * pending real support for LDAP v2.0 toolkits. * * In the mean time, please use an LDAP v3.0 toolkit. */ #if LDAP_VERSION_MAX <= 2 #error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit. #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * This structure allows the C LDAP API error codes to be returned * along with plain text error messages that explain to us mere mortals * what really happened. */ typedef struct apr_ldap_err_t { const char *reason; const char *msg; int rc; } apr_ldap_err_t; #ifdef __cplusplus } #endif /* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone * manually chooses another SDK on Windows */ #if APR_HAS_MICROSOFT_LDAPSDK #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \ || (s) == LDAP_UNAVAILABLE) #else #define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN) #endif /* These symbols are not actually exported in a DSO build, but mapped into * a private exported function array for apr_ldap_stub to bind dynamically. * Rename them appropriately to protect the global namespace. */ #ifdef APU_DSO_LDAP_BUILD #define apr_ldap_info apr__ldap_info #define apr_ldap_init apr__ldap_init #define apr_ldap_ssl_init apr__ldap_ssl_init #define apr_ldap_ssl_deinit apr__ldap_ssl_deinit #define apr_ldap_get_option apr__ldap_get_option #define apr_ldap_set_option apr__ldap_set_option #define apr_ldap_rebind_init apr__ldap_rebind_init #define apr_ldap_rebind_add apr__ldap_rebind_add #define apr_ldap_rebind_remove apr__ldap_rebind_remove #define APU_DECLARE_LDAP(type) type #else #define APU_DECLARE_LDAP(type) APU_DECLARE(type) #endif #include "apr_ldap_url.h" #include "apr_ldap_init.h" #include "apr_ldap_option.h" #include "apr_ldap_rebind.h" /** @} */ #endif /* APR_HAS_LDAP */ #endif /* APU_LDAP_H */ ================================================ FILE: third_party/include/aprutil/apr_ldap_init.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_ldap_init.h * @brief APR-UTIL LDAP ldap_init() functions */ #ifndef APR_LDAP_INIT_H #define APR_LDAP_INIT_H /** * @addtogroup APR_Util_LDAP * @{ */ #include "apr_ldap.h" #if APR_HAS_LDAP #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Macro to detect security related return values. */ #if defined(LDAP_INSUFFICIENT_ACCESS) #define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_ACCESS #elif defined(LDAP_INSUFFICIENT_RIGHTS) #define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS #elif defined(APR_HAS_MICROSOFT_LDAPSDK) /* The macros above fail to contemplate that LDAP_RETCODE values * may be represented by an enum. autoconf tests would be much * more robust. */ #define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS #else #error The security return codes must be added to support this LDAP toolkit. #endif #if defined(LDAP_SECURITY_ERROR) #define APU_LDAP_SECURITY_ERROR LDAP_SECURITY_ERROR #else #define APU_LDAP_SECURITY_ERROR(n) \ (LDAP_INAPPROPRIATE_AUTH == n) ? 1 \ : (LDAP_INVALID_CREDENTIALS == n) ? 1 \ : (APU_LDAP_INSUFFICIENT_ACCESS == n) ? 1 \ : 0 #endif /** * APR LDAP SSL Initialise function * * This function initialises SSL on the underlying LDAP toolkit * if this is necessary. * * If a CA certificate is provided, this is set, however the setting * of certificates via this method has been deprecated and will be removed in * APR v2.0. * * The apr_ldap_set_option() function with the APR_LDAP_OPT_TLS_CERT option * should be used instead to set certificates. * * If SSL support is not available on this platform, or a problem * was encountered while trying to set the certificate, the function * will return APR_EGENERAL. Further LDAP specific error information * can be found in result_err. * @param pool The pool to use * @param cert_auth_file The name of the certificate to use, can be NULL * @param cert_file_type The type of certificate specified. See the * apr_ldap_set_option() APR_LDAP_OPT_TLS_CERT option for details. * @param result_err The returned result */ APU_DECLARE_LDAP(int) apr_ldap_ssl_init(apr_pool_t *pool, const char *cert_auth_file, int cert_file_type, apr_ldap_err_t **result_err); /** * APR LDAP SSL De-Initialise function * * This function tears down any SSL certificate setup previously * set using apr_ldap_ssl_init(). It should be called to clean * up if a graceful restart of a service is attempted. * @todo currently we do not check whether apr_ldap_ssl_init() * has been called first - we probably should. */ APU_DECLARE_LDAP(int) apr_ldap_ssl_deinit(void); /** * APR LDAP initialise function * * This function is responsible for initialising an LDAP * connection in a toolkit independant way. It does the * job of ldap_init() from the C api. * * It handles both the SSL and non-SSL case, and attempts * to hide the complexity setup from the user. This function * assumes that any certificate setup necessary has already * been done. * * If SSL or STARTTLS needs to be enabled, and the underlying * toolkit supports it, the following values are accepted for * secure: * * APR_LDAP_NONE: No encryption * APR_LDAP_SSL: SSL encryption (ldaps://) * APR_LDAP_STARTTLS: Force STARTTLS on ldap:// * @remark The Novell toolkit is only able to set the SSL mode via this * function. To work around this limitation, set the SSL mode here if no * per connection client certificates are present, otherwise set secure * APR_LDAP_NONE here, then set the per connection client certificates, * followed by setting the SSL mode via apr_ldap_set_option(). As Novell * does not support per connection client certificates, this problem is * worked around while still being compatible with other LDAP toolkits. * @param pool The pool to use * @param ldap The LDAP handle * @param hostname The name of the host to connect to. This can be either a * DNS name, or an IP address. * @param portno The port to connect to * @param secure The security mode to set * @param result_err The returned result */ APU_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool, LDAP **ldap, const char *hostname, int portno, int secure, apr_ldap_err_t **result_err); /** * APR LDAP info function * * This function returns a string describing the LDAP toolkit * currently in use. The string is placed inside result_err->reason. * @param pool The pool to use * @param result_err The returned result */ APU_DECLARE_LDAP(int) apr_ldap_info(apr_pool_t *pool, apr_ldap_err_t **result_err); #ifdef __cplusplus } #endif #endif /* APR_HAS_LDAP */ /** @} */ #endif /* APR_LDAP_URL_H */ ================================================ FILE: third_party/include/aprutil/apr_ldap_option.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_ldap_option.h * @brief APR-UTIL LDAP ldap_*_option() functions */ #ifndef APR_LDAP_OPTION_H #define APR_LDAP_OPTION_H /** * @addtogroup APR_Util_LDAP * @{ */ #include "apr_ldap.h" #if APR_HAS_LDAP #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* * The following defines handle the different TLS certificate * options available. If these options are missing, APR will try and * emulate support for this using the deprecated ldap_start_tls_s() * function. */ /** * Set SSL mode to one of APR_LDAP_NONE, APR_LDAP_SSL, APR_LDAP_STARTTLS * or APR_LDAP_STOPTLS. */ #define APR_LDAP_OPT_TLS 0x6fff /** * Set zero or more CA certificates, client certificates or private * keys globally, or per connection (where supported). */ #define APR_LDAP_OPT_TLS_CERT 0x6ffe /** * Set the LDAP library to no verify the server certificate. This means * all servers are considered trusted. */ #define APR_LDAP_OPT_VERIFY_CERT 0x6ffd /** * Set the LDAP library to indicate if referrals should be chased during * LDAP searches. */ #define APR_LDAP_OPT_REFERRALS 0x6ffc /** * Set the LDAP library to indicate a maximum number of referral hops to * chase before giving up on the search. */ #define APR_LDAP_OPT_REFHOPLIMIT 0x6ffb /** * Structures for the apr_set_option() cases */ /** * APR_LDAP_OPT_TLS_CERT * * This structure includes possible options to set certificates on * system initialisation. Different SDKs have different certificate * requirements, and to achieve this multiple certificates must be * specified at once passed as an (apr_array_header_t *). * * Netscape: * Needs the CA cert database (cert7.db), the client cert database (key3.db) * and the security module file (secmod.db) set at the system initialisation * time. Three types are supported: APR_LDAP_CERT7_DB, APR_LDAP_KEY3_DB and * APR_LDAP_SECMOD. * * To specify a client cert connection, a certificate nickname needs to be * provided with a type of APR_LDAP_CERT. * int ldapssl_enable_clientauth( LDAP *ld, char *keynickname, * char *keypasswd, char *certnickname ); * keynickname is currently not used, and should be set to "" * * Novell: * Needs CA certificates and client certificates set at system initialisation * time. Three types are supported: APR_LDAP_CA*, APR_LDAP_CERT* and * APR_LDAP_KEY*. * * Certificates cannot be specified per connection. * * The functions used are: * ldapssl_add_trusted_cert(serverTrustedRoot, serverTrustedRootEncoding); * Clients certs and keys are set at system initialisation time with * int ldapssl_set_client_cert ( * void *cert, * int type * void *password); * type can be LDAPSSL_CERT_FILETYPE_B64 or LDAPSSL_CERT_FILETYPE_DER * ldapssl_set_client_private_key(clientPrivateKey, * clientPrivateKeyEncoding, * clientPrivateKeyPassword); * * OpenSSL: * Needs one or more CA certificates to be set at system initialisation time * with a type of APR_LDAP_CA*. * * May have one or more client certificates set per connection with a type of * APR_LDAP_CERT*, and keys with APR_LDAP_KEY*. */ /** CA certificate type unknown */ #define APR_LDAP_CA_TYPE_UNKNOWN 0 /** binary DER encoded CA certificate */ #define APR_LDAP_CA_TYPE_DER 1 /** PEM encoded CA certificate */ #define APR_LDAP_CA_TYPE_BASE64 2 /** Netscape/Mozilla cert7.db CA certificate database */ #define APR_LDAP_CA_TYPE_CERT7_DB 3 /** Netscape/Mozilla secmod file */ #define APR_LDAP_CA_TYPE_SECMOD 4 /** Client certificate type unknown */ #define APR_LDAP_CERT_TYPE_UNKNOWN 5 /** binary DER encoded client certificate */ #define APR_LDAP_CERT_TYPE_DER 6 /** PEM encoded client certificate */ #define APR_LDAP_CERT_TYPE_BASE64 7 /** Netscape/Mozilla key3.db client certificate database */ #define APR_LDAP_CERT_TYPE_KEY3_DB 8 /** Netscape/Mozilla client certificate nickname */ #define APR_LDAP_CERT_TYPE_NICKNAME 9 /** Private key type unknown */ #define APR_LDAP_KEY_TYPE_UNKNOWN 10 /** binary DER encoded private key */ #define APR_LDAP_KEY_TYPE_DER 11 /** PEM encoded private key */ #define APR_LDAP_KEY_TYPE_BASE64 12 /** PKCS#12 encoded client certificate */ #define APR_LDAP_CERT_TYPE_PFX 13 /** PKCS#12 encoded private key */ #define APR_LDAP_KEY_TYPE_PFX 14 /** Openldap directory full of base64-encoded cert * authorities with hashes in corresponding .0 directory */ #define APR_LDAP_CA_TYPE_CACERTDIR_BASE64 15 /** * Certificate structure. * * This structure is used to store certificate details. An array of * these structures is passed to apr_ldap_set_option() to set CA * and client certificates. * @param type Type of certificate APR_LDAP_*_TYPE_* * @param path Path, file or nickname of the certificate * @param password Optional password, can be NULL */ typedef struct apr_ldap_opt_tls_cert_t apr_ldap_opt_tls_cert_t; struct apr_ldap_opt_tls_cert_t { int type; const char *path; const char *password; }; /** * APR_LDAP_OPT_TLS * * This sets the SSL level on the LDAP handle. * * Netscape/Mozilla: * Supports SSL, but not STARTTLS * SSL is enabled by calling ldapssl_install_routines(). * * Novell: * Supports SSL and STARTTLS. * SSL is enabled by calling ldapssl_install_routines(). Note that calling * other ldap functions before ldapssl_install_routines() may cause this * function to fail. * STARTTLS is enabled by calling ldapssl_start_tls_s() after calling * ldapssl_install_routines() (check this). * * OpenLDAP: * Supports SSL and supports STARTTLS, but none of this is documented: * http://www.openldap.org/lists/openldap-software/200409/msg00618.html * Documentation for both SSL support and STARTTLS has been deleted from * the OpenLDAP documentation and website. */ /** No encryption */ #define APR_LDAP_NONE 0 /** SSL encryption (ldaps://) */ #define APR_LDAP_SSL 1 /** TLS encryption (STARTTLS) */ #define APR_LDAP_STARTTLS 2 /** end TLS encryption (STOPTLS) */ #define APR_LDAP_STOPTLS 3 /** * APR LDAP get option function * * This function gets option values from a given LDAP session if * one was specified. It maps to the native ldap_get_option() function. * @param pool The pool to use * @param ldap The LDAP handle * @param option The LDAP_OPT_* option to return * @param outvalue The value returned (if any) * @param result_err The apr_ldap_err_t structure contained detailed results * of the operation. */ APU_DECLARE_LDAP(int) apr_ldap_get_option(apr_pool_t *pool, LDAP *ldap, int option, void *outvalue, apr_ldap_err_t **result_err); /** * APR LDAP set option function * * This function sets option values to a given LDAP session if * one was specified. It maps to the native ldap_set_option() function. * * Where an option is not supported by an LDAP toolkit, this function * will try and apply legacy functions to achieve the same effect, * depending on the platform. * @param pool The pool to use * @param ldap The LDAP handle * @param option The LDAP_OPT_* option to set * @param invalue The value to set * @param result_err The apr_ldap_err_t structure contained detailed results * of the operation. */ APU_DECLARE_LDAP(int) apr_ldap_set_option(apr_pool_t *pool, LDAP *ldap, int option, const void *invalue, apr_ldap_err_t **result_err); #ifdef __cplusplus } #endif #endif /* APR_HAS_LDAP */ /** @} */ #endif /* APR_LDAP_OPTION_H */ ================================================ FILE: third_party/include/aprutil/apr_ldap_rebind.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * The APR LDAP rebind functions provide an implementation of * a rebind procedure that can be used to allow clients to chase referrals, * using the same credentials used to log in originally. * * Use of this implementation is optional. * * @file apr_ldap_rebind.h * @brief Apache LDAP library */ #ifndef APU_LDAP_REBIND_H #define APU_LDAP_REBIND_H /** * @addtogroup APR_Util_LDAP * @{ **/ #if defined(DOXYGEN) #include "apr_ldap.h" #endif /* * Handle the case when LDAP is enabled */ #if APR_HAS_LDAP /** * APR LDAP initialize rebind lock * * This function creates the lock for controlling access to the xref list.. * @param pool Pool to use when creating the xref_lock. */ APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool); /** * APR LDAP rebind_add function * * This function creates a cross reference entry for the specified ldap * connection. The rebind callback function will look up this ldap * connection so it can retrieve the bindDN and bindPW for use in any * binds while referrals are being chased. * * This function will add the callback to the LDAP handle passed in. * * A cleanup is registered within the pool provided to remove this * entry when the pool is removed. Alternatively apr_ldap_rebind_remove() * can be called to explicitly remove the entry at will. * * @param pool The pool to use * @param ld The LDAP connectionhandle * @param bindDN The bind DN to be used for any binds while chasing * referrals on this ldap connection. * @param bindPW The bind Password to be used for any binds while * chasing referrals on this ldap connection. */ APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool, LDAP *ld, const char *bindDN, const char *bindPW); /** * APR LDAP rebind_remove function * * This function removes the rebind cross reference entry for the * specified ldap connection. * * If not explicitly removed, this function will be called automatically * when the pool is cleaned up. * * @param ld The LDAP connectionhandle */ APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld); #endif /* APR_HAS_LDAP */ /** @} */ #endif /* APU_LDAP_REBIND_H */ ================================================ FILE: third_party/include/aprutil/apr_ldap_url.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_ldap_url.h * @brief APR-UTIL LDAP ldap_init() functions */ #ifndef APR_LDAP_URL_H #define APR_LDAP_URL_H /** * @addtogroup APR_Util_LDAP * @{ */ #if defined(DOXYGEN) #include "apr_ldap.h" #endif #if APR_HAS_LDAP #include "apu.h" #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Structure to access an exploded LDAP URL */ typedef struct apr_ldap_url_desc_t { struct apr_ldap_url_desc_t *lud_next; char *lud_scheme; char *lud_host; int lud_port; char *lud_dn; char **lud_attrs; int lud_scope; char *lud_filter; char **lud_exts; int lud_crit_exts; } apr_ldap_url_desc_t; #ifndef APR_LDAP_URL_SUCCESS #define APR_LDAP_URL_SUCCESS 0x00 /* Success */ #define APR_LDAP_URL_ERR_MEM 0x01 /* can't allocate memory space */ #define APR_LDAP_URL_ERR_PARAM 0x02 /* parameter is bad */ #define APR_LDAP_URL_ERR_BADSCHEME 0x03 /* URL doesn't begin with "ldap[si]://" */ #define APR_LDAP_URL_ERR_BADENCLOSURE 0x04 /* URL is missing trailing ">" */ #define APR_LDAP_URL_ERR_BADURL 0x05 /* URL is bad */ #define APR_LDAP_URL_ERR_BADHOST 0x06 /* host port is bad */ #define APR_LDAP_URL_ERR_BADATTRS 0x07 /* bad (or missing) attributes */ #define APR_LDAP_URL_ERR_BADSCOPE 0x08 /* scope string is invalid (or missing) */ #define APR_LDAP_URL_ERR_BADFILTER 0x09 /* bad or missing filter */ #define APR_LDAP_URL_ERR_BADEXTS 0x0a /* bad or missing extensions */ #endif /** * Is this URL an ldap url? ldap:// * @param url The url to test */ APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url); /** * Is this URL an SSL ldap url? ldaps:// * @param url The url to test */ APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url); /** * Is this URL an ldap socket url? ldapi:// * @param url The url to test */ APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url); /** * Parse an LDAP URL. * @param pool The pool to use * @param url_in The URL to parse * @param ludpp The structure to return the exploded URL * @param result_err The result structure of the operation */ APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool, const char *url_in, apr_ldap_url_desc_t **ludpp, apr_ldap_err_t **result_err); /** * Parse an LDAP URL. * @param pool The pool to use * @param url_in The URL to parse * @param ludpp The structure to return the exploded URL * @param result_err The result structure of the operation */ APU_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool, const char *url_in, apr_ldap_url_desc_t **ludpp, apr_ldap_err_t **result_err); #ifdef __cplusplus } #endif #endif /* APR_HAS_LDAP */ /** @} */ #endif /* APR_LDAP_URL_H */ ================================================ FILE: third_party/include/aprutil/apr_md4.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* This is derived from material copyright RSA Data Security, Inc. * Their notice is reproduced below in its entirety. * * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All * rights reserved. * * License to copy and use this software is granted provided that it * is identified as the "RSA Data Security, Inc. MD4 Message-Digest * Algorithm" in all material mentioning or referencing this software * or this function. * * License is also granted to make and use derivative works provided * that such works are identified as "derived from the RSA Data * Security, Inc. MD4 Message-Digest Algorithm" in all material * mentioning or referencing the derived work. * * RSA Data Security, Inc. makes no representations concerning either * the merchantability of this software or the suitability of this * software for any particular purpose. It is provided "as is" * without express or implied warranty of any kind. * * These notices must be retained in any copies of any part of this * documentation and/or software. */ #ifndef APR_MD4_H #define APR_MD4_H #include "apu.h" #include "apr_xlate.h" /** * @file apr_md4.h * @brief APR-UTIL MD4 Library */ #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_MD4 MD4 Library * @ingroup APR_Util * @{ */ /** The digestsize for MD4 */ #define APR_MD4_DIGESTSIZE 16 /** @see apr_md4_ctx_t */ typedef struct apr_md4_ctx_t apr_md4_ctx_t; /** MD4 context. */ struct apr_md4_ctx_t { /** state (ABCD) */ apr_uint32_t state[4]; /** number of bits, modulo 2^64 (lsb first) */ apr_uint32_t count[2]; /** input buffer */ unsigned char buffer[64]; #if APR_HAS_XLATE /** translation handle */ apr_xlate_t *xlate; #endif }; /** * MD4 Initialize. Begins an MD4 operation, writing a new context. * @param context The MD4 context to initialize. */ APU_DECLARE(apr_status_t) apr_md4_init(apr_md4_ctx_t *context); #if APR_HAS_XLATE /** * MDr4 translation setup. Provides the APR translation handle to be used * for translating the content before calculating the digest. * @param context The MD4 content to set the translation for. * @param xlate The translation handle to use for this MD4 context */ APU_DECLARE(apr_status_t) apr_md4_set_xlate(apr_md4_ctx_t *context, apr_xlate_t *xlate); #else #define apr_md4_set_xlate(context, xlate) APR_ENOTIMPL #endif /** * MD4 block update operation. Continue an MD4 message-digest operation, * processing another message block, and updating the context. * @param context The MD4 content to update. * @param input next message block to update * @param inputLen The length of the next message block */ APU_DECLARE(apr_status_t) apr_md4_update(apr_md4_ctx_t *context, const unsigned char *input, apr_size_t inputLen); /** * MD4 finalization. Ends an MD4 message-digest operation, writing the * message digest and zeroing the context * @param digest The final MD4 digest * @param context The MD4 content we are finalizing. */ APU_DECLARE(apr_status_t) apr_md4_final( unsigned char digest[APR_MD4_DIGESTSIZE], apr_md4_ctx_t *context); /** * MD4 digest computation * @param digest The MD4 digest * @param input message block to use * @param inputLen The length of the message block */ APU_DECLARE(apr_status_t) apr_md4(unsigned char digest[APR_MD4_DIGESTSIZE], const unsigned char *input, apr_size_t inputLen); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_MD4_H */ ================================================ FILE: third_party/include/aprutil/apr_md5.h ================================================ /* * This is work is derived from material Copyright RSA Data Security, Inc. * * The RSA copyright statement and Licence for that original material is * included below. This is followed by the Apache copyright statement and * licence for the modifications made to that material. */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_MD5_H #define APR_MD5_H #include "apu.h" #include "apr_xlate.h" #ifdef __cplusplus extern "C" { #endif /** * @file apr_md5.h * @brief APR MD5 Routines */ /** * @defgroup APR_MD5 MD5 Routines * @ingroup APR * @{ */ /** The MD5 digest size */ #define APR_MD5_DIGESTSIZE 16 /** @see apr_md5_ctx_t */ typedef struct apr_md5_ctx_t apr_md5_ctx_t; /** MD5 context. */ struct apr_md5_ctx_t { /** state (ABCD) */ apr_uint32_t state[4]; /** number of bits, modulo 2^64 (lsb first) */ apr_uint32_t count[2]; /** input buffer */ unsigned char buffer[64]; /** translation handle * ignored if xlate is unsupported */ apr_xlate_t *xlate; }; /** * MD5 Initialize. Begins an MD5 operation, writing a new context. * @param context The MD5 context to initialize. */ APU_DECLARE(apr_status_t) apr_md5_init(apr_md5_ctx_t *context); /** * MD5 translation setup. Provides the APR translation handle to be used * for translating the content before calculating the digest. * @param context The MD5 content to set the translation for. * @param xlate The translation handle to use for this MD5 context */ APU_DECLARE(apr_status_t) apr_md5_set_xlate(apr_md5_ctx_t *context, apr_xlate_t *xlate); /** * MD5 block update operation. Continue an MD5 message-digest operation, * processing another message block, and updating the context. * @param context The MD5 content to update. * @param input next message block to update * @param inputLen The length of the next message block */ APU_DECLARE(apr_status_t) apr_md5_update(apr_md5_ctx_t *context, const void *input, apr_size_t inputLen); /** * MD5 finalization. Ends an MD5 message-digest operation, writing the * message digest and zeroing the context * @param digest The final MD5 digest * @param context The MD5 content we are finalizing. */ APU_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[APR_MD5_DIGESTSIZE], apr_md5_ctx_t *context); /** * MD5 in one step * @param digest The final MD5 digest * @param input The message block to use * @param inputLen The length of the message block */ APU_DECLARE(apr_status_t) apr_md5(unsigned char digest[APR_MD5_DIGESTSIZE], const void *input, apr_size_t inputLen); /** * Encode a password using an MD5 algorithm * @param password The password to encode * @param salt The salt string to use for the encoding * @param result The string to store the encoded password in * @param nbytes The size of the result buffer */ APU_DECLARE(apr_status_t) apr_md5_encode(const char *password, const char *salt, char *result, apr_size_t nbytes); /** * Encode a password using the bcrypt algorithm * @param password The password to encode * @param count The cost of the encoding, possible values are 4 to 31 * @param salt Pointer to binary data to be used as salt for the encoding * @param salt_len The size of the salt data (must be >= 16) * @param out The string to store the encoded password in * @param out_len The size of the result buffer (must be >= 61) */ APU_DECLARE(apr_status_t) apr_bcrypt_encode(const char *pw, unsigned int count, const unsigned char *salt, apr_size_t salt_len, char *out, apr_size_t out_len); /** * Validate hashes created by APR-supported algorithms: md5, bcrypt, and sha1. * hashes created by crypt are supported only on platforms that provide * crypt(3), so don't rely on that function unless you know that your * application will be run only on platforms that support it. On platforms * that don't support crypt(3), this falls back to a clear text string * comparison. * @param passwd The password to validate * @param hash The password to validate against */ APU_DECLARE(apr_status_t) apr_password_validate(const char *passwd, const char *hash); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_MD5_H */ ================================================ FILE: third_party/include/aprutil/apr_memcache.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_MEMCACHE_H #define APR_MEMCACHE_H /** * @file apr_memcache.h * @brief Client interface for memcached * @remark To use this interface you must have a separate memcached * server running. See the memcached website at http://www.danga.com/memcached/ * for more information. */ #include "apr.h" #include "apr_pools.h" #include "apr_time.h" #include "apr_strings.h" #include "apr_network_io.h" #include "apr_ring.h" #include "apr_buckets.h" #include "apr_reslist.h" #include "apr_hash.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup APR_Util_MC Memcached Client Routines * @ingroup APR_Util * @{ */ /** Specifies the status of a memcached server */ typedef enum { APR_MC_SERVER_LIVE, /**< Server is alive and responding to requests */ APR_MC_SERVER_DEAD /**< Server is not responding to requests */ } apr_memcache_server_status_t; /** Opaque memcache client connection object */ typedef struct apr_memcache_conn_t apr_memcache_conn_t; /** Memcache Server Info Object */ typedef struct apr_memcache_server_t apr_memcache_server_t; struct apr_memcache_server_t { const char *host; /**< Hostname of this Server */ apr_port_t port; /**< Port of this Server */ apr_memcache_server_status_t status; /**< @see apr_memcache_server_status_t */ #if APR_HAS_THREADS || defined(DOXYGEN) apr_reslist_t *conns; /**< Resource list of actual client connections */ #else apr_memcache_conn_t *conn; #endif apr_pool_t *p; /** Pool to use for private allocations */ #if APR_HAS_THREADS apr_thread_mutex_t *lock; #endif apr_time_t btime; }; /* Custom hash callback function prototype, user for server selection. * @param baton user selected baton * @param data data to hash * @param data_len length of data */ typedef apr_uint32_t (*apr_memcache_hash_func)(void *baton, const char *data, const apr_size_t data_len); typedef struct apr_memcache_t apr_memcache_t; /* Custom Server Select callback function prototype. * @param baton user selected baton * @param mc memcache instance, use mc->live_servers to select a node * @param hash hash of the selected key. */ typedef apr_memcache_server_t* (*apr_memcache_server_func)(void *baton, apr_memcache_t *mc, const apr_uint32_t hash); /** Container for a set of memcached servers */ struct apr_memcache_t { apr_uint32_t flags; /**< Flags, Not currently used */ apr_uint16_t nalloc; /**< Number of Servers Allocated */ apr_uint16_t ntotal; /**< Number of Servers Added */ apr_memcache_server_t **live_servers; /**< Array of Servers */ apr_pool_t *p; /** Pool to use for allocations */ void *hash_baton; apr_memcache_hash_func hash_func; void *server_baton; apr_memcache_server_func server_func; }; /** Returned Data from a multiple get */ typedef struct { apr_status_t status; const char* key; apr_size_t len; char *data; apr_uint16_t flags; } apr_memcache_value_t; /** * Creates a crc32 hash used to split keys between servers * @param mc The memcache client object to use * @param data Data to be hashed * @param data_len Length of the data to use * @return crc32 hash of data * @remark The crc32 hash is not compatible with old memcached clients. */ APU_DECLARE(apr_uint32_t) apr_memcache_hash(apr_memcache_t *mc, const char *data, const apr_size_t data_len); /** * Pure CRC32 Hash. Used by some clients. */ APU_DECLARE(apr_uint32_t) apr_memcache_hash_crc32(void *baton, const char *data, const apr_size_t data_len); /** * hash compatible with the standard Perl Client. */ APU_DECLARE(apr_uint32_t) apr_memcache_hash_default(void *baton, const char *data, const apr_size_t data_len); /** * Picks a server based on a hash * @param mc The memcache client object to use * @param hash Hashed value of a Key * @return server that controls specified hash * @see apr_memcache_hash */ APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server_hash(apr_memcache_t *mc, const apr_uint32_t hash); /** * server selection compatible with the standard Perl Client. */ APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server_hash_default(void *baton, apr_memcache_t *mc, const apr_uint32_t hash); /** * Adds a server to a client object * @param mc The memcache client object to use * @param server Server to add * @remark Adding servers is not thread safe, and should be done once at startup. * @warning Changing servers after startup may cause keys to go to * different servers. */ APU_DECLARE(apr_status_t) apr_memcache_add_server(apr_memcache_t *mc, apr_memcache_server_t *server); /** * Finds a Server object based on a hostname/port pair * @param mc The memcache client object to use * @param host Hostname of the server * @param port Port of the server * @return Server with matching Hostname and Port, or NULL if none was found. */ APU_DECLARE(apr_memcache_server_t *) apr_memcache_find_server(apr_memcache_t *mc, const char *host, apr_port_t port); /** * Enables a Server for use again * @param mc The memcache client object to use * @param ms Server to Activate */ APU_DECLARE(apr_status_t) apr_memcache_enable_server(apr_memcache_t *mc, apr_memcache_server_t *ms); /** * Disable a Server * @param mc The memcache client object to use * @param ms Server to Disable */ APU_DECLARE(apr_status_t) apr_memcache_disable_server(apr_memcache_t *mc, apr_memcache_server_t *ms); /** * Creates a new Server Object * @param p Pool to use * @param host hostname of the server * @param port port of the server * @param min minimum number of client sockets to open * @param smax soft maximum number of client connections to open * @param max hard maximum number of client connections * @param ttl time to live in microseconds of a client connection * @param ns location of the new server object * @see apr_reslist_create * @remark min, smax, and max are only used when APR_HAS_THREADS */ APU_DECLARE(apr_status_t) apr_memcache_server_create(apr_pool_t *p, const char *host, apr_port_t port, apr_uint32_t min, apr_uint32_t smax, apr_uint32_t max, apr_uint32_t ttl, apr_memcache_server_t **ns); /** * Creates a new memcached client object * @param p Pool to use * @param max_servers maximum number of servers * @param flags Not currently used * @param mc location of the new memcache client object */ APU_DECLARE(apr_status_t) apr_memcache_create(apr_pool_t *p, apr_uint16_t max_servers, apr_uint32_t flags, apr_memcache_t **mc); /** * Gets a value from the server, allocating the value out of p * @param mc client to use * @param p Pool to use * @param key null terminated string containing the key * @param baton location of the allocated value * @param len length of data at baton * @param flags any flags set by the client for this key * @return */ APU_DECLARE(apr_status_t) apr_memcache_getp(apr_memcache_t *mc, apr_pool_t *p, const char* key, char **baton, apr_size_t *len, apr_uint16_t *flags); /** * Add a key to a hash for a multiget query * if the hash (*value) is NULL it will be created * @param data_pool pool from where the hash and their items are created from * @param key null terminated string containing the key * @param values hash of keys and values that this key will be added to * @return */ APU_DECLARE(void) apr_memcache_add_multget_key(apr_pool_t *data_pool, const char* key, apr_hash_t **values); /** * Gets multiple values from the server, allocating the values out of p * @param mc client to use * @param temp_pool Pool used for temporary allocations. May be cleared inside this * call. * @param data_pool Pool used to allocate data for the returned values. * @param values hash of apr_memcache_value_t keyed by strings, contains the * result of the multiget call. * @return */ APU_DECLARE(apr_status_t) apr_memcache_multgetp(apr_memcache_t *mc, apr_pool_t *temp_pool, apr_pool_t *data_pool, apr_hash_t *values); /** * Sets a value by key on the server * @param mc client to use * @param key null terminated string containing the key * @param baton data to store on the server * @param data_size length of data at baton * @param timeout time in seconds for the data to live on the server * @param flags any flags set by the client for this key */ APU_DECLARE(apr_status_t) apr_memcache_set(apr_memcache_t *mc, const char *key, char *baton, const apr_size_t data_size, apr_uint32_t timeout, apr_uint16_t flags); /** * Adds value by key on the server * @param mc client to use * @param key null terminated string containing the key * @param baton data to store on the server * @param data_size length of data at baton * @param timeout time for the data to live on the server * @param flags any flags set by the client for this key * @return APR_SUCCESS if the key was added, APR_EEXIST if the key * already exists on the server. */ APU_DECLARE(apr_status_t) apr_memcache_add(apr_memcache_t *mc, const char *key, char *baton, const apr_size_t data_size, apr_uint32_t timeout, apr_uint16_t flags); /** * Replaces value by key on the server * @param mc client to use * @param key null terminated string containing the key * @param baton data to store on the server * @param data_size length of data at baton * @param timeout time for the data to live on the server * @param flags any flags set by the client for this key * @return APR_SUCCESS if the key was added, APR_EEXIST if the key * did not exist on the server. */ APU_DECLARE(apr_status_t) apr_memcache_replace(apr_memcache_t *mc, const char *key, char *baton, const apr_size_t data_size, apr_uint32_t timeout, apr_uint16_t flags); /** * Deletes a key from a server * @param mc client to use * @param key null terminated string containing the key * @param timeout time for the delete to stop other clients from adding */ APU_DECLARE(apr_status_t) apr_memcache_delete(apr_memcache_t *mc, const char *key, apr_uint32_t timeout); /** * Increments a value * @param mc client to use * @param key null terminated string containing the key * @param n number to increment by * @param nv new value after incrementing */ APU_DECLARE(apr_status_t) apr_memcache_incr(apr_memcache_t *mc, const char *key, apr_int32_t n, apr_uint32_t *nv); /** * Decrements a value * @param mc client to use * @param key null terminated string containing the key * @param n number to decrement by * @param new_value new value after decrementing */ APU_DECLARE(apr_status_t) apr_memcache_decr(apr_memcache_t *mc, const char *key, apr_int32_t n, apr_uint32_t *new_value); /** * Query a server's version * @param ms server to query * @param p Pool to allocate answer from * @param baton location to store server version string * @param len length of the server version string */ APU_DECLARE(apr_status_t) apr_memcache_version(apr_memcache_server_t *ms, apr_pool_t *p, char **baton); typedef struct { /** Version string of this server */ const char *version; /** Process id of this server process */ apr_uint32_t pid; /** Number of seconds this server has been running */ apr_uint32_t uptime; /** current UNIX time according to the server */ apr_time_t time; /** The size of a pointer on the current machine */ apr_uint32_t pointer_size; /** Accumulated user time for this process */ apr_time_t rusage_user; /** Accumulated system time for this process */ apr_time_t rusage_system; /** Current number of items stored by the server */ apr_uint32_t curr_items; /** Total number of items stored by this server */ apr_uint32_t total_items; /** Current number of bytes used by this server to store items */ apr_uint64_t bytes; /** Number of open connections */ apr_uint32_t curr_connections; /** Total number of connections opened since the server started running */ apr_uint32_t total_connections; /** Number of connection structures allocated by the server */ apr_uint32_t connection_structures; /** Cumulative number of retrieval requests */ apr_uint32_t cmd_get; /** Cumulative number of storage requests */ apr_uint32_t cmd_set; /** Number of keys that have been requested and found present */ apr_uint32_t get_hits; /** Number of items that have been requested and not found */ apr_uint32_t get_misses; /** Number of items removed from cache because they passed their expiration time */ apr_uint64_t evictions; /** Total number of bytes read by this server */ apr_uint64_t bytes_read; /** Total number of bytes sent by this server */ apr_uint64_t bytes_written; /** Number of bytes this server is allowed to use for storage. */ apr_uint32_t limit_maxbytes; /** Number of threads the server is running (if built with threading) */ apr_uint32_t threads; } apr_memcache_stats_t; /** * Query a server for statistics * @param ms server to query * @param p Pool to allocate answer from * @param stats location of the new statistics structure */ APU_DECLARE(apr_status_t) apr_memcache_stats(apr_memcache_server_t *ms, apr_pool_t *p, apr_memcache_stats_t **stats); /** @} */ #ifdef __cplusplus } #endif #endif /* APR_MEMCACHE_H */ ================================================ FILE: third_party/include/aprutil/apr_optional.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_OPTIONAL_H #define APR_OPTIONAL_H #include "apu.h" /** * @file apr_optional.h * @brief APR-UTIL registration of functions exported by modules */ #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_Opt Optional Functions * @ingroup APR_Util * * Typesafe registration and retrieval of functions that may not be present * (i.e. functions exported by optional modules) * @{ */ /** * The type of an optional function. * @param name The name of the function */ #define APR_OPTIONAL_FN_TYPE(name) apr_OFN_##name##_t /** * Declare an optional function. * @param ret The return type of the function * @param name The name of the function * @param args The function arguments (including brackets) */ #define APR_DECLARE_OPTIONAL_FN(ret,name,args) \ typedef ret (APR_OPTIONAL_FN_TYPE(name)) args /** * XXX: This doesn't belong here, then! * Private function! DO NOT USE! * @internal */ typedef void (apr_opt_fn_t)(void); /** @internal */ APU_DECLARE_NONSTD(void) apr_dynamic_fn_register(const char *szName, apr_opt_fn_t *pfn); /** * Register an optional function. This can be later retrieved, type-safely, by * name. Like all global functions, the name must be unique. Note that, * confusingly but correctly, the function itself can be static! * @param name The name of the function */ #define APR_REGISTER_OPTIONAL_FN(name) do { \ APR_OPTIONAL_FN_TYPE(name) *apu__opt = name; \ apr_dynamic_fn_register(#name,(apr_opt_fn_t *)apu__opt); \ } while (0) /** @internal * Private function! DO NOT USE! */ APU_DECLARE(apr_opt_fn_t *) apr_dynamic_fn_retrieve(const char *szName); /** * Retrieve an optional function. Returns NULL if the function is not present. * @param name The name of the function */ #define APR_RETRIEVE_OPTIONAL_FN(name) \ (APR_OPTIONAL_FN_TYPE(name) *)apr_dynamic_fn_retrieve(#name) /** @} */ #ifdef __cplusplus } #endif #endif /* APR_OPTIONAL_H */ ================================================ FILE: third_party/include/aprutil/apr_optional_hooks.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_optional_hooks.h * @brief Apache optional hook functions */ #ifndef APR_OPTIONAL_HOOK_H #define APR_OPTIONAL_HOOK_H #include "apr_tables.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_OPT_HOOK Optional Hook Functions * @ingroup APR_Util_Hook * @{ */ /** * Function to implement the APR_OPTIONAL_HOOK Macro * @internal * @see APR_OPTIONAL_HOOK * * @param szName The name of the hook * @param pfn A pointer to a function that will be called * @param aszPre a NULL-terminated array of strings that name modules whose hooks should precede this one * @param aszSucc a NULL-terminated array of strings that name modules whose hooks should succeed this one * @param nOrder an integer determining order before honouring aszPre and aszSucc (for example HOOK_MIDDLE) */ APU_DECLARE(void) apr_optional_hook_add(const char *szName,void (*pfn)(void), const char * const *aszPre, const char * const *aszSucc, int nOrder); /** * Hook to an optional hook. * * @param ns The namespace prefix of the hook functions * @param name The name of the hook * @param pfn A pointer to a function that will be called * @param aszPre a NULL-terminated array of strings that name modules whose hooks should precede this one * @param aszSucc a NULL-terminated array of strings that name modules whose hooks should succeed this one * @param nOrder an integer determining order before honouring aszPre and aszSucc (for example HOOK_MIDDLE) */ #define APR_OPTIONAL_HOOK(ns,name,pfn,aszPre,aszSucc,nOrder) do { \ ns##_HOOK_##name##_t *apu__hook = pfn; \ apr_optional_hook_add(#name,(void (*)(void))apu__hook,aszPre, aszSucc, nOrder); \ } while (0) /** * @internal * @param szName - the name of the function * @return the hook structure for a given hook */ APU_DECLARE(apr_array_header_t *) apr_optional_hook_get(const char *szName); /** * Implement an optional hook that runs until one of the functions * returns something other than OK or DECLINE. * * @param ns The namespace prefix of the hook functions * @param link The linkage declaration prefix of the hook * @param ret The type of the return value of the hook * @param ret The type of the return value of the hook * @param name The name of the hook * @param args_decl The declaration of the arguments for the hook * @param args_use The names for the arguments for the hook * @param ok Success value * @param decline Decline value */ #define APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ns,link,ret,name,args_decl,args_use,ok,decline) \ link##_DECLARE(ret) ns##_run_##name args_decl \ { \ ns##_LINK_##name##_t *pHook; \ int n; \ ret rv; \ apr_array_header_t *pHookArray=apr_optional_hook_get(#name); \ \ if(!pHookArray) \ return ok; \ \ pHook=(ns##_LINK_##name##_t *)pHookArray->elts; \ for(n=0 ; n < pHookArray->nelts ; ++n) \ { \ rv=(pHook[n].pFunc)args_use; \ \ if(rv != ok && rv != decline) \ return rv; \ } \ return ok; \ } /** @} */ #ifdef __cplusplus } #endif #endif /* APR_OPTIONAL_HOOK_H */ ================================================ FILE: third_party/include/aprutil/apr_queue.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_QUEUE_H #define APR_QUEUE_H /** * @file apr_queue.h * @brief Thread Safe FIFO bounded queue * @note Since most implementations of the queue are backed by a condition * variable implementation, it isn't available on systems without threads. * Although condition variables are sometimes available without threads. */ #include "apu.h" #include "apr_errno.h" #include "apr_pools.h" #if APR_HAS_THREADS #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup APR_Util_FIFO Thread Safe FIFO bounded queue * @ingroup APR_Util * @{ */ /** * opaque structure */ typedef struct apr_queue_t apr_queue_t; /** * create a FIFO queue * @param queue The new queue * @param queue_capacity maximum size of the queue * @param a pool to allocate queue from */ APU_DECLARE(apr_status_t) apr_queue_create(apr_queue_t **queue, unsigned int queue_capacity, apr_pool_t *a); /** * push/add an object to the queue, blocking if the queue is already full * * @param queue the queue * @param data the data * @returns APR_EINTR the blocking was interrupted (try again) * @returns APR_EOF the queue has been terminated * @returns APR_SUCCESS on a successful push */ APU_DECLARE(apr_status_t) apr_queue_push(apr_queue_t *queue, void *data); /** * pop/get an object from the queue, blocking if the queue is already empty * * @param queue the queue * @param data the data * @returns APR_EINTR the blocking was interrupted (try again) * @returns APR_EOF if the queue has been terminated * @returns APR_SUCCESS on a successful pop */ APU_DECLARE(apr_status_t) apr_queue_pop(apr_queue_t *queue, void **data); /** * push/add an object to the queue, returning immediately if the queue is full * * @param queue the queue * @param data the data * @returns APR_EINTR the blocking operation was interrupted (try again) * @returns APR_EAGAIN the queue is full * @returns APR_EOF the queue has been terminated * @returns APR_SUCCESS on a successful push */ APU_DECLARE(apr_status_t) apr_queue_trypush(apr_queue_t *queue, void *data); /** * pop/get an object to the queue, returning immediately if the queue is empty * * @param queue the queue * @param data the data * @returns APR_EINTR the blocking operation was interrupted (try again) * @returns APR_EAGAIN the queue is empty * @returns APR_EOF the queue has been terminated * @returns APR_SUCCESS on a successful pop */ APU_DECLARE(apr_status_t) apr_queue_trypop(apr_queue_t *queue, void **data); /** * returns the size of the queue. * * @warning this is not threadsafe, and is intended for reporting/monitoring * of the queue. * @param queue the queue * @returns the size of the queue */ APU_DECLARE(unsigned int) apr_queue_size(apr_queue_t *queue); /** * interrupt all the threads blocking on this queue. * * @param queue the queue */ APU_DECLARE(apr_status_t) apr_queue_interrupt_all(apr_queue_t *queue); /** * terminate the queue, sending an interrupt to all the * blocking threads * * @param queue the queue */ APU_DECLARE(apr_status_t) apr_queue_term(apr_queue_t *queue); #ifdef __cplusplus } #endif /** @} */ #endif /* APR_HAS_THREADS */ #endif /* APRQUEUE_H */ ================================================ FILE: third_party/include/aprutil/apr_reslist.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_RESLIST_H #define APR_RESLIST_H /** * @file apr_reslist.h * @brief APR-UTIL Resource List Routines */ #include "apr.h" #include "apu.h" #include "apr_pools.h" #include "apr_errno.h" #include "apr_time.h" /** * @defgroup APR_Util_RL Resource List Routines * @ingroup APR_Util * @{ */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Opaque resource list object */ typedef struct apr_reslist_t apr_reslist_t; /* Generic constructor called by resource list when it needs to create a * resource. * @param resource opaque resource * @param params flags * @param pool Pool */ typedef apr_status_t (*apr_reslist_constructor)(void **resource, void *params, apr_pool_t *pool); /* Generic destructor called by resource list when it needs to destroy a * resource. * @param resource opaque resource * @param params flags * @param pool Pool */ typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params, apr_pool_t *pool); /* Cleanup order modes */ #define APR_RESLIST_CLEANUP_DEFAULT 0 /**< default pool cleanup */ #define APR_RESLIST_CLEANUP_FIRST 1 /**< use pool pre cleanup */ /** * Create a new resource list with the following parameters: * @param reslist An address where the pointer to the new resource * list will be stored. * @param min Allowed minimum number of available resources. Zero * creates new resources only when needed. * @param smax Resources will be destroyed during reslist maintenance to * meet this maximum restriction as they expire (reach their ttl). * @param hmax Absolute maximum limit on the number of total resources. * @param ttl If non-zero, sets the maximum amount of time in microseconds an * unused resource is valid. Any resource which has exceeded this * time will be destroyed, either when encountered by * apr_reslist_acquire() or during reslist maintenance. * @param con Constructor routine that is called to create a new resource. * @param de Destructor routine that is called to destroy an expired resource. * @param params Passed to constructor and deconstructor * @param pool The pool from which to create this resource list. Also the * same pool that is passed to the constructor and destructor * routines. * @remark If APR has been compiled without thread support, hmax will be * automatically set to 1 and values of min and smax will be forced to * 1 for any non-zero value. */ APU_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist, int min, int smax, int hmax, apr_interval_time_t ttl, apr_reslist_constructor con, apr_reslist_destructor de, void *params, apr_pool_t *pool); /** * Destroy the given resource list and all resources controlled by * this list. * FIXME: Should this block until all resources become available, * or maybe just destroy all the free ones, or maybe destroy * them even though they might be in use by something else? * Currently it will abort if there are resources that haven't * been released, so there is an assumption that all resources * have been released to the list before calling this function. * @param reslist The reslist to destroy */ APU_DECLARE(apr_status_t) apr_reslist_destroy(apr_reslist_t *reslist); /** * Retrieve a resource from the list, creating a new one if necessary. * If we have met our maximum number of resources, we will block * until one becomes available. * @param reslist The resource list. * @param resource An address where the pointer to the resource * will be stored. */ APU_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, void **resource); /** * Return a resource back to the list of available resources. * @param reslist The resource list. * @param resource The resource to return to the list. */ APU_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, void *resource); /** * Set the timeout the acquire will wait for a free resource * when the maximum number of resources is exceeded. * @param reslist The resource list. * @param timeout Timeout to wait. The zero waits forever. */ APU_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, apr_interval_time_t timeout); /** * Return the number of outstanding resources. * @param reslist The resource list. */ APU_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist); /** * Invalidate a resource in the pool - e.g. a database connection * that returns a "lost connection" error and can't be restored. * Use this instead of apr_reslist_release if the resource is bad. * @param reslist The resource list. * @param resource The resource to invalidate. */ APU_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist, void *resource); /** * Perform routine maintenance on the resource list. This call * may instantiate new resources or expire old resources. * @param reslist The resource list. */ APU_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist); /** * Set reslist cleanup order. * @param reslist The resource list. * @param mode Cleanup order mode *
 *           APR_RESLIST_CLEANUP_DEFAULT  default pool cleanup order
 *           APR_RESLIST_CLEANUP_FIRST    use pool pre cleanup
 * 
* @remark If APR_RESLIST_CLEANUP_FIRST is used the destructors will * be called before child pools of the pool used to create the reslist * are destroyed. This allows to explicitly destroy the child pools * inside reslist destructors. */ APU_DECLARE(void) apr_reslist_cleanup_order_set(apr_reslist_t *reslist, apr_uint32_t mode); #ifdef __cplusplus } #endif /** @} */ #endif /* ! APR_RESLIST_H */ ================================================ FILE: third_party/include/aprutil/apr_rmm.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_RMM_H #define APR_RMM_H /** * @file apr_rmm.h * @brief APR-UTIL Relocatable Memory Management Routines */ /** * @defgroup APR_Util_RMM Relocatable Memory Management Routines * @ingroup APR_Util * @{ */ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" #include "apu.h" #include "apr_anylock.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Structure to access Relocatable, Managed Memory */ typedef struct apr_rmm_t apr_rmm_t; /** Fundamental allocation unit, within a specific apr_rmm_t */ typedef apr_size_t apr_rmm_off_t; /** * Initialize a relocatable memory block to be managed by the apr_rmm API. * @param rmm The relocatable memory block * @param lock An apr_anylock_t of the appropriate type of lock, or NULL * if no locking is required. * @param membuf The block of relocatable memory to be managed * @param memsize The size of relocatable memory block to be managed * @param cont The pool to use for local storage and management * @remark Both @param membuf and @param memsize must be aligned * (for instance using APR_ALIGN_DEFAULT). */ APU_DECLARE(apr_status_t) apr_rmm_init(apr_rmm_t **rmm, apr_anylock_t *lock, void *membuf, apr_size_t memsize, apr_pool_t *cont); /** * Destroy a managed memory block. * @param rmm The relocatable memory block to destroy */ APU_DECLARE(apr_status_t) apr_rmm_destroy(apr_rmm_t *rmm); /** * Attach to a relocatable memory block already managed by the apr_rmm API. * @param rmm The relocatable memory block * @param lock An apr_anylock_t of the appropriate type of lock * @param membuf The block of relocatable memory already under management * @param cont The pool to use for local storage and management */ APU_DECLARE(apr_status_t) apr_rmm_attach(apr_rmm_t **rmm, apr_anylock_t *lock, void *membuf, apr_pool_t *cont); /** * Detach from the managed block of memory. * @param rmm The relocatable memory block to detach from */ APU_DECLARE(apr_status_t) apr_rmm_detach(apr_rmm_t *rmm); /** * Allocate memory from the block of relocatable memory. * @param rmm The relocatable memory block * @param reqsize How much memory to allocate */ APU_DECLARE(apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm, apr_size_t reqsize); /** * Realloc memory from the block of relocatable memory. * @param rmm The relocatable memory block * @param entity The memory allocation to realloc * @param reqsize The new size */ APU_DECLARE(apr_rmm_off_t) apr_rmm_realloc(apr_rmm_t *rmm, void *entity, apr_size_t reqsize); /** * Allocate memory from the block of relocatable memory and initialize it to zero. * @param rmm The relocatable memory block * @param reqsize How much memory to allocate */ APU_DECLARE(apr_rmm_off_t) apr_rmm_calloc(apr_rmm_t *rmm, apr_size_t reqsize); /** * Free allocation returned by apr_rmm_malloc or apr_rmm_calloc. * @param rmm The relocatable memory block * @param entity The memory allocation to free */ APU_DECLARE(apr_status_t) apr_rmm_free(apr_rmm_t *rmm, apr_rmm_off_t entity); /** * Retrieve the physical address of a relocatable allocation of memory * @param rmm The relocatable memory block * @param entity The memory allocation to free * @return address The address, aligned with APR_ALIGN_DEFAULT. */ APU_DECLARE(void *) apr_rmm_addr_get(apr_rmm_t *rmm, apr_rmm_off_t entity); /** * Compute the offset of a relocatable allocation of memory * @param rmm The relocatable memory block * @param entity The physical address to convert to an offset */ APU_DECLARE(apr_rmm_off_t) apr_rmm_offset_get(apr_rmm_t *rmm, void *entity); /** * Compute the required overallocation of memory needed to fit n allocs * @param n The number of alloc/calloc regions desired */ APU_DECLARE(apr_size_t) apr_rmm_overhead_get(int n); #ifdef __cplusplus } #endif /** @} */ #endif /* ! APR_RMM_H */ ================================================ FILE: third_party/include/aprutil/apr_sdbm.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * sdbm - ndbm work-alike hashed database library * based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978). * author: oz@nexus.yorku.ca * status: ex-public domain */ #ifndef APR_SDBM_H #define APR_SDBM_H #include "apu.h" #include "apr_errno.h" #include "apr_file_io.h" /* for apr_fileperms_t */ /** * @file apr_sdbm.h * @brief apr-util SDBM library */ /** * @defgroup APR_Util_DBM_SDBM SDBM library * @ingroup APR_Util_DBM * @{ */ /** * Structure for referencing an sdbm */ typedef struct apr_sdbm_t apr_sdbm_t; /** * Structure for referencing the datum record within an sdbm */ typedef struct { /** pointer to the data stored/retrieved */ char *dptr; /** size of data */ /* apr_ssize_t for release 2.0??? */ int dsize; } apr_sdbm_datum_t; /* The extensions used for the database files */ /** SDBM Directory file extension */ #define APR_SDBM_DIRFEXT ".dir" /** SDBM page file extension */ #define APR_SDBM_PAGFEXT ".pag" /* flags to sdbm_store */ #define APR_SDBM_INSERT 0 /**< Insert */ #define APR_SDBM_REPLACE 1 /**< Replace */ #define APR_SDBM_INSERTDUP 2 /**< Insert with duplicates */ /** * Open an sdbm database by file name * @param db The newly opened database * @param name The sdbm file to open * @param mode The flag values (APR_READ and APR_BINARY flags are implicit) *
 *           APR_WRITE          open for read-write access
 *           APR_CREATE         create the sdbm if it does not exist
 *           APR_TRUNCATE       empty the contents of the sdbm
 *           APR_EXCL           fail for APR_CREATE if the file exists
 *           APR_DELONCLOSE     delete the sdbm when closed
 *           APR_SHARELOCK      support locking across process/machines
 * 
* @param perms Permissions to apply to if created * @param p The pool to use when creating the sdbm * @remark The sdbm name is not a true file name, as sdbm appends suffixes * for seperate data and index files. */ APU_DECLARE(apr_status_t) apr_sdbm_open(apr_sdbm_t **db, const char *name, apr_int32_t mode, apr_fileperms_t perms, apr_pool_t *p); /** * Close an sdbm file previously opened by apr_sdbm_open * @param db The database to close */ APU_DECLARE(apr_status_t) apr_sdbm_close(apr_sdbm_t *db); /** * Lock an sdbm database for concurency of multiple operations * @param db The database to lock * @param type The lock type *
 *           APR_FLOCK_SHARED
 *           APR_FLOCK_EXCLUSIVE
 * 
* @remark Calls to apr_sdbm_lock may be nested. All apr_sdbm functions * perform implicit locking. Since an APR_FLOCK_SHARED lock cannot be * portably promoted to an APR_FLOCK_EXCLUSIVE lock, apr_sdbm_store and * apr_sdbm_delete calls will fail if an APR_FLOCK_SHARED lock is held. * The apr_sdbm_lock call requires the database to be opened with the * APR_SHARELOCK mode value. */ APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type); /** * Release an sdbm lock previously aquired by apr_sdbm_lock * @param db The database to unlock */ APU_DECLARE(apr_status_t) apr_sdbm_unlock(apr_sdbm_t *db); /** * Fetch an sdbm record value by key * @param db The database * @param value The value datum retrieved for this record * @param key The key datum to find this record */ APU_DECLARE(apr_status_t) apr_sdbm_fetch(apr_sdbm_t *db, apr_sdbm_datum_t *value, apr_sdbm_datum_t key); /** * Store an sdbm record value by key * @param db The database * @param key The key datum to store this record by * @param value The value datum to store in this record * @param opt The method used to store the record *
 *           APR_SDBM_INSERT     return an error if the record exists
 *           APR_SDBM_REPLACE    overwrite any existing record for key
 * 
*/ APU_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key, apr_sdbm_datum_t value, int opt); /** * Delete an sdbm record value by key * @param db The database * @param key The key datum of the record to delete * @remark It is not an error to delete a non-existent record. */ APU_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db, const apr_sdbm_datum_t key); /** * Retrieve the first record key from a dbm * @param db The database * @param key The key datum of the first record * @remark The keys returned are not ordered. To traverse the list of keys * for an sdbm opened with APR_SHARELOCK, the caller must use apr_sdbm_lock * prior to retrieving the first record, and hold the lock until after the * last call to apr_sdbm_nextkey. */ APU_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db, apr_sdbm_datum_t *key); /** * Retrieve the next record key from an sdbm * @param db The database * @param key The key datum of the next record */ APU_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db, apr_sdbm_datum_t *key); /** * Returns true if the sdbm database opened for read-only access * @param db The database to test */ APU_DECLARE(int) apr_sdbm_rdonly(apr_sdbm_t *db); /** @} */ #endif /* APR_SDBM_H */ ================================================ FILE: third_party/include/aprutil/apr_sha1.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* NIST Secure Hash Algorithm * heavily modified by Uwe Hollerbach uh@alumni.caltech edu * from Peter C. Gutmann's implementation as found in * Applied Cryptography by Bruce Schneier * This code is hereby placed in the public domain */ #ifndef APR_SHA1_H #define APR_SHA1_H #include "apu.h" #include "apr_general.h" #ifdef __cplusplus extern "C" { #endif /** * @file apr_sha1.h * @brief APR-UTIL SHA1 library */ /** size of the SHA1 DIGEST */ #define APR_SHA1_DIGESTSIZE 20 /** * Define the Magic String prefix that identifies a password as being * hashed using our algorithm. */ #define APR_SHA1PW_ID "{SHA}" /** length of the SHA Password */ #define APR_SHA1PW_IDLEN 5 /** @see apr_sha1_ctx_t */ typedef struct apr_sha1_ctx_t apr_sha1_ctx_t; /** * SHA1 context structure */ struct apr_sha1_ctx_t { /** message digest */ apr_uint32_t digest[5]; /** 64-bit bit counts */ apr_uint32_t count_lo, count_hi; /** SHA data buffer */ apr_uint32_t data[16]; /** unprocessed amount in data */ int local; }; /** * Provide a means to SHA1 crypt/encode a plaintext password in a way which * makes password file compatible with those commonly use in netscape web * and ldap installations. * @param clear The plaintext password * @param len The length of the plaintext password * @param out The encrypted/encoded password * @note SHA1 support is useful for migration purposes, but is less * secure than Apache's password format, since Apache's (MD5) * password format uses a random eight character salt to generate * one of many possible hashes for the same password. Netscape * uses plain SHA1 without a salt, so the same password * will always generate the same hash, making it easier * to break since the search space is smaller. */ APU_DECLARE(void) apr_sha1_base64(const char *clear, int len, char *out); /** * Initialize the SHA digest * @param context The SHA context to initialize */ APU_DECLARE(void) apr_sha1_init(apr_sha1_ctx_t *context); /** * Update the SHA digest * @param context The SHA1 context to update * @param input The buffer to add to the SHA digest * @param inputLen The length of the input buffer */ APU_DECLARE(void) apr_sha1_update(apr_sha1_ctx_t *context, const char *input, unsigned int inputLen); /** * Update the SHA digest with binary data * @param context The SHA1 context to update * @param input The buffer to add to the SHA digest * @param inputLen The length of the input buffer */ APU_DECLARE(void) apr_sha1_update_binary(apr_sha1_ctx_t *context, const unsigned char *input, unsigned int inputLen); /** * Finish computing the SHA digest * @param digest the output buffer in which to store the digest * @param context The context to finalize */ APU_DECLARE(void) apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE], apr_sha1_ctx_t *context); #ifdef __cplusplus } #endif #endif /* APR_SHA1_H */ ================================================ FILE: third_party/include/aprutil/apr_strmatch.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_STRMATCH_H #define APR_STRMATCH_H /** * @file apr_strmatch.h * @brief APR-UTIL string matching routines */ #include "apu.h" #include "apr_pools.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_StrMatch String matching routines * @ingroup APR_Util * @{ */ /** @see apr_strmatch_pattern */ typedef struct apr_strmatch_pattern apr_strmatch_pattern; /** * Precompiled search pattern */ struct apr_strmatch_pattern { /** Function called to compare */ const char *(*compare)(const apr_strmatch_pattern *this_pattern, const char *s, apr_size_t slen); const char *pattern; /**< Current pattern */ apr_size_t length; /**< Current length */ void *context; /**< hook to add precomputed metadata */ }; #if defined(DOXYGEN) /** * Search for a precompiled pattern within a string * @param pattern The pattern * @param s The string in which to search for the pattern * @param slen The length of s (excluding null terminator) * @return A pointer to the first instance of the pattern in s, or * NULL if not found */ APU_DECLARE(const char *) apr_strmatch(const apr_strmatch_pattern *pattern, const char *s, apr_size_t slen); #else #define apr_strmatch(pattern, s, slen) (*((pattern)->compare))((pattern), (s), (slen)) #endif /** * Precompile a pattern for matching using the Boyer-Moore-Horspool algorithm * @param p The pool from which to allocate the pattern * @param s The pattern string * @param case_sensitive Whether the matching should be case-sensitive * @return a pointer to the compiled pattern, or NULL if compilation fails */ APU_DECLARE(const apr_strmatch_pattern *) apr_strmatch_precompile(apr_pool_t *p, const char *s, int case_sensitive); /** @} */ #ifdef __cplusplus } #endif #endif /* !APR_STRMATCH_H */ ================================================ FILE: third_party/include/aprutil/apr_thread_pool.h ================================================ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License. */ #ifndef APU_THREAD_POOL_H #define APU_THREAD_POOL_H #include "apu.h" #include "apr_thread_proc.h" /** * @file apr_thread_pool.h * @brief APR Thread Pool Library * @remarks This library implements a thread pool using apr_thread_t. A thread * pool is a set of threads that can be created in advance or on demand until a * maximum number. When a task is scheduled, the thread pool will find an idle * thread to handle the task. In case all existing threads are busy and the * number of tasks in the queue is higher than the adjustable threshold, the * pool will try to create a new thread to serve the task if the maximum number * has not been reached. Otherwise, the task will be put into a queue based on * priority, which can be valued from 0 to 255, with higher values being served * first. If there are tasks with the same priority, the new task might be put at * the top or at the bottom - it depends on which function is used to put the task. * * @remarks There may be the case where the thread pool can use up to the maximum * number of threads at peak load, but having those threads idle afterwards. A * maximum number of idle threads can be set so that the extra idling threads will * be terminated to save system resources. */ #if APR_HAS_THREADS #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup APR_Util_TP Thread Pool routines * @ingroup APR_Util * @{ */ /** Opaque Thread Pool structure. */ typedef struct apr_thread_pool apr_thread_pool_t; #define APR_THREAD_TASK_PRIORITY_LOWEST 0 #define APR_THREAD_TASK_PRIORITY_LOW 63 #define APR_THREAD_TASK_PRIORITY_NORMAL 127 #define APR_THREAD_TASK_PRIORITY_HIGH 191 #define APR_THREAD_TASK_PRIORITY_HIGHEST 255 /** * Create a thread pool * @param me The pointer in which to return the newly created apr_thread_pool * object, or NULL if thread pool creation fails. * @param init_threads The number of threads to be created initially, this number * will also be used as the initial value for the maximum number of idle threads. * @param max_threads The maximum number of threads that can be created * @param pool The pool to use * @return APR_SUCCESS if the thread pool was created successfully. Otherwise, * the error code. */ APU_DECLARE(apr_status_t) apr_thread_pool_create(apr_thread_pool_t **me, apr_size_t init_threads, apr_size_t max_threads, apr_pool_t *pool); /** * Destroy the thread pool and stop all the threads * @return APR_SUCCESS if all threads are stopped. */ APU_DECLARE(apr_status_t) apr_thread_pool_destroy(apr_thread_pool_t *me); /** * Schedule a task to the bottom of the tasks of same priority. * @param me The thread pool * @param func The task function * @param param The parameter for the task function * @param priority The priority of the task. * @param owner Owner of this task. * @return APR_SUCCESS if the task had been scheduled successfully */ APU_DECLARE(apr_status_t) apr_thread_pool_push(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_byte_t priority, void *owner); /** * Schedule a task to be run after a delay * @param me The thread pool * @param func The task function * @param param The parameter for the task function * @param time Time in microseconds * @param owner Owner of this task. * @return APR_SUCCESS if the task had been scheduled successfully */ APU_DECLARE(apr_status_t) apr_thread_pool_schedule(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_interval_time_t time, void *owner); /** * Schedule a task to the top of the tasks of same priority. * @param me The thread pool * @param func The task function * @param param The parameter for the task function * @param priority The priority of the task. * @param owner Owner of this task. * @return APR_SUCCESS if the task had been scheduled successfully */ APU_DECLARE(apr_status_t) apr_thread_pool_top(apr_thread_pool_t *me, apr_thread_start_t func, void *param, apr_byte_t priority, void *owner); /** * Cancel tasks submitted by the owner. If there is any task from the owner that * is currently running, the function will spin until the task finished. * @param me The thread pool * @param owner Owner of the task * @return APR_SUCCESS if the task has been cancelled successfully * @note The task function should not be calling cancel, otherwise the function * may get stuck forever. The function assert if it detect such a case. */ APU_DECLARE(apr_status_t) apr_thread_pool_tasks_cancel(apr_thread_pool_t *me, void *owner); /** * Get the current number of tasks waiting in the queue * @param me The thread pool * @return Number of tasks in the queue */ APU_DECLARE(apr_size_t) apr_thread_pool_tasks_count(apr_thread_pool_t *me); /** * Get the current number of scheduled tasks waiting in the queue * @param me The thread pool * @return Number of scheduled tasks in the queue */ APU_DECLARE(apr_size_t) apr_thread_pool_scheduled_tasks_count(apr_thread_pool_t *me); /** * Get the current number of threads * @param me The thread pool * @return Total number of threads */ APU_DECLARE(apr_size_t) apr_thread_pool_threads_count(apr_thread_pool_t *me); /** * Get the current number of busy threads * @param me The thread pool * @return Number of busy threads */ APU_DECLARE(apr_size_t) apr_thread_pool_busy_count(apr_thread_pool_t *me); /** * Get the current number of idle threads * @param me The thread pool * @return Number of idle threads */ APU_DECLARE(apr_size_t) apr_thread_pool_idle_count(apr_thread_pool_t *me); /** * Access function for the maximum number of idle threads. Number of current * idle threads will be reduced to the new limit. * @param me The thread pool * @param cnt The number * @return The number of threads that were stopped. */ APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_set(apr_thread_pool_t *me, apr_size_t cnt); /** * Get number of tasks that have run * @param me The thread pool * @return Number of tasks that have run */ APU_DECLARE(apr_size_t) apr_thread_pool_tasks_run_count(apr_thread_pool_t * me); /** * Get high water mark of the number of tasks waiting to run * @param me The thread pool * @return High water mark of tasks waiting to run */ APU_DECLARE(apr_size_t) apr_thread_pool_tasks_high_count(apr_thread_pool_t * me); /** * Get high water mark of the number of threads * @param me The thread pool * @return High water mark of threads in thread pool */ APU_DECLARE(apr_size_t) apr_thread_pool_threads_high_count(apr_thread_pool_t * me); /** * Get the number of idle threads that were destroyed after timing out * @param me The thread pool * @return Number of idle threads that timed out */ APU_DECLARE(apr_size_t) apr_thread_pool_threads_idle_timeout_count(apr_thread_pool_t * me); /** * Access function for the maximum number of idle threads * @param me The thread pool * @return The current maximum number */ APU_DECLARE(apr_size_t) apr_thread_pool_idle_max_get(apr_thread_pool_t *me); /** * Access function for the maximum number of threads. * @param me The thread pool * @param cnt Number of threads * @return The original maximum number of threads */ APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_set(apr_thread_pool_t *me, apr_size_t cnt); /** * Access function for the maximum wait time (in microseconds) of an * idling thread that exceeds the maximum number of idling threads. * A non-zero value allows for the reaping of idling threads to shrink * over time. Which helps reduce thrashing. * @param me The thread pool * @param timeout The number of microseconds an idle thread should wait * till it reaps itself * @return The original maximum wait time */ APU_DECLARE(apr_interval_time_t) apr_thread_pool_idle_wait_set(apr_thread_pool_t * me, apr_interval_time_t timeout); /** * Access function for the maximum wait time (in microseconds) of an * idling thread that exceeds the maximum number of idling threads * @param me The thread pool * @return The current maximum wait time */ APU_DECLARE(apr_interval_time_t) apr_thread_pool_idle_wait_get(apr_thread_pool_t * me); /** * Access function for the maximum number of threads * @param me The thread pool * @return The current maximum number */ APU_DECLARE(apr_size_t) apr_thread_pool_thread_max_get(apr_thread_pool_t *me); /** * Access function for the threshold of tasks in queue to trigger a new thread. * @param me The thread pool * @param cnt The new threshold * @return The original threshold */ APU_DECLARE(apr_size_t) apr_thread_pool_threshold_set(apr_thread_pool_t *me, apr_size_t val); /** * Access function for the threshold of tasks in queue to trigger a new thread. * @param me The thread pool * @return The current threshold */ APU_DECLARE(apr_size_t) apr_thread_pool_threshold_get(apr_thread_pool_t * me); /** * Get owner of the task currently been executed by the thread. * @param thd The thread is executing a task * @param owner Pointer to receive owner of the task. * @return APR_SUCCESS if the owner is retrieved successfully */ APU_DECLARE(apr_status_t) apr_thread_pool_task_owner_get(apr_thread_t *thd, void **owner); /** @} */ #ifdef __cplusplus } #endif #endif /* APR_HAS_THREADS */ #endif /* !APR_THREAD_POOL_H */ ================================================ FILE: third_party/include/aprutil/apr_uri.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * apr_uri.h: External Interface of apr_uri.c */ /** * @file apr_uri.h * @brief APR-UTIL URI Routines */ #ifndef APR_URI_H #define APR_URI_H #include "apu.h" #include "apr_network_io.h" #ifdef __cplusplus extern "C" { #endif /** * @defgroup APR_Util_URI URI * @ingroup APR_Util * @{ */ #define APR_URI_FTP_DEFAULT_PORT 21 /**< default FTP port */ #define APR_URI_SSH_DEFAULT_PORT 22 /**< default SSH port */ #define APR_URI_TELNET_DEFAULT_PORT 23 /**< default telnet port */ #define APR_URI_GOPHER_DEFAULT_PORT 70 /**< default Gopher port */ #define APR_URI_HTTP_DEFAULT_PORT 80 /**< default HTTP port */ #define APR_URI_POP_DEFAULT_PORT 110 /**< default POP port */ #define APR_URI_NNTP_DEFAULT_PORT 119 /**< default NNTP port */ #define APR_URI_IMAP_DEFAULT_PORT 143 /**< default IMAP port */ #define APR_URI_PROSPERO_DEFAULT_PORT 191 /**< default Prospero port */ #define APR_URI_WAIS_DEFAULT_PORT 210 /**< default WAIS port */ #define APR_URI_LDAP_DEFAULT_PORT 389 /**< default LDAP port */ #define APR_URI_HTTPS_DEFAULT_PORT 443 /**< default HTTPS port */ #define APR_URI_RTSP_DEFAULT_PORT 554 /**< default RTSP port */ #define APR_URI_SNEWS_DEFAULT_PORT 563 /**< default SNEWS port */ #define APR_URI_ACAP_DEFAULT_PORT 674 /**< default ACAP port */ #define APR_URI_NFS_DEFAULT_PORT 2049 /**< default NFS port */ #define APR_URI_TIP_DEFAULT_PORT 3372 /**< default TIP port */ #define APR_URI_SIP_DEFAULT_PORT 5060 /**< default SIP port */ /** Flags passed to unparse_uri_components(): */ /** suppress "scheme://user\@site:port" */ #define APR_URI_UNP_OMITSITEPART (1U<<0) /** Just omit user */ #define APR_URI_UNP_OMITUSER (1U<<1) /** Just omit password */ #define APR_URI_UNP_OMITPASSWORD (1U<<2) /** omit "user:password\@" part */ #define APR_URI_UNP_OMITUSERINFO (APR_URI_UNP_OMITUSER | \ APR_URI_UNP_OMITPASSWORD) /** Show plain text password (default: show XXXXXXXX) */ #define APR_URI_UNP_REVEALPASSWORD (1U<<3) /** Show "scheme://user\@site:port" only */ #define APR_URI_UNP_OMITPATHINFO (1U<<4) /** Omit the "?queryarg" from the path */ #define APR_URI_UNP_OMITQUERY (1U<<5) /** @see apr_uri_t */ typedef struct apr_uri_t apr_uri_t; /** * A structure to encompass all of the fields in a uri */ struct apr_uri_t { /** scheme ("http"/"ftp"/...) */ char *scheme; /** combined [user[:password]\@]host[:port] */ char *hostinfo; /** user name, as in http://user:passwd\@host:port/ */ char *user; /** password, as in http://user:passwd\@host:port/ */ char *password; /** hostname from URI (or from Host: header) */ char *hostname; /** port string (integer representation is in "port") */ char *port_str; /** the request path (or NULL if only scheme://host was given) */ char *path; /** Everything after a '?' in the path, if present */ char *query; /** Trailing "#fragment" string, if present */ char *fragment; /** structure returned from gethostbyname() */ struct hostent *hostent; /** The port number, numeric, valid only if port_str != NULL */ apr_port_t port; /** has the structure been initialized */ unsigned is_initialized:1; /** has the DNS been looked up yet */ unsigned dns_looked_up:1; /** has the dns been resolved yet */ unsigned dns_resolved:1; }; /* apr_uri.c */ /** * Return the default port for a given scheme. The schemes recognized are * http, ftp, https, gopher, wais, nntp, snews, and prospero * @param scheme_str The string that contains the current scheme * @return The default port for this scheme */ APU_DECLARE(apr_port_t) apr_uri_port_of_scheme(const char *scheme_str); /** * Unparse a apr_uri_t structure to an URI string. Optionally * suppress the password for security reasons. * @param p The pool to allocate out of * @param uptr All of the parts of the uri * @param flags How to unparse the uri. One of: *
 *    APR_URI_UNP_OMITSITEPART        Suppress "scheme://user\@site:port" 
 *    APR_URI_UNP_OMITUSER            Just omit user 
 *    APR_URI_UNP_OMITPASSWORD        Just omit password 
 *    APR_URI_UNP_OMITUSERINFO        Omit "user:password\@" part
 *    APR_URI_UNP_REVEALPASSWORD      Show plain text password (default: show XXXXXXXX)
 *    APR_URI_UNP_OMITPATHINFO        Show "scheme://user\@site:port" only 
 *    APR_URI_UNP_OMITQUERY           Omit "?queryarg" or "#fragment" 
 * 
* @return The uri as a string */ APU_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, const apr_uri_t *uptr, unsigned flags); /** * Parse a given URI, fill in all supplied fields of a apr_uri_t * structure. This eliminates the necessity of extracting host, port, * path, query info repeatedly in the modules. * @param p The pool to allocate out of * @param uri The uri to parse * @param uptr The apr_uri_t to fill out * @return APR_SUCCESS for success or error code */ APU_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, apr_uri_t *uptr); /** * Special case for CONNECT parsing: it comes with the hostinfo part only * @param p The pool to allocate out of * @param hostinfo The hostinfo string to parse * @param uptr The apr_uri_t to fill out * @return APR_SUCCESS for success or error code */ APU_DECLARE(apr_status_t) apr_uri_parse_hostinfo(apr_pool_t *p, const char *hostinfo, apr_uri_t *uptr); /** @} */ #ifdef __cplusplus } #endif #endif /* APR_URI_H */ ================================================ FILE: third_party/include/aprutil/apr_uuid.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_uuid.h * @brief APR UUID library */ #ifndef APR_UUID_H #define APR_UUID_H #include "apu.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup APR_UUID UUID Handling * @ingroup APR * @{ */ /** * we represent a UUID as a block of 16 bytes. */ typedef struct { unsigned char data[16]; /**< the actual UUID */ } apr_uuid_t; /** UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */ #define APR_UUID_FORMATTED_LENGTH 36 /** * Generate and return a (new) UUID * @param uuid The resulting UUID */ APU_DECLARE(void) apr_uuid_get(apr_uuid_t *uuid); /** * Format a UUID into a string, following the standard format * @param buffer The buffer to place the formatted UUID string into. It must * be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold * the formatted UUID and a null terminator * @param uuid The UUID to format */ APU_DECLARE(void) apr_uuid_format(char *buffer, const apr_uuid_t *uuid); /** * Parse a standard-format string into a UUID * @param uuid The resulting UUID * @param uuid_str The formatted UUID */ APU_DECLARE(apr_status_t) apr_uuid_parse(apr_uuid_t *uuid, const char *uuid_str); /** @} */ #ifdef __cplusplus } #endif #endif /* APR_UUID_H */ ================================================ FILE: third_party/include/aprutil/apr_xlate.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_XLATE_H #define APR_XLATE_H #include "apu.h" #include "apr_pools.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @file apr_xlate.h * @brief APR I18N translation library */ /** * @defgroup APR_XLATE I18N translation library * @ingroup APR * @{ */ /** Opaque translation buffer */ typedef struct apr_xlate_t apr_xlate_t; /** * Set up for converting text from one charset to another. * @param convset The handle to be filled in by this function * @param topage The name of the target charset * @param frompage The name of the source charset * @param pool The pool to use * @remark * Specify APR_DEFAULT_CHARSET for one of the charset * names to indicate the charset of the source code at * compile time. This is useful if there are literal * strings in the source code which must be translated * according to the charset of the source code. * APR_DEFAULT_CHARSET is not useful if the source code * of the caller was not encoded in the same charset as * APR at compile time. * * @remark * Specify APR_LOCALE_CHARSET for one of the charset * names to indicate the charset of the current locale. * * @remark * Return APR_EINVAL if unable to procure a convset, or APR_ENOTIMPL * if charset transcoding is not available in this instance of * apr-util at all (i.e., APR_HAS_XLATE is undefined). */ APU_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset, const char *topage, const char *frompage, apr_pool_t *pool); /** * This is to indicate the charset of the sourcecode at compile time * names to indicate the charset of the source code at * compile time. This is useful if there are literal * strings in the source code which must be translated * according to the charset of the source code. */ #define APR_DEFAULT_CHARSET (const char *)0 /** * To indicate charset names of the current locale */ #define APR_LOCALE_CHARSET (const char *)1 /** * Find out whether or not the specified conversion is single-byte-only. * @param convset The handle allocated by apr_xlate_open, specifying the * parameters of conversion * @param onoff Output: whether or not the conversion is single-byte-only * @remark * Return APR_ENOTIMPL if charset transcoding is not available * in this instance of apr-util (i.e., APR_HAS_XLATE is undefined). */ APU_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff); /** * Convert a buffer of text from one codepage to another. * @param convset The handle allocated by apr_xlate_open, specifying * the parameters of conversion * @param inbuf The address of the source buffer * @param inbytes_left Input: the amount of input data to be translated * Output: the amount of input data not yet translated * @param outbuf The address of the destination buffer * @param outbytes_left Input: the size of the output buffer * Output: the amount of the output buffer not yet used * @remark * Returns APR_ENOTIMPL if charset transcoding is not available * in this instance of apr-util (i.e., APR_HAS_XLATE is undefined). * Returns APR_INCOMPLETE if the input buffer ends in an incomplete * multi-byte character. * * To correctly terminate the output buffer for some multi-byte * character set encodings, a final call must be made to this function * after the complete input string has been converted, passing * the inbuf and inbytes_left parameters as NULL. (Note that this * mode only works from version 1.1.0 onwards) */ APU_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left); /* @see apr_file_io.h the comment in apr_file_io.h about this hack */ #ifdef APR_NOT_DONE_YET /** * The purpose of apr_xlate_conv_char is to translate one character * at a time. This needs to be written carefully so that it works * with double-byte character sets. * @param convset The handle allocated by apr_xlate_open, specifying the * parameters of conversion * @param inchar The character to convert * @param outchar The converted character */ APU_DECLARE(apr_status_t) apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar); #endif /** * Convert a single-byte character from one charset to another. * @param convset The handle allocated by apr_xlate_open, specifying the * parameters of conversion * @param inchar The single-byte character to convert. * @warning This only works when converting between single-byte character sets. * -1 will be returned if the conversion can't be performed. */ APU_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar); /** * Close a codepage translation handle. * @param convset The codepage translation handle to close * @remark * Return APR_ENOTIMPL if charset transcoding is not available * in this instance of apr-util (i.e., APR_HAS_XLATE is undefined). */ APU_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset); /** @} */ #ifdef __cplusplus } #endif #endif /* ! APR_XLATE_H */ ================================================ FILE: third_party/include/aprutil/apr_xml.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file apr_xml.h * @brief APR-UTIL XML Library */ #ifndef APR_XML_H #define APR_XML_H /** * @defgroup APR_Util_XML XML * @ingroup APR_Util * @{ */ #include "apr_pools.h" #include "apr_tables.h" #include "apr_file_io.h" #include "apu.h" #if APR_CHARSET_EBCDIC #include "apr_xlate.h" #endif #ifdef __cplusplus extern "C" { #endif /** * @package Apache XML library */ /* -------------------------------------------------------------------- */ /* ### these will need to move at some point to a more logical spot */ /** @see apr_text */ typedef struct apr_text apr_text; /** Structure to keep a linked list of pieces of text */ struct apr_text { /** The current piece of text */ const char *text; /** a pointer to the next piece of text */ struct apr_text *next; }; /** @see apr_text_header */ typedef struct apr_text_header apr_text_header; /** A list of pieces of text */ struct apr_text_header { /** The first piece of text in the list */ apr_text *first; /** The last piece of text in the list */ apr_text *last; }; /** * Append a piece of text to the end of a list * @param p The pool to allocate out of * @param hdr The text header to append to * @param text The new text to append */ APU_DECLARE(void) apr_text_append(apr_pool_t *p, apr_text_header *hdr, const char *text); /* -------------------------------------------------------------------- ** ** XML PARSING */ /* ** Qualified namespace values ** ** APR_XML_NS_DAV_ID ** We always insert the "DAV:" namespace URI at the head of the ** namespace array. This means that it will always be at ID==0, ** making it much easier to test for. ** ** APR_XML_NS_NONE ** This special ID is used for two situations: ** ** 1) The namespace prefix begins with "xml" (and we do not know ** what it means). Namespace prefixes with "xml" (any case) as ** their first three characters are reserved by the XML Namespaces ** specification for future use. mod_dav will pass these through ** unchanged. When this identifier is used, the prefix is LEFT in ** the element/attribute name. Downstream processing should not ** prepend another prefix. ** ** 2) The element/attribute does not have a namespace. ** ** a) No prefix was used, and a default namespace has not been ** defined. ** b) No prefix was used, and the default namespace was specified ** to mean "no namespace". This is done with a namespace ** declaration of: xmlns="" ** (this declaration is typically used to override a previous ** specification for the default namespace) ** ** In these cases, we need to record that the elem/attr has no ** namespace so that we will not attempt to prepend a prefix. ** All namespaces that are used will have a prefix assigned to ** them -- mod_dav will never set or use the default namespace ** when generating XML. This means that "no prefix" will always ** mean "no namespace". ** ** In both cases, the XML generation will avoid prepending a prefix. ** For the first case, this means the original prefix/name will be ** inserted into the output stream. For the latter case, it means ** the name will have no prefix, and since we never define a default ** namespace, this means it will have no namespace. ** ** Note: currently, mod_dav understands the "xmlns" prefix and the ** "xml:lang" attribute. These are handled specially (they aren't ** left within the XML tree), so the APR_XML_NS_NONE value won't ever ** really apply to these values. */ #define APR_XML_NS_DAV_ID 0 /**< namespace ID for "DAV:" */ #define APR_XML_NS_NONE -10 /**< no namespace for this elem/attr */ #define APR_XML_NS_ERROR_BASE -100 /**< used only during processing */ /** Is this namespace an error? */ #define APR_XML_NS_IS_ERROR(e) ((e) <= APR_XML_NS_ERROR_BASE) /** @see apr_xml_attr */ typedef struct apr_xml_attr apr_xml_attr; /** @see apr_xml_elem */ typedef struct apr_xml_elem apr_xml_elem; /** @see apr_xml_doc */ typedef struct apr_xml_doc apr_xml_doc; /** apr_xml_attr: holds a parsed XML attribute */ struct apr_xml_attr { /** attribute name */ const char *name; /** index into namespace array */ int ns; /** attribute value */ const char *value; /** next attribute */ struct apr_xml_attr *next; }; /** apr_xml_elem: holds a parsed XML element */ struct apr_xml_elem { /** element name */ const char *name; /** index into namespace array */ int ns; /** xml:lang for attrs/contents */ const char *lang; /** cdata right after start tag */ apr_text_header first_cdata; /** cdata after MY end tag */ apr_text_header following_cdata; /** parent element */ struct apr_xml_elem *parent; /** next (sibling) element */ struct apr_xml_elem *next; /** first child element */ struct apr_xml_elem *first_child; /** first attribute */ struct apr_xml_attr *attr; /* used only during parsing */ /** last child element */ struct apr_xml_elem *last_child; /** namespaces scoped by this elem */ struct apr_xml_ns_scope *ns_scope; /* used by modules during request processing */ /** Place for modules to store private data */ void *priv; }; /** Is this XML element empty? */ #define APR_XML_ELEM_IS_EMPTY(e) ((e)->first_child == NULL && \ (e)->first_cdata.first == NULL) /** apr_xml_doc: holds a parsed XML document */ struct apr_xml_doc { /** root element */ apr_xml_elem *root; /** array of namespaces used */ apr_array_header_t *namespaces; }; /** Opaque XML parser structure */ typedef struct apr_xml_parser apr_xml_parser; /** * Create an XML parser * @param pool The pool for allocating the parser and the parse results. * @return The new parser. */ APU_DECLARE(apr_xml_parser *) apr_xml_parser_create(apr_pool_t *pool); /** * Parse a File, producing a xml_doc * @param p The pool for allocating the parse results. * @param parser A pointer to *parser (needed so calling function can get * errors), will be set to NULL on successful completion. * @param ppdoc A pointer to *apr_xml_doc (which has the parsed results in it) * @param xmlfd A file to read from. * @param buffer_length Buffer length which would be suitable * @return Any errors found during parsing. */ APU_DECLARE(apr_status_t) apr_xml_parse_file(apr_pool_t *p, apr_xml_parser **parser, apr_xml_doc **ppdoc, apr_file_t *xmlfd, apr_size_t buffer_length); /** * Feed input into the parser * @param parser The XML parser for parsing this data. * @param data The data to parse. * @param len The length of the data. * @return Any errors found during parsing. * @remark Use apr_xml_parser_geterror() to get more error information. */ APU_DECLARE(apr_status_t) apr_xml_parser_feed(apr_xml_parser *parser, const char *data, apr_size_t len); /** * Terminate the parsing and return the result * @param parser The XML parser for parsing this data. * @param pdoc The resulting parse information. May be NULL to simply * terminate the parsing without fetching the info. * @return Any errors found during the final stage of parsing. * @remark Use apr_xml_parser_geterror() to get more error information. */ APU_DECLARE(apr_status_t) apr_xml_parser_done(apr_xml_parser *parser, apr_xml_doc **pdoc); /** * Fetch additional error information from the parser. * @param parser The XML parser to query for errors. * @param errbuf A buffer for storing error text. * @param errbufsize The length of the error text buffer. * @return The error buffer */ APU_DECLARE(char *) apr_xml_parser_geterror(apr_xml_parser *parser, char *errbuf, apr_size_t errbufsize); /** * Converts an XML element tree to flat text * @param p The pool to allocate out of * @param elem The XML element to convert * @param style How to covert the XML. One of: *
 *     APR_XML_X2T_FULL                start tag, contents, end tag 
 *     APR_XML_X2T_INNER               contents only 
 *     APR_XML_X2T_LANG_INNER          xml:lang + inner contents 
 *     APR_XML_X2T_FULL_NS_LANG        FULL + ns defns + xml:lang 
 * 
* @param namespaces The namespace of the current XML element * @param ns_map Namespace mapping * @param pbuf Buffer to put the converted text into * @param psize Size of the converted text */ APU_DECLARE(void) apr_xml_to_text(apr_pool_t *p, const apr_xml_elem *elem, int style, apr_array_header_t *namespaces, int *ns_map, const char **pbuf, apr_size_t *psize); /* style argument values: */ #define APR_XML_X2T_FULL 0 /**< start tag, contents, end tag */ #define APR_XML_X2T_INNER 1 /**< contents only */ #define APR_XML_X2T_LANG_INNER 2 /**< xml:lang + inner contents */ #define APR_XML_X2T_FULL_NS_LANG 3 /**< FULL + ns defns + xml:lang */ /** * empty XML element * @param p The pool to allocate out of * @param elem The XML element to empty * @return the string that was stored in the XML element */ APU_DECLARE(const char *) apr_xml_empty_elem(apr_pool_t *p, const apr_xml_elem *elem); /** * quote an XML string * Replace '\<', '\>', and '\&' with '\<', '\>', and '\&'. * @param p The pool to allocate out of * @param s The string to quote * @param quotes If quotes is true, then replace '"' with '\"'. * @return The quoted string * @note If the string does not contain special characters, it is not * duplicated into the pool and the original string is returned. */ APU_DECLARE(const char *) apr_xml_quote_string(apr_pool_t *p, const char *s, int quotes); /** * Quote an XML element * @param p The pool to allocate out of * @param elem The element to quote */ APU_DECLARE(void) apr_xml_quote_elem(apr_pool_t *p, apr_xml_elem *elem); /* manage an array of unique URIs: apr_xml_insert_uri() and APR_XML_URI_ITEM() */ /** * return the URI's (existing) index, or insert it and return a new index * @param uri_array array to insert into * @param uri The uri to insert * @return int The uri's index */ APU_DECLARE(int) apr_xml_insert_uri(apr_array_header_t *uri_array, const char *uri); /** Get the URI item for this XML element */ #define APR_XML_GET_URI_ITEM(ary, i) (((const char * const *)(ary)->elts)[i]) #if APR_CHARSET_EBCDIC /** * Convert parsed tree in EBCDIC * @param p The pool to allocate out of * @param pdoc The apr_xml_doc to convert. * @param xlate The translation handle to use. * @return Any errors found during conversion. */ APU_DECLARE(apr_status_t) apr_xml_parser_convert_doc(apr_pool_t *p, apr_xml_doc *pdoc, apr_xlate_t *convset); #endif #ifdef __cplusplus } #endif /** @} */ #endif /* APR_XML_H */ ================================================ FILE: third_party/include/aprutil/apu.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * apu.h is duplicated from apu.hw at build time -- do not edit apu.h */ /* @file apu.h * @brief APR-Utility main file */ /** * @defgroup APR_Util APR Utility Functions * @{ */ #ifndef APU_H #define APU_H /** * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, * so that all public symbols are exported. * * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers, * to provide static linkage when the dynamic library may be unavailable. * * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when * including the APR-UTIL public headers, to import and link the symbols from * the dynamic APR-UTIL library and assure appropriate indirection and calling * conventions at compile time. */ /* Make sure we have our platform identifier macro defined we ask for later. */ #if defined(_WIN32) && !defined(WIN32) #define WIN32 1 #endif #if defined(DOXYGEN) || !defined(WIN32) /** * The public APR-UTIL functions are declared with APU_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APU_DECLARE_NONSTD(). * * @fn APU_DECLARE(rettype) apr_func(args); */ #define APU_DECLARE(type) type /** * The public APR-UTIL functions using variable arguments are declared with * APU_DECLARE_NONSTD(), as they must use the C language calling convention. * * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); */ #define APU_DECLARE_NONSTD(type) type /** * The public APR-UTIL variables are declared with APU_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * * @fn APU_DECLARE_DATA type apr_variable; * @note extern APU_DECLARE_DATA type apr_variable; syntax is required for * declarations within headers to properly import the variable. */ #define APU_DECLARE_DATA #elif defined(APU_DECLARE_STATIC) #define APU_DECLARE(type) type __stdcall #define APU_DECLARE_NONSTD(type) type __cdecl #define APU_DECLARE_DATA #elif defined(APU_DECLARE_EXPORT) #define APU_DECLARE(type) __declspec(dllexport) type __stdcall #define APU_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl #define APU_DECLARE_DATA __declspec(dllexport) #else #define APU_DECLARE(type) __declspec(dllimport) type __stdcall #define APU_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl #define APU_DECLARE_DATA __declspec(dllimport) #endif #if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) /** * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. * * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols * declared with APU_MODULE_DECLARE_DATA are always exported. * @code * module APU_MODULE_DECLARE_DATA mod_tag * @endcode */ #define APU_MODULE_DECLARE_DATA #else #define APU_MODULE_DECLARE_DATA __declspec(dllexport) #endif /* * we always have SDBM (it's in our codebase) */ #define APU_HAVE_SDBM 1 #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_GDBM 0 #define APU_HAVE_NDBM 0 #define APU_HAVE_DB 0 #if APU_HAVE_DB #define APU_HAVE_DB_VERSION 0 #endif #endif /* * we always enable dynamic driver loads within apr_dbd * Win32 always has odbc (it's always installed) */ #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_PGSQL 0 #define APU_HAVE_MYSQL 0 #define APU_HAVE_SQLITE3 0 #define APU_HAVE_SQLITE2 0 #define APU_HAVE_ORACLE 0 #define APU_HAVE_FREETDS 0 #define APU_HAVE_ODBC 1 #endif #define APU_HAVE_CRYPTO 0 #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_OPENSSL 0 #define APU_HAVE_NSS 0 #endif #define APU_HAVE_APR_ICONV 0 #define APU_HAVE_ICONV 0 #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) #endif /* APU_H */ /** @} */ ================================================ FILE: third_party/include/aprutil/apu.h.in ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * apu.h is generated from apu.h.in by configure -- do not edit apu.h */ /* @file apu.h * @brief APR-Utility main file */ /** * @defgroup APR_Util APR Utility Functions * @{ */ #ifndef APU_H #define APU_H /** * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, * so that all public symbols are exported. * * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers, * to provide static linkage when the dynamic library may be unavailable. * * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when * including the APR-UTIL public headers, to import and link the symbols from * the dynamic APR-UTIL library and assure appropriate indirection and calling * conventions at compile time. */ #if defined(DOXYGEN) || !defined(WIN32) /** * The public APR-UTIL functions are declared with APU_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APU_DECLARE_NONSTD(). * * @fn APU_DECLARE(rettype) apr_func(args); */ #define APU_DECLARE(type) type /** * The public APR-UTIL functions using variable arguments are declared with * APU_DECLARE_NONSTD(), as they must use the C language calling convention. * * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); */ #define APU_DECLARE_NONSTD(type) type /** * The public APR-UTIL variables are declared with APU_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * * @fn APU_DECLARE_DATA type apr_variable; * @note APU_DECLARE_DATA extern type apr_variable; syntax is required for * declarations within headers to properly import the variable. */ #define APU_DECLARE_DATA #elif defined(APU_DECLARE_STATIC) #define APU_DECLARE(type) type __stdcall #define APU_DECLARE_NONSTD(type) type __cdecl #define APU_DECLARE_DATA #elif defined(APU_DECLARE_EXPORT) #define APU_DECLARE(type) __declspec(dllexport) type __stdcall #define APU_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl #define APU_DECLARE_DATA __declspec(dllexport) #else #define APU_DECLARE(type) __declspec(dllimport) type __stdcall #define APU_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl #define APU_DECLARE_DATA __declspec(dllimport) #endif #if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) /** * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. * * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols * declared with APU_MODULE_DECLARE_DATA are always exported. * @code * module APU_MODULE_DECLARE_DATA mod_tag * @endcode */ #define APU_MODULE_DECLARE_DATA #else #define APU_MODULE_DECLARE_DATA __declspec(dllexport) #endif /* * we always have SDBM (it's in our codebase) */ #define APU_HAVE_SDBM @apu_have_sdbm@ #define APU_HAVE_GDBM @apu_have_gdbm@ #define APU_HAVE_NDBM @apu_have_ndbm@ #define APU_HAVE_DB @apu_have_db@ #if APU_HAVE_DB #define APU_HAVE_DB_VERSION @apu_db_version@ #endif #define APU_HAVE_PGSQL @apu_have_pgsql@ #define APU_HAVE_MYSQL @apu_have_mysql@ #define APU_HAVE_SQLITE3 @apu_have_sqlite3@ #define APU_HAVE_SQLITE2 @apu_have_sqlite2@ #define APU_HAVE_ORACLE @apu_have_oracle@ #define APU_HAVE_FREETDS @apu_have_freetds@ #define APU_HAVE_ODBC @apu_have_odbc@ #define APU_HAVE_CRYPTO @apu_have_crypto@ #define APU_HAVE_OPENSSL @apu_have_openssl@ #define APU_HAVE_NSS @apu_have_nss@ #define APU_HAVE_APR_ICONV @have_apr_iconv@ #define APU_HAVE_ICONV @have_iconv@ #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) #endif /* APU_H */ /** @} */ ================================================ FILE: third_party/include/aprutil/apu.hnw ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Note: This is a NetWare specific version of apu.h. It is renamed to * apu.h at the start of a NetWare build. */ /* @file apu.h * @brief APR-Utility main file */ #ifdef NETWARE #ifndef APU_H #define APU_H /** * @defgroup APR_Util APR Utility Functions * @{ */ /** * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, * so that all public symbols are exported. * * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers, * to provide static linkage when the dynamic library may be unavailable. * * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when * including the APR-UTIL public headers, to import and link the symbols from * the dynamic APR-UTIL library and assure appropriate indirection and calling * conventions at compile time. */ /** * The public APR-UTIL functions are declared with APU_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APU_DECLARE_NONSTD(). * * @fn APU_DECLARE(rettype) apr_func(args); */ #define APU_DECLARE(type) type /** * The public APR-UTIL functions using variable arguments are declared with * APU_DECLARE_NONSTD(), as they must use the C language calling convention. * * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); */ #define APU_DECLARE_NONSTD(type) type /** * The public APR-UTIL variables are declared with APU_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * * @fn APU_DECLARE_DATA type apr_variable; * @note APU_DECLARE_DATA extern type apr_variable; syntax is required for * declarations within headers to properly import the variable. */ #define APU_DECLARE_DATA /** * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. * * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols * declared with APU_MODULE_DECLARE_DATA are always exported. * @code * module APU_MODULE_DECLARE_DATA mod_tag * @endcode */ #define APU_MODULE_DECLARE_DATA /* * we always have SDBM (it's in our codebase) */ #define APU_HAVE_SDBM 1 #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_GDBM 0 #define APU_HAVE_NDBM 0 #define APU_HAVE_DB 0 #if APU_HAVE_DB #define APU_HAVE_DB_VERSION 0 #endif #endif /* * we always enable dynamic driver loads within apr_dbd */ #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_PGSQL 0 #define APU_HAVE_MYSQL 0 #define APU_HAVE_SQLITE3 0 #define APU_HAVE_SQLITE2 0 #define APU_HAVE_ORACLE 0 #define APU_HAVE_FREETDS 0 #define APU_HAVE_ODBC 0 #endif #define APU_HAVE_CRYPTO 0 #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_OPENSSL 0 #define APU_HAVE_NSS 0 #endif #define APU_HAVE_APR_ICONV 0 #define APU_HAVE_ICONV 1 #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) #endif /* APU_H */ #endif /* NETWARE */ ================================================ FILE: third_party/include/aprutil/apu.hw ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * apu.h is duplicated from apu.hw at build time -- do not edit apu.h */ /* @file apu.h * @brief APR-Utility main file */ /** * @defgroup APR_Util APR Utility Functions * @{ */ #ifndef APU_H #define APU_H /** * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, * so that all public symbols are exported. * * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers, * to provide static linkage when the dynamic library may be unavailable. * * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when * including the APR-UTIL public headers, to import and link the symbols from * the dynamic APR-UTIL library and assure appropriate indirection and calling * conventions at compile time. */ /* Make sure we have our platform identifier macro defined we ask for later. */ #if defined(_WIN32) && !defined(WIN32) #define WIN32 1 #endif #if defined(DOXYGEN) || !defined(WIN32) /** * The public APR-UTIL functions are declared with APU_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APU_DECLARE_NONSTD(). * * @fn APU_DECLARE(rettype) apr_func(args); */ #define APU_DECLARE(type) type /** * The public APR-UTIL functions using variable arguments are declared with * APU_DECLARE_NONSTD(), as they must use the C language calling convention. * * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); */ #define APU_DECLARE_NONSTD(type) type /** * The public APR-UTIL variables are declared with APU_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * * @fn APU_DECLARE_DATA type apr_variable; * @note extern APU_DECLARE_DATA type apr_variable; syntax is required for * declarations within headers to properly import the variable. */ #define APU_DECLARE_DATA #elif defined(APU_DECLARE_STATIC) #define APU_DECLARE(type) type __stdcall #define APU_DECLARE_NONSTD(type) type __cdecl #define APU_DECLARE_DATA #elif defined(APU_DECLARE_EXPORT) #define APU_DECLARE(type) __declspec(dllexport) type __stdcall #define APU_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl #define APU_DECLARE_DATA __declspec(dllexport) #else #define APU_DECLARE(type) __declspec(dllimport) type __stdcall #define APU_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl #define APU_DECLARE_DATA __declspec(dllimport) #endif #if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) /** * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. * * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols * declared with APU_MODULE_DECLARE_DATA are always exported. * @code * module APU_MODULE_DECLARE_DATA mod_tag * @endcode */ #define APU_MODULE_DECLARE_DATA #else #define APU_MODULE_DECLARE_DATA __declspec(dllexport) #endif /* * we always have SDBM (it's in our codebase) */ #define APU_HAVE_SDBM 1 #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_GDBM 0 #define APU_HAVE_NDBM 0 #define APU_HAVE_DB 0 #if APU_HAVE_DB #define APU_HAVE_DB_VERSION 0 #endif #endif /* * we always enable dynamic driver loads within apr_dbd * Win32 always has odbc (it's always installed) */ #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_PGSQL 0 #define APU_HAVE_MYSQL 0 #define APU_HAVE_SQLITE3 0 #define APU_HAVE_SQLITE2 0 #define APU_HAVE_ORACLE 0 #define APU_HAVE_FREETDS 0 #define APU_HAVE_ODBC 1 #endif #define APU_HAVE_CRYPTO 0 #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_OPENSSL 0 #define APU_HAVE_NSS 0 #endif #define APU_HAVE_APR_ICONV 0 #define APU_HAVE_ICONV 0 #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) #endif /* APU_H */ /** @} */ ================================================ FILE: third_party/include/aprutil/apu.hwc ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * apu.h is duplicated from apu.hwc at build time -- do not edit apu.h */ /* @file apu.h * @brief APR-Utility main file */ /** * @defgroup APR_Util APR Utility Functions * @{ */ #ifndef APU_H #define APU_H /** * APU_DECLARE_EXPORT is defined when building the APR-UTIL dynamic library, * so that all public symbols are exported. * * APU_DECLARE_STATIC is defined when including the APR-UTIL public headers, * to provide static linkage when the dynamic library may be unavailable. * * APU_DECLARE_STATIC and APU_DECLARE_EXPORT are left undefined when * including the APR-UTIL public headers, to import and link the symbols from * the dynamic APR-UTIL library and assure appropriate indirection and calling * conventions at compile time. */ /* Make sure we have our platform identifier macro defined we ask for later. */ #if defined(_WIN32) && !defined(WIN32) #define WIN32 1 #endif #if defined(DOXYGEN) || !defined(WIN32) /** * The public APR-UTIL functions are declared with APU_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with * variable arguments must use APU_DECLARE_NONSTD(). * * @fn APU_DECLARE(rettype) apr_func(args); */ #define APU_DECLARE(type) type /** * The public APR-UTIL functions using variable arguments are declared with * APU_DECLARE_NONSTD(), as they must use the C language calling convention. * * @fn APU_DECLARE_NONSTD(rettype) apr_func(args, ...); */ #define APU_DECLARE_NONSTD(type) type /** * The public APR-UTIL variables are declared with APU_DECLARE_DATA. * This assures the appropriate indirection is invoked at compile time. * * @fn APU_DECLARE_DATA type apr_variable; * @note extern APU_DECLARE_DATA type apr_variable; syntax is required for * declarations within headers to properly import the variable. */ #define APU_DECLARE_DATA #elif defined(APU_DECLARE_STATIC) #define APU_DECLARE(type) type __stdcall #define APU_DECLARE_NONSTD(type) type __cdecl #define APU_DECLARE_DATA #elif defined(APU_DECLARE_EXPORT) #define APU_DECLARE(type) __declspec(dllexport) type __stdcall #define APU_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl #define APU_DECLARE_DATA __declspec(dllexport) #else #define APU_DECLARE(type) __declspec(dllimport) type __stdcall #define APU_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl #define APU_DECLARE_DATA __declspec(dllimport) #endif #if !defined(WIN32) || defined(APU_MODULE_DECLARE_STATIC) /** * Declare a dso module's exported module structure as APU_MODULE_DECLARE_DATA. * * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols * declared with APU_MODULE_DECLARE_DATA are always exported. * @code * module APU_MODULE_DECLARE_DATA mod_tag * @endcode */ #define APU_MODULE_DECLARE_DATA #else #define APU_MODULE_DECLARE_DATA __declspec(dllexport) #endif /* * we always have SDBM (it's in our codebase) */ #define APU_HAVE_SDBM 1 #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_GDBM 0 #define APU_HAVE_NDBM 0 #define APU_HAVE_DB 0 #if APU_HAVE_DB #define APU_HAVE_DB_VERSION 0 #endif #endif /* * we always enable dynamic driver loads within apr_dbd * Win32 always has odbc (it's always installed) */ #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_PGSQL 0 #define APU_HAVE_MYSQL 0 #define APU_HAVE_SQLITE3 0 #define APU_HAVE_SQLITE2 0 #define APU_HAVE_ORACLE 0 #define APU_HAVE_FREETDS 0 #define APU_HAVE_ODBC 1 #endif #define APU_HAVE_CRYPTO @apu_have_crypto_10@ #ifndef APU_DSO_MODULE_BUILD #define APU_HAVE_OPENSSL 0 #define APU_HAVE_NSS 0 #endif #define APU_HAVE_APR_ICONV @apu_have_apr_iconv_10@ #define APU_HAVE_ICONV 0 #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) #endif /* APU_H */ /** @} */ ================================================ FILE: third_party/include/aprutil/apu_errno.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APU_ERRNO_H #define APU_ERRNO_H /** * @file apu_errno.h * @brief APR-Util Error Codes */ #include "apr.h" #include "apr_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup apu_errno Error Codes * @ingroup APR_Util * @{ */ /** * @defgroup APR_Util_Error APR_Util Error Values *
 * APU ERROR VALUES
 * APR_ENOKEY         The key provided was empty or NULL
 * APR_ENOIV          The initialisation vector provided was NULL
 * APR_EKEYTYPE       The key type was not recognised
 * APR_ENOSPACE       The buffer supplied was not big enough
 * APR_ECRYPT         An error occurred while encrypting or decrypting
 * APR_EPADDING       Padding was not supported
 * APR_EKEYLENGTH     The key length was incorrect
 * APR_ENOCIPHER      The cipher provided was not recognised
 * APR_ENODIGEST      The digest provided was not recognised
 * APR_ENOENGINE      The engine provided was not recognised
 * APR_EINITENGINE    The engine could not be initialised
 * APR_EREINIT        Underlying crypto has already been initialised
 * 
* *
 * APR STATUS VALUES
 * APR_INCHILD        Program is currently executing in the child
 * 
* @{ */ /** @see APR_STATUS_IS_ENOKEY */ #define APR_ENOKEY (APR_UTIL_START_STATUS + 1) /** @see APR_STATUS_IS_ENOIV */ #define APR_ENOIV (APR_UTIL_START_STATUS + 2) /** @see APR_STATUS_IS_EKEYTYPE */ #define APR_EKEYTYPE (APR_UTIL_START_STATUS + 3) /** @see APR_STATUS_IS_ENOSPACE */ #define APR_ENOSPACE (APR_UTIL_START_STATUS + 4) /** @see APR_STATUS_IS_ECRYPT */ #define APR_ECRYPT (APR_UTIL_START_STATUS + 5) /** @see APR_STATUS_IS_EPADDING */ #define APR_EPADDING (APR_UTIL_START_STATUS + 6) /** @see APR_STATUS_IS_EKEYLENGTH */ #define APR_EKEYLENGTH (APR_UTIL_START_STATUS + 7) /** @see APR_STATUS_IS_ENOCIPHER */ #define APR_ENOCIPHER (APR_UTIL_START_STATUS + 8) /** @see APR_STATUS_IS_ENODIGEST */ #define APR_ENODIGEST (APR_UTIL_START_STATUS + 9) /** @see APR_STATUS_IS_ENOENGINE */ #define APR_ENOENGINE (APR_UTIL_START_STATUS + 10) /** @see APR_STATUS_IS_EINITENGINE */ #define APR_EINITENGINE (APR_UTIL_START_STATUS + 11) /** @see APR_STATUS_IS_EREINIT */ #define APR_EREINIT (APR_UTIL_START_STATUS + 12) /** @} */ /** * @defgroup APU_STATUS_IS Status Value Tests * @warning For any particular error condition, more than one of these tests * may match. This is because platform-specific error codes may not * always match the semantics of the POSIX codes these tests (and the * corresponding APR error codes) are named after. A notable example * are the APR_STATUS_IS_ENOENT and APR_STATUS_IS_ENOTDIR tests on * Win32 platforms. The programmer should always be aware of this and * adjust the order of the tests accordingly. * @{ */ /** @} */ /** * @addtogroup APR_Util_Error * @{ */ /** * The key was empty or not provided */ #define APR_STATUS_IS_ENOKEY(s) ((s) == APR_ENOKEY) /** * The initialisation vector was not provided */ #define APR_STATUS_IS_ENOIV(s) ((s) == APR_ENOIV) /** * The key type was not recognised */ #define APR_STATUS_IS_EKEYTYPE(s) ((s) == APR_EKEYTYPE) /** * The buffer provided was not big enough */ #define APR_STATUS_IS_ENOSPACE(s) ((s) == APR_ENOSPACE) /** * An error occurred while encrypting or decrypting */ #define APR_STATUS_IS_ECRYPT(s) ((s) == APR_ECRYPT) /** * An error occurred while padding */ #define APR_STATUS_IS_EPADDING(s) ((s) == APR_EPADDING) /** * An error occurred with the key length */ #define APR_STATUS_IS_EKEYLENGTH(s) ((s) == APR_EKEYLENGTH) /** * The cipher provided was not recognised */ #define APR_STATUS_IS_ENOCIPHER(s) ((s) == APR_ENOCIPHER) /** * The digest provided was not recognised */ #define APR_STATUS_IS_ENODIGEST(s) ((s) == APR_ENODIGEST) /** * The engine provided was not recognised */ #define APR_STATUS_IS_ENOENGINE(s) ((s) == APR_ENOENGINE) /** * The engine could not be initialised */ #define APR_STATUS_IS_EINITENGINE(s) ((s) == APR_EINITENGINE) /** * Crypto has already been initialised */ #define APR_STATUS_IS_EREINIT(s) ((s) == APR_EREINIT) /** @} */ /** * This structure allows the underlying API error codes to be returned * along with plain text error messages that explain to us mere mortals * what really happened. */ typedef struct apu_err_t { const char *reason; const char *msg; int rc; } apu_err_t; /** @} */ #ifdef __cplusplus } #endif #endif /* ! APU_ERRNO_H */ ================================================ FILE: third_party/include/aprutil/apu_version.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APU_VERSION_H #define APU_VERSION_H /** * @file apu_version.h * @brief APR-util Versioning Interface * * APR-util's Version * * There are several different mechanisms for accessing the version. There * is a string form, and a set of numbers; in addition, there are constants * which can be compiled into your application, and you can query the library * being used for its actual version. * * Note that it is possible for an application to detect that it has been * compiled against a different version of APU by use of the compile-time * constants and the use of the run-time query function. * * APU version numbering follows the guidelines specified in: * * http://apr.apache.org/versioning.html */ #define APU_COPYRIGHT "Copyright (c) 2000-2014 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the * authoritative version numbers for APU. */ /** major version * Major API changes that could cause compatibility problems for older * programs such as structure size changes. No binary compatibility is * possible across a change in the major version. */ #define APU_MAJOR_VERSION 1 /** minor version * Minor API changes that do not cause binary compatibility problems. * Reset to 0 when upgrading APU_MAJOR_VERSION */ #define APU_MINOR_VERSION 5 /** patch level * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ #define APU_PATCH_VERSION 4 /** * The symbol APU_IS_DEV_VERSION is only defined for internal, * "development" copies of APU. It is undefined for released versions * of APU. */ /* #define APU_IS_DEV_VERSION */ #if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN) /** Internal: string form of the "is dev" flag */ #ifndef APU_IS_DEV_STRING #define APU_IS_DEV_STRING "-dev" #endif #else #define APU_IS_DEV_STRING "" #endif #ifndef APU_STRINGIFY /** Properly quote a value as a string in the C preprocessor */ #define APU_STRINGIFY(n) APU_STRINGIFY_HELPER(n) /** Helper macro for APU_STRINGIFY */ #define APU_STRINGIFY_HELPER(n) #n #endif /** The formatted string of APU's version */ #define APU_VERSION_STRING \ APU_STRINGIFY(APU_MAJOR_VERSION) "." \ APU_STRINGIFY(APU_MINOR_VERSION) "." \ APU_STRINGIFY(APU_PATCH_VERSION) \ APU_IS_DEV_STRING /** An alternative formatted string of APR's version */ /* macro for Win32 .rc files using numeric csv representation */ #define APU_VERSION_STRING_CSV APU_MAJOR_VERSION ##, \ ##APU_MINOR_VERSION ##, \ ##APU_PATCH_VERSION #ifndef APU_VERSION_ONLY /* The C language API to access the version at run time, * as opposed to compile time. APU_VERSION_ONLY may be defined * externally when preprocessing apr_version.h to obtain strictly * the C Preprocessor macro declarations. */ #include "apr_version.h" #include "apu.h" #ifdef __cplusplus extern "C" { #endif /** * Return APR-util's version information information in a numeric form. * * @param pvsn Pointer to a version structure for returning the version * information. */ APU_DECLARE(void) apu_version(apr_version_t *pvsn); /** Return APU's version information as a string. */ APU_DECLARE(const char *) apu_version_string(void); #ifdef __cplusplus } #endif #endif /* ndef APU_VERSION_ONLY */ #endif /* ndef APU_VERSION_H */ ================================================ FILE: third_party/include/aprutil/apu_want.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apu.h" /* configuration data */ /** * @file apu_want.h * @brief APR Standard Headers Support * *
 * Features:
 *
 *   APU_WANT_DB:       
 *
 * Typical usage:
 *
 *   #define APU_WANT_DB
 *   #include "apu_want.h"
 *
 * The appropriate headers will be included.
 *
 * Note: it is safe to use this in a header (it won't interfere with other
 *       headers' or source files' use of apu_want.h)
 * 
*/ /* --------------------------------------------------------------------- */ #ifdef APU_WANT_DB #if APU_HAVE_DB /* win32 note.. you will need to change this for db1 */ #include #endif #undef APU_WANT_DB #endif /* --------------------------------------------------------------------- */ ================================================ FILE: third_party/include/aprutil/apu_want.h.in ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apu.h" /* configuration data */ /** * @file apu_want.h * @brief APR Standard Headers Support * *
 * Features:
 *
 *   APU_WANT_DB:       <@apu_db_header@>
 *
 * Typical usage:
 *
 *   #define APU_WANT_DB
 *   #include "apu_want.h"
 *
 * The appropriate headers will be included.
 *
 * Note: it is safe to use this in a header (it won't interfere with other
 *       headers' or source files' use of apu_want.h)
 * 
*/ /* --------------------------------------------------------------------- */ #ifdef APU_WANT_DB #if APU_HAVE_DB #include <@apu_db_header@> #endif #undef APU_WANT_DB #endif /* --------------------------------------------------------------------- */ ================================================ FILE: third_party/include/aprutil/apu_want.hnw ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apu.h" /* configuration data */ /** * @file apu_want.h * @brief APR Standard Headers Support * *
 * Features:
 *
 *   APU_WANT_DB:       <@apu_db_header>
 *
 * Typical usage:
 *
 *   #define APU_WANT_DB
 *   #include "apu_want.h"
 *
 * The appropriate headers will be included.
 *
 * Note: it is safe to use this in a header (it won't interfere with other
 *       headers' or source files' use of apu_want.h)
 * 
*/ /* --------------------------------------------------------------------- */ #ifdef APU_WANT_DB #if APU_HAVE_DB /* win32 note.. you will need to change this for db1 */ #include #endif #undef APU_WANT_DB #endif /* --------------------------------------------------------------------- */ ================================================ FILE: third_party/include/aprutil/apu_want.hw ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apu.h" /* configuration data */ /** * @file apu_want.h * @brief APR Standard Headers Support * *
 * Features:
 *
 *   APU_WANT_DB:       
 *
 * Typical usage:
 *
 *   #define APU_WANT_DB
 *   #include "apu_want.h"
 *
 * The appropriate headers will be included.
 *
 * Note: it is safe to use this in a header (it won't interfere with other
 *       headers' or source files' use of apu_want.h)
 * 
*/ /* --------------------------------------------------------------------- */ #ifdef APU_WANT_DB #if APU_HAVE_DB /* win32 note.. you will need to change this for db1 */ #include #endif #undef APU_WANT_DB #endif /* --------------------------------------------------------------------- */ ================================================ FILE: third_party/include/aprutil/private/apr_crypto_internal.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_CRYPTO_INTERNAL_H #define APR_CRYPTO_INTERNAL_H #include #include "apr_crypto.h" #ifdef __cplusplus extern "C" { #endif #if APU_HAVE_CRYPTO struct apr_crypto_driver_t { /** name */ const char *name; /** * @brief: allow driver to perform once-only initialisation. * Called once only. * @param pool The pool to register the cleanup in. * @param params Optional init parameter string. * @param rc Driver-specific additional error code */ apr_status_t (*init)(apr_pool_t *pool, const char *params, const apu_err_t **result); /** * @brief Create a context for supporting encryption. Keys, certificates, * algorithms and other parameters will be set per context. More than * one context can be created at one time. A cleanup will be automatically * registered with the given pool to guarantee a graceful shutdown. * @param f - context pointer will be written here * @param provider - provider to use * @param params - array of key parameters * @param pool - process pool * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE * if the engine cannot be initialised. */ apr_status_t (*make)(apr_crypto_t **f, const apr_crypto_driver_t *provider, const char *params, apr_pool_t *pool); /** * @brief Get a hash table of key types, keyed by the name of the type against * an integer pointer constant. * * @param types - hashtable of key types keyed to constants. * @param f - encryption context * @return APR_SUCCESS for success */ apr_status_t (*get_block_key_types)(apr_hash_t **types, const apr_crypto_t *f); /** * @brief Get a hash table of key modes, keyed by the name of the mode against * an integer pointer constant. * * @param modes - hashtable of key modes keyed to constants. * @param f - encryption context * @return APR_SUCCESS for success */ apr_status_t (*get_block_key_modes)(apr_hash_t **modes, const apr_crypto_t *f); /** * @brief Create a key from the given passphrase. By default, the PBKDF2 * algorithm is used to generate the key from the passphrase. It is expected * that the same pass phrase will generate the same key, regardless of the * backend crypto platform used. The key is cleaned up when the context * is cleaned, and may be reused with multiple encryption or decryption * operations. * @note If *key is NULL, a apr_crypto_key_t will be created from a pool. If * *key is not NULL, *key must point at a previously created structure. * @param key The key returned, see note. * @param ivSize The size of the initialisation vector will be returned, based * on whether an IV is relevant for this type of crypto. * @param pass The passphrase to use. * @param passLen The passphrase length in bytes * @param salt The salt to use. * @param saltLen The salt length in bytes * @param type 3DES_192, AES_128, AES_192, AES_256. * @param mode Electronic Code Book / Cipher Block Chaining. * @param doPad Pad if necessary. * @param iterations Iteration count * @param f The context to use. * @param p The pool to use. * @return Returns APR_ENOKEY if the pass phrase is missing or empty, or if a backend * error occurred while generating the key. APR_ENOCIPHER if the type or mode * is not supported by the particular backend. APR_EKEYTYPE if the key type is * not known. APR_EPADDING if padding was requested but is not supported. * APR_ENOTIMPL if not implemented. */ apr_status_t (*passphrase)(apr_crypto_key_t **key, apr_size_t *ivSize, const char *pass, apr_size_t passLen, const unsigned char * salt, apr_size_t saltLen, const apr_crypto_block_key_type_e type, const apr_crypto_block_key_mode_e mode, const int doPad, const int iterations, const apr_crypto_t *f, apr_pool_t *p); /** * @brief Initialise a context for encrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. * @param ctx The block context returned, see note. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. * If the buffer pointed to is not NULL, the IV in the buffer will be * used. * @param key The key structure. * @param blockSize The block size of the cipher. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ apr_status_t (*block_encrypt_init)(apr_crypto_block_t **ctx, const unsigned char **iv, const apr_crypto_key_t *key, apr_size_t *blockSize, apr_pool_t *p); /** * @brief Encrypt data provided by in, write it to out. * @note The number of bytes written will be written to outlen. If * out is NULL, outlen will contain the maximum size of the * buffer needed to hold the data, including any data * generated by apr_crypto_block_encrypt_finish below. If *out points * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ apr_status_t (*block_encrypt)(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx); /** * @brief Encrypt final data block, write it to out. * @note If necessary the final block will be written out after being * padded. Typically the final block will be written to the * same buffer used by apr_crypto_block_encrypt, offset by the * number of bytes returned as actually written by the * apr_crypto_block_encrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_encrypt_init(). * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ apr_status_t (*block_encrypt_finish)(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *ctx); /** * @brief Initialise a context for decrypting arbitrary data using the given key. * @note If *ctx is NULL, a apr_crypto_block_t will be created from a pool. If * *ctx is not NULL, *ctx must point at a previously created structure. * @param ctx The block context returned, see note. * @param blockSize The block size of the cipher. * @param iv Optional initialisation vector. If the buffer pointed to is NULL, * an IV will be created at random, in space allocated from the pool. * If the buffer is not NULL, the IV in the buffer will be used. * @param key The key structure. * @param p The pool to use. * @return Returns APR_ENOIV if an initialisation vector is required but not specified. * Returns APR_EINIT if the backend failed to initialise the context. Returns * APR_ENOTIMPL if not implemented. */ apr_status_t (*block_decrypt_init)(apr_crypto_block_t **ctx, apr_size_t *blockSize, const unsigned char *iv, const apr_crypto_key_t *key, apr_pool_t *p); /** * @brief Decrypt data provided by in, write it to out. * @note The number of bytes written will be written to outlen. If * out is NULL, outlen will contain the maximum size of the * buffer needed to hold the data, including any data * generated by apr_crypto_block_decrypt_finish below. If *out points * to NULL, a buffer sufficiently large will be created from * the pool provided. If *out points to a not-NULL value, this * value will be used as a buffer instead. * @param out Address of a buffer to which data will be written, * see note. * @param outlen Length of the output will be written here. * @param in Address of the buffer to read. * @param inlen Length of the buffer to read. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. Returns APR_ENOTIMPL if * not implemented. */ apr_status_t (*block_decrypt)(unsigned char **out, apr_size_t *outlen, const unsigned char *in, apr_size_t inlen, apr_crypto_block_t *ctx); /** * @brief Decrypt final data block, write it to out. * @note If necessary the final block will be written out after being * padded. Typically the final block will be written to the * same buffer used by apr_crypto_block_decrypt, offset by the * number of bytes returned as actually written by the * apr_crypto_block_decrypt() call. After this call, the context * is cleaned and can be reused by apr_crypto_block_decrypt_init(). * @param out Address of a buffer to which data will be written. This * buffer must already exist, and is usually the same * buffer used by apr_evp_crypt(). See note. * @param outlen Length of the output will be written here. * @param ctx The block context to use. * @return APR_ECRYPT if an error occurred. * @return APR_EPADDING if padding was enabled and the block was incorrectly * formatted. * @return APR_ENOTIMPL if not implemented. */ apr_status_t (*block_decrypt_finish)(unsigned char *out, apr_size_t *outlen, apr_crypto_block_t *ctx); /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. * @param ctx The block context to use. * @return Returns APR_ENOTIMPL if not supported. */ apr_status_t (*block_cleanup)(apr_crypto_block_t *ctx); /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. * @param f The context to use. * @return Returns APR_ENOTIMPL if not supported. */ apr_status_t (*cleanup)(apr_crypto_t *f); /** * @brief Clean encryption / decryption context. * @note After cleanup, a context is free to be reused if necessary. * @return Returns APR_ENOTIMPL if not supported. */ apr_status_t (*shutdown)(void); /** * @brief: fetch the most recent error from this driver. * @param result - the result structure * @param f - context pointer * @return APR_SUCCESS for success. */ apr_status_t (*error)(const apu_err_t **result, const apr_crypto_t *f); }; #endif #ifdef __cplusplus } #endif #endif ================================================ FILE: third_party/include/aprutil/private/apr_dbd_internal.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* Overview of what this is and does: * http://www.apache.org/~niq/dbd.html */ #ifndef APR_DBD_INTERNAL_H #define APR_DBD_INTERNAL_H #include #include "apr_dbd.h" #ifdef __cplusplus extern "C" { #endif #define TXN_IGNORE_ERRORS(t) \ ((t) && ((t)->mode & APR_DBD_TRANSACTION_IGNORE_ERRORS)) #define TXN_NOTICE_ERRORS(t) \ ((t) && !((t)->mode & APR_DBD_TRANSACTION_IGNORE_ERRORS)) #define TXN_DO_COMMIT(t) (!((t)->mode & APR_DBD_TRANSACTION_ROLLBACK)) #define TXN_DO_ROLLBACK(t) ((t)->mode & APR_DBD_TRANSACTION_ROLLBACK) #define TXN_MODE_BITS \ (APR_DBD_TRANSACTION_ROLLBACK|APR_DBD_TRANSACTION_IGNORE_ERRORS) struct apr_dbd_driver_t { /** name */ const char *name; /** init: allow driver to perform once-only initialisation. * Called once only. May be NULL */ void (*init)(apr_pool_t *pool); /** native_handle: return the native database handle of the underlying db * * @param handle - apr_dbd handle * @return - native handle */ void *(*native_handle)(apr_dbd_t *handle); /** open: obtain a database connection from the server rec. * Must be explicitly closed when you're finished with it. * WARNING: only use this when you need a connection with * a lifetime other than a request * * @param pool - a pool to use for error messages (if any). * @param params - connection parameters. * @param error - descriptive error. * @return database handle, or NULL on error. */ apr_dbd_t *(*open)(apr_pool_t *pool, const char *params, const char **error); /** check_conn: check status of a database connection * * @param pool - a pool to use for error messages (if any). * @param handle - the connection to check * @return APR_SUCCESS or error */ apr_status_t (*check_conn)(apr_pool_t *pool, apr_dbd_t *handle); /** close: close/release a connection obtained from open() * * @param handle - the connection to release * @return APR_SUCCESS or error */ apr_status_t (*close)(apr_dbd_t *handle); /** set_dbname: select database name. May be a no-op if not supported. * * @param pool - working pool * @param handle - the connection * @param name - the database to select * @return 0 for success or error code */ int (*set_dbname)(apr_pool_t* pool, apr_dbd_t *handle, const char *name); /** transaction: start a transaction. May be a no-op. * * @param pool - a pool to use for error messages (if any). * @param handle - the connection * @param trans - ptr to a transaction. May be null on entry * @return 0 for success or error code */ int (*start_transaction)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_transaction_t **trans); /** end_transaction: end a transaction * (commit on success, rollback on error). * May be a no-op. * * @param trans - the transaction. * @return 0 for success or error code */ int (*end_transaction)(apr_dbd_transaction_t *trans); /** query: execute an SQL query that doesn't return a result set * * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the SQL statement to execute * @return 0 for success or error code */ int (*query)(apr_dbd_t *handle, int *nrows, const char *statement); /** select: execute an SQL query that returns a result set * * @param pool - pool to allocate the result set * @param handle - the connection * @param res - pointer to result set pointer. May point to NULL on entry * @param statement - the SQL statement to execute * @param random - 1 to support random access to results (seek any row); * 0 to support only looping through results in order * (async access - faster) * @return 0 for success or error code */ int (*select)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, const char *statement, int random); /** num_cols: get the number of columns in a results set * * @param res - result set. * @return number of columns */ int (*num_cols)(apr_dbd_results_t *res); /** num_tuples: get the number of rows in a results set * of a synchronous select * * @param res - result set. * @return number of rows, or -1 if the results are asynchronous */ int (*num_tuples)(apr_dbd_results_t *res); /** get_row: get a row from a result set * * @param pool - pool to allocate the row * @param res - result set pointer * @param row - pointer to row pointer. May point to NULL on entry * @param rownum - row number, or -1 for "next row". Ignored if random * access is not supported. * @return 0 for success, -1 for rownum out of range or data finished */ int (*get_row)(apr_pool_t *pool, apr_dbd_results_t *res, apr_dbd_row_t **row, int rownum); /** get_entry: get an entry from a row * * @param row - row pointer * @param col - entry number * @param val - entry to fill * @return 0 for success, -1 for no data, +1 for general error */ const char* (*get_entry)(const apr_dbd_row_t *row, int col); /** error: get current error message (if any) * * @param handle - the connection * @param errnum - error code from operation that returned an error * @return the database current error message, or message for errnum * (implementation-dependent whether errnum is ignored) */ const char *(*error)(apr_dbd_t *handle, int errnum); /** escape: escape a string so it is safe for use in query/select * * @param pool - pool to alloc the result from * @param string - the string to escape * @param handle - the connection * @return the escaped, safe string */ const char *(*escape)(apr_pool_t *pool, const char *string, apr_dbd_t *handle); /** prepare: prepare a statement * * @param pool - pool to alloc the result from * @param handle - the connection * @param query - the SQL query * @param label - A label for the prepared statement. * use NULL for temporary prepared statements * (eg within a Request in httpd) * @param nargs - number of parameters in the query * @param nvals - number of values passed in p[b]query/select * @param types - pointer to an array with types of parameters * @param statement - statement to prepare. May point to null on entry. * @return 0 for success or error code */ int (*prepare)(apr_pool_t *pool, apr_dbd_t *handle, const char *query, const char *label, int nargs, int nvals, apr_dbd_type_e *types, apr_dbd_prepared_t **statement); /** pvquery: query using a prepared statement + args * * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param args - args to prepared statement * @return 0 for success or error code */ int (*pvquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, va_list args); /** pvselect: select using a prepared statement + args * * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param args - args to prepared statement * @return 0 for success or error code */ int (*pvselect)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, va_list args); /** pquery: query using a prepared statement + args * * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param args - args to prepared statement * @return 0 for success or error code */ int (*pquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, const char **args); /** pselect: select using a prepared statement + args * * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param args - args to prepared statement * @return 0 for success or error code */ int (*pselect)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, const char **args); /** get_name: get a column title from a result set * * @param res - result set pointer * @param col - entry number * @return param name, or NULL if col is out of bounds. */ const char* (*get_name)(const apr_dbd_results_t *res, int col); /** transaction_mode_get: get the mode of transaction * * @param trans - the transaction. * @return mode of transaction */ int (*transaction_mode_get)(apr_dbd_transaction_t *trans); /** transaction_mode_set: get the mode of transaction * * @param trans - the transaction. * @param mode - new mode of the transaction * @return the mode of transaction in force after the call */ int (*transaction_mode_set)(apr_dbd_transaction_t *trans, int mode); /** format of prepared statement parameters */ const char *pformat; /** pvbquery: query using a prepared statement + binary args * * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param args - binary args to prepared statement * @return 0 for success or error code */ int (*pvbquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement, va_list args); /** pvbselect: select using a prepared statement + binary args * * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param args - binary args to prepared statement * @return 0 for success or error code */ int (*pvbselect)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, va_list args); /** pbquery: query using a prepared statement + binary args * * @param pool - working pool * @param handle - the connection * @param nrows - number of rows affected. * @param statement - the prepared statement to execute * @param args - binary args to prepared statement * @return 0 for success or error code */ int (*pbquery)(apr_pool_t *pool, apr_dbd_t *handle, int *nrows, apr_dbd_prepared_t *statement,const void **args); /** pbselect: select using a prepared statement + binary args * * @param pool - working pool * @param handle - the connection * @param res - pointer to query results. May point to NULL on entry * @param statement - the prepared statement to execute * @param random - Whether to support random-access to results * @param args - binary args to prepared statement * @return 0 for success or error code */ int (*pbselect)(apr_pool_t *pool, apr_dbd_t *handle, apr_dbd_results_t **res, apr_dbd_prepared_t *statement, int random, const void **args); /** datum_get: get a binary entry from a row * * @param row - row pointer * @param col - entry number * @param type - type of data to get * @param data - pointer to data, allocated by the caller * @return APR_SUCCESS, an error code on error or if col is out of bounds */ apr_status_t (*datum_get)(const apr_dbd_row_t *row, int col, apr_dbd_type_e type, void *data); }; /* Export mutex lock/unlock for drivers that need it * deprecated; create a per-dbd mutex within the (*init) function * to avoid blocking other providers running on other threads */ APU_DECLARE(apr_status_t) apr_dbd_mutex_lock(void); APU_DECLARE(apr_status_t) apr_dbd_mutex_unlock(void); #ifdef __cplusplus } #endif #endif ================================================ FILE: third_party/include/aprutil/private/apr_dbd_odbc_v2.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* ONLY USED FOR ODBC Version 2 -DODBCV2 * * Re-define everything to work (more-or-less) in an ODBC V2 environment * Random access to retrieved rows is not supported - i.e. calls to apr_dbd_select() cannot * have a 'random' argument of 1. apr_dbd_get_row() must always pass rownum as 0 (get next row) * */ #define SQLHANDLE SQLHENV /* Presumes that ENV, DBC, and STMT handles are all the same datatype */ #define SQL_NULL_HANDLE 0 #define SQL_HANDLE_STMT 1 #define SQL_HANDLE_DBC 2 #define SQL_HANDLE_ENV 3 #define SQL_NO_DATA SQL_NO_DATA_FOUND #ifndef SQL_SUCCEEDED #define SQL_SUCCEEDED(rc) (((rc)&(~1))==0) #endif #undef SQLSetEnvAttr #define SQLSetEnvAttr(henv, Attribute, Value, StringLength) (0) #undef SQLAllocHandle #define SQLAllocHandle(type, parent, hndl) \ ( (type == SQL_HANDLE_STMT) ? SQLAllocStmt(parent, hndl) \ : (type == SQL_HANDLE_ENV) ? SQLAllocEnv(hndl) \ : SQLAllocConnect(parent, hndl) \ ) #undef SQLFreeHandle #define SQLFreeHandle(type, hndl) \ ( (type == SQL_HANDLE_STMT) ? SQLFreeStmt(hndl, SQL_DROP) \ : (type == SQL_HANDLE_ENV) ? SQLFreeEnv(hndl) \ : SQLFreeConnect(hndl) \ ) #undef SQLGetDiagRec #define SQLGetDiagRec(type, h, i, state, native, buffer, bufsize, reslen) \ SQLError( (type == SQL_HANDLE_ENV) ? h : NULL, \ (type == SQL_HANDLE_DBC) ? h : NULL, \ (type == SQL_HANDLE_STMT) ? h : NULL, \ state, native, buffer, bufsize, reslen) #undef SQLCloseCursor #define SQLCloseCursor(stmt) SQLFreeStmt(stmt, SQL_CLOSE) #undef SQLGetConnectAttr #define SQLGetConnectAttr(hdbc, fOption, ValuePtr, BufferLength, NULL) \ SQLGetConnectOption(hdbc, fOption, ValuePtr) #undef SQLSetConnectAttr #define SQLSetConnectAttr(hdbc, fOption, ValuePtr, BufferLength) \ SQLSetConnectOption(hdbc, fOption, (SQLUINTEGER) ValuePtr) #undef SQLSetStmtAttr #define SQLSetStmtAttr(hstmt, fOption, ValuePtr, BufferLength) (0); return APR_ENOTIMPL; #undef SQLEndTran #define SQLEndTran(hType, hdbc,type) SQLTransact(henv, hdbc, type) #undef SQLFetchScroll #define SQLFetchScroll(stmt, orient, rownum) (0); return APR_ENOTIMPL; #define SQL_DESC_TYPE SQL_COLUMN_TYPE #define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE #define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE #define SQL_DESC_OCTET_LENGTH SQL_COLUMN_LENGTH #define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED #undef SQLColAttribute #define SQLColAttribute(s, c, f, a, l, m, n) SQLColAttributes(s, c, f, a, l, m, n) #define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE #define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT #define SQL_ATTR_CONNECTION_TIMEOUT 113 #define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER #define SQL_ATTR_DISCONNECT_BEHAVIOR 114 #define SQL_ATTR_ENLIST_IN_DTC 1207 #define SQL_ATTR_ENLIST_IN_XA 1208 #define SQL_ATTR_CONNECTION_DEAD 1209 #define SQL_CD_TRUE 1L /* Connection is closed/dead */ #define SQL_CD_FALSE 0L /* Connection is open/available */ #define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT #define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS #define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE #define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE #define SQL_ATTR_TRACE SQL_OPT_TRACE #define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE #define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL #define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION #define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION #define SQL_ATTR_CURSOR_SCROLLABLE -1 #define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */ #define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */ #define SQL_FALSE 0 #define SQL_TRUE 1 ================================================ FILE: third_party/include/aprutil/private/apr_dbm_private.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APR_DBM_PRIVATE_H #define APR_DBM_PRIVATE_H #include "apr.h" #include "apr_errno.h" #include "apr_pools.h" #include "apr_dbm.h" #include "apr_file_io.h" #include "apu.h" /* ### for now, include the DBM selection; this will go away once we start ### building and linking all of the DBMs at once. */ #include "apu_select_dbm.h" #ifdef __cplusplus extern "C" { #endif /** @internal */ /** * Most DBM libraries take a POSIX mode for creating files. Don't trust * the mode_t type, some platforms may not support it, int is safe. */ APU_DECLARE(int) apr_posix_perms2mode(apr_fileperms_t perm); /** * Structure to describe the operations of the DBM */ typedef struct { /** The name of the DBM Type */ const char *name; /** Open the DBM */ apr_status_t (*open)(apr_dbm_t **pdb, const char *pathname, apr_int32_t mode, apr_fileperms_t perm, apr_pool_t *pool); /** Close the DBM */ void (*close)(apr_dbm_t *dbm); /** Fetch a dbm record value by key */ apr_status_t (*fetch)(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t * pvalue); /** Store a dbm record value by key */ apr_status_t (*store)(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value); /** Delete a dbm record value by key */ apr_status_t (*del)(apr_dbm_t *dbm, apr_datum_t key); /** Search for a key within the dbm */ int (*exists)(apr_dbm_t *dbm, apr_datum_t key); /** Retrieve the first record key from a dbm */ apr_status_t (*firstkey)(apr_dbm_t *dbm, apr_datum_t * pkey); /** Retrieve the next record key from a dbm */ apr_status_t (*nextkey)(apr_dbm_t *dbm, apr_datum_t * pkey); /** Proactively toss any memory associated with the apr_datum_t. */ void (*freedatum)(apr_dbm_t *dbm, apr_datum_t data); /** Get the names that the DBM will use for a given pathname. */ void (*getusednames)(apr_pool_t *pool, const char *pathname, const char **used1, const char **used2); } apr_dbm_type_t; /** * The actual DBM */ struct apr_dbm_t { /** Associated pool */ apr_pool_t *pool; /** pointer to DB Implementation Specific data */ void *file; /** Current integer error code */ int errcode; /** Current string error code */ const char *errmsg; /** the type of DBM */ const apr_dbm_type_t *type; }; /* Declare all of the DBM provider tables */ APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm; APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm; APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm; APU_MODULE_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db; #ifdef __cplusplus } #endif #endif /* APR_DBM_PRIVATE_H */ ================================================ FILE: third_party/include/aprutil/private/apu_config.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Note: This is a Windows specific version of apu_config.hw. It is copied * as apu_config.h at the start of a Windows build. */ #ifdef WIN32 #ifndef APU_CONFIG_H #define APU_CONFIG_H /* Compile win32 with DSO support for .dll builds */ #ifdef APU_DECLARE_STATIC #define APU_DSO_BUILD 0 #else #define APU_DSO_BUILD 1 #endif /* Presume a standard, modern (5.x) mysql sdk/ #define HAVE_MY_GLOBAL_H 1 /* my_sys.h is broken on VC/Win32, and apparently not required */ /* #undef HAVE_MY_SYS_H 0 */ /* * Windows does not have GDBM, and we always use the bundled (new) Expat */ /* Define if you have the gdbm library (-lgdbm). */ /* #undef HAVE_LIBGDBM */ /* define if Expat 1.0 or 1.1 was found */ /* #undef APR_HAVE_OLD_EXPAT */ #endif /* APU_CONFIG_H */ #endif /* WIN32 */ ================================================ FILE: third_party/include/aprutil/private/apu_config.hnw ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Note: This is a NetWare specific version of apu_config.hnw. It is copied * as apu_config.h at the start of a NetWare build. */ #ifdef NETWARE #ifndef APU_CONFIG_H #define APU_CONFIG_H /* Always compile Netware with DSO support for .nlm builds */ #define APU_DSO_BUILD 0 /* * NetWare does not have GDBM, and we always use the bundled (new) Expat */ /* Define if you have the gdbm library (-lgdbm). */ /* #undef HAVE_LIBGDBM */ /* define if Expat 1.0 or 1.1 was found */ /* #undef APR_HAVE_OLD_EXPAT */ /* NetWare uses its own ICONV implementation. */ #define HAVE_ICONV_H 1 /* * check for newer NDKs which use now correctly 'const char*' with iconv. */ #include #if (CURRENT_NDK_THRESHOLD >= 705110000) #define APU_ICONV_INBUF_CONST #endif #endif /* APU_CONFIG_H */ #endif /* NETWARE */ ================================================ FILE: third_party/include/aprutil/private/apu_config.hw ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Note: This is a Windows specific version of apu_config.hw. It is copied * as apu_config.h at the start of a Windows build. */ #ifdef WIN32 #ifndef APU_CONFIG_H #define APU_CONFIG_H /* Compile win32 with DSO support for .dll builds */ #ifdef APU_DECLARE_STATIC #define APU_DSO_BUILD 0 #else #define APU_DSO_BUILD 1 #endif /* Presume a standard, modern (5.x) mysql sdk/ #define HAVE_MY_GLOBAL_H 1 /* my_sys.h is broken on VC/Win32, and apparently not required */ /* #undef HAVE_MY_SYS_H 0 */ /* * Windows does not have GDBM, and we always use the bundled (new) Expat */ /* Define if you have the gdbm library (-lgdbm). */ /* #undef HAVE_LIBGDBM */ /* define if Expat 1.0 or 1.1 was found */ /* #undef APR_HAVE_OLD_EXPAT */ #endif /* APU_CONFIG_H */ #endif /* WIN32 */ ================================================ FILE: third_party/include/aprutil/private/apu_internal.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "apr.h" #include "apr_dso.h" #include "apu.h" #ifndef APU_INTERNAL_H #define APU_INTERNAL_H #if APU_DSO_BUILD #ifdef __cplusplus extern "C" { #endif /* For modular dso loading, an internal interlock to allow us to * continue to initialize modules by multiple threads, the caller * of apu_dso_load must lock first, and not unlock until any init * finalization is complete. */ apr_status_t apu_dso_init(apr_pool_t *pool); apr_status_t apu_dso_mutex_lock(void); apr_status_t apu_dso_mutex_unlock(void); apr_status_t apu_dso_load(apr_dso_handle_t **dso, apr_dso_handle_sym_t *dsoptr, const char *module, const char *modsym, apr_pool_t *pool); #if APR_HAS_LDAP /* For LDAP internal builds, wrap our LDAP namespace */ struct apr__ldap_dso_fntable { int (*info)(apr_pool_t *pool, apr_ldap_err_t **result_err); int (*init)(apr_pool_t *pool, LDAP **ldap, const char *hostname, int portno, int secure, apr_ldap_err_t **result_err); int (*ssl_init)(apr_pool_t *pool, const char *cert_auth_file, int cert_file_type, apr_ldap_err_t **result_err); int (*ssl_deinit)(void); int (*get_option)(apr_pool_t *pool, LDAP *ldap, int option, void *outvalue, apr_ldap_err_t **result_err); int (*set_option)(apr_pool_t *pool, LDAP *ldap, int option, const void *invalue, apr_ldap_err_t **result_err); apr_status_t (*rebind_init)(apr_pool_t *pool); apr_status_t (*rebind_add)(apr_pool_t *pool, LDAP *ld, const char *bindDN, const char *bindPW); apr_status_t (*rebind_remove)(LDAP *ld); }; #endif /* APR_HAS_LDAP */ #ifdef __cplusplus } #endif #endif /* APU_DSO_BUILD */ #endif /* APU_INTERNAL_H */ ================================================ FILE: third_party/include/aprutil/private/apu_select_dbm.h ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APU_SELECT_DBM_H #define APU_SELECT_DBM_H /* ** The following macros control what features APRUTIL will use */ #define APU_USE_SDBM 1 #define APU_USE_GDBM 0 #define APU_USE_NDBM 0 #define APU_USE_DB 0 #endif /* !APU_SELECT_DBM_H */ ================================================ FILE: third_party/include/aprutil/private/apu_select_dbm.h.in ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APU_SELECT_DBM_H #define APU_SELECT_DBM_H /* ** The following macros control what features APRUTIL will use */ #define APU_USE_SDBM @apu_use_sdbm@ #define APU_USE_NDBM @apu_use_ndbm@ #define APU_USE_GDBM @apu_use_gdbm@ #define APU_USE_DB @apu_use_db@ #endif /* !APU_SELECT_DBM_H */ ================================================ FILE: third_party/include/aprutil/private/apu_select_dbm.hw ================================================ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APU_SELECT_DBM_H #define APU_SELECT_DBM_H /* ** The following macros control what features APRUTIL will use */ #define APU_USE_SDBM 1 #define APU_USE_GDBM 0 #define APU_USE_NDBM 0 #define APU_USE_DB 0 #endif /* !APU_SELECT_DBM_H */ ================================================ FILE: third_party/include/curl/config-win32.h ================================================ #ifndef HEADER_CURL_CONFIG_WIN32_H #define HEADER_CURL_CONFIG_WIN32_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* ================================================================ */ /* Hand crafted config file for Windows */ /* ================================================================ */ /* ---------------------------------------------------------------- */ /* HEADER FILES */ /* ---------------------------------------------------------------- */ /* Define if you have the header file. */ /* #define HAVE_ARPA_INET_H 1 */ /* Define if you have the header file. */ #define HAVE_ASSERT_H 1 /* Define if you have the header file. */ /* #define HAVE_CRYPTO_H 1 */ /* Define if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define if you have the header file. */ /* #define HAVE_ERR_H 1 */ /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ #if defined(__MINGW32__) || defined(__POCC__) #define HAVE_GETOPT_H 1 #endif /* Define if you have the header file. */ #define HAVE_IO_H 1 /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #define HAVE_LOCALE_H 1 /* Define if you need header even with header file. */ #if !defined(__SALFORDC__) && !defined(__POCC__) #define NEED_MALLOC_H 1 #endif /* Define if you have the header file. */ /* #define HAVE_NETDB_H 1 */ /* Define if you have the header file. */ /* #define HAVE_NETINET_IN_H 1 */ /* Define if you have the header file. */ #ifndef __SALFORDC__ #define HAVE_PROCESS_H 1 #endif /* Define if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define if you have the header file. */ /* #define HAVE_SGTTY_H 1 */ /* Define if you have the header file. */ /* #define HAVE_SSL_H 1 */ /* Define if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define if you have the header file. */ /* #define HAVE_SYS_PARAM_H 1 */ /* Define if you have the header file. */ /* #define HAVE_SYS_SELECT_H 1 */ /* Define if you have the header file. */ /* #define HAVE_SYS_SOCKET_H 1 */ /* Define if you have the header file. */ /* #define HAVE_SYS_SOCKIO_H 1 */ /* Define if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define if you have the header file. */ /* #define HAVE_SYS_TIME_H 1 */ /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define if you have the header file. */ #ifndef __BORLANDC__ #define HAVE_SYS_UTIME_H 1 #endif /* Define if you have the header file. */ /* #define HAVE_TERMIO_H 1 */ /* Define if you have the header file. */ /* #define HAVE_TERMIOS_H 1 */ /* Define if you have the header file. */ #define HAVE_TIME_H 1 /* Define if you have the header file. */ #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \ defined(__POCC__) #define HAVE_UNISTD_H 1 #endif /* Define if you have the header file. */ #define HAVE_WINDOWS_H 1 /* Define if you have the header file. */ #define HAVE_WINSOCK_H 1 /* Define if you have the header file. */ #ifndef __SALFORDC__ #define HAVE_WINSOCK2_H 1 #endif /* Define if you have the header file. */ #ifndef __SALFORDC__ #define HAVE_WS2TCPIP_H 1 #endif /* ---------------------------------------------------------------- */ /* OTHER HEADER INFO */ /* ---------------------------------------------------------------- */ /* Define if sig_atomic_t is an available typedef. */ #define HAVE_SIG_ATOMIC_T 1 /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both and . */ /* #define TIME_WITH_SYS_TIME 1 */ /* ---------------------------------------------------------------- */ /* FUNCTIONS */ /* ---------------------------------------------------------------- */ /* Define if you have the closesocket function. */ #define HAVE_CLOSESOCKET 1 /* Define if you don't have vprintf but do have _doprnt. */ /* #define HAVE_DOPRNT 1 */ /* Define if you have the ftruncate function. */ #define HAVE_FTRUNCATE 1 /* Define if you have the gethostbyaddr function. */ #define HAVE_GETHOSTBYADDR 1 /* Define if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define if you have the getpass function. */ /* #define HAVE_GETPASS 1 */ /* Define if you have the getservbyname function. */ #define HAVE_GETSERVBYNAME 1 /* Define if you have the getprotobyname function. */ #define HAVE_GETPROTOBYNAME /* Define if you have the gettimeofday function. */ /* #define HAVE_GETTIMEOFDAY 1 */ /* Define if you have the inet_addr function. */ #define HAVE_INET_ADDR 1 /* Define if you have the ioctlsocket function. */ #define HAVE_IOCTLSOCKET 1 /* Define if you have a working ioctlsocket FIONBIO function. */ #define HAVE_IOCTLSOCKET_FIONBIO 1 /* Define if you have the perror function. */ #define HAVE_PERROR 1 /* Define if you have the RAND_screen function when using SSL. */ #define HAVE_RAND_SCREEN 1 /* Define if you have the `RAND_status' function when using SSL. */ #define HAVE_RAND_STATUS 1 /* Define if you have the `CRYPTO_cleanup_all_ex_data' function. This is present in OpenSSL versions after 0.9.6b */ #define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1 /* Define if you have the select function. */ #define HAVE_SELECT 1 /* Define if you have the setlocale function. */ #define HAVE_SETLOCALE 1 /* Define if you have the setmode function. */ #define HAVE_SETMODE 1 /* Define if you have the setvbuf function. */ #define HAVE_SETVBUF 1 /* Define if you have the socket function. */ #define HAVE_SOCKET 1 /* Define if you have the strcasecmp function. */ /* #define HAVE_STRCASECMP 1 */ /* Define if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 /* Define if you have the stricmp function. */ #define HAVE_STRICMP 1 /* Define if you have the strncasecmp function. */ /* #define HAVE_STRNCASECMP 1 */ /* Define if you have the strnicmp function. */ #define HAVE_STRNICMP 1 /* Define if you have the strstr function. */ #define HAVE_STRSTR 1 /* Define if you have the strtoll function. */ #if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__POCC__) #define HAVE_STRTOLL 1 #endif /* Define if you have the tcgetattr function. */ /* #define HAVE_TCGETATTR 1 */ /* Define if you have the tcsetattr function. */ /* #define HAVE_TCSETATTR 1 */ /* Define if you have the utime function. */ #ifndef __BORLANDC__ #define HAVE_UTIME 1 #endif /* Define to the type qualifier of arg 1 for getnameinfo. */ #define GETNAMEINFO_QUAL_ARG1 const /* Define to the type of arg 1 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG1 struct sockaddr * /* Define to the type of arg 2 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG2 socklen_t /* Define to the type of args 4 and 6 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG46 DWORD /* Define to the type of arg 7 for getnameinfo. */ #define GETNAMEINFO_TYPE_ARG7 int /* Define if you have the recv function. */ #define HAVE_RECV 1 /* Define to the type of arg 1 for recv. */ #define RECV_TYPE_ARG1 SOCKET /* Define to the type of arg 2 for recv. */ #define RECV_TYPE_ARG2 char * /* Define to the type of arg 3 for recv. */ #define RECV_TYPE_ARG3 int /* Define to the type of arg 4 for recv. */ #define RECV_TYPE_ARG4 int /* Define to the function return type for recv. */ #define RECV_TYPE_RETV int /* Define if you have the recvfrom function. */ #define HAVE_RECVFROM 1 /* Define to the type of arg 1 for recvfrom. */ #define RECVFROM_TYPE_ARG1 SOCKET /* Define to the type pointed by arg 2 for recvfrom. */ #define RECVFROM_TYPE_ARG2 char /* Define to the type of arg 3 for recvfrom. */ #define RECVFROM_TYPE_ARG3 int /* Define to the type of arg 4 for recvfrom. */ #define RECVFROM_TYPE_ARG4 int /* Define to the type pointed by arg 5 for recvfrom. */ #define RECVFROM_TYPE_ARG5 struct sockaddr /* Define to the type pointed by arg 6 for recvfrom. */ #define RECVFROM_TYPE_ARG6 int /* Define to the function return type for recvfrom. */ #define RECVFROM_TYPE_RETV int /* Define if you have the send function. */ #define HAVE_SEND 1 /* Define to the type of arg 1 for send. */ #define SEND_TYPE_ARG1 SOCKET /* Define to the type qualifier of arg 2 for send. */ #define SEND_QUAL_ARG2 const /* Define to the type of arg 2 for send. */ #define SEND_TYPE_ARG2 char * /* Define to the type of arg 3 for send. */ #define SEND_TYPE_ARG3 int /* Define to the type of arg 4 for send. */ #define SEND_TYPE_ARG4 int /* Define to the function return type for send. */ #define SEND_TYPE_RETV int /* ---------------------------------------------------------------- */ /* TYPEDEF REPLACEMENTS */ /* ---------------------------------------------------------------- */ /* Define if in_addr_t is not an available 'typedefed' type. */ #define in_addr_t unsigned long /* Define to the return type of signal handlers (int or void). */ #define RETSIGTYPE void /* Define if ssize_t is not an available 'typedefed' type. */ #ifndef _SSIZE_T_DEFINED # if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \ defined(__POCC__) || \ defined(__MINGW32__) # elif defined(_WIN64) # define _SSIZE_T_DEFINED # define ssize_t __int64 # else # define _SSIZE_T_DEFINED # define ssize_t int # endif #endif /* ---------------------------------------------------------------- */ /* TYPE SIZES */ /* ---------------------------------------------------------------- */ /* Define to the size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* Define to the size of `long double', as computed by sizeof. */ #define SIZEOF_LONG_DOUBLE 16 /* Define to the size of `long long', as computed by sizeof. */ /* #define SIZEOF_LONG_LONG 8 */ /* Define to the size of `short', as computed by sizeof. */ #define SIZEOF_SHORT 2 /* Define to the size of `size_t', as computed by sizeof. */ #if defined(_WIN64) # define SIZEOF_SIZE_T 8 #else # define SIZEOF_SIZE_T 4 #endif /* ---------------------------------------------------------------- */ /* STRUCT RELATED */ /* ---------------------------------------------------------------- */ /* Define if you have struct sockaddr_storage. */ #if !defined(__SALFORDC__) && !defined(__BORLANDC__) #define HAVE_STRUCT_SOCKADDR_STORAGE 1 #endif /* Define if you have struct timeval. */ #define HAVE_STRUCT_TIMEVAL 1 /* Define if struct sockaddr_in6 has the sin6_scope_id member. */ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 /* ---------------------------------------------------------------- */ /* BSD-style lwIP TCP/IP stack SPECIFIC */ /* ---------------------------------------------------------------- */ /* Define to use BSD-style lwIP TCP/IP stack. */ /* #define USE_LWIPSOCK 1 */ #ifdef USE_LWIPSOCK # undef USE_WINSOCK # undef HAVE_WINSOCK_H # undef HAVE_WINSOCK2_H # undef HAVE_WS2TCPIP_H # undef HAVE_ERRNO_H # undef HAVE_GETHOSTNAME # undef HAVE_GETNAMEINFO # undef LWIP_POSIX_SOCKETS_IO_NAMES # undef RECV_TYPE_ARG1 # undef RECV_TYPE_ARG3 # undef SEND_TYPE_ARG1 # undef SEND_TYPE_ARG3 # define HAVE_FREEADDRINFO # define HAVE_GETADDRINFO # define HAVE_GETHOSTBYNAME # define HAVE_GETHOSTBYNAME_R # define HAVE_GETHOSTBYNAME_R_6 # define LWIP_POSIX_SOCKETS_IO_NAMES 0 # define RECV_TYPE_ARG1 int # define RECV_TYPE_ARG3 size_t # define SEND_TYPE_ARG1 int # define SEND_TYPE_ARG3 size_t #endif /* ---------------------------------------------------------------- */ /* Watt-32 tcp/ip SPECIFIC */ /* ---------------------------------------------------------------- */ #ifdef USE_WATT32 #include #undef byte #undef word #undef USE_WINSOCK #undef HAVE_WINSOCK_H #undef HAVE_WINSOCK2_H #undef HAVE_WS2TCPIP_H #define HAVE_GETADDRINFO #define HAVE_GETNAMEINFO #define HAVE_SYS_IOCTL_H #define HAVE_SYS_SOCKET_H #define HAVE_NETINET_IN_H #define HAVE_NETDB_H #define HAVE_ARPA_INET_H #define HAVE_FREEADDRINFO #define SOCKET int #endif /* ---------------------------------------------------------------- */ /* COMPILER SPECIFIC */ /* ---------------------------------------------------------------- */ /* Define to nothing if compiler does not support 'const' qualifier. */ /* #define const */ /* Define to nothing if compiler does not support 'volatile' qualifier. */ /* #define volatile */ /* Windows should not have HAVE_GMTIME_R defined */ /* #undef HAVE_GMTIME_R */ /* Define if the compiler supports C99 variadic macro style. */ #if defined(_MSC_VER) && (_MSC_VER >= 1400) #define HAVE_VARIADIC_MACROS_C99 1 #endif /* Define if the compiler supports the 'long long' data type. */ #if defined(__MINGW32__) || defined(__WATCOMC__) #define HAVE_LONGLONG 1 #endif /* Define to avoid VS2005 complaining about portable C functions. */ #if defined(_MSC_VER) && (_MSC_VER >= 1400) #define _CRT_SECURE_NO_DEPRECATE 1 #define _CRT_NONSTDC_NO_DEPRECATE 1 #endif /* VS2005 and later dafault size for time_t is 64-bit, unless _USE_32BIT_TIME_T has been defined to get a 32-bit time_t. */ #if defined(_MSC_VER) && (_MSC_VER >= 1400) # ifndef _USE_32BIT_TIME_T # define SIZEOF_TIME_T 8 # else # define SIZEOF_TIME_T 4 # endif #endif /* Officially, Microsoft's Windows SDK versions 6.X do not support Windows 2000 as a supported build target. VS2008 default installations provide an embedded Windows SDK v6.0A along with the claim that Windows 2000 is a valid build target for VS2008. Popular belief is that binaries built with VS2008 using Windows SDK versions 6.X and Windows 2000 as a build target are functional. */ #if defined(_MSC_VER) && (_MSC_VER >= 1500) # define VS2008_MIN_TARGET 0x0500 #endif /* When no build target is specified VS2008 default build target is Windows Vista, which leaves out even Winsows XP. If no build target has been given for VS2008 we will target the minimum Officially supported build target, which happens to be Windows XP. */ #if defined(_MSC_VER) && (_MSC_VER >= 1500) # define VS2008_DEF_TARGET 0x0501 #endif /* VS2008 default target settings and minimum build target check. */ #if defined(_MSC_VER) && (_MSC_VER >= 1500) # ifndef _WIN32_WINNT # define _WIN32_WINNT VS2008_DEF_TARGET # endif # ifndef WINVER # define WINVER VS2008_DEF_TARGET # endif # if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET) # error VS2008 does not support Windows build targets prior to Windows 2000 # endif #endif /* When no build target is specified Pelles C 5.00 and later default build target is Windows Vista. We override default target to be Windows 2000. */ #if defined(__POCC__) && (__POCC__ >= 500) # ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0500 # endif # ifndef WINVER # define WINVER 0x0500 # endif #endif /* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is quite convoluted, compiler dependent and even build target dependent. */ #if defined(HAVE_WS2TCPIP_H) # if defined(__POCC__) # define HAVE_FREEADDRINFO 1 # define HAVE_GETADDRINFO 1 # define HAVE_GETADDRINFO_THREADSAFE 1 # define HAVE_GETNAMEINFO 1 # elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) # define HAVE_FREEADDRINFO 1 # define HAVE_GETADDRINFO 1 # define HAVE_GETADDRINFO_THREADSAFE 1 # define HAVE_GETNAMEINFO 1 # elif defined(_MSC_VER) && (_MSC_VER >= 1200) # define HAVE_FREEADDRINFO 1 # define HAVE_GETADDRINFO 1 # define HAVE_GETADDRINFO_THREADSAFE 1 # define HAVE_GETNAMEINFO 1 # endif #endif #if defined(__POCC__) # ifndef _MSC_VER # error Microsoft extensions /Ze compiler option is required # endif # ifndef __POCC__OLDNAMES # error Compatibility names /Go compiler option is required # endif #endif /* ---------------------------------------------------------------- */ /* LARGE FILE SUPPORT */ /* ---------------------------------------------------------------- */ #if defined(_MSC_VER) && !defined(_WIN32_WCE) # if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) # define USE_WIN32_LARGE_FILES # else # define USE_WIN32_SMALL_FILES # endif #endif #if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES) # define USE_WIN32_LARGE_FILES #endif #if defined(__WATCOMC__) && !defined(USE_WIN32_LARGE_FILES) # define USE_WIN32_LARGE_FILES #endif #if defined(__POCC__) # undef USE_WIN32_LARGE_FILES #endif #if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES) # define USE_WIN32_SMALL_FILES #endif /* ---------------------------------------------------------------- */ /* DNS RESOLVER SPECIALTY */ /* ---------------------------------------------------------------- */ /* * Undefine both USE_ARES and USE_THREADS_WIN32 for synchronous DNS. */ /* Define to enable c-ares asynchronous DNS lookups. */ /* #define USE_ARES 1 */ /* Default define to enable threaded asynchronous DNS lookups. */ #if !defined(USE_SYNC_DNS) && !defined(USE_ARES) && \ !defined(USE_THREADS_WIN32) # define USE_THREADS_WIN32 1 #endif #if defined(USE_ARES) && defined(USE_THREADS_WIN32) # error "Only one DNS lookup specialty may be defined at most" #endif /* ---------------------------------------------------------------- */ /* LDAP SUPPORT */ /* ---------------------------------------------------------------- */ #if defined(CURL_HAS_NOVELL_LDAPSDK) || defined(CURL_HAS_MOZILLA_LDAPSDK) #undef CURL_LDAP_WIN #define HAVE_LDAP_SSL_H 1 #define HAVE_LDAP_URL_PARSE 1 #elif defined(CURL_HAS_OPENLDAP_LDAPSDK) #undef CURL_LDAP_WIN #define HAVE_LDAP_URL_PARSE 1 #else #undef HAVE_LDAP_URL_PARSE #define CURL_LDAP_WIN 1 #endif #if defined(__WATCOMC__) && defined(CURL_LDAP_WIN) #if __WATCOMC__ < 1280 #define WINBERAPI __declspec(cdecl) #define WINLDAPAPI __declspec(cdecl) #endif #endif #if defined(__POCC__) && defined(CURL_LDAP_WIN) # define CURL_DISABLE_LDAP 1 #endif /* ---------------------------------------------------------------- */ /* ADDITIONAL DEFINITIONS */ /* ---------------------------------------------------------------- */ /* Define cpu-machine-OS */ #undef OS #if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */ #define OS "i386-pc-win32" #elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (MSVC >=2005 or gcc) */ #define OS "x86_64-pc-win32" #elif defined(_M_IA64) /* Itanium */ #define OS "ia64-pc-win32" #else #define OS "unknown-pc-win32" #endif /* Name of package */ #define PACKAGE "curl" /* If you want to build curl with the built-in manual */ #define USE_MANUAL 1 #if defined(__POCC__) || (USE_IPV6) # define ENABLE_IPV6 1 #endif #endif /* HEADER_CURL_CONFIG_WIN32_H */ ================================================ FILE: third_party/include/curl/curl.h ================================================ #ifndef __CURL_CURL_H #define __CURL_CURL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* * If you have libcurl problems, all docs and details are found here: * http://curl.haxx.se/libcurl/ * * curl-library mailing list subscription and unsubscription web interface: * http://cool.haxx.se/mailman/listinfo/curl-library/ */ #include "curlver.h" /* libcurl version defines */ #include "curlbuild.h" /* libcurl build definitions */ #include "curlrules.h" /* libcurl rules enforcement */ /* * Define WIN32 when build target is Win32 API */ #if (defined(_WIN32) || defined(__WIN32__)) && \ !defined(WIN32) && !defined(__SYMBIAN32__) #define WIN32 #endif #include #include #if defined(__FreeBSD__) && (__FreeBSD__ >= 2) /* Needed for __FreeBSD_version symbol definition */ #include #endif /* The include stuff here below is mainly for time_t! */ #include #include #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__)) /* The check above prevents the winsock2 inclusion if winsock.h already was included, since they can't co-exist without problems */ #include #include #endif #endif /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish libc5-based Linux systems. Only include it on systems that are known to require it! */ #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ defined(ANDROID) || defined(__ANDROID__) || \ (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) #include #endif #if !defined(WIN32) && !defined(_WIN32_WCE) #include #endif #if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__) #include #endif #ifdef __BEOS__ #include #endif #ifdef __cplusplus extern "C" { #endif typedef void CURL; /* * libcurl external API function linkage decorations. */ #ifdef CURL_STATICLIB # define CURL_EXTERN #elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__) # if defined(BUILDING_LIBCURL) # define CURL_EXTERN __declspec(dllexport) # else # define CURL_EXTERN __declspec(dllimport) # endif #elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS) # define CURL_EXTERN CURL_EXTERN_SYMBOL #else # define CURL_EXTERN #endif #ifndef curl_socket_typedef /* socket typedef */ #if defined(WIN32) && !defined(__LWIP_OPT_H__) typedef SOCKET curl_socket_t; #define CURL_SOCKET_BAD INVALID_SOCKET #else typedef int curl_socket_t; #define CURL_SOCKET_BAD -1 #endif #define curl_socket_typedef #endif /* curl_socket_typedef */ struct curl_httppost { struct curl_httppost *next; /* next entry in the list */ char *name; /* pointer to allocated name */ long namelength; /* length of name length */ char *contents; /* pointer to allocated data contents */ long contentslength; /* length of contents field */ char *buffer; /* pointer to allocated buffer contents */ long bufferlength; /* length of buffer field */ char *contenttype; /* Content-Type */ struct curl_slist* contentheader; /* list of extra headers for this form */ struct curl_httppost *more; /* if one field name has more than one file, this link should link to following files */ long flags; /* as defined below */ #define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */ #define HTTPPOST_READFILE (1<<1) /* specified content is a file name */ #define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer do not free in formfree */ #define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer do not free in formfree */ #define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */ #define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */ #define HTTPPOST_CALLBACK (1<<6) /* upload file contents by using the regular read callback to get the data and pass the given pointer as custom pointer */ char *showfilename; /* The file name to show. If not set, the actual file name will be used (if this is a file part) */ void *userp; /* custom pointer used for HTTPPOST_CALLBACK posts */ }; typedef int (*curl_progress_callback)(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow); #ifndef CURL_MAX_WRITE_SIZE /* Tests have proven that 20K is a very bad buffer size for uploads on Windows, while 16K for some odd reason performed a lot better. We do the ifndef check to allow this value to easier be changed at build time for those who feel adventurous. The practical minimum is about 400 bytes since libcurl uses a buffer of this size as a scratch area (unrelated to network send operations). */ #define CURL_MAX_WRITE_SIZE 16384 #endif #ifndef CURL_MAX_HTTP_HEADER /* The only reason to have a max limit for this is to avoid the risk of a bad server feeding libcurl with a never-ending header that will cause reallocs infinitely */ #define CURL_MAX_HTTP_HEADER (100*1024) #endif /* This is a magic return code for the write callback that, when returned, will signal libcurl to pause receiving on the current transfer. */ #define CURL_WRITEFUNC_PAUSE 0x10000001 typedef size_t (*curl_write_callback)(char *buffer, size_t size, size_t nitems, void *outstream); /* enumeration of file types */ typedef enum { CURLFILETYPE_FILE = 0, CURLFILETYPE_DIRECTORY, CURLFILETYPE_SYMLINK, CURLFILETYPE_DEVICE_BLOCK, CURLFILETYPE_DEVICE_CHAR, CURLFILETYPE_NAMEDPIPE, CURLFILETYPE_SOCKET, CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */ CURLFILETYPE_UNKNOWN /* should never occur */ } curlfiletype; #define CURLFINFOFLAG_KNOWN_FILENAME (1<<0) #define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1) #define CURLFINFOFLAG_KNOWN_TIME (1<<2) #define CURLFINFOFLAG_KNOWN_PERM (1<<3) #define CURLFINFOFLAG_KNOWN_UID (1<<4) #define CURLFINFOFLAG_KNOWN_GID (1<<5) #define CURLFINFOFLAG_KNOWN_SIZE (1<<6) #define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7) /* Content of this structure depends on information which is known and is achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man page for callbacks returning this structure -- some fields are mandatory, some others are optional. The FLAG field has special meaning. */ struct curl_fileinfo { char *filename; curlfiletype filetype; time_t time; unsigned int perm; int uid; int gid; curl_off_t size; long int hardlinks; struct { /* If some of these fields is not NULL, it is a pointer to b_data. */ char *time; char *perm; char *user; char *group; char *target; /* pointer to the target filename of a symlink */ } strings; unsigned int flags; /* used internally */ char * b_data; size_t b_size; size_t b_used; }; /* return codes for CURLOPT_CHUNK_BGN_FUNCTION */ #define CURL_CHUNK_BGN_FUNC_OK 0 #define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */ #define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */ /* if splitting of data transfer is enabled, this callback is called before download of an individual chunk started. Note that parameter "remains" works only for FTP wildcard downloading (for now), otherwise is not used */ typedef long (*curl_chunk_bgn_callback)(const void *transfer_info, void *ptr, int remains); /* return codes for CURLOPT_CHUNK_END_FUNCTION */ #define CURL_CHUNK_END_FUNC_OK 0 #define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */ /* If splitting of data transfer is enabled this callback is called after download of an individual chunk finished. Note! After this callback was set then it have to be called FOR ALL chunks. Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC. This is the reason why we don't need "transfer_info" parameter in this callback and we are not interested in "remains" parameter too. */ typedef long (*curl_chunk_end_callback)(void *ptr); /* return codes for FNMATCHFUNCTION */ #define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */ #define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */ #define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */ /* callback type for wildcard downloading pattern matching. If the string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */ typedef int (*curl_fnmatch_callback)(void *ptr, const char *pattern, const char *string); /* These are the return codes for the seek callbacks */ #define CURL_SEEKFUNC_OK 0 #define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */ #define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so libcurl might try other means instead */ typedef int (*curl_seek_callback)(void *instream, curl_off_t offset, int origin); /* 'whence' */ /* This is a return code for the read callback that, when returned, will signal libcurl to immediately abort the current transfer. */ #define CURL_READFUNC_ABORT 0x10000000 /* This is a return code for the read callback that, when returned, will signal libcurl to pause sending data on the current transfer. */ #define CURL_READFUNC_PAUSE 0x10000001 typedef size_t (*curl_read_callback)(char *buffer, size_t size, size_t nitems, void *instream); typedef enum { CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */ CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */ CURLSOCKTYPE_LAST /* never use */ } curlsocktype; /* The return code from the sockopt_callback can signal information back to libcurl: */ #define CURL_SOCKOPT_OK 0 #define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return CURLE_ABORTED_BY_CALLBACK */ #define CURL_SOCKOPT_ALREADY_CONNECTED 2 typedef int (*curl_sockopt_callback)(void *clientp, curl_socket_t curlfd, curlsocktype purpose); struct curl_sockaddr { int family; int socktype; int protocol; unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it turned really ugly and painful on the systems that lack this type */ struct sockaddr addr; }; typedef curl_socket_t (*curl_opensocket_callback)(void *clientp, curlsocktype purpose, struct curl_sockaddr *address); typedef int (*curl_closesocket_callback)(void *clientp, curl_socket_t item); typedef enum { CURLIOE_OK, /* I/O operation successful */ CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ CURLIOE_FAILRESTART, /* failed to restart the read */ CURLIOE_LAST /* never use */ } curlioerr; typedef enum { CURLIOCMD_NOP, /* no operation */ CURLIOCMD_RESTARTREAD, /* restart the read stream from start */ CURLIOCMD_LAST /* never use */ } curliocmd; typedef curlioerr (*curl_ioctl_callback)(CURL *handle, int cmd, void *clientp); /* * The following typedef's are signatures of malloc, free, realloc, strdup and * calloc respectively. Function pointers of these types can be passed to the * curl_global_init_mem() function to set user defined memory management * callback routines. */ typedef void *(*curl_malloc_callback)(size_t size); typedef void (*curl_free_callback)(void *ptr); typedef void *(*curl_realloc_callback)(void *ptr, size_t size); typedef char *(*curl_strdup_callback)(const char *str); typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size); /* the kind of data that is passed to information_callback*/ typedef enum { CURLINFO_TEXT = 0, CURLINFO_HEADER_IN, /* 1 */ CURLINFO_HEADER_OUT, /* 2 */ CURLINFO_DATA_IN, /* 3 */ CURLINFO_DATA_OUT, /* 4 */ CURLINFO_SSL_DATA_IN, /* 5 */ CURLINFO_SSL_DATA_OUT, /* 6 */ CURLINFO_END } curl_infotype; typedef int (*curl_debug_callback) (CURL *handle, /* the handle/transfer this concerns */ curl_infotype type, /* what kind of data */ char *data, /* points to the data */ size_t size, /* size of the data pointed to */ void *userptr); /* whatever the user please */ /* All possible error codes from all sorts of curl functions. Future versions may return other values, stay prepared. Always add new return codes last. Never *EVER* remove any. The return codes must remain the same! */ typedef enum { CURLE_OK = 0, CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ CURLE_FAILED_INIT, /* 2 */ CURLE_URL_MALFORMAT, /* 3 */ CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for 7.17.0, reused in April 2011 for 7.21.5] */ CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ CURLE_COULDNT_RESOLVE_HOST, /* 6 */ CURLE_COULDNT_CONNECT, /* 7 */ CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */ CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server due to lack of access - when login fails this is not returned. */ CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for 7.15.4, reused in Dec 2011 for 7.24.0]*/ CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server [was obsoleted in August 2007 for 7.17.0, reused in Dec 2011 for 7.24.0]*/ CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ CURLE_FTP_CANT_GET_HOST, /* 15 */ CURLE_OBSOLETE16, /* 16 - NOT USED */ CURLE_FTP_COULDNT_SET_TYPE, /* 17 */ CURLE_PARTIAL_FILE, /* 18 */ CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ CURLE_OBSOLETE20, /* 20 - NOT USED */ CURLE_QUOTE_ERROR, /* 21 - quote command failure */ CURLE_HTTP_RETURNED_ERROR, /* 22 */ CURLE_WRITE_ERROR, /* 23 */ CURLE_OBSOLETE24, /* 24 - NOT USED */ CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ CURLE_READ_ERROR, /* 26 - couldn't open/read from file */ CURLE_OUT_OF_MEMORY, /* 27 */ /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error instead of a memory allocation error if CURL_DOES_CONVERSIONS is defined */ CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ CURLE_OBSOLETE29, /* 29 - NOT USED */ CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ CURLE_OBSOLETE32, /* 32 - NOT USED */ CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ CURLE_HTTP_POST_ERROR, /* 34 */ CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ CURLE_FILE_COULDNT_READ_FILE, /* 37 */ CURLE_LDAP_CANNOT_BIND, /* 38 */ CURLE_LDAP_SEARCH_FAILED, /* 39 */ CURLE_OBSOLETE40, /* 40 - NOT USED */ CURLE_FUNCTION_NOT_FOUND, /* 41 */ CURLE_ABORTED_BY_CALLBACK, /* 42 */ CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ CURLE_OBSOLETE44, /* 44 - NOT USED */ CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ CURLE_OBSOLETE46, /* 46 - NOT USED */ CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */ CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ CURLE_OBSOLETE50, /* 50 - NOT USED */ CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint wasn't verified fine */ CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as default */ CURLE_SEND_ERROR, /* 55 - failed sending network data */ CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ CURLE_OBSOLETE57, /* 57 - NOT IN USE */ CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */ CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind that failed */ CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not accepted and we failed to login */ CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ CURLE_TFTP_PERM, /* 69 - permission problem on server */ CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */ CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */ CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ CURLE_CONV_FAILED, /* 75 - conversion failed */ CURLE_CONV_REQD, /* 76 - caller must register conversion callbacks using curl_easy_setopt options CURLOPT_CONV_FROM_NETWORK_FUNCTION, CURLOPT_CONV_TO_NETWORK_FUNCTION, and CURLOPT_CONV_FROM_UTF8_FUNCTION */ CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing or wrong format */ CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */ CURLE_SSH, /* 79 - error from the SSH layer, somewhat generic so the error message will be of interest when this has happened */ CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL connection */ CURLE_AGAIN, /* 81 - socket is not ready for send/recv, wait till it's ready and try again (Added in 7.18.2) */ CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or wrong format (Added in 7.19.0) */ CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in 7.19.0) */ CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */ CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */ CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */ CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */ CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */ CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the session will be queued */ CURL_LAST /* never use! */ } CURLcode; #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all the obsolete stuff removed! */ /* Previously obsoletes error codes re-used in 7.24.0 */ #define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED #define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT /* compatibility with older names */ #define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING /* The following were added in 7.21.5, April 2011 */ #define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION /* The following were added in 7.17.1 */ /* These are scheduled to disappear by 2009 */ #define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION /* The following were added in 7.17.0 */ /* These are scheduled to disappear by 2009 */ #define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */ #define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46 #define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44 #define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10 #define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16 #define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32 #define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29 #define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12 #define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20 #define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40 #define CURLE_MALFORMAT_USER CURLE_OBSOLETE24 #define CURLE_SHARE_IN_USE CURLE_OBSOLETE57 #define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN #define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED #define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE #define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR #define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL #define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS #define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR #define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED /* The following were added earlier */ #define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT #define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR #define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED #define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED #define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE #define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME /* This was the error code 50 in 7.7.3 and a few earlier versions, this is no longer used by libcurl but is instead #defined here only to not make programs break */ #define CURLE_ALREADY_COMPLETE 99999 #endif /*!CURL_NO_OLDIES*/ /* This prototype applies to all conversion callbacks */ typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length); typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */ void *ssl_ctx, /* actually an OpenSSL SSL_CTX */ void *userptr); typedef enum { CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use CONNECT HTTP/1.1 */ CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT HTTP/1.0 */ CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already in 7.10 */ CURLPROXY_SOCKS5 = 5, /* added in 7.10 */ CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */ CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the host name rather than the IP address. added in 7.18.0 */ } curl_proxytype; /* this enum was added in 7.10 */ /* * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options: * * CURLAUTH_NONE - No HTTP authentication * CURLAUTH_BASIC - HTTP Basic authentication (default) * CURLAUTH_DIGEST - HTTP Digest authentication * CURLAUTH_GSSNEGOTIATE - HTTP GSS-Negotiate authentication * CURLAUTH_NTLM - HTTP NTLM authentication * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper * CURLAUTH_ONLY - Use together with a single other type to force no * authentication or just that single type * CURLAUTH_ANY - All fine types set * CURLAUTH_ANYSAFE - All fine types except Basic */ #define CURLAUTH_NONE ((unsigned long)0) #define CURLAUTH_BASIC (((unsigned long)1)<<0) #define CURLAUTH_DIGEST (((unsigned long)1)<<1) #define CURLAUTH_GSSNEGOTIATE (((unsigned long)1)<<2) #define CURLAUTH_NTLM (((unsigned long)1)<<3) #define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4) #define CURLAUTH_NTLM_WB (((unsigned long)1)<<5) #define CURLAUTH_ONLY (((unsigned long)1)<<31) #define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) #define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) #define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */ #define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */ #define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */ #define CURLSSH_AUTH_PASSWORD (1<<1) /* password */ #define CURLSSH_AUTH_HOST (1<<2) /* host key files */ #define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */ #define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */ #define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY #define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */ #define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */ #define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */ #define CURL_ERROR_SIZE 256 struct curl_khkey { const char *key; /* points to a zero-terminated string encoded with base64 if len is zero, otherwise to the "raw" data */ size_t len; enum type { CURLKHTYPE_UNKNOWN, CURLKHTYPE_RSA1, CURLKHTYPE_RSA, CURLKHTYPE_DSS } keytype; }; /* this is the set of return values expected from the curl_sshkeycallback callback */ enum curl_khstat { CURLKHSTAT_FINE_ADD_TO_FILE, CURLKHSTAT_FINE, CURLKHSTAT_REJECT, /* reject the connection, return an error */ CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so this causes a CURLE_DEFER error but otherwise the connection will be left intact etc */ CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */ }; /* this is the set of status codes pass in to the callback */ enum curl_khmatch { CURLKHMATCH_OK, /* match */ CURLKHMATCH_MISMATCH, /* host found, key mismatch! */ CURLKHMATCH_MISSING, /* no matching host/key found */ CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */ }; typedef int (*curl_sshkeycallback) (CURL *easy, /* easy handle */ const struct curl_khkey *knownkey, /* known */ const struct curl_khkey *foundkey, /* found */ enum curl_khmatch, /* libcurl's view on the keys */ void *clientp); /* custom pointer passed from app */ /* parameter for the CURLOPT_USE_SSL option */ typedef enum { CURLUSESSL_NONE, /* do not attempt to use SSL */ CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */ CURLUSESSL_CONTROL, /* SSL for the control connection or fail */ CURLUSESSL_ALL, /* SSL for all communication or fail */ CURLUSESSL_LAST /* not an option, never use */ } curl_usessl; /* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */ /* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the name of improving interoperability with older servers. Some SSL libraries have introduced work-arounds for this flaw but those work-arounds sometimes make the SSL communication fail. To regain functionality with those broken servers, a user can this way allow the vulnerability back. */ #define CURLSSLOPT_ALLOW_BEAST (1<<0) #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all the obsolete stuff removed! */ /* Backwards compatibility with older names */ /* These are scheduled to disappear by 2009 */ #define CURLFTPSSL_NONE CURLUSESSL_NONE #define CURLFTPSSL_TRY CURLUSESSL_TRY #define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL #define CURLFTPSSL_ALL CURLUSESSL_ALL #define CURLFTPSSL_LAST CURLUSESSL_LAST #define curl_ftpssl curl_usessl #endif /*!CURL_NO_OLDIES*/ /* parameter for the CURLOPT_FTP_SSL_CCC option */ typedef enum { CURLFTPSSL_CCC_NONE, /* do not send CCC */ CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */ CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */ CURLFTPSSL_CCC_LAST /* not an option, never use */ } curl_ftpccc; /* parameter for the CURLOPT_FTPSSLAUTH option */ typedef enum { CURLFTPAUTH_DEFAULT, /* let libcurl decide */ CURLFTPAUTH_SSL, /* use "AUTH SSL" */ CURLFTPAUTH_TLS, /* use "AUTH TLS" */ CURLFTPAUTH_LAST /* not an option, never use */ } curl_ftpauth; /* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */ typedef enum { CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */ CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD again if MKD succeeded, for SFTP this does similar magic */ CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD again even if MKD failed! */ CURLFTP_CREATE_DIR_LAST /* not an option, never use */ } curl_ftpcreatedir; /* parameter for the CURLOPT_FTP_FILEMETHOD option */ typedef enum { CURLFTPMETHOD_DEFAULT, /* let libcurl pick */ CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */ CURLFTPMETHOD_NOCWD, /* no CWD at all */ CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */ CURLFTPMETHOD_LAST /* not an option, never use */ } curl_ftpmethod; /* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */ #define CURLPROTO_HTTP (1<<0) #define CURLPROTO_HTTPS (1<<1) #define CURLPROTO_FTP (1<<2) #define CURLPROTO_FTPS (1<<3) #define CURLPROTO_SCP (1<<4) #define CURLPROTO_SFTP (1<<5) #define CURLPROTO_TELNET (1<<6) #define CURLPROTO_LDAP (1<<7) #define CURLPROTO_LDAPS (1<<8) #define CURLPROTO_DICT (1<<9) #define CURLPROTO_FILE (1<<10) #define CURLPROTO_TFTP (1<<11) #define CURLPROTO_IMAP (1<<12) #define CURLPROTO_IMAPS (1<<13) #define CURLPROTO_POP3 (1<<14) #define CURLPROTO_POP3S (1<<15) #define CURLPROTO_SMTP (1<<16) #define CURLPROTO_SMTPS (1<<17) #define CURLPROTO_RTSP (1<<18) #define CURLPROTO_RTMP (1<<19) #define CURLPROTO_RTMPT (1<<20) #define CURLPROTO_RTMPE (1<<21) #define CURLPROTO_RTMPTE (1<<22) #define CURLPROTO_RTMPS (1<<23) #define CURLPROTO_RTMPTS (1<<24) #define CURLPROTO_GOPHER (1<<25) #define CURLPROTO_ALL (~0) /* enable everything */ /* long may be 32 or 64 bits, but we should never depend on anything else but 32 */ #define CURLOPTTYPE_LONG 0 #define CURLOPTTYPE_OBJECTPOINT 10000 #define CURLOPTTYPE_FUNCTIONPOINT 20000 #define CURLOPTTYPE_OFF_T 30000 /* name is uppercase CURLOPT_, type is one of the defined CURLOPTTYPE_ number is unique identifier */ #ifdef CINIT #undef CINIT #endif #ifdef CURL_ISOCPP #define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu #else /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ #define LONG CURLOPTTYPE_LONG #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT #define OFF_T CURLOPTTYPE_OFF_T #define CINIT(name,type,number) CURLOPT_/**/name = type + number #endif /* * This macro-mania below setups the CURLOPT_[what] enum, to be used with * curl_easy_setopt(). The first argument in the CINIT() macro is the [what] * word. */ typedef enum { /* This is the FILE * or void * the regular output should be written to. */ CINIT(FILE, OBJECTPOINT, 1), /* The full URL to get/put */ CINIT(URL, OBJECTPOINT, 2), /* Port number to connect to, if other than default. */ CINIT(PORT, LONG, 3), /* Name of proxy to use. */ CINIT(PROXY, OBJECTPOINT, 4), /* "name:password" to use when fetching. */ CINIT(USERPWD, OBJECTPOINT, 5), /* "name:password" to use with proxy. */ CINIT(PROXYUSERPWD, OBJECTPOINT, 6), /* Range to get, specified as an ASCII string. */ CINIT(RANGE, OBJECTPOINT, 7), /* not used */ /* Specified file stream to upload from (use as input): */ CINIT(INFILE, OBJECTPOINT, 9), /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE * bytes big. If this is not used, error messages go to stderr instead: */ CINIT(ERRORBUFFER, OBJECTPOINT, 10), /* Function that will be called to store the output (instead of fwrite). The * parameters will use fwrite() syntax, make sure to follow them. */ CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11), /* Function that will be called to read the input (instead of fread). The * parameters will use fread() syntax, make sure to follow them. */ CINIT(READFUNCTION, FUNCTIONPOINT, 12), /* Time-out the read operation after this amount of seconds */ CINIT(TIMEOUT, LONG, 13), /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about * how large the file being sent really is. That allows better error * checking and better verifies that the upload was successful. -1 means * unknown size. * * For large file support, there is also a _LARGE version of the key * which takes an off_t type, allowing platforms with larger off_t * sizes to handle larger files. See below for INFILESIZE_LARGE. */ CINIT(INFILESIZE, LONG, 14), /* POST static input fields. */ CINIT(POSTFIELDS, OBJECTPOINT, 15), /* Set the referrer page (needed by some CGIs) */ CINIT(REFERER, OBJECTPOINT, 16), /* Set the FTP PORT string (interface name, named or numerical IP address) Use i.e '-' to use default address. */ CINIT(FTPPORT, OBJECTPOINT, 17), /* Set the User-Agent string (examined by some CGIs) */ CINIT(USERAGENT, OBJECTPOINT, 18), /* If the download receives less than "low speed limit" bytes/second * during "low speed time" seconds, the operations is aborted. * You could i.e if you have a pretty high speed connection, abort if * it is less than 2000 bytes/sec during 20 seconds. */ /* Set the "low speed limit" */ CINIT(LOW_SPEED_LIMIT, LONG, 19), /* Set the "low speed time" */ CINIT(LOW_SPEED_TIME, LONG, 20), /* Set the continuation offset. * * Note there is also a _LARGE version of this key which uses * off_t types, allowing for large file offsets on platforms which * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. */ CINIT(RESUME_FROM, LONG, 21), /* Set cookie in request: */ CINIT(COOKIE, OBJECTPOINT, 22), /* This points to a linked list of headers, struct curl_slist kind */ CINIT(HTTPHEADER, OBJECTPOINT, 23), /* This points to a linked list of post entries, struct curl_httppost */ CINIT(HTTPPOST, OBJECTPOINT, 24), /* name of the file keeping your private SSL-certificate */ CINIT(SSLCERT, OBJECTPOINT, 25), /* password for the SSL or SSH private key */ CINIT(KEYPASSWD, OBJECTPOINT, 26), /* send TYPE parameter? */ CINIT(CRLF, LONG, 27), /* send linked-list of QUOTE commands */ CINIT(QUOTE, OBJECTPOINT, 28), /* send FILE * or void * to store headers to, if you use a callback it is simply passed to the callback unmodified */ CINIT(WRITEHEADER, OBJECTPOINT, 29), /* point to a file to read the initial cookies from, also enables "cookie awareness" */ CINIT(COOKIEFILE, OBJECTPOINT, 31), /* What version to specifically try to use. See CURL_SSLVERSION defines below. */ CINIT(SSLVERSION, LONG, 32), /* What kind of HTTP time condition to use, see defines */ CINIT(TIMECONDITION, LONG, 33), /* Time to use with the above condition. Specified in number of seconds since 1 Jan 1970 */ CINIT(TIMEVALUE, LONG, 34), /* 35 = OBSOLETE */ /* Custom request, for customizing the get command like HTTP: DELETE, TRACE and others FTP: to use a different list command */ CINIT(CUSTOMREQUEST, OBJECTPOINT, 36), /* HTTP request, for odd commands like DELETE, TRACE and others */ CINIT(STDERR, OBJECTPOINT, 37), /* 38 is not used */ /* send linked-list of post-transfer QUOTE commands */ CINIT(POSTQUOTE, OBJECTPOINT, 39), CINIT(WRITEINFO, OBJECTPOINT, 40), /* DEPRECATED, do not use! */ CINIT(VERBOSE, LONG, 41), /* talk a lot */ CINIT(HEADER, LONG, 42), /* throw the header out too */ CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */ CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */ CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */ CINIT(UPLOAD, LONG, 46), /* this is an upload */ CINIT(POST, LONG, 47), /* HTTP POST method */ CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */ CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */ /* Specify whether to read the user+password from the .netrc or the URL. * This must be one of the CURL_NETRC_* enums below. */ CINIT(NETRC, LONG, 51), CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */ CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */ CINIT(PUT, LONG, 54), /* HTTP PUT */ /* 55 = OBSOLETE */ /* Function that will be called instead of the internal progress display * function. This function should be defined as the curl_progress_callback * prototype defines. */ CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), /* Data passed to the progress callback */ CINIT(PROGRESSDATA, OBJECTPOINT, 57), /* We want the referrer field set automatically when following locations */ CINIT(AUTOREFERER, LONG, 58), /* Port of the proxy, can be set in the proxy string as well with: "[host]:[port]" */ CINIT(PROXYPORT, LONG, 59), /* size of the POST input data, if strlen() is not good to use */ CINIT(POSTFIELDSIZE, LONG, 60), /* tunnel non-http operations through a HTTP proxy */ CINIT(HTTPPROXYTUNNEL, LONG, 61), /* Set the interface string to use as outgoing network interface */ CINIT(INTERFACE, OBJECTPOINT, 62), /* Set the krb4/5 security level, this also enables krb4/5 awareness. This * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string * is set but doesn't match one of these, 'private' will be used. */ CINIT(KRBLEVEL, OBJECTPOINT, 63), /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ CINIT(SSL_VERIFYPEER, LONG, 64), /* The CApath or CAfile used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true */ CINIT(CAINFO, OBJECTPOINT, 65), /* 66 = OBSOLETE */ /* 67 = OBSOLETE */ /* Maximum number of http redirects to follow */ CINIT(MAXREDIRS, LONG, 68), /* Pass a long set to 1 to get the date of the requested document (if possible)! Pass a zero to shut it off. */ CINIT(FILETIME, LONG, 69), /* This points to a linked list of telnet options */ CINIT(TELNETOPTIONS, OBJECTPOINT, 70), /* Max amount of cached alive connections */ CINIT(MAXCONNECTS, LONG, 71), CINIT(CLOSEPOLICY, LONG, 72), /* DEPRECATED, do not use! */ /* 73 = OBSOLETE */ /* Set to explicitly use a new connection for the upcoming transfer. Do not use this unless you're absolutely sure of this, as it makes the operation slower and is less friendly for the network. */ CINIT(FRESH_CONNECT, LONG, 74), /* Set to explicitly forbid the upcoming transfer's connection to be re-used when done. Do not use this unless you're absolutely sure of this, as it makes the operation slower and is less friendly for the network. */ CINIT(FORBID_REUSE, LONG, 75), /* Set to a file name that contains random data for libcurl to use to seed the random engine when doing SSL connects. */ CINIT(RANDOM_FILE, OBJECTPOINT, 76), /* Set to the Entropy Gathering Daemon socket pathname */ CINIT(EGDSOCKET, OBJECTPOINT, 77), /* Time-out connect operations after this amount of seconds, if connects are OK within this time, then fine... This only aborts the connect phase. */ CINIT(CONNECTTIMEOUT, LONG, 78), /* Function that will be called to store headers (instead of fwrite). The * parameters will use fwrite() syntax, make sure to follow them. */ CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79), /* Set this to force the HTTP request to get back to GET. Only really usable if POST, PUT or a custom request have been used first. */ CINIT(HTTPGET, LONG, 80), /* Set if we should verify the Common name from the peer certificate in ssl * handshake, set 1 to check existence, 2 to ensure that it matches the * provided hostname. */ CINIT(SSL_VERIFYHOST, LONG, 81), /* Specify which file name to write all known cookies in after completed operation. Set file name to "-" (dash) to make it go to stdout. */ CINIT(COOKIEJAR, OBJECTPOINT, 82), /* Specify which SSL ciphers to use */ CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83), /* Specify which HTTP version to use! This must be set to one of the CURL_HTTP_VERSION* enums set below. */ CINIT(HTTP_VERSION, LONG, 84), /* Specifically switch on or off the FTP engine's use of the EPSV command. By default, that one will always be attempted before the more traditional PASV command. */ CINIT(FTP_USE_EPSV, LONG, 85), /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ CINIT(SSLCERTTYPE, OBJECTPOINT, 86), /* name of the file keeping your private SSL-key */ CINIT(SSLKEY, OBJECTPOINT, 87), /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ CINIT(SSLKEYTYPE, OBJECTPOINT, 88), /* crypto engine for the SSL-sub system */ CINIT(SSLENGINE, OBJECTPOINT, 89), /* set the crypto engine for the SSL-sub system as default the param has no meaning... */ CINIT(SSLENGINE_DEFAULT, LONG, 90), /* Non-zero value means to use the global dns cache */ CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */ /* DNS cache timeout */ CINIT(DNS_CACHE_TIMEOUT, LONG, 92), /* send linked-list of pre-transfer QUOTE commands */ CINIT(PREQUOTE, OBJECTPOINT, 93), /* set the debug function */ CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), /* set the data for the debug function */ CINIT(DEBUGDATA, OBJECTPOINT, 95), /* mark this as start of a cookie session */ CINIT(COOKIESESSION, LONG, 96), /* The CApath directory used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true */ CINIT(CAPATH, OBJECTPOINT, 97), /* Instruct libcurl to use a smaller receive buffer */ CINIT(BUFFERSIZE, LONG, 98), /* Instruct libcurl to not use any signal/alarm handlers, even when using timeouts. This option is useful for multi-threaded applications. See libcurl-the-guide for more background information. */ CINIT(NOSIGNAL, LONG, 99), /* Provide a CURLShare for mutexing non-ts data */ CINIT(SHARE, OBJECTPOINT, 100), /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */ CINIT(PROXYTYPE, LONG, 101), /* Set the Accept-Encoding string. Use this to tell a server you would like the response to be compressed. Before 7.21.6, this was known as CURLOPT_ENCODING */ CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102), /* Set pointer to private data */ CINIT(PRIVATE, OBJECTPOINT, 103), /* Set aliases for HTTP 200 in the HTTP Response header */ CINIT(HTTP200ALIASES, OBJECTPOINT, 104), /* Continue to send authentication (user+password) when following locations, even when hostname changed. This can potentially send off the name and password to whatever host the server decides. */ CINIT(UNRESTRICTED_AUTH, LONG, 105), /* Specifically switch on or off the FTP engine's use of the EPRT command ( it also disables the LPRT attempt). By default, those ones will always be attempted before the good old traditional PORT command. */ CINIT(FTP_USE_EPRT, LONG, 106), /* Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_USERPWD. Note that setting multiple bits may cause extra network round-trips. */ CINIT(HTTPAUTH, LONG, 107), /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx in second argument. The function must be matching the curl_ssl_ctx_callback proto. */ CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108), /* Set the userdata for the ssl context callback function's third argument */ CINIT(SSL_CTX_DATA, OBJECTPOINT, 109), /* FTP Option that causes missing dirs to be created on the remote server. In 7.19.4 we introduced the convenience enums for this option using the CURLFTP_CREATE_DIR prefix. */ CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110), /* Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. Note that setting multiple bits may cause extra network round-trips. */ CINIT(PROXYAUTH, LONG, 111), /* FTP option that changes the timeout, in seconds, associated with getting a response. This is different from transfer timeout time and essentially places a demand on the FTP server to acknowledge commands in a timely manner. */ CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112), #define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to tell libcurl to resolve names to those IP versions only. This only has affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */ CINIT(IPRESOLVE, LONG, 113), /* Set this option to limit the size of a file that will be downloaded from an HTTP or FTP server. Note there is also _LARGE version which adds large file support for platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ CINIT(MAXFILESIZE, LONG, 114), /* See the comment for INFILESIZE above, but in short, specifies * the size of the file being uploaded. -1 means unknown. */ CINIT(INFILESIZE_LARGE, OFF_T, 115), /* Sets the continuation offset. There is also a LONG version of this; * look above for RESUME_FROM. */ CINIT(RESUME_FROM_LARGE, OFF_T, 116), /* Sets the maximum size of data that will be downloaded from * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. */ CINIT(MAXFILESIZE_LARGE, OFF_T, 117), /* Set this option to the file name of your .netrc file you want libcurl to parse (using the CURLOPT_NETRC option). If not set, libcurl will do a poor attempt to find the user's home directory and check for a .netrc file in there. */ CINIT(NETRC_FILE, OBJECTPOINT, 118), /* Enable SSL/TLS for FTP, pick one of: CURLUSESSL_TRY - try using SSL, proceed anyway otherwise CURLUSESSL_CONTROL - SSL for the control connection or fail CURLUSESSL_ALL - SSL for all communication or fail */ CINIT(USE_SSL, LONG, 119), /* The _LARGE version of the standard POSTFIELDSIZE option */ CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120), /* Enable/disable the TCP Nagle algorithm */ CINIT(TCP_NODELAY, LONG, 121), /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 123 OBSOLETE. Gone in 7.16.0 */ /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 127 OBSOLETE. Gone in 7.16.0 */ /* 128 OBSOLETE. Gone in 7.16.0 */ /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option can be used to change libcurl's default action which is to first try "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK response has been received. Available parameters are: CURLFTPAUTH_DEFAULT - let libcurl decide CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL */ CINIT(FTPSSLAUTH, LONG, 129), CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130), CINIT(IOCTLDATA, OBJECTPOINT, 131), /* 132 OBSOLETE. Gone in 7.16.0 */ /* 133 OBSOLETE. Gone in 7.16.0 */ /* zero terminated string for pass on to the FTP server when asked for "account" info */ CINIT(FTP_ACCOUNT, OBJECTPOINT, 134), /* feed cookies into cookie engine */ CINIT(COOKIELIST, OBJECTPOINT, 135), /* ignore Content-Length */ CINIT(IGNORE_CONTENT_LENGTH, LONG, 136), /* Set to non-zero to skip the IP address received in a 227 PASV FTP server response. Typically used for FTP-SSL purposes but is not restricted to that. libcurl will then instead use the same IP address it used for the control connection. */ CINIT(FTP_SKIP_PASV_IP, LONG, 137), /* Select "file method" to use when doing FTP, see the curl_ftpmethod above. */ CINIT(FTP_FILEMETHOD, LONG, 138), /* Local port number to bind the socket to */ CINIT(LOCALPORT, LONG, 139), /* Number of ports to try, including the first one set with LOCALPORT. Thus, setting it to 1 will make no additional attempts but the first. */ CINIT(LOCALPORTRANGE, LONG, 140), /* no transfer, set up connection and let application use the socket by extracting it with CURLINFO_LASTSOCKET */ CINIT(CONNECT_ONLY, LONG, 141), /* Function that will be called to convert from the network encoding (instead of using the iconv calls in libcurl) */ CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142), /* Function that will be called to convert to the network encoding (instead of using the iconv calls in libcurl) */ CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143), /* Function that will be called to convert from UTF8 (instead of using the iconv calls in libcurl) Note that this is used only for SSL certificate processing */ CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144), /* if the connection proceeds too quickly then need to slow it down */ /* limit-rate: maximum number of bytes per second to send or receive */ CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145), CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146), /* Pointer to command string to send if USER/PASS fails. */ CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147), /* callback function for setting socket options */ CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148), CINIT(SOCKOPTDATA, OBJECTPOINT, 149), /* set to 0 to disable session ID re-use for this transfer, default is enabled (== 1) */ CINIT(SSL_SESSIONID_CACHE, LONG, 150), /* allowed SSH authentication methods */ CINIT(SSH_AUTH_TYPES, LONG, 151), /* Used by scp/sftp to do public/private key authentication */ CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152), CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153), /* Send CCC (Clear Command Channel) after authentication */ CINIT(FTP_SSL_CCC, LONG, 154), /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */ CINIT(TIMEOUT_MS, LONG, 155), CINIT(CONNECTTIMEOUT_MS, LONG, 156), /* set to zero to disable the libcurl's decoding and thus pass the raw body data to the application even when it is encoded/compressed */ CINIT(HTTP_TRANSFER_DECODING, LONG, 157), CINIT(HTTP_CONTENT_DECODING, LONG, 158), /* Permission used when creating new files and directories on the remote server for protocols that support it, SFTP/SCP/FILE */ CINIT(NEW_FILE_PERMS, LONG, 159), CINIT(NEW_DIRECTORY_PERMS, LONG, 160), /* Set the behaviour of POST when redirecting. Values must be set to one of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */ CINIT(POSTREDIR, LONG, 161), /* used by scp/sftp to verify the host's public key */ CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162), /* Callback function for opening socket (instead of socket(2)). Optionally, callback is able change the address or refuse to connect returning CURL_SOCKET_BAD. The callback should have type curl_opensocket_callback */ CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163), CINIT(OPENSOCKETDATA, OBJECTPOINT, 164), /* POST volatile input fields. */ CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165), /* set transfer mode (;type=) when doing FTP via an HTTP proxy */ CINIT(PROXY_TRANSFER_MODE, LONG, 166), /* Callback function for seeking in the input stream */ CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167), CINIT(SEEKDATA, OBJECTPOINT, 168), /* CRL file */ CINIT(CRLFILE, OBJECTPOINT, 169), /* Issuer certificate */ CINIT(ISSUERCERT, OBJECTPOINT, 170), /* (IPv6) Address scope */ CINIT(ADDRESS_SCOPE, LONG, 171), /* Collect certificate chain info and allow it to get retrievable with CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only working with OpenSSL-powered builds. */ CINIT(CERTINFO, LONG, 172), /* "name" and "pwd" to use when fetching. */ CINIT(USERNAME, OBJECTPOINT, 173), CINIT(PASSWORD, OBJECTPOINT, 174), /* "name" and "pwd" to use with Proxy when fetching. */ CINIT(PROXYUSERNAME, OBJECTPOINT, 175), CINIT(PROXYPASSWORD, OBJECTPOINT, 176), /* Comma separated list of hostnames defining no-proxy zones. These should match both hostnames directly, and hostnames within a domain. For example, local.com will match local.com and www.local.com, but NOT notlocal.com or www.notlocal.com. For compatibility with other implementations of this, .local.com will be considered to be the same as local.com. A single * is the only valid wildcard, and effectively disables the use of proxy. */ CINIT(NOPROXY, OBJECTPOINT, 177), /* block size for TFTP transfers */ CINIT(TFTP_BLKSIZE, LONG, 178), /* Socks Service */ CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179), /* Socks Service */ CINIT(SOCKS5_GSSAPI_NEC, LONG, 180), /* set the bitmask for the protocols that are allowed to be used for the transfer, which thus helps the app which takes URLs from users or other external inputs and want to restrict what protocol(s) to deal with. Defaults to CURLPROTO_ALL. */ CINIT(PROTOCOLS, LONG, 181), /* set the bitmask for the protocols that libcurl is allowed to follow to, as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs to be set in both bitmasks to be allowed to get redirected to. Defaults to all protocols except FILE and SCP. */ CINIT(REDIR_PROTOCOLS, LONG, 182), /* set the SSH knownhost file name to use */ CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183), /* set the SSH host key callback, must point to a curl_sshkeycallback function */ CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184), /* set the SSH host key callback custom pointer */ CINIT(SSH_KEYDATA, OBJECTPOINT, 185), /* set the SMTP mail originator */ CINIT(MAIL_FROM, OBJECTPOINT, 186), /* set the SMTP mail receiver(s) */ CINIT(MAIL_RCPT, OBJECTPOINT, 187), /* FTP: send PRET before PASV */ CINIT(FTP_USE_PRET, LONG, 188), /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */ CINIT(RTSP_REQUEST, LONG, 189), /* The RTSP session identifier */ CINIT(RTSP_SESSION_ID, OBJECTPOINT, 190), /* The RTSP stream URI */ CINIT(RTSP_STREAM_URI, OBJECTPOINT, 191), /* The Transport: header to use in RTSP requests */ CINIT(RTSP_TRANSPORT, OBJECTPOINT, 192), /* Manually initialize the client RTSP CSeq for this handle */ CINIT(RTSP_CLIENT_CSEQ, LONG, 193), /* Manually initialize the server RTSP CSeq for this handle */ CINIT(RTSP_SERVER_CSEQ, LONG, 194), /* The stream to pass to INTERLEAVEFUNCTION. */ CINIT(INTERLEAVEDATA, OBJECTPOINT, 195), /* Let the application define a custom write method for RTP data */ CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196), /* Turn on wildcard matching */ CINIT(WILDCARDMATCH, LONG, 197), /* Directory matching callback called before downloading of an individual file (chunk) started */ CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198), /* Directory matching callback called after the file (chunk) was downloaded, or skipped */ CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199), /* Change match (fnmatch-like) callback for wildcard matching */ CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200), /* Let the application define custom chunk data pointer */ CINIT(CHUNK_DATA, OBJECTPOINT, 201), /* FNMATCH_FUNCTION user pointer */ CINIT(FNMATCH_DATA, OBJECTPOINT, 202), /* send linked-list of name:port:address sets */ CINIT(RESOLVE, OBJECTPOINT, 203), /* Set a username for authenticated TLS */ CINIT(TLSAUTH_USERNAME, OBJECTPOINT, 204), /* Set a password for authenticated TLS */ CINIT(TLSAUTH_PASSWORD, OBJECTPOINT, 205), /* Set authentication type for authenticated TLS */ CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206), /* Set to 1 to enable the "TE:" header in HTTP requests to ask for compressed transfer-encoded responses. Set to 0 to disable the use of TE: in outgoing requests. The current default is 0, but it might change in a future libcurl release. libcurl will ask for the compressed methods it knows of, and if that isn't any, it will not ask for transfer-encoding at all even if this option is set to 1. */ CINIT(TRANSFER_ENCODING, LONG, 207), /* Callback function for closing socket (instead of close(2)). The callback should have type curl_closesocket_callback */ CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208), CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209), /* allow GSSAPI credential delegation */ CINIT(GSSAPI_DELEGATION, LONG, 210), /* Set the name servers to use for DNS resolution */ CINIT(DNS_SERVERS, OBJECTPOINT, 211), /* Time-out accept operations (currently for FTP only) after this amount of miliseconds. */ CINIT(ACCEPTTIMEOUT_MS, LONG, 212), /* Set TCP keepalive */ CINIT(TCP_KEEPALIVE, LONG, 213), /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */ CINIT(TCP_KEEPIDLE, LONG, 214), CINIT(TCP_KEEPINTVL, LONG, 215), /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */ CINIT(SSL_OPTIONS, LONG, 216), /* set the SMTP auth originator */ CINIT(MAIL_AUTH, OBJECTPOINT, 217), CURLOPT_LASTENTRY /* the last unused */ } CURLoption; #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all the obsolete stuff removed! */ /* Backwards compatibility with older names */ /* These are scheduled to disappear by 2011 */ /* This was added in version 7.19.1 */ #define CURLOPT_POST301 CURLOPT_POSTREDIR /* These are scheduled to disappear by 2009 */ /* The following were added in 7.17.0 */ #define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD #define CURLOPT_FTPAPPEND CURLOPT_APPEND #define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY #define CURLOPT_FTP_SSL CURLOPT_USE_SSL /* The following were added earlier */ #define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD #define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL #else /* This is set if CURL_NO_OLDIES is defined at compile-time */ #undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */ #endif /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host name resolves addresses using more than one IP protocol version, this option might be handy to force libcurl to use a specific IP version. */ #define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP versions that your system allows */ #define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */ #define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */ /* three convenient "aliases" that follow the name scheme better */ #define CURLOPT_WRITEDATA CURLOPT_FILE #define CURLOPT_READDATA CURLOPT_INFILE #define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER #define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER /* These enums are for use with the CURLOPT_HTTP_VERSION option. */ enum { CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd like the library to choose the best possible for us! */ CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ }; /* * Public API enums for RTSP requests */ enum { CURL_RTSPREQ_NONE, /* first in list */ CURL_RTSPREQ_OPTIONS, CURL_RTSPREQ_DESCRIBE, CURL_RTSPREQ_ANNOUNCE, CURL_RTSPREQ_SETUP, CURL_RTSPREQ_PLAY, CURL_RTSPREQ_PAUSE, CURL_RTSPREQ_TEARDOWN, CURL_RTSPREQ_GET_PARAMETER, CURL_RTSPREQ_SET_PARAMETER, CURL_RTSPREQ_RECORD, CURL_RTSPREQ_RECEIVE, CURL_RTSPREQ_LAST /* last in list */ }; /* These enums are for use with the CURLOPT_NETRC option. */ enum CURL_NETRC_OPTION { CURL_NETRC_IGNORED, /* The .netrc will never be read. * This is the default. */ CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred * to one in the .netrc. */ CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored. * Unless one is set programmatically, the .netrc * will be queried. */ CURL_NETRC_LAST }; enum { CURL_SSLVERSION_DEFAULT, CURL_SSLVERSION_TLSv1, CURL_SSLVERSION_SSLv2, CURL_SSLVERSION_SSLv3, CURL_SSLVERSION_LAST /* never use, keep last */ }; enum CURL_TLSAUTH { CURL_TLSAUTH_NONE, CURL_TLSAUTH_SRP, CURL_TLSAUTH_LAST /* never use, keep last */ }; /* symbols to use with CURLOPT_POSTREDIR. CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303 can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302 | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */ #define CURL_REDIR_GET_ALL 0 #define CURL_REDIR_POST_301 1 #define CURL_REDIR_POST_302 2 #define CURL_REDIR_POST_303 4 #define CURL_REDIR_POST_ALL \ (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303) typedef enum { CURL_TIMECOND_NONE, CURL_TIMECOND_IFMODSINCE, CURL_TIMECOND_IFUNMODSINCE, CURL_TIMECOND_LASTMOD, CURL_TIMECOND_LAST } curl_TimeCond; /* curl_strequal() and curl_strnequal() are subject for removal in a future libcurl, see lib/README.curlx for details */ CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2); CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n); /* name is uppercase CURLFORM_ */ #ifdef CFINIT #undef CFINIT #endif #ifdef CURL_ISOCPP #define CFINIT(name) CURLFORM_ ## name #else /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ #define CFINIT(name) CURLFORM_/**/name #endif typedef enum { CFINIT(NOTHING), /********* the first one is unused ************/ /* */ CFINIT(COPYNAME), CFINIT(PTRNAME), CFINIT(NAMELENGTH), CFINIT(COPYCONTENTS), CFINIT(PTRCONTENTS), CFINIT(CONTENTSLENGTH), CFINIT(FILECONTENT), CFINIT(ARRAY), CFINIT(OBSOLETE), CFINIT(FILE), CFINIT(BUFFER), CFINIT(BUFFERPTR), CFINIT(BUFFERLENGTH), CFINIT(CONTENTTYPE), CFINIT(CONTENTHEADER), CFINIT(FILENAME), CFINIT(END), CFINIT(OBSOLETE2), CFINIT(STREAM), CURLFORM_LASTENTRY /* the last unused */ } CURLformoption; #undef CFINIT /* done */ /* structure to be used as parameter for CURLFORM_ARRAY */ struct curl_forms { CURLformoption option; const char *value; }; /* use this for multipart formpost building */ /* Returns code for curl_formadd() * * Returns: * CURL_FORMADD_OK on success * CURL_FORMADD_MEMORY if the FormInfo allocation fails * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form * CURL_FORMADD_NULL if a null pointer was given for a char * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated * CURL_FORMADD_MEMORY if some allocation for string copying failed. * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array * ***************************************************************************/ typedef enum { CURL_FORMADD_OK, /* first, no error */ CURL_FORMADD_MEMORY, CURL_FORMADD_OPTION_TWICE, CURL_FORMADD_NULL, CURL_FORMADD_UNKNOWN_OPTION, CURL_FORMADD_INCOMPLETE, CURL_FORMADD_ILLEGAL_ARRAY, CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */ CURL_FORMADD_LAST /* last */ } CURLFORMcode; /* * NAME curl_formadd() * * DESCRIPTION * * Pretty advanced function for building multi-part formposts. Each invoke * adds one part that together construct a full post. Then use * CURLOPT_HTTPPOST to send it off to libcurl. */ CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost, struct curl_httppost **last_post, ...); /* * callback function for curl_formget() * The void *arg pointer will be the one passed as second argument to * curl_formget(). * The character buffer passed to it must not be freed. * Should return the buffer length passed to it as the argument "len" on * success. */ typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len); /* * NAME curl_formget() * * DESCRIPTION * * Serialize a curl_httppost struct built with curl_formadd(). * Accepts a void pointer as second argument which will be passed to * the curl_formget_callback function. * Returns 0 on success. */ CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg, curl_formget_callback append); /* * NAME curl_formfree() * * DESCRIPTION * * Free a multipart formpost previously built with curl_formadd(). */ CURL_EXTERN void curl_formfree(struct curl_httppost *form); /* * NAME curl_getenv() * * DESCRIPTION * * Returns a malloc()'ed string that MUST be curl_free()ed after usage is * complete. DEPRECATED - see lib/README.curlx */ CURL_EXTERN char *curl_getenv(const char *variable); /* * NAME curl_version() * * DESCRIPTION * * Returns a static ascii string of the libcurl version. */ CURL_EXTERN char *curl_version(void); /* * NAME curl_easy_escape() * * DESCRIPTION * * Escapes URL strings (converts all letters consider illegal in URLs to their * %XX versions). This function returns a new allocated string or NULL if an * error occurred. */ CURL_EXTERN char *curl_easy_escape(CURL *handle, const char *string, int length); /* the previous version: */ CURL_EXTERN char *curl_escape(const char *string, int length); /* * NAME curl_easy_unescape() * * DESCRIPTION * * Unescapes URL encoding in strings (converts all %XX codes to their 8bit * versions). This function returns a new allocated string or NULL if an error * occurred. * Conversion Note: On non-ASCII platforms the ASCII %XX codes are * converted into the host encoding. */ CURL_EXTERN char *curl_easy_unescape(CURL *handle, const char *string, int length, int *outlength); /* the previous version */ CURL_EXTERN char *curl_unescape(const char *string, int length); /* * NAME curl_free() * * DESCRIPTION * * Provided for de-allocation in the same translation unit that did the * allocation. Added in libcurl 7.10 */ CURL_EXTERN void curl_free(void *p); /* * NAME curl_global_init() * * DESCRIPTION * * curl_global_init() should be invoked exactly once for each application that * uses libcurl and before any call of other libcurl functions. * * This function is not thread-safe! */ CURL_EXTERN CURLcode curl_global_init(long flags); /* * NAME curl_global_init_mem() * * DESCRIPTION * * curl_global_init() or curl_global_init_mem() should be invoked exactly once * for each application that uses libcurl. This function can be used to * initialize libcurl and set user defined memory management callback * functions. Users can implement memory management routines to check for * memory leaks, check for mis-use of the curl library etc. User registered * callback routines with be invoked by this library instead of the system * memory management routines like malloc, free etc. */ CURL_EXTERN CURLcode curl_global_init_mem(long flags, curl_malloc_callback m, curl_free_callback f, curl_realloc_callback r, curl_strdup_callback s, curl_calloc_callback c); /* * NAME curl_global_cleanup() * * DESCRIPTION * * curl_global_cleanup() should be invoked exactly once for each application * that uses libcurl */ CURL_EXTERN void curl_global_cleanup(void); /* linked-list structure for the CURLOPT_QUOTE option (and other) */ struct curl_slist { char *data; struct curl_slist *next; }; /* * NAME curl_slist_append() * * DESCRIPTION * * Appends a string to a linked list. If no list exists, it will be created * first. Returns the new list, after appending. */ CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *, const char *); /* * NAME curl_slist_free_all() * * DESCRIPTION * * free a previously built curl_slist. */ CURL_EXTERN void curl_slist_free_all(struct curl_slist *); /* * NAME curl_getdate() * * DESCRIPTION * * Returns the time, in seconds since 1 Jan 1970 of the time string given in * the first argument. The time argument in the second parameter is unused * and should be set to NULL. */ CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused); /* info about the certificate chain, only for OpenSSL builds. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */ struct curl_certinfo { int num_of_certs; /* number of certificates with information */ struct curl_slist **certinfo; /* for each index in this array, there's a linked list with textual information in the format "name: value" */ }; #define CURLINFO_STRING 0x100000 #define CURLINFO_LONG 0x200000 #define CURLINFO_DOUBLE 0x300000 #define CURLINFO_SLIST 0x400000 #define CURLINFO_MASK 0x0fffff #define CURLINFO_TYPEMASK 0xf00000 typedef enum { CURLINFO_NONE, /* first, never use this */ CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7, CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8, CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9, CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10, CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, CURLINFO_FILETIME = CURLINFO_LONG + 14, CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15, CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16, CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, CURLINFO_PRIVATE = CURLINFO_STRING + 21, CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22, CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27, CURLINFO_COOKIELIST = CURLINFO_SLIST + 28, CURLINFO_LASTSOCKET = CURLINFO_LONG + 29, CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30, CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31, CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32, CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33, CURLINFO_CERTINFO = CURLINFO_SLIST + 34, CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35, CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36, CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37, CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38, CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39, CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40, CURLINFO_LOCAL_IP = CURLINFO_STRING + 41, CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42, /* Fill in new entries below here! */ CURLINFO_LASTONE = 42 } CURLINFO; /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as CURLINFO_HTTP_CODE */ #define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE typedef enum { CURLCLOSEPOLICY_NONE, /* first, never use this */ CURLCLOSEPOLICY_OLDEST, CURLCLOSEPOLICY_LEAST_RECENTLY_USED, CURLCLOSEPOLICY_LEAST_TRAFFIC, CURLCLOSEPOLICY_SLOWEST, CURLCLOSEPOLICY_CALLBACK, CURLCLOSEPOLICY_LAST /* last, never use this */ } curl_closepolicy; #define CURL_GLOBAL_SSL (1<<0) #define CURL_GLOBAL_WIN32 (1<<1) #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) #define CURL_GLOBAL_NOTHING 0 #define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL #define CURL_GLOBAL_ACK_EINTR (1<<2) /***************************************************************************** * Setup defines, protos etc for the sharing stuff. */ /* Different data locks for a single share */ typedef enum { CURL_LOCK_DATA_NONE = 0, /* CURL_LOCK_DATA_SHARE is used internally to say that * the locking is just made to change the internal state of the share * itself. */ CURL_LOCK_DATA_SHARE, CURL_LOCK_DATA_COOKIE, CURL_LOCK_DATA_DNS, CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_DATA_CONNECT, CURL_LOCK_DATA_LAST } curl_lock_data; /* Different lock access types */ typedef enum { CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */ CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */ CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */ CURL_LOCK_ACCESS_LAST /* never use */ } curl_lock_access; typedef void (*curl_lock_function)(CURL *handle, curl_lock_data data, curl_lock_access locktype, void *userptr); typedef void (*curl_unlock_function)(CURL *handle, curl_lock_data data, void *userptr); typedef void CURLSH; typedef enum { CURLSHE_OK, /* all is fine */ CURLSHE_BAD_OPTION, /* 1 */ CURLSHE_IN_USE, /* 2 */ CURLSHE_INVALID, /* 3 */ CURLSHE_NOMEM, /* 4 out of memory */ CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */ CURLSHE_LAST /* never use */ } CURLSHcode; typedef enum { CURLSHOPT_NONE, /* don't use */ CURLSHOPT_SHARE, /* specify a data type to share */ CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */ CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */ CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */ CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock callback functions */ CURLSHOPT_LAST /* never use */ } CURLSHoption; CURL_EXTERN CURLSH *curl_share_init(void); CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...); CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *); /**************************************************************************** * Structures for querying information about the curl library at runtime. */ typedef enum { CURLVERSION_FIRST, CURLVERSION_SECOND, CURLVERSION_THIRD, CURLVERSION_FOURTH, CURLVERSION_LAST /* never actually use this */ } CURLversion; /* The 'CURLVERSION_NOW' is the symbolic name meant to be used by basically all programs ever that want to get version information. It is meant to be a built-in version number for what kind of struct the caller expects. If the struct ever changes, we redefine the NOW to another enum from above. */ #define CURLVERSION_NOW CURLVERSION_FOURTH typedef struct { CURLversion age; /* age of the returned struct */ const char *version; /* LIBCURL_VERSION */ unsigned int version_num; /* LIBCURL_VERSION_NUM */ const char *host; /* OS/host/cpu/machine when configured */ int features; /* bitmask, see defines below */ const char *ssl_version; /* human readable string */ long ssl_version_num; /* not used anymore, always 0 */ const char *libz_version; /* human readable string */ /* protocols is terminated by an entry with a NULL protoname */ const char * const *protocols; /* The fields below this were added in CURLVERSION_SECOND */ const char *ares; int ares_num; /* This field was added in CURLVERSION_THIRD */ const char *libidn; /* These field were added in CURLVERSION_FOURTH */ /* Same as '_libiconv_version' if built with HAVE_ICONV */ int iconv_ver_num; const char *libssh_version; /* human readable string */ } curl_version_info_data; #define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */ #define CURL_VERSION_KERBEROS4 (1<<1) /* kerberos auth is supported */ #define CURL_VERSION_SSL (1<<2) /* SSL options are present */ #define CURL_VERSION_LIBZ (1<<3) /* libz features are present */ #define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */ #define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */ #define CURL_VERSION_DEBUG (1<<6) /* built with debug capabilities */ #define CURL_VERSION_ASYNCHDNS (1<<7) /* asynchronous dns resolves */ #define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth */ #define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */ #define CURL_VERSION_IDN (1<<10) /* International Domain Names support */ #define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */ #define CURL_VERSION_CONV (1<<12) /* character conversions supported */ #define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */ #define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */ #define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegating to winbind helper */ /* * NAME curl_version_info() * * DESCRIPTION * * This function returns a pointer to a static copy of the version info * struct. See above. */ CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion); /* * NAME curl_easy_strerror() * * DESCRIPTION * * The curl_easy_strerror function may be used to turn a CURLcode value * into the equivalent human readable error string. This is useful * for printing meaningful error messages. */ CURL_EXTERN const char *curl_easy_strerror(CURLcode); /* * NAME curl_share_strerror() * * DESCRIPTION * * The curl_share_strerror function may be used to turn a CURLSHcode value * into the equivalent human readable error string. This is useful * for printing meaningful error messages. */ CURL_EXTERN const char *curl_share_strerror(CURLSHcode); /* * NAME curl_easy_pause() * * DESCRIPTION * * The curl_easy_pause function pauses or unpauses transfers. Select the new * state by setting the bitmask, use the convenience defines below. * */ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask); #define CURLPAUSE_RECV (1<<0) #define CURLPAUSE_RECV_CONT (0) #define CURLPAUSE_SEND (1<<2) #define CURLPAUSE_SEND_CONT (0) #define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND) #define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT) #ifdef __cplusplus } #endif /* unfortunately, the easy.h and multi.h include files need options and info stuff before they can be included! */ #include "easy.h" /* nothing in curl is fun without the easy stuff */ #include "multi.h" /* the typechecker doesn't work in C++ (yet) */ #if defined(__GNUC__) && defined(__GNUC_MINOR__) && \ ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \ !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK) #include "typecheck-gcc.h" #else #if defined(__STDC__) && (__STDC__ >= 1) /* This preprocessor magic that replaces a call with the exact same call is only done to make sure application authors pass exactly three arguments to these functions. */ #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param) #define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg) #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) #endif /* __STDC__ >= 1 */ #endif /* gcc >= 4.3 && !__cplusplus */ #endif /* __CURL_CURL_H */ ================================================ FILE: third_party/include/curl/curlbuild.h ================================================ #ifndef __CURL_CURLBUILD_H #define __CURL_CURLBUILD_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* ================================================================ */ /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */ /* ================================================================ */ /* * NOTE 1: * ------- * * See file include/curl/curlbuild.h.in, run configure, and forget * that this file exists it is only used for non-configure systems. * But you can keep reading if you want ;-) * */ /* ================================================================ */ /* NOTES FOR NON-CONFIGURE SYSTEMS */ /* ================================================================ */ /* * NOTE 1: * ------- * * Nothing in this file is intended to be modified or adjusted by the * curl library user nor by the curl library builder. * * If you think that something actually needs to be changed, adjusted * or fixed in this file, then, report it on the libcurl development * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/ * * Try to keep one section per platform, compiler and architecture, * otherwise, if an existing section is reused for a different one and * later on the original is adjusted, probably the piggybacking one can * be adversely changed. * * In order to differentiate between platforms/compilers/architectures * use only compiler built in predefined preprocessor symbols. * * This header file shall only export symbols which are 'curl' or 'CURL' * prefixed, otherwise public name space would be polluted. * * NOTE 2: * ------- * * For any given platform/compiler curl_off_t must be typedef'ed to a * 64-bit wide signed integral data type. The width of this data type * must remain constant and independent of any possible large file * support settings. * * As an exception to the above, curl_off_t shall be typedef'ed to a * 32-bit wide signed integral data type if there is no 64-bit type. * * As a general rule, curl_off_t shall not be mapped to off_t. This * rule shall only be violated if off_t is the only 64-bit data type * available and the size of off_t is independent of large file support * settings. Keep your build on the safe side avoiding an off_t gating. * If you have a 64-bit off_t then take for sure that another 64-bit * data type exists, dig deeper and you will find it. * * NOTE 3: * ------- * * Right now you might be staring at file include/curl/curlbuild.h.dist or * at file include/curl/curlbuild.h, this is due to the following reason: * file include/curl/curlbuild.h.dist is renamed to include/curl/curlbuild.h * when the libcurl source code distribution archive file is created. * * File include/curl/curlbuild.h.dist is not included in the distribution * archive. File include/curl/curlbuild.h is not present in the git tree. * * The distributed include/curl/curlbuild.h file is only intended to be used * on systems which can not run the also distributed configure script. * * On systems capable of running the configure script, the configure process * will overwrite the distributed include/curl/curlbuild.h file with one that * is suitable and specific to the library being configured and built, which * is generated from the include/curl/curlbuild.h.in template file. * * If you check out from git on a non-configure platform, you must run the * appropriate buildconf* script to set up curlbuild.h and other local files. * */ /* ================================================================ */ /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */ /* ================================================================ */ #ifdef CURL_SIZEOF_LONG # error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined #endif #ifdef CURL_TYPEOF_CURL_SOCKLEN_T # error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined #endif #ifdef CURL_SIZEOF_CURL_SOCKLEN_T # error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined #endif #ifdef CURL_TYPEOF_CURL_OFF_T # error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined #endif #ifdef CURL_FORMAT_CURL_OFF_T # error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined #endif #ifdef CURL_FORMAT_CURL_OFF_TU # error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined #endif #ifdef CURL_FORMAT_OFF_T # error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined #endif #ifdef CURL_SIZEOF_CURL_OFF_T # error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined #endif #ifdef CURL_SUFFIX_CURL_OFF_T # error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined #endif #ifdef CURL_SUFFIX_CURL_OFF_TU # error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined #endif /* ================================================================ */ /* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */ /* ================================================================ */ #if defined(__DJGPP__) || defined(__GO32__) # if defined(__DJGPP__) && (__DJGPP__ > 1) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long long # define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_OFF_T "%lld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # else # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 4 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # endif # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(__SALFORDC__) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 4 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(__BORLANDC__) # if (__BORLANDC__ < 0x520) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 4 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # else # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T __int64 # define CURL_FORMAT_CURL_OFF_T "I64d" # define CURL_FORMAT_CURL_OFF_TU "I64u" # define CURL_FORMAT_OFF_T "%I64d" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T i64 # define CURL_SUFFIX_CURL_OFF_TU ui64 # endif # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(__TURBOC__) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 4 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(__WATCOMC__) # if defined(__386__) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T __int64 # define CURL_FORMAT_CURL_OFF_T "I64d" # define CURL_FORMAT_CURL_OFF_TU "I64u" # define CURL_FORMAT_OFF_T "%I64d" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T i64 # define CURL_SUFFIX_CURL_OFF_TU ui64 # else # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 4 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # endif # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(__POCC__) # if (__POCC__ < 280) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 4 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # elif defined(_MSC_VER) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T __int64 # define CURL_FORMAT_CURL_OFF_T "I64d" # define CURL_FORMAT_CURL_OFF_TU "I64u" # define CURL_FORMAT_OFF_T "%I64d" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T i64 # define CURL_SUFFIX_CURL_OFF_TU ui64 # else # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long long # define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_OFF_T "%lld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # endif # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(__LCC__) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 4 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(__SYMBIAN32__) # if defined(__EABI__) /* Treat all ARM compilers equally */ # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long long # define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_OFF_T "%lld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # elif defined(__CW32__) # pragma longlong on # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long long # define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_OFF_T "%lld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # elif defined(__VC32__) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T __int64 # define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_OFF_T "%lld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # endif # define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(__MWERKS__) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long long # define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_OFF_T "%lld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(_WIN32_WCE) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T __int64 # define CURL_FORMAT_CURL_OFF_T "I64d" # define CURL_FORMAT_CURL_OFF_TU "I64u" # define CURL_FORMAT_OFF_T "%I64d" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T i64 # define CURL_SUFFIX_CURL_OFF_TU ui64 # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(__MINGW32__) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long long # define CURL_FORMAT_CURL_OFF_T "I64d" # define CURL_FORMAT_CURL_OFF_TU "I64u" # define CURL_FORMAT_OFF_T "%I64d" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(__VMS) # if defined(__VAX) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 4 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # else # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long long # define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_OFF_T "%lld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # endif # define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 #elif defined(__OS400__) # if defined(__ILEC400__) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long long # define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_OFF_T "%lld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t # define CURL_SIZEOF_CURL_SOCKLEN_T 4 # define CURL_PULL_SYS_TYPES_H 1 # define CURL_PULL_SYS_SOCKET_H 1 # endif #elif defined(__MVS__) # if defined(__IBMC__) || defined(__IBMCPP__) # if defined(_ILP32) # define CURL_SIZEOF_LONG 4 # elif defined(_LP64) # define CURL_SIZEOF_LONG 8 # endif # if defined(_LONG_LONG) # define CURL_TYPEOF_CURL_OFF_T long long # define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_OFF_T "%lld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # elif defined(_LP64) # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # else # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 4 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # endif # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t # define CURL_SIZEOF_CURL_SOCKLEN_T 4 # define CURL_PULL_SYS_TYPES_H 1 # define CURL_PULL_SYS_SOCKET_H 1 # endif #elif defined(__370__) # if defined(__IBMC__) || defined(__IBMCPP__) # if defined(_ILP32) # define CURL_SIZEOF_LONG 4 # elif defined(_LP64) # define CURL_SIZEOF_LONG 8 # endif # if defined(_LONG_LONG) # define CURL_TYPEOF_CURL_OFF_T long long # define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_OFF_T "%lld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # elif defined(_LP64) # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # else # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 4 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # endif # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t # define CURL_SIZEOF_CURL_SOCKLEN_T 4 # define CURL_PULL_SYS_TYPES_H 1 # define CURL_PULL_SYS_SOCKET_H 1 # endif #elif defined(TPF) # define CURL_SIZEOF_LONG 8 # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 /* ===================================== */ /* KEEP MSVC THE PENULTIMATE ENTRY */ /* ===================================== */ #elif defined(_MSC_VER) # if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T __int64 # define CURL_FORMAT_CURL_OFF_T "I64d" # define CURL_FORMAT_CURL_OFF_TU "I64u" # define CURL_FORMAT_OFF_T "%I64d" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T i64 # define CURL_SUFFIX_CURL_OFF_TU ui64 # else # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 4 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # endif # define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SIZEOF_CURL_SOCKLEN_T 4 /* ===================================== */ /* KEEP GENERIC GCC THE LAST ENTRY */ /* ===================================== */ #elif defined(__GNUC__) # if defined(__ILP32__) || \ defined(__i386__) || defined(__ppc__) || defined(__arm__) # define CURL_SIZEOF_LONG 4 # define CURL_TYPEOF_CURL_OFF_T long long # define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_OFF_T "%lld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_TU ULL # elif defined(__LP64__) || \ defined(__x86_64__) || defined(__ppc64__) # define CURL_SIZEOF_LONG 8 # define CURL_TYPEOF_CURL_OFF_T long # define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_OFF_T "%ld" # define CURL_SIZEOF_CURL_OFF_T 8 # define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_TU UL # endif # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t # define CURL_SIZEOF_CURL_SOCKLEN_T 4 # define CURL_PULL_SYS_TYPES_H 1 # define CURL_PULL_SYS_SOCKET_H 1 #else # error "Unknown non-configure build target!" Error Compilation_aborted_Unknown_non_configure_build_target #endif /* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */ /* sys/types.h is required here to properly make type definitions below. */ #ifdef CURL_PULL_SYS_TYPES_H # include #endif /* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */ /* sys/socket.h is required here to properly make type definitions below. */ #ifdef CURL_PULL_SYS_SOCKET_H # include #endif /* Data type definition of curl_socklen_t. */ #ifdef CURL_TYPEOF_CURL_SOCKLEN_T typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; #endif /* Data type definition of curl_off_t. */ #ifdef CURL_TYPEOF_CURL_OFF_T typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; #endif #endif /* __CURL_CURLBUILD_H */ ================================================ FILE: third_party/include/curl/curlrules.h ================================================ #ifndef __CURL_CURLRULES_H #define __CURL_CURLRULES_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* ================================================================ */ /* COMPILE TIME SANITY CHECKS */ /* ================================================================ */ /* * NOTE 1: * ------- * * All checks done in this file are intentionally placed in a public * header file which is pulled by curl/curl.h when an application is * being built using an already built libcurl library. Additionally * this file is also included and used when building the library. * * If compilation fails on this file it is certainly sure that the * problem is elsewhere. It could be a problem in the curlbuild.h * header file, or simply that you are using different compilation * settings than those used to build the library. * * Nothing in this file is intended to be modified or adjusted by the * curl library user nor by the curl library builder. * * Do not deactivate any check, these are done to make sure that the * library is properly built and used. * * You can find further help on the libcurl development mailing list: * http://cool.haxx.se/mailman/listinfo/curl-library/ * * NOTE 2 * ------ * * Some of the following compile time checks are based on the fact * that the dimension of a constant array can not be a negative one. * In this way if the compile time verification fails, the compilation * will fail issuing an error. The error description wording is compiler * dependent but it will be quite similar to one of the following: * * "negative subscript or subscript is too large" * "array must have at least one element" * "-1 is an illegal array size" * "size of array is negative" * * If you are building an application which tries to use an already * built libcurl library and you are getting this kind of errors on * this file, it is a clear indication that there is a mismatch between * how the library was built and how you are trying to use it for your * application. Your already compiled or binary library provider is the * only one who can give you the details you need to properly use it. */ /* * Verify that some macros are actually defined. */ #ifndef CURL_SIZEOF_LONG # error "CURL_SIZEOF_LONG definition is missing!" Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing #endif #ifndef CURL_TYPEOF_CURL_SOCKLEN_T # error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!" Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing #endif #ifndef CURL_SIZEOF_CURL_SOCKLEN_T # error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!" Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing #endif #ifndef CURL_TYPEOF_CURL_OFF_T # error "CURL_TYPEOF_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing #endif #ifndef CURL_FORMAT_CURL_OFF_T # error "CURL_FORMAT_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing #endif #ifndef CURL_FORMAT_CURL_OFF_TU # error "CURL_FORMAT_CURL_OFF_TU definition is missing!" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing #endif #ifndef CURL_FORMAT_OFF_T # error "CURL_FORMAT_OFF_T definition is missing!" Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing #endif #ifndef CURL_SIZEOF_CURL_OFF_T # error "CURL_SIZEOF_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing #endif #ifndef CURL_SUFFIX_CURL_OFF_T # error "CURL_SUFFIX_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing #endif #ifndef CURL_SUFFIX_CURL_OFF_TU # error "CURL_SUFFIX_CURL_OFF_TU definition is missing!" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing #endif /* * Macros private to this header file. */ #define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1 #define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1 /* * Verify that the size previously defined and expected for long * is the same as the one reported by sizeof() at compile time. */ typedef char __curl_rule_01__ [CurlchkszEQ(long, CURL_SIZEOF_LONG)]; /* * Verify that the size previously defined and expected for * curl_off_t is actually the the same as the one reported * by sizeof() at compile time. */ typedef char __curl_rule_02__ [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)]; /* * Verify at compile time that the size of curl_off_t as reported * by sizeof() is greater or equal than the one reported for long * for the current compilation. */ typedef char __curl_rule_03__ [CurlchkszGE(curl_off_t, long)]; /* * Verify that the size previously defined and expected for * curl_socklen_t is actually the the same as the one reported * by sizeof() at compile time. */ typedef char __curl_rule_04__ [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)]; /* * Verify at compile time that the size of curl_socklen_t as reported * by sizeof() is greater or equal than the one reported for int for * the current compilation. */ typedef char __curl_rule_05__ [CurlchkszGE(curl_socklen_t, int)]; /* ================================================================ */ /* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */ /* ================================================================ */ /* * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow * these to be visible and exported by the external libcurl interface API, * while also making them visible to the library internals, simply including * curl_setup.h, without actually needing to include curl.h internally. * If some day this section would grow big enough, all this should be moved * to its own header file. */ /* * Figure out if we can use the ## preprocessor operator, which is supported * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ * or __cplusplus so we need to carefully check for them too. */ #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \ defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \ defined(__ILEC400__) /* This compiler is believed to have an ISO compatible preprocessor */ #define CURL_ISOCPP #else /* This compiler is believed NOT to have an ISO compatible preprocessor */ #undef CURL_ISOCPP #endif /* * Macros for minimum-width signed and unsigned curl_off_t integer constants. */ #if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551) # define __CURL_OFF_T_C_HLPR2(x) x # define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x) # define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T) # define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU) #else # ifdef CURL_ISOCPP # define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix # else # define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix # endif # define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix) # define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T) # define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU) #endif /* * Get rid of macros private to this header file. */ #undef CurlchkszEQ #undef CurlchkszGE /* * Get rid of macros not intended to exist beyond this point. */ #undef CURL_PULL_WS2TCPIP_H #undef CURL_PULL_SYS_TYPES_H #undef CURL_PULL_SYS_SOCKET_H #undef CURL_PULL_SYS_POLL_H #undef CURL_PULL_STDINT_H #undef CURL_PULL_INTTYPES_H #undef CURL_TYPEOF_CURL_SOCKLEN_T #undef CURL_TYPEOF_CURL_OFF_T #ifdef CURL_NO_OLDIES #undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */ #endif #endif /* __CURL_CURLRULES_H */ ================================================ FILE: third_party/include/curl/curlver.h ================================================ #ifndef __CURL_CURLVER_H #define __CURL_CURLVER_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This header file contains nothing but libcurl version info, generated by a script at release-time. This was made its own header file in 7.11.2 */ /* This is the global package copyright */ #define LIBCURL_COPYRIGHT "1996 - 2013 Daniel Stenberg, ." /* This is the version number of the libcurl package from which this header file origins: */ #define LIBCURL_VERSION "7.30.0-DEV" /* The numeric version number is also available "in parts" by using these defines: */ #define LIBCURL_VERSION_MAJOR 7 #define LIBCURL_VERSION_MINOR 30 #define LIBCURL_VERSION_PATCH 0 /* This is the numeric version of the libcurl version number, meant for easier parsing and comparions by programs. The LIBCURL_VERSION_NUM define will always follow this syntax: 0xXXYYZZ Where XX, YY and ZZ are the main version, release and patch numbers in hexadecimal (using 8 bits each). All three numbers are always represented using two digits. 1.2 would appear as "0x010200" while version 9.11.7 appears as "0x090b07". This 6-digit (24 bits) hexadecimal number does not show pre-release number, and it is always a greater number in a more recent release. It makes comparisons with greater than and less than work. */ #define LIBCURL_VERSION_NUM 0x071e00 /* * This is the date and time when the full source package was created. The * timestamp is not stored in git, as the timestamp is properly set in the * tarballs by the maketgz script. * * The format of the date should follow this template: * * "Mon Feb 12 11:35:33 UTC 2007" */ #define LIBCURL_TIMESTAMP "DEV" #endif /* __CURL_CURLVER_H */ ================================================ FILE: third_party/include/curl/easy.h ================================================ #ifndef __CURL_EASY_H #define __CURL_EASY_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #ifdef __cplusplus extern "C" { #endif CURL_EXTERN CURL *curl_easy_init(void); CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); CURL_EXTERN void curl_easy_cleanup(CURL *curl); /* * NAME curl_easy_getinfo() * * DESCRIPTION * * Request internal information from the curl session with this function. The * third argument MUST be a pointer to a long, a pointer to a char * or a * pointer to a double (as the documentation describes elsewhere). The data * pointed to will be filled in accordingly and can be relied upon only if the * function returns CURLE_OK. This function is intended to get used *AFTER* a * performed transfer, all results from this function are undefined until the * transfer is completed. */ CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); /* * NAME curl_easy_duphandle() * * DESCRIPTION * * Creates a new curl session handle with the same options set for the handle * passed in. Duplicating a handle could only be a matter of cloning data and * options, internal state info and things like persistent connections cannot * be transferred. It is useful in multithreaded applications when you can run * curl_easy_duphandle() for each new thread to avoid a series of identical * curl_easy_setopt() invokes in every thread. */ CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl); /* * NAME curl_easy_reset() * * DESCRIPTION * * Re-initializes a CURL handle to the default values. This puts back the * handle to the same state as it was in when it was just created. * * It does keep: live connections, the Session ID cache, the DNS cache and the * cookies. */ CURL_EXTERN void curl_easy_reset(CURL *curl); /* * NAME curl_easy_recv() * * DESCRIPTION * * Receives data from the connected socket. Use after successful * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. */ CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n); /* * NAME curl_easy_send() * * DESCRIPTION * * Sends data over the connected socket. Use after successful * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. */ CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, size_t buflen, size_t *n); #ifdef __cplusplus } #endif #endif ================================================ FILE: third_party/include/curl/mprintf.h ================================================ #ifndef __CURL_MPRINTF_H #define __CURL_MPRINTF_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include #include /* needed for FILE */ #include "curl.h" #ifdef __cplusplus extern "C" { #endif CURL_EXTERN int curl_mprintf(const char *format, ...); CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...); CURL_EXTERN int curl_mvprintf(const char *format, va_list args); CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args); CURL_EXTERN char *curl_maprintf(const char *format, ...); CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); #ifdef _MPRINTF_REPLACE # undef printf # undef fprintf # undef sprintf # undef vsprintf # undef snprintf # undef vprintf # undef vfprintf # undef vsnprintf # undef aprintf # undef vaprintf # define printf curl_mprintf # define fprintf curl_mfprintf #ifdef CURLDEBUG /* When built with CURLDEBUG we define away the sprintf functions since we don't want internal code to be using them */ # define sprintf sprintf_was_used # define vsprintf vsprintf_was_used #else # define sprintf curl_msprintf # define vsprintf curl_mvsprintf #endif # define snprintf curl_msnprintf # define vprintf curl_mvprintf # define vfprintf curl_mvfprintf # define vsnprintf curl_mvsnprintf # define aprintf curl_maprintf # define vaprintf curl_mvaprintf #endif #ifdef __cplusplus } #endif #endif /* __CURL_MPRINTF_H */ ================================================ FILE: third_party/include/curl/multi.h ================================================ #ifndef __CURL_MULTI_H #define __CURL_MULTI_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This is an "external" header file. Don't give away any internals here! GOALS o Enable a "pull" interface. The application that uses libcurl decides where and when to ask libcurl to get/send data. o Enable multiple simultaneous transfers in the same thread without making it complicated for the application. o Enable the application to select() on its own file descriptors and curl's file descriptors simultaneous easily. */ /* * This header file should not really need to include "curl.h" since curl.h * itself includes this file and we expect user applications to do #include * without the need for especially including multi.h. * * For some reason we added this include here at one point, and rather than to * break existing (wrongly written) libcurl applications, we leave it as-is * but with this warning attached. */ #include "curl.h" #ifdef __cplusplus extern "C" { #endif typedef void CURLM; typedef enum { CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or curl_multi_socket*() soon */ CURLM_OK, CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ CURLM_LAST } CURLMcode; /* just to make code nicer when using curl_multi_socket() you can now check for CURLM_CALL_MULTI_SOCKET too in the same style it works for curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ #define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM typedef enum { CURLMSG_NONE, /* first, not used */ CURLMSG_DONE, /* This easy handle has completed. 'result' contains the CURLcode of the transfer */ CURLMSG_LAST /* last, not used */ } CURLMSG; struct CURLMsg { CURLMSG msg; /* what this message means */ CURL *easy_handle; /* the handle it concerns */ union { void *whatever; /* message-specific data */ CURLcode result; /* return code for transfer */ } data; }; typedef struct CURLMsg CURLMsg; /* Based on poll(2) structure and values. * We don't use pollfd and POLL* constants explicitly * to cover platforms without poll(). */ #define CURL_WAIT_POLLIN 0x0001 #define CURL_WAIT_POLLPRI 0x0002 #define CURL_WAIT_POLLOUT 0x0004 struct curl_waitfd { curl_socket_t fd; short events; short revents; /* not supported yet */ }; /* * Name: curl_multi_init() * * Desc: inititalize multi-style curl usage * * Returns: a new CURLM handle to use in all 'curl_multi' functions. */ CURL_EXTERN CURLM *curl_multi_init(void); /* * Name: curl_multi_add_handle() * * Desc: add a standard curl handle to the multi stack * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, CURL *curl_handle); /* * Name: curl_multi_remove_handle() * * Desc: removes a curl handle from the multi stack again * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, CURL *curl_handle); /* * Name: curl_multi_fdset() * * Desc: Ask curl for its fd_set sets. The app can use these to select() or * poll() on. We want curl_multi_perform() called as soon as one of * them are ready. * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, fd_set *read_fd_set, fd_set *write_fd_set, fd_set *exc_fd_set, int *max_fd); /* * Name: curl_multi_wait() * * Desc: Poll on all fds within a CURLM set as well as any * additional fds passed to the function. * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, struct curl_waitfd extra_fds[], unsigned int extra_nfds, int timeout_ms, int *ret); /* * Name: curl_multi_perform() * * Desc: When the app thinks there's data available for curl it calls this * function to read/write whatever there is right now. This returns * as soon as the reads and writes are done. This function does not * require that there actually is data available for reading or that * data can be written, it can be called just in case. It returns * the number of handles that still transfer data in the second * argument's integer-pointer. * * Returns: CURLMcode type, general multi error code. *NOTE* that this only * returns errors etc regarding the whole multi stack. There might * still have occurred problems on invidual transfers even when this * returns OK. */ CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles); /* * Name: curl_multi_cleanup() * * Desc: Cleans up and removes a whole multi stack. It does not free or * touch any individual easy handles in any way. We need to define * in what state those handles will be if this function is called * in the middle of a transfer. * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); /* * Name: curl_multi_info_read() * * Desc: Ask the multi handle if there's any messages/informationals from * the individual transfers. Messages include informationals such as * error code from the transfer or just the fact that a transfer is * completed. More details on these should be written down as well. * * Repeated calls to this function will return a new struct each * time, until a special "end of msgs" struct is returned as a signal * that there is no more to get at this point. * * The data the returned pointer points to will not survive calling * curl_multi_cleanup(). * * The 'CURLMsg' struct is meant to be very simple and only contain * very basic informations. If more involved information is wanted, * we will provide the particular "transfer handle" in that struct * and that should/could/would be used in subsequent * curl_easy_getinfo() calls (or similar). The point being that we * must never expose complex structs to applications, as then we'll * undoubtably get backwards compatibility problems in the future. * * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out * of structs. It also writes the number of messages left in the * queue (after this read) in the integer the second argument points * to. */ CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue); /* * Name: curl_multi_strerror() * * Desc: The curl_multi_strerror function may be used to turn a CURLMcode * value into the equivalent human readable error string. This is * useful for printing meaningful error messages. * * Returns: A pointer to a zero-terminated error message. */ CURL_EXTERN const char *curl_multi_strerror(CURLMcode); /* * Name: curl_multi_socket() and * curl_multi_socket_all() * * Desc: An alternative version of curl_multi_perform() that allows the * application to pass in one of the file descriptors that have been * detected to have "action" on them and let libcurl perform. * See man page for details. */ #define CURL_POLL_NONE 0 #define CURL_POLL_IN 1 #define CURL_POLL_OUT 2 #define CURL_POLL_INOUT 3 #define CURL_POLL_REMOVE 4 #define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD #define CURL_CSELECT_IN 0x01 #define CURL_CSELECT_OUT 0x02 #define CURL_CSELECT_ERR 0x04 typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ curl_socket_t s, /* socket */ int what, /* see above */ void *userp, /* private callback pointer */ void *socketp); /* private socket pointer */ /* * Name: curl_multi_timer_callback * * Desc: Called by libcurl whenever the library detects a change in the * maximum number of milliseconds the app is allowed to wait before * curl_multi_socket() or curl_multi_perform() must be called * (to allow libcurl's timed events to take place). * * Returns: The callback should return zero. */ typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ long timeout_ms, /* see above */ void *userp); /* private callback pointer */ CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, int *running_handles); CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, curl_socket_t s, int ev_bitmask, int *running_handles); CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, int *running_handles); #ifndef CURL_ALLOW_OLD_MULTI_SOCKET /* This macro below was added in 7.16.3 to push users who recompile to use the new curl_multi_socket_action() instead of the old curl_multi_socket() */ #define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) #endif /* * Name: curl_multi_timeout() * * Desc: Returns the maximum number of milliseconds the app is allowed to * wait before curl_multi_socket() or curl_multi_perform() must be * called (to allow libcurl's timed events to take place). * * Returns: CURLM error code. */ CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, long *milliseconds); #undef CINIT /* re-using the same name as in curl.h */ #ifdef CURL_ISOCPP #define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num #else /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ #define LONG CURLOPTTYPE_LONG #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT #define OFF_T CURLOPTTYPE_OFF_T #define CINIT(name,type,number) CURLMOPT_/**/name = type + number #endif typedef enum { /* This is the socket callback function pointer */ CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), /* This is the argument passed to the socket callback */ CINIT(SOCKETDATA, OBJECTPOINT, 2), /* set to 1 to enable pipelining for this multi handle */ CINIT(PIPELINING, LONG, 3), /* This is the timer callback function pointer */ CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), /* This is the argument passed to the timer callback */ CINIT(TIMERDATA, OBJECTPOINT, 5), /* maximum number of entries in the connection cache */ CINIT(MAXCONNECTS, LONG, 6), /* maximum number of (pipelining) connections to one host */ CINIT(MAX_HOST_CONNECTIONS, LONG, 7), /* maximum number of requests in a pipeline */ CINIT(MAX_PIPELINE_LENGTH, LONG, 8), /* a connection with a content-length longer than this will not be considered for pipelining */ CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9), /* a connection with a chunk length longer than this will not be considered for pipelining */ CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10), /* a list of site names(+port) that are blacklisted from pipelining */ CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11), /* a list of server types that are blacklisted from pipelining */ CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12), /* maximum number of open connections in total */ CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13), CURLMOPT_LASTENTRY /* the last unused */ } CURLMoption; /* * Name: curl_multi_setopt() * * Desc: Sets options for the multi handle. * * Returns: CURLM error code. */ CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, CURLMoption option, ...); /* * Name: curl_multi_assign() * * Desc: This function sets an association in the multi handle between the * given socket and a private pointer of the application. This is * (only) useful for curl_multi_socket uses. * * Returns: CURLM error code. */ CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, curl_socket_t sockfd, void *sockp); #ifdef __cplusplus } /* end of extern "C" */ #endif #endif ================================================ FILE: third_party/include/curl/stdcheaders.h ================================================ #ifndef __STDC_HEADERS_H #define __STDC_HEADERS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include size_t fread (void *, size_t, size_t, FILE *); size_t fwrite (const void *, size_t, size_t, FILE *); int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #endif /* __STDC_HEADERS_H */ ================================================ FILE: third_party/include/curl/typecheck-gcc.h ================================================ #ifndef __CURL_TYPECHECK_GCC_H #define __CURL_TYPECHECK_GCC_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* wraps curl_easy_setopt() with typechecking */ /* To add a new kind of warning, add an * if(_curl_is_sometype_option(_curl_opt)) * if(!_curl_is_sometype(value)) * _curl_easy_setopt_err_sometype(); * block and define _curl_is_sometype_option, _curl_is_sometype and * _curl_easy_setopt_err_sometype below * * NOTE: We use two nested 'if' statements here instead of the && operator, in * order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x * when compiling with -Wlogical-op. * * To add an option that uses the same type as an existing option, you'll just * need to extend the appropriate _curl_*_option macro */ #define curl_easy_setopt(handle, option, value) \ __extension__ ({ \ __typeof__ (option) _curl_opt = option; \ if(__builtin_constant_p(_curl_opt)) { \ if(_curl_is_long_option(_curl_opt)) \ if(!_curl_is_long(value)) \ _curl_easy_setopt_err_long(); \ if(_curl_is_off_t_option(_curl_opt)) \ if(!_curl_is_off_t(value)) \ _curl_easy_setopt_err_curl_off_t(); \ if(_curl_is_string_option(_curl_opt)) \ if(!_curl_is_string(value)) \ _curl_easy_setopt_err_string(); \ if(_curl_is_write_cb_option(_curl_opt)) \ if(!_curl_is_write_cb(value)) \ _curl_easy_setopt_err_write_callback(); \ if((_curl_opt) == CURLOPT_READFUNCTION) \ if(!_curl_is_read_cb(value)) \ _curl_easy_setopt_err_read_cb(); \ if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \ if(!_curl_is_ioctl_cb(value)) \ _curl_easy_setopt_err_ioctl_cb(); \ if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \ if(!_curl_is_sockopt_cb(value)) \ _curl_easy_setopt_err_sockopt_cb(); \ if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \ if(!_curl_is_opensocket_cb(value)) \ _curl_easy_setopt_err_opensocket_cb(); \ if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \ if(!_curl_is_progress_cb(value)) \ _curl_easy_setopt_err_progress_cb(); \ if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \ if(!_curl_is_debug_cb(value)) \ _curl_easy_setopt_err_debug_cb(); \ if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \ if(!_curl_is_ssl_ctx_cb(value)) \ _curl_easy_setopt_err_ssl_ctx_cb(); \ if(_curl_is_conv_cb_option(_curl_opt)) \ if(!_curl_is_conv_cb(value)) \ _curl_easy_setopt_err_conv_cb(); \ if((_curl_opt) == CURLOPT_SEEKFUNCTION) \ if(!_curl_is_seek_cb(value)) \ _curl_easy_setopt_err_seek_cb(); \ if(_curl_is_cb_data_option(_curl_opt)) \ if(!_curl_is_cb_data(value)) \ _curl_easy_setopt_err_cb_data(); \ if((_curl_opt) == CURLOPT_ERRORBUFFER) \ if(!_curl_is_error_buffer(value)) \ _curl_easy_setopt_err_error_buffer(); \ if((_curl_opt) == CURLOPT_STDERR) \ if(!_curl_is_FILE(value)) \ _curl_easy_setopt_err_FILE(); \ if(_curl_is_postfields_option(_curl_opt)) \ if(!_curl_is_postfields(value)) \ _curl_easy_setopt_err_postfields(); \ if((_curl_opt) == CURLOPT_HTTPPOST) \ if(!_curl_is_arr((value), struct curl_httppost)) \ _curl_easy_setopt_err_curl_httpost(); \ if(_curl_is_slist_option(_curl_opt)) \ if(!_curl_is_arr((value), struct curl_slist)) \ _curl_easy_setopt_err_curl_slist(); \ if((_curl_opt) == CURLOPT_SHARE) \ if(!_curl_is_ptr((value), CURLSH)) \ _curl_easy_setopt_err_CURLSH(); \ } \ curl_easy_setopt(handle, _curl_opt, value); \ }) /* wraps curl_easy_getinfo() with typechecking */ /* FIXME: don't allow const pointers */ #define curl_easy_getinfo(handle, info, arg) \ __extension__ ({ \ __typeof__ (info) _curl_info = info; \ if(__builtin_constant_p(_curl_info)) { \ if(_curl_is_string_info(_curl_info)) \ if(!_curl_is_arr((arg), char *)) \ _curl_easy_getinfo_err_string(); \ if(_curl_is_long_info(_curl_info)) \ if(!_curl_is_arr((arg), long)) \ _curl_easy_getinfo_err_long(); \ if(_curl_is_double_info(_curl_info)) \ if(!_curl_is_arr((arg), double)) \ _curl_easy_getinfo_err_double(); \ if(_curl_is_slist_info(_curl_info)) \ if(!_curl_is_arr((arg), struct curl_slist *)) \ _curl_easy_getinfo_err_curl_slist(); \ } \ curl_easy_getinfo(handle, _curl_info, arg); \ }) /* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(), * for now just make sure that the functions are called with three * arguments */ #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) /* the actual warnings, triggered by calling the _curl_easy_setopt_err* * functions */ /* To define a new warning, use _CURL_WARNING(identifier, "message") */ #define _CURL_WARNING(id, message) \ static void __attribute__((__warning__(message))) \ __attribute__((__unused__)) __attribute__((__noinline__)) \ id(void) { __asm__(""); } _CURL_WARNING(_curl_easy_setopt_err_long, "curl_easy_setopt expects a long argument for this option") _CURL_WARNING(_curl_easy_setopt_err_curl_off_t, "curl_easy_setopt expects a curl_off_t argument for this option") _CURL_WARNING(_curl_easy_setopt_err_string, "curl_easy_setopt expects a " "string (char* or char[]) argument for this option" ) _CURL_WARNING(_curl_easy_setopt_err_write_callback, "curl_easy_setopt expects a curl_write_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_read_cb, "curl_easy_setopt expects a curl_read_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_ioctl_cb, "curl_easy_setopt expects a curl_ioctl_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_sockopt_cb, "curl_easy_setopt expects a curl_sockopt_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_opensocket_cb, "curl_easy_setopt expects a " "curl_opensocket_callback argument for this option" ) _CURL_WARNING(_curl_easy_setopt_err_progress_cb, "curl_easy_setopt expects a curl_progress_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_debug_cb, "curl_easy_setopt expects a curl_debug_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb, "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_conv_cb, "curl_easy_setopt expects a curl_conv_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_seek_cb, "curl_easy_setopt expects a curl_seek_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_cb_data, "curl_easy_setopt expects a " "private data pointer as argument for this option") _CURL_WARNING(_curl_easy_setopt_err_error_buffer, "curl_easy_setopt expects a " "char buffer of CURL_ERROR_SIZE as argument for this option") _CURL_WARNING(_curl_easy_setopt_err_FILE, "curl_easy_setopt expects a FILE* argument for this option") _CURL_WARNING(_curl_easy_setopt_err_postfields, "curl_easy_setopt expects a void* or char* argument for this option") _CURL_WARNING(_curl_easy_setopt_err_curl_httpost, "curl_easy_setopt expects a struct curl_httppost* argument for this option") _CURL_WARNING(_curl_easy_setopt_err_curl_slist, "curl_easy_setopt expects a struct curl_slist* argument for this option") _CURL_WARNING(_curl_easy_setopt_err_CURLSH, "curl_easy_setopt expects a CURLSH* argument for this option") _CURL_WARNING(_curl_easy_getinfo_err_string, "curl_easy_getinfo expects a pointer to char * for this info") _CURL_WARNING(_curl_easy_getinfo_err_long, "curl_easy_getinfo expects a pointer to long for this info") _CURL_WARNING(_curl_easy_getinfo_err_double, "curl_easy_getinfo expects a pointer to double for this info") _CURL_WARNING(_curl_easy_getinfo_err_curl_slist, "curl_easy_getinfo expects a pointer to struct curl_slist * for this info") /* groups of curl_easy_setops options that take the same type of argument */ /* To add a new option to one of the groups, just add * (option) == CURLOPT_SOMETHING * to the or-expression. If the option takes a long or curl_off_t, you don't * have to do anything */ /* evaluates to true if option takes a long argument */ #define _curl_is_long_option(option) \ (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT) #define _curl_is_off_t_option(option) \ ((option) > CURLOPTTYPE_OFF_T) /* evaluates to true if option takes a char* argument */ #define _curl_is_string_option(option) \ ((option) == CURLOPT_URL || \ (option) == CURLOPT_PROXY || \ (option) == CURLOPT_INTERFACE || \ (option) == CURLOPT_NETRC_FILE || \ (option) == CURLOPT_USERPWD || \ (option) == CURLOPT_USERNAME || \ (option) == CURLOPT_PASSWORD || \ (option) == CURLOPT_PROXYUSERPWD || \ (option) == CURLOPT_PROXYUSERNAME || \ (option) == CURLOPT_PROXYPASSWORD || \ (option) == CURLOPT_NOPROXY || \ (option) == CURLOPT_ACCEPT_ENCODING || \ (option) == CURLOPT_REFERER || \ (option) == CURLOPT_USERAGENT || \ (option) == CURLOPT_COOKIE || \ (option) == CURLOPT_COOKIEFILE || \ (option) == CURLOPT_COOKIEJAR || \ (option) == CURLOPT_COOKIELIST || \ (option) == CURLOPT_FTPPORT || \ (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \ (option) == CURLOPT_FTP_ACCOUNT || \ (option) == CURLOPT_RANGE || \ (option) == CURLOPT_CUSTOMREQUEST || \ (option) == CURLOPT_SSLCERT || \ (option) == CURLOPT_SSLCERTTYPE || \ (option) == CURLOPT_SSLKEY || \ (option) == CURLOPT_SSLKEYTYPE || \ (option) == CURLOPT_KEYPASSWD || \ (option) == CURLOPT_SSLENGINE || \ (option) == CURLOPT_CAINFO || \ (option) == CURLOPT_CAPATH || \ (option) == CURLOPT_RANDOM_FILE || \ (option) == CURLOPT_EGDSOCKET || \ (option) == CURLOPT_SSL_CIPHER_LIST || \ (option) == CURLOPT_KRBLEVEL || \ (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \ (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \ (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \ (option) == CURLOPT_CRLFILE || \ (option) == CURLOPT_ISSUERCERT || \ (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \ (option) == CURLOPT_SSH_KNOWNHOSTS || \ (option) == CURLOPT_MAIL_FROM || \ (option) == CURLOPT_RTSP_SESSION_ID || \ (option) == CURLOPT_RTSP_STREAM_URI || \ (option) == CURLOPT_RTSP_TRANSPORT || \ 0) /* evaluates to true if option takes a curl_write_callback argument */ #define _curl_is_write_cb_option(option) \ ((option) == CURLOPT_HEADERFUNCTION || \ (option) == CURLOPT_WRITEFUNCTION) /* evaluates to true if option takes a curl_conv_callback argument */ #define _curl_is_conv_cb_option(option) \ ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \ (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \ (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION) /* evaluates to true if option takes a data argument to pass to a callback */ #define _curl_is_cb_data_option(option) \ ((option) == CURLOPT_WRITEDATA || \ (option) == CURLOPT_READDATA || \ (option) == CURLOPT_IOCTLDATA || \ (option) == CURLOPT_SOCKOPTDATA || \ (option) == CURLOPT_OPENSOCKETDATA || \ (option) == CURLOPT_PROGRESSDATA || \ (option) == CURLOPT_WRITEHEADER || \ (option) == CURLOPT_DEBUGDATA || \ (option) == CURLOPT_SSL_CTX_DATA || \ (option) == CURLOPT_SEEKDATA || \ (option) == CURLOPT_PRIVATE || \ (option) == CURLOPT_SSH_KEYDATA || \ (option) == CURLOPT_INTERLEAVEDATA || \ (option) == CURLOPT_CHUNK_DATA || \ (option) == CURLOPT_FNMATCH_DATA || \ 0) /* evaluates to true if option takes a POST data argument (void* or char*) */ #define _curl_is_postfields_option(option) \ ((option) == CURLOPT_POSTFIELDS || \ (option) == CURLOPT_COPYPOSTFIELDS || \ 0) /* evaluates to true if option takes a struct curl_slist * argument */ #define _curl_is_slist_option(option) \ ((option) == CURLOPT_HTTPHEADER || \ (option) == CURLOPT_HTTP200ALIASES || \ (option) == CURLOPT_QUOTE || \ (option) == CURLOPT_POSTQUOTE || \ (option) == CURLOPT_PREQUOTE || \ (option) == CURLOPT_TELNETOPTIONS || \ (option) == CURLOPT_MAIL_RCPT || \ 0) /* groups of curl_easy_getinfo infos that take the same type of argument */ /* evaluates to true if info expects a pointer to char * argument */ #define _curl_is_string_info(info) \ (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG) /* evaluates to true if info expects a pointer to long argument */ #define _curl_is_long_info(info) \ (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE) /* evaluates to true if info expects a pointer to double argument */ #define _curl_is_double_info(info) \ (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST) /* true if info expects a pointer to struct curl_slist * argument */ #define _curl_is_slist_info(info) \ (CURLINFO_SLIST < (info)) /* typecheck helpers -- check whether given expression has requested type*/ /* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros, * otherwise define a new macro. Search for __builtin_types_compatible_p * in the GCC manual. * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is * the actual expression passed to the curl_easy_setopt macro. This * means that you can only apply the sizeof and __typeof__ operators, no * == or whatsoever. */ /* XXX: should evaluate to true iff expr is a pointer */ #define _curl_is_any_ptr(expr) \ (sizeof(expr) == sizeof(void*)) /* evaluates to true if expr is NULL */ /* XXX: must not evaluate expr, so this check is not accurate */ #define _curl_is_NULL(expr) \ (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL))) /* evaluates to true if expr is type*, const type* or NULL */ #define _curl_is_ptr(expr, type) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), type *) || \ __builtin_types_compatible_p(__typeof__(expr), const type *)) /* evaluates to true if expr is one of type[], type*, NULL or const type* */ #define _curl_is_arr(expr, type) \ (_curl_is_ptr((expr), type) || \ __builtin_types_compatible_p(__typeof__(expr), type [])) /* evaluates to true if expr is a string */ #define _curl_is_string(expr) \ (_curl_is_arr((expr), char) || \ _curl_is_arr((expr), signed char) || \ _curl_is_arr((expr), unsigned char)) /* evaluates to true if expr is a long (no matter the signedness) * XXX: for now, int is also accepted (and therefore short and char, which * are promoted to int when passed to a variadic function) */ #define _curl_is_long(expr) \ (__builtin_types_compatible_p(__typeof__(expr), long) || \ __builtin_types_compatible_p(__typeof__(expr), signed long) || \ __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \ __builtin_types_compatible_p(__typeof__(expr), int) || \ __builtin_types_compatible_p(__typeof__(expr), signed int) || \ __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \ __builtin_types_compatible_p(__typeof__(expr), short) || \ __builtin_types_compatible_p(__typeof__(expr), signed short) || \ __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \ __builtin_types_compatible_p(__typeof__(expr), char) || \ __builtin_types_compatible_p(__typeof__(expr), signed char) || \ __builtin_types_compatible_p(__typeof__(expr), unsigned char)) /* evaluates to true if expr is of type curl_off_t */ #define _curl_is_off_t(expr) \ (__builtin_types_compatible_p(__typeof__(expr), curl_off_t)) /* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ /* XXX: also check size of an char[] array? */ #define _curl_is_error_buffer(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), char *) || \ __builtin_types_compatible_p(__typeof__(expr), char[])) /* evaluates to true if expr is of type (const) void* or (const) FILE* */ #if 0 #define _curl_is_cb_data(expr) \ (_curl_is_ptr((expr), void) || \ _curl_is_ptr((expr), FILE)) #else /* be less strict */ #define _curl_is_cb_data(expr) \ _curl_is_any_ptr(expr) #endif /* evaluates to true if expr is of type FILE* */ #define _curl_is_FILE(expr) \ (__builtin_types_compatible_p(__typeof__(expr), FILE *)) /* evaluates to true if expr can be passed as POST data (void* or char*) */ #define _curl_is_postfields(expr) \ (_curl_is_ptr((expr), void) || \ _curl_is_arr((expr), char)) /* FIXME: the whole callback checking is messy... * The idea is to tolerate char vs. void and const vs. not const * pointers in arguments at least */ /* helper: __builtin_types_compatible_p distinguishes between functions and * function pointers, hide it */ #define _curl_callback_compatible(func, type) \ (__builtin_types_compatible_p(__typeof__(func), type) || \ __builtin_types_compatible_p(__typeof__(func), type*)) /* evaluates to true if expr is of type curl_read_callback or "similar" */ #define _curl_is_read_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \ __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \ _curl_callback_compatible((expr), _curl_read_callback1) || \ _curl_callback_compatible((expr), _curl_read_callback2) || \ _curl_callback_compatible((expr), _curl_read_callback3) || \ _curl_callback_compatible((expr), _curl_read_callback4) || \ _curl_callback_compatible((expr), _curl_read_callback5) || \ _curl_callback_compatible((expr), _curl_read_callback6)) typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*); typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*); typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*); typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*); typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*); typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*); /* evaluates to true if expr is of type curl_write_callback or "similar" */ #define _curl_is_write_cb(expr) \ (_curl_is_read_cb(expr) || \ __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \ __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \ _curl_callback_compatible((expr), _curl_write_callback1) || \ _curl_callback_compatible((expr), _curl_write_callback2) || \ _curl_callback_compatible((expr), _curl_write_callback3) || \ _curl_callback_compatible((expr), _curl_write_callback4) || \ _curl_callback_compatible((expr), _curl_write_callback5) || \ _curl_callback_compatible((expr), _curl_write_callback6)) typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*); typedef size_t (_curl_write_callback2)(const char *, size_t, size_t, const void*); typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*); typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*); typedef size_t (_curl_write_callback5)(const void *, size_t, size_t, const void*); typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*); /* evaluates to true if expr is of type curl_ioctl_callback or "similar" */ #define _curl_is_ioctl_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \ _curl_callback_compatible((expr), _curl_ioctl_callback1) || \ _curl_callback_compatible((expr), _curl_ioctl_callback2) || \ _curl_callback_compatible((expr), _curl_ioctl_callback3) || \ _curl_callback_compatible((expr), _curl_ioctl_callback4)) typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*); typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*); typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*); typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*); /* evaluates to true if expr is of type curl_sockopt_callback or "similar" */ #define _curl_is_sockopt_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \ _curl_callback_compatible((expr), _curl_sockopt_callback1) || \ _curl_callback_compatible((expr), _curl_sockopt_callback2)) typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype); typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t, curlsocktype); /* evaluates to true if expr is of type curl_opensocket_callback or "similar" */ #define _curl_is_opensocket_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\ _curl_callback_compatible((expr), _curl_opensocket_callback1) || \ _curl_callback_compatible((expr), _curl_opensocket_callback2) || \ _curl_callback_compatible((expr), _curl_opensocket_callback3) || \ _curl_callback_compatible((expr), _curl_opensocket_callback4)) typedef curl_socket_t (_curl_opensocket_callback1) (void *, curlsocktype, struct curl_sockaddr *); typedef curl_socket_t (_curl_opensocket_callback2) (void *, curlsocktype, const struct curl_sockaddr *); typedef curl_socket_t (_curl_opensocket_callback3) (const void *, curlsocktype, struct curl_sockaddr *); typedef curl_socket_t (_curl_opensocket_callback4) (const void *, curlsocktype, const struct curl_sockaddr *); /* evaluates to true if expr is of type curl_progress_callback or "similar" */ #define _curl_is_progress_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \ _curl_callback_compatible((expr), _curl_progress_callback1) || \ _curl_callback_compatible((expr), _curl_progress_callback2)) typedef int (_curl_progress_callback1)(void *, double, double, double, double); typedef int (_curl_progress_callback2)(const void *, double, double, double, double); /* evaluates to true if expr is of type curl_debug_callback or "similar" */ #define _curl_is_debug_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \ _curl_callback_compatible((expr), _curl_debug_callback1) || \ _curl_callback_compatible((expr), _curl_debug_callback2) || \ _curl_callback_compatible((expr), _curl_debug_callback3) || \ _curl_callback_compatible((expr), _curl_debug_callback4) || \ _curl_callback_compatible((expr), _curl_debug_callback5) || \ _curl_callback_compatible((expr), _curl_debug_callback6) || \ _curl_callback_compatible((expr), _curl_debug_callback7) || \ _curl_callback_compatible((expr), _curl_debug_callback8)) typedef int (_curl_debug_callback1) (CURL *, curl_infotype, char *, size_t, void *); typedef int (_curl_debug_callback2) (CURL *, curl_infotype, char *, size_t, const void *); typedef int (_curl_debug_callback3) (CURL *, curl_infotype, const char *, size_t, void *); typedef int (_curl_debug_callback4) (CURL *, curl_infotype, const char *, size_t, const void *); typedef int (_curl_debug_callback5) (CURL *, curl_infotype, unsigned char *, size_t, void *); typedef int (_curl_debug_callback6) (CURL *, curl_infotype, unsigned char *, size_t, const void *); typedef int (_curl_debug_callback7) (CURL *, curl_infotype, const unsigned char *, size_t, void *); typedef int (_curl_debug_callback8) (CURL *, curl_infotype, const unsigned char *, size_t, const void *); /* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ /* this is getting even messier... */ #define _curl_is_ssl_ctx_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback8)) typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *); typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *); typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *); typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *); #ifdef HEADER_SSL_H /* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX * this will of course break if we're included before OpenSSL headers... */ typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *); typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *); typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *); typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, const void *); #else typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5; typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6; typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7; typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8; #endif /* evaluates to true if expr is of type curl_conv_callback or "similar" */ #define _curl_is_conv_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \ _curl_callback_compatible((expr), _curl_conv_callback1) || \ _curl_callback_compatible((expr), _curl_conv_callback2) || \ _curl_callback_compatible((expr), _curl_conv_callback3) || \ _curl_callback_compatible((expr), _curl_conv_callback4)) typedef CURLcode (*_curl_conv_callback1)(char *, size_t length); typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length); typedef CURLcode (*_curl_conv_callback3)(void *, size_t length); typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length); /* evaluates to true if expr is of type curl_seek_callback or "similar" */ #define _curl_is_seek_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \ _curl_callback_compatible((expr), _curl_seek_callback1) || \ _curl_callback_compatible((expr), _curl_seek_callback2)) typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int); typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int); #endif /* __CURL_TYPECHECK_GCC_H */ ================================================ FILE: third_party/include/mxml/config.h ================================================ /* * "$Id: config.h 451 2014-01-04 21:50:06Z msweet $" * * Configuration file for Mini-XML, a small XML-like file parsing library. * * Copyright 2003-2014 by Michael R Sweet. * * These coded instructions, statements, and computer programs are the * property of Michael R Sweet and are protected by Federal copyright * law. Distribution and use rights are outlined in the file "COPYING" * which should have been included with this file. If this file is * missing or damaged, see the license at: * * http://www.msweet.org/projects.php/Mini-XML */ /* * Beginning with VC2005, Microsoft breaks ISO C and POSIX conformance * by deprecating a number of functions in the name of security, even * when many of the affected functions are otherwise completely secure. * The _CRT_SECURE_NO_DEPRECATE definition ensures that we won't get * warnings from their use... * * Then Microsoft decided that they should ignore this in VC2008 and use * yet another define (_CRT_SECURE_NO_WARNINGS) instead. Bastards. */ #define _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_WARNINGS /* * Include necessary headers... */ #include #include #include #include #include #include /* * Microsoft also renames the POSIX functions to _name, and introduces * a broken compatibility layer using the original names. As a result, * random crashes can occur when, for example, strdup() allocates memory * from a different heap than used by malloc() and free(). * * To avoid moronic problems like this, we #define the POSIX function * names to the corresponding non-standard Microsoft names. */ #define close _close #define open _open #define read _read #define snprintf _snprintf #define strdup _strdup #define vsnprintf _vsnprintf #define write _write /* * Version number... */ #define MXML_VERSION "Mini-XML v2.8" /* * Inline function support... */ #define inline _inline /* * Long long support... */ #define HAVE_LONG_LONG 1 /* * Do we have the snprintf() and vsnprintf() functions? */ #define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 /* * Do we have the strXXX() functions? */ #define HAVE_STRDUP 1 /* * Define prototypes for string functions as needed... */ # ifndef HAVE_STRDUP extern char *_mxml_strdup(const char *); # define strdup _mxml_strdup # endif /* !HAVE_STRDUP */ extern char *_mxml_strdupf(const char *, ...); extern char *_mxml_vstrdupf(const char *, va_list); # ifndef HAVE_SNPRINTF extern int _mxml_snprintf(char *, size_t, const char *, ...); # define snprintf _mxml_snprintf # endif /* !HAVE_SNPRINTF */ # ifndef HAVE_VSNPRINTF extern int _mxml_vsnprintf(char *, size_t, const char *, va_list); # define vsnprintf _mxml_vsnprintf # endif /* !HAVE_VSNPRINTF */ /* * End of "$Id: config.h 451 2014-01-04 21:50:06Z msweet $". */ ================================================ FILE: third_party/include/mxml/mxml.h ================================================ /* * "$Id: mxml.h 451 2014-01-04 21:50:06Z msweet $" * * Header file for Mini-XML, a small XML-like file parsing library. * * Copyright 2003-2014 by Michael R Sweet. * * These coded instructions, statements, and computer programs are the * property of Michael R Sweet and are protected by Federal copyright * law. Distribution and use rights are outlined in the file "COPYING" * which should have been included with this file. If this file is * missing or damaged, see the license at: * * http://www.msweet.org/projects.php/Mini-XML */ /* * Prevent multiple inclusion... */ #ifndef _mxml_h_ # define _mxml_h_ /* * Include necessary headers... */ # include # include # include # include # include /* * Constants... */ # define MXML_MAJOR_VERSION 2 /* Major version number */ # define MXML_MINOR_VERSION 8 /* Minor version number */ # define MXML_TAB 8 /* Tabs every N columns */ # define MXML_NO_CALLBACK 0 /* Don't use a type callback */ # define MXML_INTEGER_CALLBACK mxml_integer_cb /* Treat all data as integers */ # define MXML_OPAQUE_CALLBACK mxml_opaque_cb /* Treat all data as opaque */ # define MXML_REAL_CALLBACK mxml_real_cb /* Treat all data as real numbers */ # define MXML_TEXT_CALLBACK 0 /* Treat all data as text */ # define MXML_IGNORE_CALLBACK mxml_ignore_cb /* Ignore all non-element content */ # define MXML_NO_PARENT 0 /* No parent for the node */ # define MXML_DESCEND 1 /* Descend when finding/walking */ # define MXML_NO_DESCEND 0 /* Don't descend when finding/walking */ # define MXML_DESCEND_FIRST -1 /* Descend for first find */ # define MXML_WS_BEFORE_OPEN 0 /* Callback for before open tag */ # define MXML_WS_AFTER_OPEN 1 /* Callback for after open tag */ # define MXML_WS_BEFORE_CLOSE 2 /* Callback for before close tag */ # define MXML_WS_AFTER_CLOSE 3 /* Callback for after close tag */ # define MXML_ADD_BEFORE 0 /* Add node before specified node */ # define MXML_ADD_AFTER 1 /* Add node after specified node */ # define MXML_ADD_TO_PARENT NULL /* Add node relative to parent */ /* * Data types... */ typedef enum mxml_sax_event_e /**** SAX event type. ****/ { MXML_SAX_CDATA, /* CDATA node */ MXML_SAX_COMMENT, /* Comment node */ MXML_SAX_DATA, /* Data node */ MXML_SAX_DIRECTIVE, /* Processing directive node */ MXML_SAX_ELEMENT_CLOSE, /* Element closed */ MXML_SAX_ELEMENT_OPEN /* Element opened */ } mxml_sax_event_t; typedef enum mxml_type_e /**** The XML node type. ****/ { MXML_IGNORE = -1, /* Ignore/throw away node @since Mini-XML 2.3@ */ MXML_ELEMENT, /* XML element with attributes */ MXML_INTEGER, /* Integer value */ MXML_OPAQUE, /* Opaque string */ MXML_REAL, /* Real value */ MXML_TEXT, /* Text fragment */ MXML_CUSTOM /* Custom data @since Mini-XML 2.1@ */ } mxml_type_t; typedef void (*mxml_custom_destroy_cb_t)(void *); /**** Custom data destructor ****/ typedef void (*mxml_error_cb_t)(const char *); /**** Error callback function ****/ typedef struct mxml_attr_s /**** An XML element attribute value. @private@ ****/ { char *name; /* Attribute name */ char *value; /* Attribute value */ } mxml_attr_t; typedef struct mxml_element_s /**** An XML element value. @private@ ****/ { char *name; /* Name of element */ int num_attrs; /* Number of attributes */ mxml_attr_t *attrs; /* Attributes */ } mxml_element_t; typedef struct mxml_text_s /**** An XML text value. @private@ ****/ { int whitespace; /* Leading whitespace? */ char *string; /* Fragment string */ } mxml_text_t; typedef struct mxml_custom_s /**** An XML custom value. @private@ ****/ { void *data; /* Pointer to (allocated) custom data */ mxml_custom_destroy_cb_t destroy; /* Pointer to destructor function */ } mxml_custom_t; typedef union mxml_value_u /**** An XML node value. @private@ ****/ { mxml_element_t element; /* Element */ int integer; /* Integer number */ char *opaque; /* Opaque string */ double real; /* Real number */ mxml_text_t text; /* Text fragment */ mxml_custom_t custom; /* Custom data @since Mini-XML 2.1@ */ } mxml_value_t; struct mxml_node_s /**** An XML node. @private@ ****/ { mxml_type_t type; /* Node type */ struct mxml_node_s *next; /* Next node under same parent */ struct mxml_node_s *prev; /* Previous node under same parent */ struct mxml_node_s *parent; /* Parent node */ struct mxml_node_s *child; /* First child node */ struct mxml_node_s *last_child; /* Last child node */ mxml_value_t value; /* Node value */ int ref_count; /* Use count */ void *user_data; /* User data */ }; typedef struct mxml_node_s mxml_node_t; /**** An XML node. ****/ struct mxml_index_s /**** An XML node index. @private@ ****/ { char *attr; /* Attribute used for indexing or NULL */ int num_nodes; /* Number of nodes in index */ int alloc_nodes; /* Allocated nodes in index */ int cur_node; /* Current node */ mxml_node_t **nodes; /* Node array */ }; typedef struct mxml_index_s mxml_index_t; /**** An XML node index. ****/ typedef int (*mxml_custom_load_cb_t)(mxml_node_t *, const char *); /**** Custom data load callback function ****/ typedef char *(*mxml_custom_save_cb_t)(mxml_node_t *); /**** Custom data save callback function ****/ typedef int (*mxml_entity_cb_t)(const char *); /**** Entity callback function */ typedef mxml_type_t (*mxml_load_cb_t)(mxml_node_t *); /**** Load callback function ****/ typedef const char *(*mxml_save_cb_t)(mxml_node_t *, int); /**** Save callback function ****/ typedef void (*mxml_sax_cb_t)(mxml_node_t *, mxml_sax_event_t, void *); /**** SAX callback function ****/ /* * C++ support... */ # ifdef __cplusplus extern "C" { # endif /* __cplusplus */ /* * Prototypes... */ extern void mxmlAdd(mxml_node_t *parent, int where, mxml_node_t *child, mxml_node_t *node); extern void mxmlDelete(mxml_node_t *node); extern void mxmlElementDeleteAttr(mxml_node_t *node, const char *name); extern const char *mxmlElementGetAttr(mxml_node_t *node, const char *name); extern void mxmlElementSetAttr(mxml_node_t *node, const char *name, const char *value); extern void mxmlElementSetAttrf(mxml_node_t *node, const char *name, const char *format, ...) # ifdef __GNUC__ __attribute__ ((__format__ (__printf__, 3, 4))) # endif /* __GNUC__ */ ; extern int mxmlEntityAddCallback(mxml_entity_cb_t cb); extern const char *mxmlEntityGetName(int val); extern int mxmlEntityGetValue(const char *name); extern void mxmlEntityRemoveCallback(mxml_entity_cb_t cb); extern mxml_node_t *mxmlFindElement(mxml_node_t *node, mxml_node_t *top, const char *name, const char *attr, const char *value, int descend); extern mxml_node_t *mxmlFindPath(mxml_node_t *node, const char *path); extern const char *mxmlGetCDATA(mxml_node_t *node); extern const void *mxmlGetCustom(mxml_node_t *node); extern const char *mxmlGetElement(mxml_node_t *node); extern mxml_node_t *mxmlGetFirstChild(mxml_node_t *node); extern int mxmlGetInteger(mxml_node_t *node); extern mxml_node_t *mxmlGetLastChild(mxml_node_t *node); extern mxml_node_t *mxmlGetNextSibling(mxml_node_t *node); extern const char *mxmlGetOpaque(mxml_node_t *node); extern mxml_node_t *mxmlGetParent(mxml_node_t *node); extern mxml_node_t *mxmlGetPrevSibling(mxml_node_t *node); extern double mxmlGetReal(mxml_node_t *node); extern int mxmlGetRefCount(mxml_node_t *node); extern const char *mxmlGetText(mxml_node_t *node, int *whitespace); extern mxml_type_t mxmlGetType(mxml_node_t *node); extern void *mxmlGetUserData(mxml_node_t *node); extern void mxmlIndexDelete(mxml_index_t *ind); extern mxml_node_t *mxmlIndexEnum(mxml_index_t *ind); extern mxml_node_t *mxmlIndexFind(mxml_index_t *ind, const char *element, const char *value); extern int mxmlIndexGetCount(mxml_index_t *ind); extern mxml_index_t *mxmlIndexNew(mxml_node_t *node, const char *element, const char *attr); extern mxml_node_t *mxmlIndexReset(mxml_index_t *ind); extern mxml_node_t *mxmlLoadFd(mxml_node_t *top, int fd, mxml_type_t (*cb)(mxml_node_t *)); extern mxml_node_t *mxmlLoadFile(mxml_node_t *top, FILE *fp, mxml_type_t (*cb)(mxml_node_t *)); extern mxml_node_t *mxmlLoadString(mxml_node_t *top, const char *s, mxml_type_t (*cb)(mxml_node_t *)); extern mxml_node_t *mxmlNewCDATA(mxml_node_t *parent, const char *string); extern mxml_node_t *mxmlNewCustom(mxml_node_t *parent, void *data, mxml_custom_destroy_cb_t destroy); extern mxml_node_t *mxmlNewElement(mxml_node_t *parent, const char *name); extern mxml_node_t *mxmlNewInteger(mxml_node_t *parent, int integer); extern mxml_node_t *mxmlNewOpaque(mxml_node_t *parent, const char *opaque); extern mxml_node_t *mxmlNewReal(mxml_node_t *parent, double real); extern mxml_node_t *mxmlNewText(mxml_node_t *parent, int whitespace, const char *string); extern mxml_node_t *mxmlNewTextf(mxml_node_t *parent, int whitespace, const char *format, ...) # ifdef __GNUC__ __attribute__ ((__format__ (__printf__, 3, 4))) # endif /* __GNUC__ */ ; extern mxml_node_t *mxmlNewXML(const char *version); extern int mxmlRelease(mxml_node_t *node); extern void mxmlRemove(mxml_node_t *node); extern int mxmlRetain(mxml_node_t *node); extern char *mxmlSaveAllocString(mxml_node_t *node, mxml_save_cb_t cb); extern int mxmlSaveFd(mxml_node_t *node, int fd, mxml_save_cb_t cb); extern int mxmlSaveFile(mxml_node_t *node, FILE *fp, mxml_save_cb_t cb); extern int mxmlSaveString(mxml_node_t *node, char *buffer, int bufsize, mxml_save_cb_t cb); extern mxml_node_t *mxmlSAXLoadFd(mxml_node_t *top, int fd, mxml_type_t (*cb)(mxml_node_t *), mxml_sax_cb_t sax, void *sax_data); extern mxml_node_t *mxmlSAXLoadFile(mxml_node_t *top, FILE *fp, mxml_type_t (*cb)(mxml_node_t *), mxml_sax_cb_t sax, void *sax_data); extern mxml_node_t *mxmlSAXLoadString(mxml_node_t *top, const char *s, mxml_type_t (*cb)(mxml_node_t *), mxml_sax_cb_t sax, void *sax_data); extern int mxmlSetCDATA(mxml_node_t *node, const char *data); extern int mxmlSetCustom(mxml_node_t *node, void *data, mxml_custom_destroy_cb_t destroy); extern void mxmlSetCustomHandlers(mxml_custom_load_cb_t load, mxml_custom_save_cb_t save); extern int mxmlSetElement(mxml_node_t *node, const char *name); extern void mxmlSetErrorCallback(mxml_error_cb_t cb); extern int mxmlSetInteger(mxml_node_t *node, int integer); extern int mxmlSetOpaque(mxml_node_t *node, const char *opaque); extern int mxmlSetReal(mxml_node_t *node, double real); extern int mxmlSetText(mxml_node_t *node, int whitespace, const char *string); extern int mxmlSetTextf(mxml_node_t *node, int whitespace, const char *format, ...) # ifdef __GNUC__ __attribute__ ((__format__ (__printf__, 3, 4))) # endif /* __GNUC__ */ ; extern int mxmlSetUserData(mxml_node_t *node, void *data); extern void mxmlSetWrapMargin(int column); extern mxml_node_t *mxmlWalkNext(mxml_node_t *node, mxml_node_t *top, int descend); extern mxml_node_t *mxmlWalkPrev(mxml_node_t *node, mxml_node_t *top, int descend); /* * Semi-private functions... */ extern void mxml_error(const char *format, ...); extern mxml_type_t mxml_ignore_cb(mxml_node_t *node); extern mxml_type_t mxml_integer_cb(mxml_node_t *node); extern mxml_type_t mxml_opaque_cb(mxml_node_t *node); extern mxml_type_t mxml_real_cb(mxml_node_t *node); /* * C++ support... */ # ifdef __cplusplus } # endif /* __cplusplus */ #endif /* !_mxml_h_ */ /* * End of "$Id: mxml.h 451 2014-01-04 21:50:06Z msweet $". */