- /* Allow sequencing of test actions */
- testharness_pause_ms(100);
-
- /* Write the request string, if not empty or already done */
-
- if (reqstr.len)
- {
- DEBUG(D_expand) debug_printf_indent("writing \"%s\" to socket\n",
- reqstr.data);
- if ( (
-#ifndef DISABLE_TLS
- do_tls ? tls_write(cctx.tls_ctx, reqstr.data, reqstr.len, FALSE) :
-#endif
- write(cctx.sock, reqstr.data, reqstr.len)) != reqstr.len)
- {
- expand_string_message = string_sprintf("request write to socket "
- "failed: %s", strerror(errno));
- goto SOCK_FAIL;
- }
- }
-
- /* Shut down the sending side of the socket. This helps some servers to
- recognise that it is their turn to do some work. Just in case some
- system doesn't have this function, make it conditional. */
-
-#ifdef SHUT_WR
- if (!do_tls && do_shutdown) shutdown(cctx.sock, SHUT_WR);
-#endif
-
- testharness_pause_ms(100);
-
- /* Now we need to read from the socket, under a timeout. The function
- that reads a file can be used. */
-
- if (!do_tls)
- fp = fdopen(cctx.sock, "rb");
- sigalrm_seen = FALSE;
- ALARM(timeout);
- yield =
-#ifndef DISABLE_TLS
- do_tls ? cat_file_tls(cctx.tls_ctx, yield, sub_arg[3]) :
-#endif
- cat_file(fp, yield, sub_arg[3]);
- ALARM_CLR(0);