- if ((Z_STRVAL_P(zoption)[0] != '"') || (Z_STRVAL_P(zoption)[Z_STRLEN_P(zoption)-1] != '"')) {
- spprintf("ed_etag, 0, "\"%s\"", Z_STRVAL_P(zoption));
- }
- snprintf(match_header, sizeof(match_header), "%s: %s", range_req?"If-Match":"If-None-Match", quoted_etag?quoted_etag:Z_STRVAL_P(zoption));
- request->_cache.headers = curl_slist_append(request->_cache.headers, match_header);
- STR_FREE(quoted_etag);
+ phpstr_init(&header);
+ phpstr_appendf(&header, is_quoted?"%s: %s":"%s: \"%s\"", range_req?"If-Match":"If-None-Match", Z_STRVAL_P(zoption));
+ phpstr_fix(&header);
+ request->_cache.headers = curl_slist_append(request->_cache.headers, PHPSTR_VAL(&header));
+ phpstr_dtor(&header);