Skip to content

Commit bf869a5

Browse files
committed
ext/soap/php_http.c: Refactor proxy_authentication()
1 parent 1ee7821 commit bf869a5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ext/soap/php_http.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ static zend_string *get_http_headers(php_stream *socketd);
2828
smart_str_appendl(str,const,sizeof(const)-1)
2929

3030
/* Proxy HTTP Authentication */
31-
int proxy_authentication(zval* this_ptr, smart_str* soap_headers)
31+
bool proxy_authentication(const zval* this_ptr, smart_str* soap_headers)
3232
{
33-
zval *login = Z_CLIENT_PROXY_LOGIN_P(this_ptr);
33+
const zval *login = Z_CLIENT_PROXY_LOGIN_P(this_ptr);
3434
if (Z_TYPE_P(login) == IS_STRING) {
3535
smart_str auth = {0};
3636
smart_str_append(&auth, Z_STR_P(login));
3737
smart_str_appendc(&auth, ':');
3838

39-
zval *password = Z_CLIENT_PROXY_PASSWORD_P(this_ptr);
39+
const zval *password = Z_CLIENT_PROXY_PASSWORD_P(this_ptr);
4040
if (Z_TYPE_P(password) == IS_STRING) {
4141
smart_str_append(&auth, Z_STR_P(password));
4242
}
@@ -47,9 +47,9 @@ int proxy_authentication(zval* this_ptr, smart_str* soap_headers)
4747
smart_str_append_const(soap_headers, "\r\n");
4848
zend_string_release_ex(buf, 0);
4949
smart_str_free(&auth);
50-
return 1;
50+
return true;
5151
}
52-
return 0;
52+
return false;
5353
}
5454

5555
/* HTTP Authentication */

ext/soap/php_http.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int make_http_soap_request(zval *this_ptr,
2626
int soap_version,
2727
zval *response);
2828

29-
int proxy_authentication(zval* this_ptr, smart_str* soap_headers);
29+
bool proxy_authentication(const zval* this_ptr, smart_str* soap_headers);
3030
int basic_authentication(zval* this_ptr, smart_str* soap_headers);
3131
void http_context_headers(php_stream_context* context,
3232
bool has_authorization,

0 commit comments

Comments
 (0)