Back to index

php5  5.3.10
Functions
php_http.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int make_http_soap_request (zval *this_ptr, char *request, int request_size, char *location, char *soapaction, int soap_version, char **response, int *response_len TSRMLS_DC)
void proxy_authentication (zval *this_ptr, smart_str *soap_headers TSRMLS_DC)
void basic_authentication (zval *this_ptr, smart_str *soap_headers TSRMLS_DC)

Function Documentation

void basic_authentication ( zval *  this_ptr,
smart_str *soap_headers  TSRMLS_DC 
)

Definition at line 60 of file php_http.c.

{
       zval **login, **password;

       if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS &&
                     !zend_hash_exists(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest"))) {
              unsigned char* buf;
              int len;
              smart_str auth = {0};

              smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login));
              smart_str_appendc(&auth, ':');
              if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS) {
                     smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password));
              }
              smart_str_0(&auth);
              buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len);
              smart_str_append_const(soap_headers, "Authorization: Basic ");
              smart_str_appendl(soap_headers, (char*)buf, len);
              smart_str_append_const(soap_headers, "\r\n");
              efree(buf);
              smart_str_free(&auth);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

int make_http_soap_request ( zval *  this_ptr,
char *  request,
int  request_size,
char *  location,
char *  soapaction,
int  soap_version,
char **  response,
int *response_len  TSRMLS_DC 
)
void proxy_authentication ( zval *  this_ptr,
smart_str *soap_headers  TSRMLS_DC 
)

Definition at line 35 of file php_http.c.

{
       zval **login, **password;

       if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_login", sizeof("_proxy_login"), (void **)&login) == SUCCESS) {
              unsigned char* buf;
              int len;
              smart_str auth = {0};

              smart_str_appendl(&auth, Z_STRVAL_PP(login), Z_STRLEN_PP(login));
              smart_str_appendc(&auth, ':');
              if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_password", sizeof("_proxy_password"), (void **)&password) == SUCCESS) {
                     smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password));
              }
              smart_str_0(&auth);
              buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len);
              smart_str_append_const(soap_headers, "Proxy-Authorization: Basic ");
              smart_str_appendl(soap_headers, (char*)buf, len);
              smart_str_append_const(soap_headers, "\r\n");
              efree(buf);
              smart_str_free(&auth);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function: