| 1228 | } |
| 1229 | |
| 1230 | static ssize_t connTLSSyncReadLine(connection *conn_, char *ptr, ssize_t size, long long timeout) { |
| 1231 | tls_connection *conn = (tls_connection *) conn_; |
| 1232 | ssize_t nread = 0; |
| 1233 | |
| 1234 | serverAssert(conn->el == serverTL->el); |
| 1235 | |
| 1236 | setBlockingTimeout(conn, timeout); |
| 1237 | |
| 1238 | size--; |
| 1239 | while(size) { |
| 1240 | char c; |
| 1241 | |
| 1242 | if (SSL_read(conn->ssl,&c,1) <= 0) { |
| 1243 | nread = -1; |
| 1244 | goto exit; |
| 1245 | } |
| 1246 | if (c == '\n') { |
| 1247 | *ptr = '\0'; |
| 1248 | if (nread && *(ptr-1) == '\r') *(ptr-1) = '\0'; |
| 1249 | goto exit; |
| 1250 | } else { |
| 1251 | *ptr++ = c; |
| 1252 | *ptr = '\0'; |
| 1253 | nread++; |
| 1254 | } |
| 1255 | size--; |
| 1256 | } |
| 1257 | exit: |
| 1258 | unsetBlockingTimeout(conn); |
| 1259 | return nread; |
| 1260 | } |
| 1261 | |
| 1262 | static int connTLSGetType(connection *conn_) { |
| 1263 | (void) conn_; |
nothing calls this directly
no test coverage detected