27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
-
-
-
-
-
-
+
+
+
+
+
+
|
#define BIO_meth_set_destroy(bio, val) (bio)->destroy = val;
#endif
/*
* Forward declarations
*/
static int BioWrite _ANSI_ARGS_((BIO *h, CONST char *buf, int num));
static int BioRead _ANSI_ARGS_((BIO *h, char *buf, int num));
static int BioPuts _ANSI_ARGS_((BIO *h, CONST char *str));
static long BioCtrl _ANSI_ARGS_((BIO *h, int cmd, long arg1, void *ptr));
static int BioNew _ANSI_ARGS_((BIO *h));
static int BioFree _ANSI_ARGS_((BIO *h));
static int BioWrite (BIO *h, const char *buf, int num);
static int BioRead (BIO *h, char *buf, int num);
static int BioPuts (BIO *h, const char *str);
static long BioCtrl (BIO *h, int cmd, long arg1, void *ptr);
static int BioNew (BIO *h);
static int BioFree (BIO *h);
BIO *BIO_new_tcl(State *statePtr, int flags) {
BIO *bio;
static BIO_METHOD *BioMethods = NULL;
#ifdef TCLTLS_SSL_USE_FASTPATH
Tcl_Channel parentChannel;
const Tcl_ChannelType *parentChannelType;
|
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
-
+
|
BIO_set_data(bio, statePtr);
BIO_set_shutdown(bio, flags);
BIO_set_init(bio, 1);
return(bio);
}
static int BioWrite(BIO *bio, CONST char *buf, int bufLen) {
static int BioWrite(BIO *bio, const char *buf, int bufLen) {
Tcl_Channel chan;
int ret;
int tclEofChan, tclErrno;
chan = Tls_GetParent((State *) BIO_get_data(bio), 0);
dprintf("[chan=%p] BioWrite(%p, <buf>, %d)", (void *)chan, (void *) bio, bufLen);
|
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
-
+
|
}
dprintf("BioRead(%p, <buf>, %d) [%p] returning %i", (void *) bio, bufLen, (void *) chan, ret);
return(ret);
}
static int BioPuts(BIO *bio, CONST char *str) {
static int BioPuts(BIO *bio, const char *str) {
dprintf("BioPuts(%p, <string:%p>) called", bio, str);
return BioWrite(bio, str, (int) strlen(str));
}
static long BioCtrl(BIO *bio, int cmd, long num, void *ptr) {
Tcl_Channel chan;
|