Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Fixed pass-through to fetch file descriptor using a pointer |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | wip-fix-io-layer |
| Files: | files | file ages | folders |
| SHA1: |
b5ba86f2bea2cd651a4a8553b5317b7e |
| User & Date: | rkeene 2016-12-11 20:05:54 |
Context
|
2016-12-11
| ||
| 21:22 | Rewrote state engine for OpenSSL connection establishment to be more easily reasoned about check-in: 77e904c4e2 user: rkeene tags: wip-fix-io-layer | |
| 20:05 | Fixed pass-through to fetch file descriptor using a pointer check-in: b5ba86f2be user: rkeene tags: wip-fix-io-layer | |
| 19:20 | Updated to support optionally enabling/disabling a faster path for talking to the underlying channel check-in: d25ae3c232 user: rkeene tags: wip-fix-io-layer | |
Changes
Changes to tlsBIO.c.
| ︙ | ︙ | |||
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
static int BioFree _ANSI_ARGS_((BIO *h));
BIO *BIO_new_tcl(State *statePtr, int flags) {
BIO *bio;
Tcl_Channel parentChannel;
const Tcl_ChannelType *parentChannelType;
static BIO_METHOD *BioMethods = NULL;
int parentChannelFdIn, parentChannelFdOut, parentChannelFd;
int validParentChannelFd;
int tclGetChannelHandleRet;
dprintf("BIO_new_tcl() called");
if (BioMethods == NULL) {
| > | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
static int BioFree _ANSI_ARGS_((BIO *h));
BIO *BIO_new_tcl(State *statePtr, int flags) {
BIO *bio;
Tcl_Channel parentChannel;
const Tcl_ChannelType *parentChannelType;
static BIO_METHOD *BioMethods = NULL;
void *parentChannelFdIn_p, *parentChannelFdOut_p;
int parentChannelFdIn, parentChannelFdOut, parentChannelFd;
int validParentChannelFd;
int tclGetChannelHandleRet;
dprintf("BIO_new_tcl() called");
if (BioMethods == NULL) {
|
| ︙ | ︙ | |||
69 70 71 72 73 74 75 | /* * If the channel can be mapped back to a file descriptor, just use the file descriptor * with the SSL library since it will likely be optimized for this. */ parentChannel = Tls_GetParent(statePtr); parentChannelType = Tcl_GetChannelType(parentChannel); | < < < < | | > > | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
/*
* If the channel can be mapped back to a file descriptor, just use the file descriptor
* with the SSL library since it will likely be optimized for this.
*/
parentChannel = Tls_GetParent(statePtr);
parentChannelType = Tcl_GetChannelType(parentChannel);
validParentChannelFd = 0;
if (strcmp(parentChannelType->typeName, "tcp") == 0) {
tclGetChannelHandleRet = Tcl_GetChannelHandle(parentChannel, TCL_READABLE, (ClientData) &parentChannelFdIn_p);
if (tclGetChannelHandleRet == TCL_OK) {
tclGetChannelHandleRet = Tcl_GetChannelHandle(parentChannel, TCL_WRITABLE, (ClientData) &parentChannelFdOut_p);
if (tclGetChannelHandleRet == TCL_OK) {
parentChannelFdIn = PTR2INT(parentChannelFdIn_p);
parentChannelFdOut = PTR2INT(parentChannelFdOut_p);
if (parentChannelFdIn == parentChannelFdOut) {
parentChannelFd = parentChannelFdIn;
validParentChannelFd = 1;
}
}
}
}
|
| ︙ | ︙ |
Changes to tlsInt.h.
| ︙ | ︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | */ #ifndef _TLSINT_H #define _TLSINT_H #include "tls.h" #include <errno.h> #include <string.h> #ifdef __WIN32__ #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <wincrypt.h> /* OpenSSL needs this on Windows */ #endif | > | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | */ #ifndef _TLSINT_H #define _TLSINT_H #include "tls.h" #include <errno.h> #include <string.h> #include <stdint.h> #ifdef __WIN32__ #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <wincrypt.h> /* OpenSSL needs this on Windows */ #endif |
| ︙ | ︙ | |||
160 161 162 163 164 165 166 167 168 | Tcl_Obj *Tls_NewX509Obj(Tcl_Interp *interp, X509 *cert); void Tls_Error(State *statePtr, char *msg); void Tls_Free(char *blockPtr); void Tls_Clean(State *statePtr); int Tls_WaitForConnect(State *statePtr, int *errorCodePtr); BIO *BIO_new_tcl(State* statePtr, int flags); #endif /* _TLSINT_H */ | > > | 161 162 163 164 165 166 167 168 169 170 171 | Tcl_Obj *Tls_NewX509Obj(Tcl_Interp *interp, X509 *cert); void Tls_Error(State *statePtr, char *msg); void Tls_Free(char *blockPtr); void Tls_Clean(State *statePtr); int Tls_WaitForConnect(State *statePtr, int *errorCodePtr); BIO *BIO_new_tcl(State* statePtr, int flags); #define PTR2INT(x) ((int) ((intptr_t) (x))) #endif /* _TLSINT_H */ |