File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -916,7 +916,23 @@ _httpTLSRead(http_t *http, // I - Connection to server
916916 char * buf , // I - Buffer to store data
917917 int len ) // I - Length of buffer
918918{
919- return (SSL_read ((SSL * )(http -> tls ), buf , len ));
919+ int bytes ;
920+
921+ bytes = SSL_read ((SSL * )(http -> tls ), buf , len );
922+
923+ if (bytes > 0 )
924+ return (bytes );
925+
926+ /*
927+ * For now, make difference only for error after which we can retry, EPIPE otherwise...
928+ */
929+
930+ if (SSL_get_error (http -> tls , bytes ) == SSL_ERROR_WANT_READ )
931+ errno = EAGAIN ;
932+ else
933+ errno = EPIPE ;
934+
935+ return (-1 );
920936}
921937
922938
@@ -1242,7 +1258,23 @@ _httpTLSWrite(http_t *http, // I - Connection to server
12421258 const char * buf , // I - Buffer holding data
12431259 int len ) // I - Length of buffer
12441260{
1245- return (SSL_write (http -> tls , buf , len ));
1261+ int bytes ;
1262+
1263+ bytes = SSL_write (http -> tls , buf , len );
1264+
1265+ if (bytes > 0 )
1266+ return (bytes );
1267+
1268+ /*
1269+ * For now, make difference only for error after which we can retry, EPIPE otherwise...
1270+ */
1271+
1272+ if (SSL_get_error (http -> tls , bytes ) == SSL_ERROR_WANT_WRITE )
1273+ errno = EAGAIN ;
1274+ else
1275+ errno = EPIPE ;
1276+
1277+ return (-1 );
12461278}
12471279
12481280
You can’t perform that action at this time.
0 commit comments