return (0);
case BIO_CTRL_RESET :
- h->ptr = NULL;
+ BIO_set_data(h, NULL);
return (0);
case BIO_C_SET_FILE_PTR :
- h->ptr = arg2;
- h->init = 1;
+ BIO_set_data(h, arg2);
+ BIO_set_init(h, 1);
return (1);
case BIO_C_GET_FILE_PTR :
if (arg2)
{
- *((void **)arg2) = h->ptr;
+ *((void **)arg2) = BIO_get_data(h);
return (1);
}
else
if (!h)
return (0);
- if (h->shutdown)
- {
- h->init = 0;
- h->flags = 0;
- }
+ if (BIO_get_shutdown(h))
+ BIO_set_init(h, 0);
return (1);
}
if (!h)
return (0);
- h->init = 0;
- h->num = 0;
- h->ptr = NULL;
- h->flags = 0;
+ BIO_set_init(h, 0);
+ BIO_set_data(h, NULL);
return (1);
}
const char *str) // I - String to write
{
#ifdef WIN32
- return (send(((http_t *)h->ptr)->fd, str, (int)strlen(str), 0));
+ return (send(((http_t *)BIO_get_data(h))->fd, str, (int)strlen(str), 0));
#else
- return ((int)send(((http_t *)h->ptr)->fd, str, strlen(str), 0));
+ return ((int)send(((http_t *)BIO_get_data(h))->fd, str, strlen(str), 0));
#endif // WIN32
}
http_t *http; // HTTP connection
- http = (http_t *)h->ptr;
+ http = (http_t *)BIO_get_data(h);
if (!http->blocking)
{
const char *buf, // I - Buffer to write
int num) // I - Number of bytes to write
{
- return (send(((http_t *)h->ptr)->fd, buf, num, 0));
+ return (send(((http_t *)BIO_get_data(h))->fd, buf, num, 0));
}