Jim Tcl
Check-in [35cbeebf78]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:aio: Always set error message on I/O error

Some operations that failed (such as read) would leave an empty error result.

Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 35cbeebf78404dee33802a7e9da8f3788b54c117
User & Date: steveb@workware.net.au 2018-07-08 00:42:49
Original User & Date: steveb@workware.net.au 2018-07-08 00:42:50
Context
2018-07-08
00:42
aio: Fall back to stdio error if no ssl error

Conditions such as ECONNRESET may result in a failed ssl connection with no ssl error, so return the stdio error in this case rather than just "unknown SSL error"

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 5985f8c4d5 user: steveb@workware.net.au tags: trunk

00:42
aio: Always set error message on I/O error

Some operations that failed (such as read) would leave an empty error result.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 35cbeebf78 user: steveb@workware.net.au tags: trunk

2018-07-05
03:02
expr: Fix compiler warning on older gcc

jim/jim.c: In function ‘SetExprFromAny’: jim/jim.c:9109:16: error: ‘top’ may be used uninitialized in this function [-Werror=maybe-uninitialized] expr->expr = top; ^ jim/jim.c:9075:25: note: ‘top’ was declared here struct JimExprNode *top;

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: c9b57c7b2b user: steveb@workware.net.au tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to jim-aio.c.

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
...
484
485
486
487
488
489
490









491
492
493
494
495
496
497
....
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279

#ifdef JIM_ANSIC
/* no fdopen() with ANSIC, so can't support these */
#undef HAVE_PIPE
#undef HAVE_SOCKETPAIR
#endif

#define JimCheckStreamError(interp, af) af->fops->error(af)

#if defined(HAVE_SOCKETS) && !defined(JIM_BOOTSTRAP)
union sockaddr_any {
    struct sockaddr sa;
    struct sockaddr_in sin;
#if IPV6
    struct sockaddr_in6 sin6;
#endif
................................................................................
    if (name) {
        Jim_SetResultFormatted(interp, "%#s: %s", name, JimAioErrorString(af));
    }
    else {
        Jim_SetResultString(interp, JimAioErrorString(af), -1);
    }
}










static void JimAioDelProc(Jim_Interp *interp, void *privData)
{
    AioFile *af = privData;

    JIM_NOTUSED(interp);

................................................................................

    if (!af->fops->verify) {
        return JIM_OK;
    }

    ret = af->fops->verify(af);
    if (ret != JIM_OK) {
        if (JimCheckStreamError(interp, af)) {
            JimAioSetError(interp, af->filename);
        } else {
            Jim_SetResultString(interp, "failed to verify the connection authenticity", -1);
        }
    }
    return ret;
}
#endif /* JIM_BOOTSTRAP */








<
<







 







>
>
>
>
>
>
>
>
>







 







|
<
<







105
106
107
108
109
110
111


112
113
114
115
116
117
118
...
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
....
1270
1271
1272
1273
1274
1275
1276
1277


1278
1279
1280
1281
1282
1283
1284

#ifdef JIM_ANSIC
/* no fdopen() with ANSIC, so can't support these */
#undef HAVE_PIPE
#undef HAVE_SOCKETPAIR
#endif



#if defined(HAVE_SOCKETS) && !defined(JIM_BOOTSTRAP)
union sockaddr_any {
    struct sockaddr sa;
    struct sockaddr_in sin;
#if IPV6
    struct sockaddr_in6 sin6;
#endif
................................................................................
    if (name) {
        Jim_SetResultFormatted(interp, "%#s: %s", name, JimAioErrorString(af));
    }
    else {
        Jim_SetResultString(interp, JimAioErrorString(af), -1);
    }
}

static int JimCheckStreamError(Jim_Interp *interp, AioFile *af)
{
	int ret = af->fops->error(af);
	if (ret) {
		JimAioSetError(interp, af->filename);
	}
	return ret;
}

static void JimAioDelProc(Jim_Interp *interp, void *privData)
{
    AioFile *af = privData;

    JIM_NOTUSED(interp);

................................................................................

    if (!af->fops->verify) {
        return JIM_OK;
    }

    ret = af->fops->verify(af);
    if (ret != JIM_OK) {
        if (JimCheckStreamError(interp, af) == JIM_OK) {


            Jim_SetResultString(interp, "failed to verify the connection authenticity", -1);
        }
    }
    return ret;
}
#endif /* JIM_BOOTSTRAP */