Changeset 0831437 in mod_gnutls for src


Ignore:
Timestamp:
Jun 11, 2016, 7:03:01 PM (3 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, master, upstream
Children:
04addef
Parents:
47a909e
git-author:
Thomas Klute <thomas2.klute@…> (06/11/16 18:36:47)
git-committer:
Thomas Klute <thomas2.klute@…> (06/11/16 19:03:01)
Message:

Clarify the purpose of mgs_time2sz()

I've renamed the CTIME macro to OPENSSL_TIME_FORMAT because its name
is misleading: ctime() uses a different output format.

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_cache.c

    r47a909e r0831437  
    101101}
    102102
    103 #define CTIME "%b %d %k:%M:%S %Y %Z"
    104 
    105 char *mgs_time2sz(time_t in_time, char *str, int strsize) {
     103/* The OPENSSL_TIME_FORMAT macro and mgs_time2sz() serve to print time
     104 * in a format compatible with OpenSSL's ASN1_TIME_print()
     105 * function. */
     106
     107#define OPENSSL_TIME_FORMAT "%b %d %k:%M:%S %Y %Z"
     108
     109char *mgs_time2sz(time_t in_time, char *str, int strsize)
     110{
    106111    apr_time_exp_t vtm;
    107112    apr_size_t ret_size;
     
    111116    apr_time_ansi_put(&t, in_time);
    112117    apr_time_exp_gmt(&vtm, t);
    113     apr_strftime(str, &ret_size, strsize - 1, CTIME, &vtm);
     118    apr_strftime(str, &ret_size, strsize - 1, OPENSSL_TIME_FORMAT, &vtm);
    114119
    115120    return str;
  • src/gnutls_cache.h

    r47a909e r0831437  
    4444
    4545/**
    46  * Convert a time_t into a Null Terminated String
     46 * Convert a time_t into a null terminated string in a format
     47 * compatible with OpenSSL's ASN1_TIME_print()
     48 *
    4749 * @param t time_t time
    48  * @param str Location to store the Hex Encoded String
    49  * @param strsize The Maximum Length that can be stored in str
     50 * @param str Location to store the time string
     51 * @param strsize The maximum length that can be stored in str
    5052 */
    5153char *mgs_time2sz(time_t t, char *str, int strsize);
Note: See TracChangeset for help on using the changeset viewer.