Skip to content

Commit 7b9145d

Browse files
committed
curl: Fix coding style
1 parent 8c860ce commit 7b9145d

File tree

1 file changed

+35
-34
lines changed

1 file changed

+35
-34
lines changed

ext/curl/interface.c

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ PHP_MINFO_FUNCTION(curl)
253253

254254
d = curl_version_info(CURLVERSION_NOW);
255255
php_info_print_table_start();
256-
php_info_print_table_row(2, "cURL support", "enabled");
256+
php_info_print_table_row(2, "cURL support", "enabled");
257257
php_info_print_table_row(2, "cURL Information", d->version);
258258
snprintf(str, sizeof(str), "%d", d->age);
259259
php_info_print_table_row(2, "Age", str);
@@ -513,6 +513,7 @@ static HashTable *curl_get_gc(zend_object *object, zval **table, int *n)
513513
zend_get_gc_buffer_add_fcc(gc_buffer, &curl->handlers.prereq);
514514
}
515515
#endif
516+
516517
#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
517518
if (ZEND_FCC_INITIALIZED(curl->handlers.sshhostkey)) {
518519
zend_get_gc_buffer_add_fcc(gc_buffer, &curl->handlers.sshhostkey);
@@ -728,8 +729,8 @@ static int curl_prereqfunction(void *clientp, char *conn_primary_ip, char *conn_
728729
// gets called. Return CURL_PREREQFUNC_OK immediately in this case to avoid
729730
// zend_call_known_fcc() with an uninitialized FCC.
730731
if (!ZEND_FCC_INITIALIZED(ch->handlers.prereq)) {
731-
return rval;
732-
}
732+
return rval;
733+
}
733734

734735
#if PHP_CURL_DEBUG
735736
fprintf(stderr, "curl_prereqfunction() called\n");
@@ -924,42 +925,42 @@ static int curl_debug(CURL *handle, curl_infotype type, char *data, size_t size,
924925
{
925926
php_curl *ch = (php_curl *)clientp;
926927

927-
#if PHP_CURL_DEBUG
928-
fprintf(stderr, "curl_debug() called\n");
929-
fprintf(stderr, "type = %d, data = %s\n", type, data);
930-
#endif
928+
#if PHP_CURL_DEBUG
929+
fprintf(stderr, "curl_debug() called\n");
930+
fprintf(stderr, "type = %d, data = %s\n", type, data);
931+
#endif
931932

932933
// Implicitly store the headers for compatibility with CURLINFO_HEADER_OUT
933934
// used as a Curl option. Previously, setting CURLINFO_HEADER_OUT set curl_debug
934935
// as the CURLOPT_DEBUGFUNCTION and stored the debug data when type is set to
935936
// CURLINFO_HEADER_OUT. For backward compatibility, we now store the headers
936937
// but also call the user-callback function if available.
937-
if (type == CURLINFO_HEADER_OUT) {
938-
if (ch->header.str) {
939-
zend_string_release_ex(ch->header.str, 0);
940-
}
941-
ch->header.str = zend_string_init(data, size, 0);
942-
}
938+
if (type == CURLINFO_HEADER_OUT) {
939+
if (ch->header.str) {
940+
zend_string_release_ex(ch->header.str, 0);
941+
}
942+
ch->header.str = zend_string_init(data, size, 0);
943+
}
943944

944-
if (!ZEND_FCC_INITIALIZED(ch->handlers.debug)) {
945-
return 0;
946-
}
945+
if (!ZEND_FCC_INITIALIZED(ch->handlers.debug)) {
946+
return 0;
947+
}
947948

948-
zval args[3];
949+
zval args[3];
949950

950-
GC_ADDREF(&ch->std);
951-
ZVAL_OBJ(&args[0], &ch->std);
952-
ZVAL_LONG(&args[1], type);
953-
ZVAL_STRINGL(&args[2], data, size);
951+
GC_ADDREF(&ch->std);
952+
ZVAL_OBJ(&args[0], &ch->std);
953+
ZVAL_LONG(&args[1], type);
954+
ZVAL_STRINGL(&args[2], data, size);
954955

955-
ch->in_callback = true;
956-
zend_call_known_fcc(&ch->handlers.debug, NULL, /* param_count */ 3, args, /* named_params */ NULL);
957-
ch->in_callback = false;
956+
ch->in_callback = true;
957+
zend_call_known_fcc(&ch->handlers.debug, NULL, /* param_count */ 3, args, /* named_params */ NULL);
958+
ch->in_callback = false;
958959

959-
zval_ptr_dtor(&args[0]);
960-
zval_ptr_dtor(&args[2]);
960+
zval_ptr_dtor(&args[0]);
961+
zval_ptr_dtor(&args[2]);
961962

962-
return 0;
963+
return 0;
963964
}
964965
/* }}} */
965966

@@ -1813,7 +1814,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
18131814
case CURLOPT_DNS_SHUFFLE_ADDRESSES:
18141815
case CURLOPT_HAPROXYPROTOCOL:
18151816
case CURLOPT_DISALLOW_USERNAME_IN_URL:
1816-
#if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
1817+
#if LIBCURL_VERSION_NUM >= 0x073e00 /* Available since 7.62.0 */
18171818
case CURLOPT_UPKEEP_INTERVAL_MS:
18181819
case CURLOPT_UPLOAD_BUFFERSIZE:
18191820
#endif
@@ -1976,7 +1977,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
19761977
case CURLOPT_DNS_LOCAL_IP6:
19771978
case CURLOPT_XOAUTH2_BEARER:
19781979
case CURLOPT_UNIX_SOCKET_PATH:
1979-
#if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
1980+
#if LIBCURL_VERSION_NUM >= 0x073e00 /* Available since 7.62.0 */
19801981
case CURLOPT_DOH_URL:
19811982
#endif
19821983
#if LIBCURL_VERSION_NUM >= 0x074a00 /* Available since 7.74.0 */
@@ -2282,9 +2283,9 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
22822283

22832284
case CURLINFO_HEADER_OUT:
22842285
if (ZEND_FCC_INITIALIZED(ch->handlers.debug)) {
2285-
zend_value_error("CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set");
2286-
return FAILURE;
2287-
}
2286+
zend_value_error("CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set");
2287+
return FAILURE;
2288+
}
22882289

22892290
if (zend_is_true(zvalue)) {
22902291
curl_easy_setopt(ch->cp, CURLOPT_DEBUGFUNCTION, curl_debug);
@@ -3071,7 +3072,7 @@ PHP_FUNCTION(curl_pause)
30713072
}
30723073
/* }}} */
30733074

3074-
#if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
3075+
#if LIBCURL_VERSION_NUM >= 0x073e00 /* Available since 7.62.0 */
30753076
/* {{{ perform connection upkeep checks */
30763077
PHP_FUNCTION(curl_upkeep)
30773078
{
@@ -3090,5 +3091,5 @@ PHP_FUNCTION(curl_upkeep)
30903091

30913092
RETURN_BOOL(error == CURLE_OK);
30923093
}
3093-
/*}}} */
3094+
/* }}} */
30943095
#endif

0 commit comments

Comments
 (0)