> + } else if (outvar) {
> + pid = __popen(command->s, "r", &pout);
> + } else {
> + pid = fork();
> + if (pid == 0) {
> + execl("/bin/sh", "/bin/sh", "-c", command->s, NULL);
> + exit(-1);
> + }
> + }
> +
> + if (input->len) {
> + if (fwrite(input->s, 1, input->len, pin) != input->len) {
> + LM_ERR("failed to write to pipe\n");
> + ser_error=E_EXEC;
> + goto error;
> + }
This will stall if there is lots of output before the input is needed.
Pipes won't buffer an unlimited amount of data, and I doube that FILE streams
will either.
---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/360/files#r18956935
_______________________________________________
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel