@@ -866,19 +866,19 @@ static OCSP_RESPONSE *parse_ocsp_resp(char *buf, int len)
866866
867867/* Reads the response from the APR socket to a buffer, and parses the buffer to
868868 return the OCSP response */
869- #define ADDLEN 512
869+ #define BUFFER_SIZE 512
870870static OCSP_RESPONSE * ocsp_get_resp (apr_pool_t * mp , apr_socket_t * sock )
871871{
872872 int buflen ;
873873 apr_size_t totalread = 0 ;
874874 apr_size_t readlen ;
875- char * buf , tmpbuf [ADDLEN ];
875+ char * buf , tmpbuf [BUFFER_SIZE ];
876876 apr_status_t rv = APR_SUCCESS ;
877877 apr_pool_t * p ;
878878 OCSP_RESPONSE * resp ;
879879
880880 apr_pool_create (& p , mp );
881- buflen = ADDLEN ;
881+ buflen = BUFFER_SIZE ;
882882 buf = apr_palloc (p , buflen );
883883 if (buf == NULL ) {
884884 apr_pool_destroy (p );
@@ -890,12 +890,12 @@ static OCSP_RESPONSE *ocsp_get_resp(apr_pool_t *mp, apr_socket_t *sock)
890890 rv = apr_socket_recv (sock , tmpbuf , & readlen );
891891 if (rv == APR_SUCCESS ) { /* if we have read something .. we can put it in the buffer*/
892892 if ((totalread + readlen ) >= buflen ) {
893- buf = apr_xrealloc (buf , buflen , buflen + ADDLEN , p );
893+ buf = apr_xrealloc (buf , buflen , buflen * 2 , p );
894894 if (buf == NULL ) {
895895 apr_pool_destroy (p );
896896 return NULL ;
897897 }
898- buflen += ADDLEN ; /* if needed we enlarge the buffer */
898+ buflen *= 2 ; /* if needed we enlarge the buffer */
899899 }
900900 memcpy (buf + totalread , tmpbuf , readlen ); /* the copy to the buffer */
901901 totalread += readlen ; /* update the total bytes read */
0 commit comments