Lines Matching refs:stream

40 int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stream TSRMLS_DC);
41 SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC);
45 static size_t php_openssl_sockop_io(int read, php_stream *stream, char *buf, size_t count TSRMLS_DC…
70 static int is_http_stream_talking_to_iis(php_stream *stream TSRMLS_DC) in is_http_stream_talking_to_iis()
72 …if (stream->wrapperdata && stream->wrapper && strcasecmp(stream->wrapper->wops->label, "HTTP") == … in is_http_stream_talking_to_iis()
79 zend_hash_internal_pointer_reset(Z_ARRVAL_P(stream->wrapperdata)); in is_http_stream_talking_to_iis()
80 while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(stream->wrapperdata), (void**)&tmp)) { in is_http_stream_talking_to_iis()
88 zend_hash_move_forward(Z_ARRVAL_P(stream->wrapperdata)); in is_http_stream_talking_to_iis()
94 static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init TSRMLS_DC) in handle_ssl_error() argument
96 php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; in handle_ssl_error()
118 if (!is_http_stream_talking_to_iis(stream TSRMLS_CC) && ERR_get_error() != 0) { in handle_ssl_error()
123 stream->eof = 1; in handle_ssl_error()
177 static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) in php_openssl_sockop_read() argument
179 return php_openssl_sockop_io(1, stream, buf, count TSRMLS_CC); in php_openssl_sockop_read()
182 static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) in php_openssl_sockop_write() argument
184 return php_openssl_sockop_io(0, stream, (char*)buf, count TSRMLS_CC); in php_openssl_sockop_write()
194 static size_t php_openssl_sockop_io(int read, php_stream *stream, char *buf, size_t count TSRMLS_DC) in php_openssl_sockop_io() argument
196 php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; in php_openssl_sockop_io()
262 retry = handle_ssl_error(stream, nr_bytes, 0 TSRMLS_CC); in php_openssl_sockop_io()
274 stream->eof = (retry == 0 && errno != EAGAIN && !SSL_pending(sslsock->ssl_handle)); in php_openssl_sockop_io()
319 php_stream_notify_progress_increment(stream->context, nr_bytes, 0); in php_openssl_sockop_io()
329 nr_bytes = php_stream_socket_ops.read(stream, buf, count TSRMLS_CC); in php_openssl_sockop_io()
331 nr_bytes = php_stream_socket_ops.write(stream, buf, count TSRMLS_CC); in php_openssl_sockop_io()
369 static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_DC) in php_openssl_sockop_close() argument
371 php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; in php_openssl_sockop_close()
413 pefree(sslsock->sni, php_stream_is_persistent(stream)); in php_openssl_sockop_close()
415 pefree(sslsock, php_stream_is_persistent(stream)); in php_openssl_sockop_close()
420 static int php_openssl_sockop_flush(php_stream *stream TSRMLS_DC) in php_openssl_sockop_flush()
422 return php_stream_socket_ops.flush(stream TSRMLS_CC); in php_openssl_sockop_flush()
425 static int php_openssl_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) in php_openssl_sockop_stat() argument
427 return php_stream_socket_ops.stat(stream, ssb TSRMLS_CC); in php_openssl_sockop_stat()
431 static inline int php_openssl_setup_crypto(php_stream *stream, in php_openssl_setup_crypto() argument
524 if (stream->context && SUCCESS == php_stream_context_get_option( in php_openssl_setup_crypto()
525 stream->context, "ssl", "no_ticket", &val) && in php_openssl_setup_crypto()
536 if (stream->context && SUCCESS == php_stream_context_get_option( in php_openssl_setup_crypto()
537 stream->context, "ssl", "disable_compression", &val) && in php_openssl_setup_crypto()
544 sslsock->ssl_handle = php_SSL_new_from_context(sslsock->ctx, stream TSRMLS_CC); in php_openssl_setup_crypto()
553 handle_ssl_error(stream, 0, 1 TSRMLS_CC); in php_openssl_setup_crypto()
568 static inline int php_openssl_enable_crypto(php_stream *stream, in php_openssl_enable_crypto() argument
629 retry = handle_ssl_error(stream, n, blocked TSRMLS_CC); in php_openssl_enable_crypto()
656 …if (FAILURE == php_openssl_apply_verification_policy(sslsock->ssl_handle, peer_cert, stream TSRMLS… in php_openssl_enable_crypto()
664 if (stream->context) { in php_openssl_enable_crypto()
668 stream->context, "ssl", in php_openssl_enable_crypto()
674 php_stream_context_set_option(stream->context, in php_openssl_enable_crypto()
682 stream->context, "ssl", in php_openssl_enable_crypto()
710 php_stream_context_set_option(stream->context, in php_openssl_enable_crypto()
736 static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_netstream_data_t *s… in php_openssl_tcp_sockop_accept() argument
768 xparam->outputs.client = php_stream_alloc_rel(stream->ops, clisockdata, NULL, "r+"); in php_openssl_tcp_sockop_accept()
770 xparam->outputs.client->context = stream->context; in php_openssl_tcp_sockop_accept()
771 if (stream->context) { in php_openssl_tcp_sockop_accept()
772 zend_list_addref(stream->context->rsrc_id); in php_openssl_tcp_sockop_accept()
812 static int php_openssl_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam … in php_openssl_sockop_set_option() argument
814 php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; in php_openssl_sockop_set_option()
877 cparam->outputs.returncode = php_openssl_setup_crypto(stream, sslsock, cparam TSRMLS_CC); in php_openssl_sockop_set_option()
881 cparam->outputs.returncode = php_openssl_enable_crypto(stream, sslsock, cparam TSRMLS_CC); in php_openssl_sockop_set_option()
898 php_stream_socket_ops.set_option(stream, option, value, ptrparam TSRMLS_CC); in php_openssl_sockop_set_option()
905 if (php_stream_xport_crypto_setup(stream, sslsock->method, NULL TSRMLS_CC) < 0 || in php_openssl_sockop_set_option()
906 php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) { in php_openssl_sockop_set_option()
916 …xparam->outputs.returncode = php_openssl_tcp_sockop_accept(stream, sslsock, xparam STREAMS_CC TSRM… in php_openssl_sockop_set_option()
927 return php_stream_socket_ops.set_option(stream, option, value, ptrparam TSRMLS_CC); in php_openssl_sockop_set_option()
930 static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC) in php_openssl_sockop_cast() argument
932 php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; in php_openssl_sockop_cast()
940 *ret = fdopen(sslsock->s.socket, stream->mode); in php_openssl_sockop_cast()
957 if (stream->writepos == stream->readpos in php_openssl_sockop_cast()
960 php_stream_fill_read_buffer(stream, pending < stream->chunk_size in php_openssl_sockop_cast()
962 : stream->chunk_size); in php_openssl_sockop_cast()
1046 php_stream *stream = NULL; in php_openssl_ssl_socket_factory() local
1068 stream = php_stream_alloc_rel(&php_openssl_socket_ops, sslsock, persistent_id, "r+"); in php_openssl_ssl_socket_factory()
1070 if (stream == NULL) { in php_openssl_ssl_socket_factory()
1096 return stream; in php_openssl_ssl_socket_factory()