Diff

Differences From Artifact [19e4f3db10]:

To Artifact [cad97cf7a0]:


42
43
44
45
46
47
48


49
50
51
52
53
54
55
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57







+
+







BIO_new_tcl(statePtr, flags)
    State *statePtr;
    int flags;
{
    BIO *bio;
    static BIO_METHOD *BioMethods = NULL;

    dprintf("BIO_new_tcl() called");

    if (BioMethods == NULL) {
        BioMethods = BIO_meth_new(BIO_TYPE_TCL, "tcl");
        BIO_meth_set_write(BioMethods, BioWrite);
        BIO_meth_set_read(BioMethods, BioRead);
        BIO_meth_set_puts(BioMethods, BioPuts);
        BIO_meth_set_ctrl(BioMethods, BioCtrl);
        BIO_meth_set_create(BioMethods, BioNew);
148
149
150
151
152
153
154

155
156
157
158
159
160
161
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164







+







}

static int
BioPuts	(bio, str)
    BIO *bio;
    CONST char *str;
{
    dprintf("BioPuts(%p, <string:%p>) called", bio, str);
    return BioWrite(bio, str, (int) strlen(str));
}

static long
BioCtrl	(bio, cmd, num, ptr)
    BIO *bio;
    int cmd;
222
223
224
225
226
227
228



229
230
231
232
233
234
235
236
237
238
239
240
241
242



243
244
245
246
247
248
249
250
251
252
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261







+
+
+














+
+
+










    return(ret);
}

static int
BioNew	(bio)
    BIO *bio;
{

    dprintf("BioNew(%p) called", bio);

    BIO_set_init(bio, 0);
    BIO_set_data(bio, NULL);
    BIO_clear_flags(bio, -1);

    return 1;
}

static int
BioFree	(bio)
    BIO *bio;
{
    if (bio == NULL) {
	return 0;
    }

    dprintf("BioFree(%p) called", bio);

    if (BIO_get_shutdown(bio)) {
	if (BIO_get_init(bio)) {
	    /*shutdown(bio->num, 2) */
	    /*closesocket(bio->num) */
	}
        BIO_set_init(bio, 0);
        BIO_clear_flags(bio, -1);
    }
    return 1;
}